Synopsis

#include <adg-1/adg.h>

struct              AdgADim;
struct              AdgADimClass;
AdgADim *           adg_adim_new                        (void);
AdgADim *           adg_adim_new_full                   (const CpmlPair *ref1,
                                                         const CpmlPair *ref2,
                                                         const CpmlPair *org1,
                                                         const CpmlPair *org2,
                                                         const CpmlPair *pos);
AdgADim *           adg_adim_new_full_explicit          (gdouble ref1_x,
                                                         gdouble ref1_y,
                                                         gdouble ref2_x,
                                                         gdouble ref2_y,
                                                         gdouble org1_x,
                                                         gdouble org1_y,
                                                         gdouble org2_x,
                                                         gdouble org2_y,
                                                         gdouble pos_x,
                                                         gdouble pos_y);
AdgADim *           adg_adim_new_full_from_model        (AdgModel *model,
                                                         const gchar *ref1,
                                                         const gchar *ref2,
                                                         const gchar *org1,
                                                         const gchar *org2,
                                                         const gchar *pos);
void                adg_adim_set_org1                   (AdgADim *adim,
                                                         const AdgPoint *org1);
void                adg_adim_set_org1_explicit          (AdgADim *adim,
                                                         gdouble x,
                                                         gdouble y);
void                adg_adim_set_org1_from_pair         (AdgADim *adim,
                                                         const CpmlPair *org1);
void                adg_adim_set_org1_from_model        (AdgADim *adim,
                                                         AdgModel *model,
                                                         const gchar *org1);
AdgPoint *          adg_adim_get_org1                   (AdgADim *adim);
void                adg_adim_set_org2                   (AdgADim *adim,
                                                         const AdgPoint *org2);
void                adg_adim_set_org2_explicit          (AdgADim *adim,
                                                         gdouble x,
                                                         gdouble y);
void                adg_adim_set_org2_from_pair         (AdgADim *adim,
                                                         const CpmlPair *org2);
void                adg_adim_set_org2_from_model        (AdgADim *adim,
                                                         AdgModel *model,
                                                         const gchar *org2);
AdgPoint *          adg_adim_get_org2                   (AdgADim *adim);
void                adg_adim_switch_extension1          (AdgADim *adim,
                                                         gboolean new_state);
gboolean            adg_adim_has_extension1             (AdgADim *adim);
void                adg_adim_switch_extension2          (AdgADim *adim,
                                                         gboolean new_state);
gboolean            adg_adim_has_extension2             (AdgADim *adim);

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----AdgEntity
               +----AdgDim
                     +----AdgADim

Properties

  "has-extension1"           gboolean              : Read / Write
  "has-extension2"           gboolean              : Read / Write
  "org1"                     AdgPoint*             : Read / Write
  "org2"                     AdgPoint*             : Read / Write
  "value"                    gchar*                : Read / Write / Construct

Description

The AdgADim entity defines an angular dimension.

Details

struct AdgADim

struct AdgADim;

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

Since 1.0


struct AdgADimClass

struct AdgADimClass {
};

adg_adim_new ()

AdgADim *           adg_adim_new                        (void);

Creates a new - undefined - angular dimension. You must, at least, define the first line by setting "org1" (start point) and "ref1" (end point), the second line by setting "org2" (start point) and "ref2" (end point) and the position of the quote in "pos".

Returns :

the newly created angular dimension entity

Since 1.0


adg_adim_new_full ()

AdgADim *           adg_adim_new_full                   (const CpmlPair *ref1,
                                                         const CpmlPair *ref2,
                                                         const CpmlPair *org1,
                                                         const CpmlPair *org2,
                                                         const CpmlPair *pos);

Creates a new angular dimension, specifing all the needed properties in one shot using CpmlPair.

ref1 :

first reference point. [allow-none]

ref2 :

second reference point. [allow-none]

org1 :

first origin point. [allow-none]

org2 :

second origin point. [allow-none]

pos :

the position point. [allow-none]

Returns :

the newly created angular dimension entity

Since 1.0


adg_adim_new_full_explicit ()

AdgADim *           adg_adim_new_full_explicit          (gdouble ref1_x,
                                                         gdouble ref1_y,
                                                         gdouble ref2_x,
                                                         gdouble ref2_y,
                                                         gdouble org1_x,
                                                         gdouble org1_y,
                                                         gdouble org2_x,
                                                         gdouble org2_y,
                                                         gdouble pos_x,
                                                         gdouble pos_y);

Wrappes adg_adim_new_full() with explicit values.

ref1_x :

the x coordinate of end point of the first line

ref1_y :

the y coordinate of end point of the first line

ref2_x :

the x coordinate of end point of the second line

ref2_y :

the y coordinate of end point of the second line

org1_x :

the x coordinate of start point of the first line

org1_y :

the y coordinate of start point of the first line

org2_x :

the x coordinate of start point of the second line

org2_y :

the y coordinate of start point of the second line

pos_x :

the x coordinate of the position reference

pos_y :

the y coordinate of the position reference

Returns :

the newly created linear dimension entity

Since 1.0


adg_adim_new_full_from_model ()

