|
GLG Toolkit, JavaScript Library
Version 4.6
|
This group contains methods for positioning objects in the drawing, as well as scaling and rotating them. More...
This group contains methods for positioning objects in the drawing, as well as scaling and rotating them.
It also includes the LayoutObjects method that can be used to align and distribute objects, as well as to set their width and height.
Functions | |
| static boolean | EnableAttachmentPoints (boolean state) |
| Controls the use of attachment points to determine object extents when the objects are aligned. More... | |
| boolean | FitObject (GlgCoordType coord_type, GlgCube box, boolean keep_ratio) |
| Fits the object to the specified rectangular area. More... | |
| boolean | LayoutObjects (GlgObject anchor, GlgLayoutType type, double distance, boolean use_box, boolean process_subobjects) |
| Performs operations ranging from setting an object's width and height to aligning and layout of groups of objects. More... | |
| boolean | MoveObject (GlgCoordType coord_type, GlgPoint start_point, GlgPoint end_point) |
| Moves an object by a move vector. More... | |
| boolean | MoveObjectBy (GlgCoordType coord_type, double x, double y, double z) |
| Moves the object by the specified distances. More... | |
| boolean | MoveObjectByPoint (GlgCoordType coord_type, GlgPoint point) |
| Moves the object by distances specified by the GlgPoint object. More... | |
| boolean | PositionObject (GlgCoordType coord_type, GlgAnchoringType anchoring, double x, double y, double z) |
| Positions the object at the specified location. More... | |
| boolean | PositionObjectByPoint (GlgCoordType coord_type, GlgAnchoringType anchoring, GlgPoint position) |
| Positions the object at the location specified by the GlgPoint object. More... | |
| boolean | RotateObject (GlgCoordType coord_type, GlgPoint center, double x_angle, double y_angle, double z_angle) |
| Rotates the object. More... | |
| boolean | ScaleObject (GlgCoordType coord_type, GlgPoint center, double x_scale, double y_scale, double z_scale) |
| Scales the object. More... | |
| boolean | TransformObject (GlgObject xform, GlgCoordType coord_type, GlgObject parent) |
| ADVANCED: Transforms all control points of the object with an arbitrary transformation. More... | |
|
static |
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. |
| boolean FitObject | ( | GlgCoordType | coord_type, |
| GlgCube | box, | ||
| boolean | keep_ratio | ||
| ) |
Fits the object to the specified rectangular area.
| 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 method 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 method.
| boolean LayoutObjects | ( | GlgObject | anchor, |
| GlgLayoutType | type, | ||
| double | distance, | ||
| boolean | use_box, | ||
| boolean | process_subobjects | ||
| ) |
Performs operations ranging from setting an object's width and height to aligning and layout of groups of objects.
This method can be invoked on an object or a group of objects to perform the requested operations upon them.
| 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 method.
| boolean MoveObject | ( | GlgCoordType | coord_type, |
| GlgPoint | start_point, | ||
| GlgPoint | end_point | ||
| ) |
Moves an object by a move vector.
| 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 method 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 method.
| boolean MoveObjectBy | ( | GlgCoordType | coord_type, |
| double | x, | ||
| double | y, | ||
| double | z | ||
| ) |
Moves the object by the specified distances.
| coord_type | Specifies the coordinate system for interpreting move distances:
|
| x,y,z | The X, Y and Z move distances. |
This method moves the 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 method.
| boolean MoveObjectByPoint | ( | GlgCoordType | coord_type, |
| GlgPoint | point | ||
| ) |
Moves the object by distances specified by the GlgPoint object.
| coord_type | Specifies the coordinate system for interpreting move distances:
|
| point | GlgPoint containing X, Y and Z move distance values. |
This method moves an object's control points by the distances specified as the X, Y and Z parameters of the GlgPoint, calculating new control point values. The object's hierarchy must be set up to use this method.
| boolean PositionObject | ( | GlgCoordType | coord_type, |
| GlgAnchoringType | anchoring, | ||
| double | x, | ||
| double | y, | ||
| double | z | ||
| ) |
Positions the object at the specified location.
| 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 (HLEFT, HCENTER or HRIGHT) with the vertical anchoring constants (VTOP, VCENTER or VBOTTOM). For example, using ( VTOP | 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 method positions the object, calculating new control point values. The object's hierarchy must be set up to use this method.
| boolean PositionObjectByPoint | ( | GlgCoordType | coord_type, |
| GlgAnchoringType | anchoring, | ||
| GlgPoint | position | ||
| ) |
Positions the object at the location specified by the GlgPoint object.
| 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 (HLEFT, HCENTER or HRIGHT) with the vertical anchoring constants (VTOP, VCENTER or VBOTTOM). For example, using ( VTOP | HLEFT ) causes the upper left corner of the object's bounding box to be positioned at the specified location. |
| position | GlgPoint containing x, y and z coordinates of the desired object position. |
This method positions the object, calculating new control point values. The object's hierarchy must be set up to use this method.
| boolean RotateObject | ( | GlgCoordType | coord_type, |
| GlgPoint | center, | ||
| double | x_angle, | ||
| double | y_angle, | ||
| double | z_angle | ||
| ) |
Rotates the object.
| 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 method rotates the object's control points by the specified rotation angle and relative to the specified center, calculating new control point values. The object's hierarchy must be set up to use this method.
| boolean ScaleObject | ( | GlgCoordType | coord_type, |
| GlgPoint | center, | ||
| double | x_scale, | ||
| double | y_scale, | ||
| double | z_scale | ||
| ) |
Scales the object.
| 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 method 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 method.
| boolean TransformObject | ( | GlgObject | xform, |
| GlgCoordType | coord_type, | ||
| GlgObject | parent | ||
| ) |
ADVANCED: Transforms all control points of the object with an arbitrary transformation.
The method can be invoked on a drawable object or on a G data object representing a control point.
| xform | The transformation (an 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=PARENT_COORD, or if the object is a G data object representing a control point. null may be passed in all other cases. |
This method 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 method.