Synopsis

#include <adg-1/adg.h>

struct              AdgLDim;
struct              AdgLDimClass;
AdgLDim *           adg_ldim_new                        (void);
AdgLDim *           adg_ldim_new_full                   (const CpmlPair *ref1,
                                                         const CpmlPair *ref2,
                                                         const CpmlPair *pos,
                                                         gdouble direction);
AdgLDim *           adg_ldim_new_full_explicit          (gdouble ref1_x,
                                                         gdouble ref1_y,
                                                         gdouble ref2_x,
                                                         gdouble ref2_y,
                                                         gdouble pos_x,
                                                         gdouble pos_y,
                                                         gdouble direction);
AdgLDim *           adg_ldim_new_full_from_model        (AdgModel *model,
                                                         const gchar *ref1,
                                                         const gchar *ref2,
                                                         const gchar *pos,
                                                         gdouble direction);
void                adg_ldim_set_direction              (AdgLDim *ldim,
                                                         gdouble direction);
gdouble             adg_ldim_get_direction              (AdgLDim *ldim);
void                adg_ldim_switch_extension1          (AdgLDim *ldim,
                                                         gboolean new_state);
gboolean            adg_ldim_has_extension1             (AdgLDim *ldim);
void                adg_ldim_switch_extension2          (AdgLDim *ldim,
                                                         gboolean new_state);
gboolean            adg_ldim_has_extension2             (AdgLDim *ldim);

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----AdgEntity
               +----AdgDim
                     +----AdgLDim

Properties

  "direction"                gdouble               : Read / Write / Construct
  "has-extension1"           gboolean              : Read / Write
  "has-extension2"           gboolean              : Read / Write

Description

The AdgLDim entity represents a linear dimension.

Details

struct AdgLDim

struct AdgLDim;

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

Since 1.0


struct AdgLDimClass

struct AdgLDimClass {
};

adg_ldim_new ()

AdgLDim *           adg_ldim_new                        (void);

Creates a new - undefined - linear dimension. You must, at least, define the start of the dimension in "ref1", the end in "ref2" and the position of the quote in "pos" using any valid AdgDim method. The director of the dimension (that is, if it is horizontal, vertical or oblique at a specific angle) should be specified with adg_ldim_set_direction().

Returns :

the newly created linear dimension entity

Since 1.0


adg_ldim_new_full ()

AdgLDim *           adg_ldim_new_full                   (const CpmlPair *ref1,
                                                         const CpmlPair *ref2,
                                                         const CpmlPair *pos,
                                                         gdouble direction);

Creates a new linear dimension, specifing all the needed properties in one shot.

ref1 :

the first reference point. [allow-none]

ref2 :

the second reference point. [allow-none]

pos :

the position reference. [allow-none]

direction :

angle where to extend the dimension

Returns :

the newly created linear dimension entity

Since 1.0


adg_ldim_new_full_explicit ()

AdgLDim *           adg_ldim_new_full_explicit          (gdouble ref1_x,
                                                         gdouble ref1_y,
                                                         gdouble ref2_x,
                                                         gdouble ref2_y,
                                                         gdouble pos_x,
                                                         gdouble pos_y,
                                                         gdouble direction);

Wrappes adg_ldim_new_full() with explicit values.

ref1_x :

the x coordinate of the first reference point

ref1_y :

the y coordinate of the first reference point

ref2_x :

the x coordinate of the second reference point

ref2_y :

the y coordinate of the second reference point

pos_x :

the x coordinate of the position reference

pos_y :

the y coordinate of the position reference

direction :

angle where to extend the dimension

Returns :

the newly created linear dimension entity

Since 1.0


adg_ldim_new_full_from_model ()

AdgLDim *           adg_ldim_new_full_from_model        (AdgModel *model,
                                                         const gchar *ref1,
                                                         const gchar *ref2,
                                                         const gchar *pos,
                                                         gdouble direction);

Creates a new linear dimension, specifing all the needed properties in one shot and using named pairs from model.

model :

the model from which the named pairs are taken. [transfer none]

ref1 :

the first reference point. [allow-none]

ref2 :

the second reference point. [allow-none]

pos :

the position reference. [allow-none]

direction :

angle where to extend the dimension

Returns :

the newly created linear dimension entity

Since 1.0


adg_ldim_set_direction ()

void                adg_ldim_set_direction              (AdgLDim *ldim,
                                                         gdouble direction);

Sets the direction angle where to extend ldim. direction is normalized by cpml_angle() before being used.

ldim :

an AdgLDim entity

direction :

an angle value, in radians

Since 1.0


adg_ldim_get_direction ()

gdouble             adg_ldim_get_direction              (AdgLDim *ldim);

Gets the direction where ldim will extend.

ldim :

an AdgLDim entity

Returns :

the direction angle in radians

Since 1.0


adg_ldim_switch_extension1 ()

void                adg_ldim_switch_extension1          (AdgLDim *ldim,
                                                         gboolean new_state);

Shows (if new_state is TRUE) or hide (if new_state is FALSE) the first extension line of ldim.

ldim :

an AdgLDim entity

new_state :

the new state

Since 1.0


adg_ldim_has_extension1 ()

gboolean            adg_ldim_has_extension1             (AdgLDim *ldim);

Checks if ldim should render also the first extension line.

ldim :

an AdgLDim entity

Returns :

TRUE on first extension line presents, FALSE otherwise

Since 1.0


adg_ldim_switch_extension2 ()

void                adg_ldim_switch_extension2          (AdgLDim *ldim,
                                                         gboolean new_state);

Shows (if new_state is TRUE) or hide (if new_state is FALSE) the second extension line of ldim.

ldim :

an AdgLDim entity

new_state :

the new new_state

Since 1.0


adg_ldim_has_extension2 ()

gboolean            adg_ldim_has_extension2             (AdgLDim *ldim);

Checks if ldim should render also the second extension line.

ldim :

an AdgLDim entity

Returns :

TRUE on first extension line presents, FALSE otherwise

Since 1.0

Property Details

The "direction" property

  "direction"                gdouble               : Read / Write / Construct

The inclination angle of the extension lines.

Allowed values: [-3.14159,3.14159]

Default value: 0


The "has-extension1" property

  "has-extension1"           gboolean              : Read / Write

Show (TRUE) or hide (FALSE) the first extension line.

Default value: TRUE


The "has-extension2" property

  "has-extension2"           gboolean              : Read / Write

Show (TRUE) or hide (FALSE) the second extension line.

Default value: TRUE