AdgDim

AdgDim — Root abstract class for all dimension entities

Synopsis

                    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);

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----AdgEntity
               +----AdgDim
                     +----AdgADim
                     +----AdgLDim
                     +----AdgRDim

Properties

  "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

Description

The AdgDim class is the base stub of all the dimension entities.

Details

AdgDim

typedef struct _AdgDim AdgDim;

All fields are private and should not be used directly. Use its public methods instead.


adg_dim_get_dim_dress ()

AdgDress            adg_dim_get_dim_dress               (AdgDim *dim);

Gets the dimension dress to be used in rendering dim.

dim :

an AdgDim

Returns :

the current dimension dress

adg_dim_set_dim_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.

dim :

an AdgDim

dress :

the new AdgDress to use

adg_dim_set_ref ()

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.

dim :

an AdgDim

ref1 :

the ref1 coordinates

ref2 :

the ref2 coordinates

adg_dim_set_ref_explicit ()

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.

dim :

an AdgDim

ref1_x :

x coordinate of ref1

ref1_y :

y coordinate of ref1

ref2_x :

x coordinate of ref2

ref2_y :

y coordinate of ref2

adg_dim_set_ref_from_model ()

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);

dim :

an AdgDim

model :

the source AdgModel

ref1 :

name of the pair in model to use as ref1

ref2 :

name of the pair in model to use as ref2

adg_dim_get_ref1 ()

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.

dim :

an AdgDim

Returns :

the ref1 coordinates

adg_dim_get_ref2 ()

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.

dim :

an AdgDim

Returns :

the ref2 coordinates

adg_dim_set_pos ()

void                adg_dim_set_pos                     (AdgDim *dim,
                                                         const AdgPair *pos);

Sets a new "pos" position.

dim :

an AdgDim

pos :

the pos coordinates

adg_dim_set_pos_explicit ()

void                adg_dim_set_pos_explicit            (AdgDim *dim,
                                                         gdouble x,
                                                         gdouble y);

Shortcut to set "pos" using explicit coordinates.

dim :

an AdgDim

pos_x :

x coordinate of pos

pos_y :

y coordinate of pos

adg_dim_set_pos_from_model ()

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.

dim :

an AdgDim

model :

the source AdgModel

ref1 :

name of the pair in model to use as pos

adg_dim_get_pos ()

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.

dim :

an AdgDim

Returns :

the pos coordinates

adg_dim_set_level ()

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).

dim :

an AdgDim

level :

the new level

adg_dim_get_level ()

gdouble             adg_dim_get_level                   (AdgDim *dim);

Gets the level of this dimension.

dim :

an AdgDim

Returns :

the level value

adg_dim_set_outside ()

void                adg_dim_set_outside                 (AdgDim *dim,
                                                         AdgThreeState outside);

Sets a new state for the "outside" flag: check the property documentation for further details.

dim :

an AdgDim

outside :

the new outside state

adg_dim_get_outside ()

AdgThreeState       adg_dim_get_outside                 (AdgDim *dim);

Gets the state of the "outside" property: check the property documentation for further details.

dim :

an AdgDim

Returns :

the current flag state

adg_dim_set_detached ()

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.

dim :

an AdgDim

detached :

the new detached state

adg_dim_get_detached ()

AdgThreeState       adg_dim_get_detached                (AdgDim *dim);

Gets the state of the "detached" property: check the property documentation for further details.

dim :

an AdgDim

Returns :

the current flag state

adg_dim_set_value ()

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.

dim :

an AdgDim

value :

the value text

adg_dim_get_value ()

const gchar *       adg_dim_get_value                   (AdgDim *dim);

Gets the value text. The string is internally owned and must not be freed or modified.

dim :

an AdgDim

Returns :

the value text

adg_dim_set_limits ()

void                adg_dim_set_limits                  (AdgDim *dim,
                                                         const gchar *min,
                                                         const gchar *max);

Shortcut to set both the limits at once.

dim :

an AdgDim

min :

the new minumum value

max :

the new maximum value

adg_dim_set_min ()

void                adg_dim_set_min                     (AdgDim *dim,
                                                         const gchar *min);

Sets the minimum value. Use NULL as min to disable it.

dim :

an AdgDim

min :

the new minimum limit

adg_dim_get_min ()

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.

dim :

an AdgDim

Returns :

the mimimum value text

adg_dim_set_max ()

void                adg_dim_set_max                     (AdgDim *dim,
                                                         const gchar *max);

Sets the maximum value. Use NULL as max to disable it.

dim :

an AdgDim

max :

the new maximum value

adg_dim_get_max ()

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.

dim :

an AdgDim

Returns :

the maximum value text

adg_dim_quote_angle ()

gdouble             adg_dim_quote_angle                 (AdgDim *dim,
                                                         gdouble angle);

Note

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.

dim :

an AdgDim

angle :

an angle (in radians)

Returns :

the angle to use (always in radians)

adg_dim_get_quote ()

AdgAlignment *      adg_dim_get_quote                   (AdgDim *dim);

Note

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.

dim :

an AdgDim

Returns :

the quote entity

Property Details

The "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


The "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


The "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


The "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


The "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.


The "ref1" property

  "ref1"                     AdgPoint*             : Read / Write

First reference point of the dimension.


The "ref2" property

  "ref2"                     AdgPoint*             : Read / Write

Second reference point of the dimension.


The "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


The "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


The "value-min" property

  "value-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

AdgDim was last modified by gtk-doc on Sun 21 Feb 2010 10:22:16 PM CET
Hosted by Get Automatic Drawing Generation at SourceForge.net. Fast, secure and Free Open Source software downloads
Search on this domain