AdgDim — Root abstract class for all dimension entities
AdgDim; AdgDress adg_dim_get_dim_dress (AdgDim *dim); void adg_dim_set_dim_dress (AdgDim *dim, AdgDress dress); void adg_dim_set_ref1 (AdgDim *dim, const AdgPoint *ref1); void adg_dim_set_ref1_explicit (AdgDim *dim, gdouble x, gdouble y); void adg_dim_set_ref1_from_pair (AdgDim *dim, const AdgPair *ref1); void adg_dim_set_ref1_from_model (AdgDim *dim, AdgModel *model, const gchar *ref1); AdgPoint * adg_dim_get_ref1 (AdgDim *dim); void adg_dim_set_ref2 (AdgDim *dim, const AdgPoint *ref2); void adg_dim_set_ref2_explicit (AdgDim *dim, gdouble x, gdouble y); void adg_dim_set_ref2_from_pair (AdgDim *dim, const AdgPair *ref2); void adg_dim_set_ref2_from_model (AdgDim *dim, AdgModel *model, const gchar *ref2); AdgPoint * adg_dim_get_ref2 (AdgDim *dim); void adg_dim_set_pos (AdgDim *dim, const AdgPoint *pos); void adg_dim_set_pos_explicit (AdgDim *dim, gdouble x, gdouble y); void adg_dim_set_pos_from_pair (AdgDim *dim, const AdgPair *pos); void adg_dim_set_pos_from_model (AdgDim *dim, AdgModel *model, const gchar *pos); AdgPoint * adg_dim_get_pos (AdgDim *dim); void adg_dim_set_level (AdgDim *dim, gdouble level); gdouble adg_dim_get_level (AdgDim *dim); void adg_dim_set_outside (AdgDim *dim, AdgThreeState outside); AdgThreeState adg_dim_get_outside (AdgDim *dim); void adg_dim_set_detached (AdgDim *dim, AdgThreeState detached); AdgThreeState adg_dim_get_detached (AdgDim *dim); void adg_dim_set_value (AdgDim *dim, const gchar *value); const gchar * adg_dim_get_value (AdgDim *dim); void adg_dim_set_limits (AdgDim *dim, const gchar *min, const gchar *max); void adg_dim_set_min (AdgDim *dim, const gchar *min); const gchar * adg_dim_get_min (AdgDim *dim); void adg_dim_set_max (AdgDim *dim, const gchar *max); const gchar * adg_dim_get_max (AdgDim *dim); gdouble adg_dim_quote_angle (AdgDim *dim, gdouble angle); AdgAlignment * adg_dim_get_quote (AdgDim *dim);
GObject
+----GInitiallyUnowned
+----AdgEntity
+----AdgDim
+----AdgADim
+----AdgLDim
+----AdgRDim
"detached" AdgThreeState : Read / Write "dim-dress" AdgDress : Read / Write "level" gdouble : Read / Write "max" gchar* : Read / Write "min" gchar* : Read / Write "outside" AdgThreeState : Read / Write "pos" AdgPoint* : Read / Write "ref1" AdgPoint* : Read / Write "ref2" AdgPoint* : Read / Write "value" gchar* : Read / Write / Construct
typedef struct _AdgDim AdgDim;
All fields are private and should not be used directly. Use its public methods instead.
AdgDress adg_dim_get_dim_dress (AdgDim *dim);
Gets the dimension dress to be used in rendering dim.
|
|
an AdgDim |
|
Returns : |
the current dimension dress |
void adg_dim_set_dim_dress (AdgDim *dim, AdgDress dress);
Sets a new dimension dress to dim. The new dress must be
related to the original dress for this property: you cannot
set a dress used for line styles to a dress managing fonts.
The check is done by calling adg_dress_are_related() with
dress and the previous dress as arguments. Check out its
documentation for details on what is a related dress.
void adg_dim_set_ref1 (AdgDim *dim, const AdgPoint *ref1);
Sets the "ref1" property to ref1. The old point
is silently discarded, unreferencing its model if that
point was bound to a named pair (hence, possibly destroying
the model if this was the last reference).
ref1 can be NULL, in which case the point is destroyed.
|
|
an AdgDim |
|
|
the new point to use as first reference |
void adg_dim_set_ref1_explicit (AdgDim *dim, gdouble x, gdouble y);
Sets the "ref1" property to the (x, y) explicit
coordinates. The old point is silently discarded,
unreferencing its model if that point was bound to a named
pair (hence, possibly destroying the model if this was the
last reference).
|
|
an AdgDim |
|
|
x coordinate of the first reference point |
|
|
y coordinate of the first reference point |
void adg_dim_set_ref1_from_pair (AdgDim *dim, const AdgPair *ref1);
Convenient function to set the "ref1" property using a pair instead of explicit coordinates.
|
|
an AdgDim |
|
|
the coordinates pair of the first reference point |
void adg_dim_set_ref1_from_model (AdgDim *dim, AdgModel *model, const gchar *ref1);
Binds "ref1" to the ref1 named pair of model. If model
is NULL, the point will be unset. In any case, the old point
is silently discarded, unreferencing its model if that point
was bound to a named pair (hence, possibly destroying the model
if this was the last reference).
The assignment is lazy so ref1 could be not be present in model.
Anyway, at the first access to this point an error will be raised
if the named pair is still missing.
AdgPoint * adg_dim_get_ref1 (AdgDim *dim);
Gets the "ref1" point. The returned point is internally owned
and must not be freed or modified. Anyway, it is not const because
adg_point_get_pair() must be able to modify the internal cache of
the returned point.
|
|
an AdgDim |
|
Returns : |
the first reference point |
void adg_dim_set_ref2 (AdgDim *dim, const AdgPoint *ref2);
Sets the "ref2" property to ref2. The old point
is silently discarded, unreferencing its model if that
point was bound to a named pair (hence, possibly destroying
the model if it was the last reference).
ref2 can be NULL, in which case the point is destroyed.
|
|
an AdgDim |
|
|
the new point to use as second reference |
void adg_dim_set_ref2_explicit (AdgDim *dim, gdouble x, gdouble y);
Sets the "ref2" property to the (x, y) explicit
coordinates. The old point is silently discarded,
unreferencing its model if that point was bound to a named
pair (hence, possibly destroying the model if this was the
last reference).
|
|
an AdgDim |
|
|
x coordinate of the second reference point |
|
|
y coordinate of the second reference point |
void adg_dim_set_ref2_from_pair (AdgDim *dim, const AdgPair *ref2);
Convenient function to set the "ref2" property using a pair instead of explicit coordinates.
|
|
an AdgDim |
|
|
the coordinates pair of the second reference point |
void adg_dim_set_ref2_from_model (AdgDim *dim, AdgModel *model, const gchar *ref2);
Binds "ref2" to the ref2 named pair of model. If model
is NULL, the point will be unset. In any case, the old point
is silently discarded, unreferencing its model if that point
was bound to a named pair (hence, possibly destroying the model
if this was the last reference).
The assignment is lazy so ref2 could be not be present in model.
Anyway, at the first access to this point an error will be raised
if the named pair is still missing.
AdgPoint * adg_dim_get_ref2 (AdgDim *dim);
Gets the "ref2" point. The returned point is internally owned
and must not be freed or modified. Anyway, it is not const because
adg_point_get_pair() must be able to modify the internal cache of
the returned point.
|
|
an AdgDim |
|
Returns : |
the second reference point |
void adg_dim_set_pos (AdgDim *dim, const AdgPoint *pos);
Sets the "pos" property to pos. The old point
is silently discarded, unreferencing its model if that
point was bound to a named pair (hence, possibly destroying
the model if it was the last reference).
pos can be NULL, in which case the point is destroyed.
|
|
an AdgDim |
|
|
the new point to use as position |
void adg_dim_set_pos_explicit (AdgDim *dim, gdouble x, gdouble y);
Sets the "pos" property to the (x, y) explicit
coordinates. The old point is silently discarded,
unreferencing its model if that point was bound to a named
pair (hence, possibly destroying the model if this was the
last reference).
|
|
an AdgDim |
|
|
x coordinate of the position |
|
|
y coordinate of the position |
void adg_dim_set_pos_from_pair (AdgDim *dim, const AdgPair *pos);
Convenient function to set the "pos" property using a pair instead of explicit coordinates.
|
|
an AdgDim |
|
|
the coordinates pair of the position point |
void adg_dim_set_pos_from_model (AdgDim *dim, AdgModel *model, const gchar *pos);
Binds "pos" to the pos named pair of model. If model
is NULL, the point will be unset. In any case, the old point
is silently discarded, unreferencing its model if that point
was bound to a named pair (hence, possibly destroying the model
if this was the last reference).
The assignment is lazy so pos could be not be present in model.
Anyway, at the first access to this point an error will be raised
if the named pair is still missing.
AdgPoint * adg_dim_get_pos (AdgDim *dim);
Gets the "pos" point. The returned point is internally owned
and must not be freed or modified. Anyway, it is not const because
adg_point_get_pair() must be able to modify the internal cache of
the returned point.
|
|
an AdgDim |
|
Returns : |
the position point |
void adg_dim_set_level (AdgDim *dim, gdouble level);
Sets a new level for this dimension. The level is used to stack the quotes using a spacing value from dim_style (specified in global space).
|
|
an AdgDim |
|
|
the new level |
gdouble adg_dim_get_level (AdgDim *dim);
Gets the level of this dimension.
|
|
an AdgDim |
|
Returns : |
the level value |
void adg_dim_set_outside (AdgDim *dim, AdgThreeState outside);
Sets a new state for the "outside" flag: check the property documentation for further details.
|
|
an AdgDim |
|
|
the new outside state |
AdgThreeState adg_dim_get_outside (AdgDim *dim);
Gets the state of the "outside" property: check the property documentation for further details.
|
|
an AdgDim |
|
Returns : |
the current flag state |
void adg_dim_set_detached (AdgDim *dim, AdgThreeState detached);
Sets a new state for the "detached" flag: check the property documentation for further details.
This is used only by dimensions where detaching has meaning. In some cases, such as with AdgRDim dimensions, this property is not used.
|
|
an AdgDim |
|
|
the new detached state |
AdgThreeState adg_dim_get_detached (AdgDim *dim);
Gets the state of the "detached" property: check the property documentation for further details.
|
|
an AdgDim |
|
Returns : |
the current flag state |
void adg_dim_set_value (AdgDim *dim, const gchar *value);
Explicitely sets the text to use as value. If value is NULL or
was never set, an automatic text is calculated using the format
specified in the current AdgDimStyle and getting its value by
calling the default_value() virtual method.
Inside the template string, the "<>" tag (or whatever specified by the "number-tag" property) is substituted with the string returned by the default_value() virtual method.
|
|
an AdgDim |
|
|
the value text |
const gchar * adg_dim_get_value (AdgDim *dim);
Gets the value text. The string is internally owned and must not be freed or modified.
|
|
an AdgDim |
|
Returns : |
the value text |
void adg_dim_set_limits (AdgDim *dim, const gchar *min, const gchar *max);
Shortcut to set both the limits at once.
|
|
an AdgDim |
|
|
the new minumum value |
|
|
the new maximum value |
void adg_dim_set_min (AdgDim *dim, const gchar *min);
Sets the minimum value. Use NULL as min to disable it.
|
|
an AdgDim |
|
|
the new minimum limit |
const gchar * adg_dim_get_min (AdgDim *dim);
Gets the minimum value text or NULL on minimum value disabled. The string is internally owned and must not be freed or modified.
|
|
an AdgDim |
|
Returns : |
the mimimum value text |
void adg_dim_set_max (AdgDim *dim, const gchar *max);
Sets the maximum value. Use NULL as max to disable it.
|
|
an AdgDim |
|
|
the new maximum value |
const gchar * adg_dim_get_max (AdgDim *dim);
Gets the maximum value text or NULL on maximum value disabled. The string is internally owned and must not be freed or modified.
|
|
an AdgDim |
|
Returns : |
the maximum value text |
gdouble adg_dim_quote_angle (AdgDim *dim, gdouble angle);
This function is only useful in new dimension implementations.
Converts angle accordling to the style of dim. Any quote angle
should be validated by this method because every dimensioning
style has its own convention regardling the text rotation.
|
|
an AdgDim |
|
|
an angle (in radians) |
|
Returns : |
the angle to use (always in radians) |
AdgAlignment * adg_dim_get_quote (AdgDim *dim);
This function is only useful in new dimension implementations.
Gets the quote entity, if any. This function is valid only after the AdgDim implementation of the arrange() virtual method has been called.
|
|
an AdgDim |
|
Returns : |
the quote entity |
"detached" property"detached" AdgThreeState : Read / Write
Where the quote must be positioned: in the middle of the base line (ADG_THREE_STATE_OFF), near the pos point (ADG_THREE_STATE_ON) or should be automatically deducted depending on the available space.
Default value: ADG_THREE_STATE_UNKNOWN
"dim-dress" property"dim-dress" AdgDress : Read / Write
The dress to use for rendering this dimension.
Allowed values: [G_MAXINT,G_MININT]
Default value: 0
"level" property"level" gdouble : Read / Write
The dimension level, that is the factor to multiply the baseline spacing (defined in the dimension style) to get the offset from pos where the quote should be rendered.
Default value: 1
"max" property"max" gchar* : Read / Write
The maximum value allowed or the highest tolerance from value (depending of the dimension style): set to NULL to suppress.
Default value: NULL
"min" property"min" gchar* : Read / Write
The minimum value allowed or the lowest tolerance from value (depending of the dimension style): set to NULL to suppress.
Default value: NULL
"outside" property"outside" AdgThreeState : Read / Write
Whether the arrows must be inside the extension lines (ADG_THREE_STATE_OFF), must be extended outside the extension lines (ADG_THREE_STATE_ON) or should be automatically handled depending on the available space.
Default value: ADG_THREE_STATE_UNKNOWN
"pos" property"pos" AdgPoint* : Read / Write
The reference position of the quote: it will be combined with "level" to get the real quote position.