|
GLG Toolkit, C / C++ API Library
Version 4.6
|
This group contains methods for manipulating objects at run time.
Functions | |
| GlgBoolean | SetResourceObject (char *resource_name, GlgObjectC *value) |
| Replaces a resource object. More... | |
| GlgBoolean | SetXform (GlgObjectC *xform) |
| Adds or deletes transformations attached to an object. More... | |
| GlgBoolean SetResourceObject | ( | char * | resource_name, |
| GlgObjectC * | value | ||
| ) |
Replaces a resource object.
This is a wrapper for GlgSetResourceObject.
| resource_name | A default attribute name of a resource that is being set or replaced. |
| value | A new resource object. |
This method sets or replaces the resource object specified by the resource name. It may be used to attach custom properties (CustomData resource), history (History resource) and aliases (Aliases resource) to this object, or to replace them with new values. A container object may be used as o_value to attach a list of properties or other objects. If objects have been drawn, they must be suspended with SuspendObject before using SetResourceObject and released with ReleaseObject when finished.
This method may also be used to set or replace values of other resources. For example, it may be used instead of the SetXform method to set the object's transformation using the "Xform" resource name. However, SetResourceObject provides direct manipulation capabilities and doesn't do any error checking, making the user responsible for the proper handling of objects.
While this method provides the Extended API functionality, it may also be used with the Intermediate API for setting global configuration resources.
| GlgBoolean SetXform | ( | GlgObjectC * | xform | ) |
Adds or deletes transformations attached to an object.
This is a wrapper for GlgSetXform.
| xform | A new transformation object to be attached to this object, or NULL to delete the currently attached transformation. |
This method replaces the current object's transformation with a new one. A NULL pointer may be used as the value of the transformation parameter to just delete the existing transformation (use the "Xform" resource name to query the existence of the transformation with the GetResourceObject method).
A transformation may be added only to a drawable object (such as a viewport, group, polygon, etc.) or to the object's attributes. Any attempt to add a transformation to a non-drawable object generates an error message.
The attributes of an object differ by their data type. It is important not to try to attach a transformation of an inappropriate type to these objects. For example, SetXform fails if you try to attach a string transformation to a geometrical object.
A transformation may be added to an object only before it has been drawn. To add a transformation after the object has been drawn, use SuspendObject, then use ReleaseObject when done. Adding a transformation without using the SuspendObject method after the object has been drawn generates an error message.