AdgEdges — A model with the edges of another model
AdgEdges; 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);
"axis-angle" gdouble : Read / Write "critical-angle" gdouble : Read / Write "source" AdgTrail* : Read / Write / Construct
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.
typedef struct _AdgEdges AdgEdges;
All fields are private and should not be used directly. Use its public methods instead.
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 |
AdgEdges * adg_edges_new_with_source (AdgTrail *source);
Creates a new edges model explicitely specifying the source trail.
|
Returns : |
the newly created edges model |
void adg_edges_set_source (AdgEdges *edges, AdgTrail *source);
Sets source as the source trail for edges.
AdgTrail * adg_edges_get_source (AdgEdges *edges);
Gets the source AdgTrail of this edges model.
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) |
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 |
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) |
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 |
"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
"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
"source" property"source" AdgTrail* : Read / Write / Construct
The source from which the edges should be computed from.