![]() |
![]() |
![]() |
adg-1 reference manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties |
#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
);
"has-extension1" gboolean : Read / Write "has-extension2" gboolean : Read / Write "org1" AdgPoint* : Read / Write "org2" AdgPoint* : Read / Write "value" gchar* : Read / Write / Construct
struct AdgADim;
All fields are privates and should not be used directly. Use its public methods instead.
Since 1.0
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
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.
|
first reference point. [allow-none] |
|
second reference point. [allow-none] |
|
first origin point. [allow-none] |
|
second origin point. [allow-none] |
|
the position point. [allow-none] |
Returns : |
the newly created angular dimension entity |
Since 1.0
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.
|
the x coordinate of end point of the first line |
|
the y coordinate of end point of the first line |
|
the x coordinate of end point of the second line |
|
the y coordinate of end point of the second line |
|
the x coordinate of start point of the first line |
|
the y coordinate of start point of the first line |
|
the x coordinate of start point of the second line |
|
the y coordinate of start point of the second line |
|
the x coordinate of the position reference |
|
the y coordinate of the position reference |
Returns : |
the newly created linear dimension entity |
Since 1.0
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
.
|
the model from which the named pairs are taken. [transfer none] |
|
the end point of the first line. [allow-none] |
|
the end point of the second line. [allow-none] |
|
the origin of the first line. [allow-none] |
|
the origin of the second line. [allow-none] |
|
the position reference. [allow-none] |
Returns : |
the newly created angular dimension entity |
Since 1.0
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.
|
an AdgADim |
|
the new point to use as first reference |
Since 1.0
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).
|
an AdgADim |
|
x coordinate of the first reference point |
|
y coordinate of the first reference point |
Since 1.0
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.
|
an AdgADim |
|
the coordinates pair of the first reference point |
Since 1.0
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.
Since 1.0
AdgPoint * adg_adim_get_org1 (AdgADim *adim
);
Gets the "org1" point. The returned point is internally owned and must not be freed or modified.
|
an AdgADim |
Returns : |
the first reference point. [transfer none] |
Since 1.0
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.
|
an AdgADim |
|
the new point to use as first reference |
Since 1.0
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).
|
an AdgADim |
|
x coordinate of the first reference point |
|
y coordinate of the first reference point |
Since 1.0
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.
|
an AdgADim |
|
the coordinates pair of the first reference point |
Since 1.0
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.
Since 1.0
AdgPoint * adg_adim_get_org2 (AdgADim *adim
);
Gets the "org2" point. The returned point is internally owned and must not be freed or modified.
|
an AdgADim |
Returns : |
the second reference point. [transfer none] |
Since 1.0
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
.
|
an AdgADim entity |
|
the new state |
Since 1.0
gboolean adg_adim_has_extension1 (AdgADim *adim
);
Checks if adim
should render the first extension line.
|
an AdgADim entity |
Returns : |
TRUE on first extension line presents, FALSE otherwise |
Since 1.0
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
.
|
an AdgADim entity |
|
the new new_state |
Since 1.0
"has-extension1"
property "has-extension1" gboolean : Read / Write
Show (TRUE) or hide (FALSE) the first extension line.
Default value: TRUE
"has-extension2"
property "has-extension2" gboolean : Read / Write
Show (TRUE) or hide (FALSE) the second extension line.
Default value: TRUE
"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.
"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.