Synopsis
#include <adg-1/adg.h> struct AdgEdges; struct AdgEdgesClass; AdgEdges * adg_edges_new (void
); AdgEdges * adg_edges_new_with_source (AdgTrail *source
); void adg_edges_set_source (AdgEdges *edges
,AdgTrail *source
); AdgTrail * adg_edges_get_source (AdgEdges *edges
); void adg_edges_set_axis_angle (AdgEdges *edges
,gdouble angle
); gdouble adg_edges_get_axis_angle (AdgEdges *edges
); void adg_edges_set_critical_angle (AdgEdges *edges
,gdouble angle
); gdouble adg_edges_get_critical_angle (AdgEdges *edges
);
Properties
"axis-angle" gdouble : Read / Write "critical-angle" gdouble : Read / Write "source" AdgTrail* : Read / Write / Construct
Description
The AdgEdges can be used to render the edges of a yet existing AdgTrail source. It is useful for any part made by revolution, where the shape is symmetric along a specific axis and thus the edge lines can be easily computed.
The trail can be set by changing the "source" property
or the relevant APIs. If the trail changes, a recomputation
can be forced by calling the adg_model_clear()
method.
The angle of the axis is implied to pass through the (0,0) point and has an angle of "axis-angle" radiants. The default is a 0 radiant angle, meaning the y=0 axis is assumed.
Details
struct AdgEdges
struct AdgEdges;
All fields are private and should not be used directly. Use its public methods instead.
Since 1.0
adg_edges_new ()
AdgEdges * adg_edges_new (void
);
Creates a new undefined model to keep track of the edges of
another model. You should at least set the referred AdgTrail
with adg_edges_set_source()
.
Returns : |
the newly created edges model |
Since 1.0
adg_edges_new_with_source ()
AdgEdges * adg_edges_new_with_source (AdgTrail *source
);
Creates a new edges model explicitely specifying the source trail.
The returned object will own a weak reference on source
.
|
the new source AdgTrail. [transfer none] |
Returns : |
the newly created edges model |
Since 1.0
adg_edges_set_source ()
void adg_edges_set_source (AdgEdges *edges
,AdgTrail *source
);
Sets source
as the source trail for edges
.
After the call, edges
will own a weak reference on source
.
Since 1.0
adg_edges_get_source ()
AdgTrail * adg_edges_get_source (AdgEdges *edges
);
Gets the source AdgTrail of this edges
model.
The returned object is owned by edges
and should not be
freed or modified.
Since 1.0
adg_edges_set_axis_angle ()
void adg_edges_set_axis_angle (AdgEdges *edges
,gdouble angle
);
Sets the axis angle of edges
to angle
, basically setting
the "axis-angle" property. All the resulting edge
lines will be normal to this axis.
It is implied the axis will pass through the (0,0) point, so the underlying trail should be constructed accordingly.
|
an AdgEdges |
|
the new angle (in radians) |
Since 1.0
adg_edges_get_axis_angle ()
gdouble adg_edges_get_axis_angle (AdgEdges *edges
);
Gets the angle of the supposed axis of edges
. Refer to
adg_edges_set_axis_angle()
for details of what this parameter
is used for.
|
an AdgEdges |
Returns : |
the value (in radians) of the axis angle |
Since 1.0
adg_edges_set_critical_angle ()
void adg_edges_set_critical_angle (AdgEdges *edges
,gdouble angle
);
Sets the critical angle of edges
to angle
, basically setting
the "critical-angle" property.
The critical angle defines what corner should generate an edge and
what not. Typical values are close to 0
, being 0
the lowest angle
where every corner generates an edge.
|
an AdgEdges |
|
the new angle (in radians) |
Since 1.0
adg_edges_get_critical_angle ()
gdouble adg_edges_get_critical_angle (AdgEdges *edges
);
Gets the current critical angle of edges
. Refer to
adg_edges_set_critical_angle()
for details of what this parameter
is used for.
|
an AdgEdges |
Returns : |
the value (in radians) of the critical angle |
Since 1.0
Property Details
The "axis-angle"
property
"axis-angle" gdouble : Read / Write
The angle of the axis of the source trail: it is implied this axis passes through (0,0).
Allowed values: [-3.14159,3.14159]
Default value: 0
The "critical-angle"
property
"critical-angle" gdouble : Read / Write
The angle that defines which corner generates an edge (if the corner angle is greater than this critical angle) and which edge is ignored.
Allowed values: [0,3.14159]
Default value: 0.0698132
The "source"
property
"source" AdgTrail* : Read / Write / Construct
The source from which the edges should be computed from.