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_ref (AdgDim *dim, const AdgPair *ref1, const AdgPair *ref2); void adg_dim_set_ref_explicit (AdgDim *dim, gdouble ref1_x, gdouble ref1_y, gdouble ref2_x, gdouble ref2_y); void adg_dim_set_ref_from_model (AdgDim *dim, AdgModel *model, const gchar *ref1, const gchar *ref2); const AdgPair * adg_dim_get_ref1 (AdgDim *dim); const AdgPair * adg_dim_get_ref2 (AdgDim *dim); void adg_dim_set_pos (AdgDim *dim, const AdgPair *pos); void adg_dim_set_pos_explicit (AdgDim *dim, gdouble x, gdouble y); void adg_dim_set_pos_from_model (AdgDim *dim, AdgModel *model, const gchar *pos); const AdgPair * 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 "outside" AdgThreeState : Read / Write "pos" AdgPoint* : Read / Write "ref1" AdgPoint* : Read / Write "ref2" AdgPoint* : Read / Write "value" gchar* : Read / Write "value-max" gchar* : Read / Write "value-min" gchar* : Read / Write
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_ref (AdgDim *dim, const AdgPair *ref1, const AdgPair *ref2);
Sets the "ref1" and "ref2" reference points
using ref1 and ref2 pairs. ref1 or ref2 could be
NULL (but not both), in which case only the non-null
reference point is changed.
|
|
an AdgDim |
|
|
the ref1 coordinates |
|
|
the ref2 coordinates |
void adg_dim_set_ref_explicit (AdgDim *dim, gdouble ref1_x, gdouble ref1_y, gdouble ref2_x, gdouble ref2_y);
Works in the same way as adg_dim_set_ref() but using
explicit coordinates instead of AdgPair args. The
notable difference is that, by using gdouble values,
you can't set only a single reference point.
|
|
an AdgDim |
|
|
x coordinate of ref1 |
|
|
y coordinate of ref1 |
|
|
x coordinate of ref2 |
|
|
y coordinate of ref2 |
void adg_dim_set_ref_from_model (AdgDim *dim, AdgModel *model, const gchar *ref1, const gchar *ref2);
Sets "ref1" and "ref2" properties by linking
them to the ref1 and ref2 named pairs in model. ref1
or ref2 could be NULL (but not both), in which case
only the non-null reference point is changed.
Using this function twice you can also link the reference points to named pairs taken from different models:
adg_dim_set_ref_from_model(dim, model1, ref1, NULL); adg_dim_set_ref_from_model(dim, model2, NULL, ref2);
const AdgPair * adg_dim_get_ref1 (AdgDim *dim);
Gets the ref1 coordinates. The returned pair is internally owned and must not be freed or modified.
|
|
an AdgDim |
|
Returns : |
the ref1 coordinates |
const AdgPair * adg_dim_get_ref2 (AdgDim *dim);
Gets the ref2 coordinates. The returned pair is internally owned and must not be freed or modified.
|
|
an AdgDim |
|
Returns : |
the ref2 coordinates |
void adg_dim_set_pos (AdgDim *dim, const AdgPair *pos);
Sets a new "pos" position.
|
|
an AdgDim |
|
|
the pos coordinates |
void adg_dim_set_pos_explicit (AdgDim *dim, gdouble x, gdouble y);
Shortcut to set "pos" using explicit coordinates.
|
|
an AdgDim |
|
|
x coordinate of pos |
|
|
y coordinate of pos |
void adg_dim_set_pos_from_model (AdgDim *dim, AdgModel *model, const gchar *pos);
Sets "pos" by linking it to the pos named pair
in model.
const AdgPair * adg_dim_get_pos (AdgDim *dim);
Gets the position coordinates. The returned pair is internally owned and must not be freed or modified.
|
|
an AdgDim |
|
Returns : |
the pos coordinates |
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.
|
|
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
"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 in local space of the quote: it will be combined with "level" to get the real quote position.
"value" property"value" gchar* : Read / Write
The theoretically exact value for this quote: set to NULL to automatically get the default value.
Default value: NULL
"value-max" property"value-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