AdgADim *           adg_adim_new_full_from_model        (AdgModel *model,
                                                         const gchar *ref1,
                                                         const gchar *ref2,
                                                         const gchar *org1,
                                                         const gchar *org2,
                                                         const gchar *pos);

Creates a new angular 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 end point of the first line. [allow-none]

ref2 :

the end point of the second line. [allow-none]

org1 :

the origin of the first line. [allow-none]

org2 :

the origin of the second line. [allow-none]

pos :

the position reference. [allow-none]

Returns :

the newly created angular dimension entity

Since 1.0


adg_adim_set_org1 ()

void                adg_adim_set_org1                   (AdgADim *adim,
                                                         const AdgPoint *org1);

Sets the "org1" property to org1. 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).

org1 can be NULL, in which case the point is destroyed.

adim :

an AdgADim

org1 :

the new point to use as first reference

Since 1.0


adg_adim_set_org1_explicit ()

void                adg_adim_set_org1_explicit          (AdgADim *adim,
                                                         gdouble x,
                                                         gdouble y);

Sets the "org1" 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).

adim :

an AdgADim

x :

x coordinate of the first reference point

y :

y coordinate of the first reference point

Since 1.0


adg_adim_set_org1_from_pair ()

void                adg_adim_set_org1_from_pair         (AdgADim *adim,
                                                         const CpmlPair *org1);

Convenient function to set the "org1" property using a pair instead of explicit coordinates.

adim :

an AdgADim

org1 :

the coordinates pair of the first reference point

Since 1.0


adg_adim_set_org1_from_model ()

void                adg_adim_set_org1_from_model        (AdgADim *adim,
                                                         AdgModel *model,
                                                         const gchar *org1);

Binds "org1" to the org1 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 org1 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.

adim :

an AdgADim

model :

the source AdgModel

org1 :

a named pair in model

Since 1.0


adg_adim_get_org1 ()

AdgPoint *          adg_adim_get_org1                   (AdgADim *adim);

Gets the "org1" point. The returned point is internally owned and must not be freed or modified.

adim :

an AdgADim

Returns :

the first reference point. [transfer none]

Since 1.0


adg_adim_set_org2 ()

void                adg_adim_set_org2                   (AdgADim *adim,
                                                         const AdgPoint *org2);

Sets the "org2" property to org2. 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).

org2 can be NULL, in which case the point is destroyed.

adim :

an AdgADim

org2 :

the new point to use as first reference

Since 1.0


adg_adim_set_org2_explicit ()

void                adg_adim_set_org2_explicit          (AdgADim *adim,
                                                         gdouble x,
                                                         gdouble y);

Sets the "org2" 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).

adim :

an AdgADim

x :

x coordinate of the first reference point

y :

y coordinate of the first reference point

Since 1.0


adg_adim_set_org2_from_pair ()

void                adg_adim_set_org2_from_pair         (AdgADim *adim,
                                                         const CpmlPair *org2);

Convenient function to set the "org2" property using a pair instead of explicit coordinates.

adim :

an AdgADim

org2 :

the coordinates pair of the first reference point

Since 1.0


adg_adim_set_org2_from_model ()

void                adg_adim_set_org2_from_model        (AdgADim *adim,
                                                         AdgModel *model,
                                                         const gchar *org2);

Binds "org2" to the org2 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 org2 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.

adim :

an AdgADim

model :

the source AdgModel

org2 :

a named pair in model

Since 1.0


adg_adim_get_org2 ()

AdgPoint *          adg_adim_get_org2                   (AdgADim *adim);

Gets the "org2" point. The returned point is internally owned and must not be freed or modified.

adim :

an AdgADim

Returns :

the second reference point. [transfer none]

Since 1.0


adg_adim_switch_extension1 ()

void                adg_adim_switch_extension1          (AdgADim *adim,
                                                         gboolean new_state);

Shows (if new_state is TRUE) or hides (if new_state is FALSE) the first extension line of adim.

adim :

an AdgADim entity

new_state :

the new state

Since 1.0


adg_adim_has_extension1 ()

gboolean            adg_adim_has_extension1             (AdgADim *adim);

Checks if adim should render the first extension line.

adim :

an AdgADim entity

Returns :

TRUE on first extension line presents, FALSE otherwise

Since 1.0


adg_adim_switch_extension2 ()

void                adg_adim_switch_extension2          (AdgADim *adim,
                                                         gboolean new_state);

Shows (if new_state is TRUE) or hides (if new_state is FALSE) the second extension line of adim.

adim :

an AdgADim entity

new_state :

the new new_state

Since 1.0


adg_adim_has_extension2 ()

gboolean            adg_adim_has_extension2             (AdgADim *adim);

Checks if adim should render the second extension line.

adim :

an AdgADim entity

Returns :

TRUE on first extension line presents, FALSE otherwise

Since 1.0

Property Details

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


The "org1" property

  "org1"                     AdgPoint*             : Read / Write

Where the first line comes from: this point is used toghether with "ref1" to align the first extension line.


The "org2" property

  "org2"                     AdgPoint*             : Read / Write

Where the second line comes from: this point is used toghether with "ref2" to align the second extension line.


The "value" property

  "value"                    gchar*                : Read / Write / Construct

The template string to be used for generating the set value of the quote.

Default value: "<>\302\260"