Created functions gswe_moment_get_sign_planets() and gswe_moment_get_house_planets()
This commit is contained in:
parent
c8753f49be
commit
a92fdca8b2
@ -718,6 +718,64 @@ gswe_moment_get_all_planets(GsweMoment *moment)
|
||||
return moment->priv->planet_list;
|
||||
}
|
||||
|
||||
/**
|
||||
* gswe_moment_get_sign_planets:
|
||||
* @moment: a GsweMoment
|
||||
* @sign: the sign of whose planets are requested
|
||||
*
|
||||
* Gets the list of planets in @sign.
|
||||
*
|
||||
* Returns: (transfer container) (element-type GswePlanetData): a #GList of
|
||||
* #GswePlanetData.
|
||||
*/
|
||||
GList *
|
||||
gswe_moment_get_sign_planets(GsweMoment *moment, GsweZodiac sign)
|
||||
{
|
||||
GList *ret = NULL,
|
||||
*planet;
|
||||
|
||||
gswe_moment_calculate_all_planets(moment);
|
||||
|
||||
for (planet = moment->priv->planet_list; planet; planet = g_list_next(planet)) {
|
||||
GswePlanetData *pd = planet->data;
|
||||
|
||||
if (pd->sign->sign_id == sign) {
|
||||
ret = g_list_prepend(ret, pd);
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* gswe_moment_get_house_planets:
|
||||
* @moment: a GsweMoment
|
||||
* @house: a house number
|
||||
*
|
||||
* Gets the list of planets in house @house.
|
||||
*
|
||||
* Returns: (transfer container) (element-type GswePlanetData): a #GList of
|
||||
* #GswePlanetData
|
||||
*/
|
||||
GList *
|
||||
gswe_moment_get_house_planets(GsweMoment *moment, guint house)
|
||||
{
|
||||
GList *ret = NULL,
|
||||
*planet;
|
||||
|
||||
gswe_moment_calculate_all_planets(moment);
|
||||
|
||||
for (planet = moment->priv->planet_list; planet; planet = g_list_next(planet)) {
|
||||
GswePlanetData *pd = planet->data;
|
||||
|
||||
if (pd->house == house) {
|
||||
ret = g_list_prepend(ret, pd);
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* gswe_moment_get_house:
|
||||
* @moment: a GsweMoment object
|
||||
|
@ -125,24 +125,35 @@ GType gswe_moment_get_type(void);
|
||||
/* Method definitions */
|
||||
GsweMoment *gswe_moment_new(void);
|
||||
GsweMoment *gswe_moment_new_full(GsweTimestamp *timestamp, gdouble longitude, gdouble latitude, gdouble altitude, GsweHouseSystem house_system);
|
||||
|
||||
void gswe_moment_set_timestamp(GsweMoment *moment, GsweTimestamp *timestamp);
|
||||
GsweTimestamp *gswe_moment_get_timestamp(GsweMoment *moment);
|
||||
|
||||
void gswe_moment_set_coordinates(GsweMoment *moment, gdouble longitude, gdouble latitude, gdouble altitude);
|
||||
GsweCoordinates *gswe_moment_get_coordinates(GsweMoment *moment);
|
||||
|
||||
void gswe_moment_set_house_system(GsweMoment *moment, GsweHouseSystem house_system);
|
||||
GsweHouseSystem gswe_moment_get_house_system(GsweMoment *moment);
|
||||
|
||||
GList *gswe_moment_get_house_cusps(GsweMoment *moment, GError **err);
|
||||
gint gswe_moment_get_house(GsweMoment *moment, gdouble position, GError **err);
|
||||
|
||||
gboolean gswe_moment_has_planet(GsweMoment *moment, GswePlanet planet);
|
||||
void gswe_moment_add_planet(GsweMoment *moment, GswePlanet planet);
|
||||
void gswe_moment_add_all_planets(GsweMoment *moment);
|
||||
GList *gswe_moment_get_all_planets(GsweMoment *moment);
|
||||
const GswePlanetData *gswe_moment_get_planet(GsweMoment *moment, GswePlanet planet, GError **err);
|
||||
GList *gswe_moment_get_sign_planets(GsweMoment *moment, GsweZodiac sign);
|
||||
GList *gswe_moment_get_house_planets(GsweMoment *moment, guint house);
|
||||
|
||||
guint gswe_moment_get_element_points(GsweMoment *moment, GsweElement element);
|
||||
guint gswe_moment_get_quality_points(GsweMoment *moment, GsweQuality quality);
|
||||
|
||||
const GsweMoonPhaseData *gswe_moment_get_moon_phase(GsweMoment *moment, GError **err);
|
||||
|
||||
GList *gswe_moment_get_all_aspects(GsweMoment *moment);
|
||||
GList *gswe_moment_get_planet_aspects(GsweMoment *moment, GswePlanet planet, GError **err);
|
||||
|
||||
GList *gswe_moment_get_all_antiscia(GsweMoment *moment);
|
||||
GList *gswe_moment_get_all_planet_antiscia(GsweMoment *moment, GswePlanet planet, GError **err);
|
||||
GList *gswe_moment_get_axis_all_antiscia(GsweMoment *moment, GsweAntiscionAxis axis);
|
||||
|
Loading…
Reference in New Issue
Block a user