|
GLG Toolkit, C / C++ API Library
Version 4.5
|
This group contains functions for positioning objects in the drawing, as well as scaling and rotating them. More...
This group contains functions for positioning objects in the drawing, as well as scaling and rotating them.
It also includes the GlgLayoutObjects function that can be used to align and distribute objects, as well as to set their width and height.
Functions | |
| GlgBoolean | GlgEnableAttachmentPoints (GlgBoolean state) |
| Controls the use of attachment points to determine object extents when the objects are aligned. More... | |
| GlgBoolean | GlgFitObject (GlgObject object, GlgCoordType coord_type, GlgCube *box, GlgBoolean keep_ratio) |
| Fits an object to the specified rectangular area. More... | |
| GlgBoolean | GlgLayoutObjects (GlgObject object, GlgObject anchor, GlgLayoutType type, double distance, GlgBoolean use_box, GlgBoolean process_subobjects) |
| Performs operations ranging from setting an object's width and height to aligning and layout of groups of objects. More... | |
| GlgBoolean | GlgMoveObject (GlgObject object, GlgCoordType coord_type, GlgPoint *start_point, GlgPoint *end_point) |
| Moves an object by a move vector. More... | |
| GlgBoolean | GlgMoveObjectBy (GlgObject object, GlgCoordType coord_type, double x, double y, double z) |
| Moves an object by the specified distances. More... | |
| GlgBoolean | GlgPositionObject (GlgObject object, GlgCoordType coord_type, GlgLong anchoring, double x, double y, double z) |
| Positions an object at the specified location. More... | |
| GlgBoolean | GlgRotateObject (GlgObject object, GlgCoordType coord_type, GlgPoint *center, double x_angle, double y_angle, double z_angle) |
| Rotates an object. More... | |
| GlgBoolean | GlgScaleObject (GlgObject object, GlgCoordType coord_type, GlgPoint *center, double x_scale, double y_scale, double z_scale) |
| Scales an object. More... | |
| GlgBoolean | GlgTransformObject (GlgObject object, GlgObject xform, GlgCoordType coord_type, GlgObject parent) |
| ADVANCED: Transforms all control points of an object with an arbitrary transformation. More... | |
| GlgBoolean GlgEnableAttachmentPoints | ( | GlgBoolean | state | ) |
Controls the use of attachment points to determine object extents when the objects are aligned.
| state | Specifies if attachment points should be used in addition to the control points to determine object extents when the objects are aligned using control points. |
| GlgBoolean GlgFitObject | ( | GlgObject | object, |
| GlgCoordType | coord_type, | ||
| GlgCube * | box, | ||
| GlgBoolean | keep_ratio | ||
| ) |
Fits an object to the specified rectangular area.
| object | The object to fit. |
| coord_type | Specifies the coordinate system for interpreting coordinates of the area to fit to:
|
| box | The area to fit the object to.
|
| keep_ratio | Controls how the object's X/Y ratio is handled:
|
This function transforms the object to fit it to the area defined by the box parameter, calculating new control point values. The object's hierarchy must be set up to use this function.
| GlgBoolean GlgLayoutObjects | ( | GlgObject | object, |
| GlgObject | anchor, | ||
| GlgLayoutType | type, | ||
| double | distance, | ||
| GlgBoolean | use_box, | ||
| GlgBoolean | process_subobjects | ||
| ) |
Performs operations ranging from setting an object's width and height to aligning and layout of groups of objects.
| object | The object or the group of objects to perform the requested operations upon. |
| anchor | The anchor object for alignment operations. If NULL, the first encountered object in the specified alignment direction is used. |
| type | The type of the layout action to perform:
|
| distance | The distance in screen coordinates for positioning objects, it is interpreted depending on the layout action. |
| use_box | Controls how the objects extent is determined:
|
| process_subobjects | Controls how to apply the layout action if the object is a group:
|
The object's hierarchy must be set up to use this function.
| GlgBoolean GlgMoveObject | ( | GlgObject | object, |
| GlgCoordType | coord_type, | ||
| GlgPoint * | start_point, | ||
| GlgPoint * | end_point | ||
| ) |
Moves an object by a move vector.
| object | The object to move. |
| coord_type | Specifies the coordinate system for interpreting the move vector:
|
| start_point | The start point of the move vector. If NULL, (0,0,0) is used as the start point. |
| end_point | The end point of the move vector. |
This function moves an object's control points by the distance defined by the move vector, calculating new control point values. The object's hierarchy must be set up to use this function.
| GlgBoolean GlgMoveObjectBy | ( | GlgObject | object, |
| GlgCoordType | coord_type, | ||
| double | x, | ||
| double | y, | ||
| double | z | ||
| ) |
Moves an object by the specified distances.
| object | The object to move. |
| coord_type | Specifies the coordinate system for interpreting move distances:
|
| x,y,z | The X, Y and Z move distances. |
This function moves an object's control points by the specified X, Y and Z distances, calculating new control point values. The object's hierarchy must be set up to use this function.
| GlgBoolean GlgPositionObject | ( | GlgObject | object, |
| GlgCoordType | coord_type, | ||
| GlgLong | anchoring, | ||
| double | x, | ||
| double | y, | ||
| double | z | ||
| ) |
Positions an object at the specified location.
| object | The object to position. |
| coord_type | Specifies the coordinate system for interpreting postion coordinates:
|
| anchoring | Specifies what part of the object's bounding box will be anchored at the specified position. It is formed as a bitwise OR of the horizontal anchoring constant (GLG_HLEFT, GLG_HCENTER or GLG_HRIGHT) with the vertical anchoring constants (GLG_VTOP, GLG_VCENTER or GLG_VBOTTOM). For example, using ( GLG_VTOP | GLG_HLEFT ) causes the upper left corner of the object's bounding box to be positioned at the specified location. |
| x,y,z | The X, Y and Z coordinates of the desired object position. |
This function positions the object, calculating new control point values. The object's hierarchy must be set up to use this function.
| GlgBoolean GlgRotateObject | ( | GlgObject | object, |
| GlgCoordType | coord_type, | ||
| GlgPoint * | center, | ||
| double | x_angle, | ||
| double | y_angle, | ||
| double | z_angle | ||
| ) |
Rotates an object.
| object | The object to rotate. |
| coord_type | Specifies the coordinate system for interpreting the rotation's center:
|
| center | The center of rotation. If the parameter is NULL, the object is rotated relative to the center of its bounding box. |
| x_angle,y_angle,z_angle | The X, Y and Z rotation angles in degrees. Only one rotation at a time can be performed (only one angle can have non-zero value). |
This function rotates the object's control points by the specified rotation angles and relative to the specified center, calculating new control point values. The object's hierarchy must be set up to use this function.
| GlgBoolean GlgScaleObject | ( | GlgObject | object, |
| GlgCoordType | coord_type, | ||
| GlgPoint * | center, | ||
| double | x_scale, | ||
| double | y_scale, | ||
| double | z_scale | ||
| ) |
Scales an object.
| object | The object to scale. |
| coord_type | Specifies the coordinate system for interpreting the scale center:
|
| center | The center of scaling. If the parameter is NULL, the object is scaled relative to the center of its bounding box. |
| x_scale,y_scale,z_scale | The X, Y and Z scaling factors. Use the same value for all three factors to scale the object uniformly in all dimensions. |
This function scales the object's control points by the specified scale factors and relative to the specified center, calculating new control point values. The object's hierarchy must be set up to use this function.
| GlgBoolean GlgTransformObject | ( | GlgObject | object, |
| GlgObject | xform, | ||
| GlgCoordType | coord_type, | ||
| GlgObject | parent | ||
| ) |
ADVANCED: Transforms all control points of an object with an arbitrary transformation.
| object | The object to transform: a drawable object or a G data object representing a control point. |
| xform | The transformation (a GLG_XFORM object) to be applied to the object's points. |
| coord_type | The coordinate system to interpret the transformation in:
|
| parent | The object's parent. It is required if coord_type=GLG_PARENT_COORD, or if the object is a G data object representing a control point. NULL may be passed in all other cases. |
This function applies the given transformation to an object's control points, calculating new control point values. The object's hierarchy must be set up to use this function.