GLG Toolkit, C# Class Library  Version 4.6
Intermediate API Methods

Detailed Description

Functions

virtual bool ConstrainObject (GlgObject from_attribute, GlgObject to_attribute)
 Constrains an attribute or a point of the object to an attribute or a point of another object. More...
 
virtual bool ContainsObject (GlgObject container, Object object)
 Checks if object belongs to the container. More...
 
virtual Object GetElement (GlgObject container, int index)
 Returns element at the specified position in the container. More...
 
virtual int GetIndex (GlgObject container, Object object)
 Returns index of the first occurrence of an object in the container. More...
 
virtual GlgObject GetNamedObject (GlgObject container, String name)
 Finds an object with the specified name inside the container of GLG objects and returns it. More...
 
virtual int GetNumParents (GlgObject glg_object)
 ADVANCED: Returns number of the object's parents. More...
 
virtual GlgObject GetParent (GlgObject glg_object)
 ADVANCED: Returns an object's parent object, if one exists., or an array of all parents for constrained data objects. More...
 
virtual Object GetResource (GlgObject glg_object, String resource_name)
 Deprecated, use GetNativeComponent:
Returns an ID of a native resource. More...
 
virtual GlgObject GetResourceObject (GlgObject glg_object, String resource_name)
 Finds and returns a named resource or an attribute of the object. More...
 
virtual int GetSize (GlgObject container)
 Returns size of the container object. More...
 
virtual void Inverse (GlgObject container)
 Inverses the order of elements inside the container object. More...
 
virtual Object Iterate (GlgObject container)
 Traverses the container object's elements in the forward direction. More...
 
virtual Object IterateBack (GlgObject container)
 Traverses the container object's elements in the backward direction. More...
 
virtual void ReleaseObject (GlgObject glg_object, GlgObject suspend_info)
 Releases the object that was suspended for editing. More...
 
virtual bool ReorderElement (GlgObject container, int old_index, int new_index)
 Changes an element's position inside the container. More...
 
virtual bool SaveObject (GlgObject glg_object, String filename)
 Saves the object to a file using a default encoding. More...
 
virtual bool SaveObject (GlgObject glg_object, String filename, Encoding encoding)
 Saves an object into a file using the specified charset. More...
 
virtual void SetEnd (GlgObject container)
 Initializes the container object for the backward traversing. More...
 
virtual void SetStart (GlgObject container)
 Initializes the container object for the forward traversing. More...
 
virtual GlgObject SuspendObject (GlgObject glg_object)
 Suspends the object for editing after it has been drawn. More...
 
virtual bool UnconstrainObject (GlgObject glg_object)
 Unconstrains an object's attribute or an object's point. More...
 

Function Documentation

◆ ConstrainObject()

virtual bool ConstrainObject ( GlgObject  from_attribute,
GlgObject  to_attribute 
)
virtual

Constrains an attribute or a point of the object to an attribute or a point of another object.

Parameters
from_attributeThe attribute or point object to be constrained.
to_attributeThe attribute or the point to constrain to.
Returns
Success or failure status.

This method invokes the corresponding method of the GlgObject class. See ConstrainObject for more information.

◆ ContainsObject()

virtual bool ContainsObject ( GlgObject  container,
Object  object 
)
virtual

Checks if object belongs to the container.

Parameters
containerA container object.
objectThe object to search for.
Returns
true if the object is found in the container, false otherwise.

This method invokes the corresponding method of the GlgObject class.

◆ GetElement()

virtual Object GetElement ( GlgObject  container,
int  index 
)
virtual

Returns element at the specified position in the container.

Parameters
containerA container object.
indexThe element's position inside the container.
Returns
The element at the specified position.

This method invokes the corresponding method of the GlgObject class. See GetElement for more information.

◆ GetIndex()

virtual int GetIndex ( GlgObject  container,
Object  object 
)
virtual

Returns index of the first occurrence of an object in the container.

Parameters
containerA container object.
objectThe object to search for.
Returns
Index of the object, or -1 if the object was not found in the container.

This method invokes the corresponding method of the GlgObject class.

◆ GetNamedObject()

virtual GlgObject GetNamedObject ( GlgObject  container,
String  name 
)
virtual

Finds an object with the specified name inside the container of GLG objects and returns it.

Parameters
containerA container object.
nameThe object's name.
Returns
The retrieved object, of null if the named object was not found.

This method invokes the corresponding method of the GlgObject class.

◆ GetNumParents()

virtual int GetNumParents ( GlgObject  glg_object)
virtual

ADVANCED: Returns number of the object's parents.

This method is used to determine the type of the return value of the GetParent method and must be called after the hierarchy is created.

For constrained objects, the method returns a number greater than 1.

Parameters
glg_objectAn object to query.
Returns
The number of the object's parents.

This method invokes the corresponding method of the GlgObject class.

◆ GetParent()

virtual GlgObject GetParent ( GlgObject  glg_object)
virtual

ADVANCED: Returns an object's parent object, if one exists., or an array of all parents for constrained data objects.

Parameters
glg_objectAn object to query.
Returns
  • The parent object if the object has a single parent.
  • A group containing all object's parents if the object has multiple parents.
  • null if the object has no parents or in case of an error.

This method invokes the corresponding method of the GlgObject class. See GetParent for more information.

◆ GetResource()

virtual Object GetResource ( GlgObject  glg_object,
String  resource_name 
)
virtual

Deprecated, use GetNativeComponent:
Returns an ID of a native resource.

Parameters
glg_objectThe object to be queried.
resource_nameSpecifies the resource path of a native resource.
Returns
Native resource object.

This method was used in previous releases to get IDs of native objects used to render the viewport's drawing.

The method is deprecated, use GetNativeComponent.

◆ GetResourceObject()

virtual GlgObject GetResourceObject ( GlgObject  glg_object,
String  resource_name 
)
virtual

Finds and returns a named resource or an attribute of the object.

Parameters
glg_objectThe parent object whose resources are queried.
resource_nameA resource path to access the resource object inside the object the method is invoked on. It may use object names or default attribute names.
Returns
The retrieved object, or null if the resource was not found.

This method invokes the corresponding method of the GlgObject class. See GetResourceObject for more information.

◆ GetSize()

virtual int GetSize ( GlgObject  container)
virtual

Returns size of the container object.

For a viewport or group object, the size is the number of objects in the viewport or group. For a polygon, the size is the number of vertices.

Parameters
containerA container object.
Returns
The size of the container.

While the method provides the Intermediate API functionality, it is also available in the Standard API when used with a group object returned by CreateTagList.

This method invokes the corresponding method of the GlgObject class.

◆ Inverse()

virtual void Inverse ( GlgObject  container)
virtual

Inverses the order of elements inside the container object.

Parameters
containerA container object.

This method invokes the corresponding method of the GlgObject class.

◆ Iterate()

virtual Object Iterate ( GlgObject  container)
virtual

Traverses the container object's elements in the forward direction.

Parameters
containerA container object.
Returns
The next element of the container.

This method invokes the corresponding method of the GlgObject class. See Iterate for more information.

◆ IterateBack()

virtual Object IterateBack ( GlgObject  container)
virtual

Traverses the container object's elements in the backward direction.

Parameters
containerA container object.
Returns
The previous element of the container.

This method invokes the corresponding method of the GlgObject class. See IterateBack for more information.

◆ ReleaseObject()

virtual void ReleaseObject ( GlgObject  glg_object,
GlgObject  suspend_info 
)
virtual

Releases the object that was suspended for editing.

Parameters
glg_objectThe suspended object to be released.
suspend_infoSuspension information returned by the previous call to SuspendObject.

This method releases previously suspended object and is intended to be used only in conjunction with the SuspendObject method.

This method invokes the corresponding method of the GlgObject class.

◆ ReorderElement()

virtual bool ReorderElement ( GlgObject  container,
int  old_index,
int  new_index 
)
virtual

Changes an element's position inside the container.

Parameters
containerA container object.
old_indexThe index of an element to be reordered.
new_indexA new element position.
Returns
Success or failure status.

This method moves the element at the old_index to the new_index position inside the container. It generates an error message and returns false if indexes are out of range.

This method invokes the corresponding method of the GlgObject class.

◆ SaveObject() [1/2]

virtual bool SaveObject ( GlgObject  glg_object,
String  filename 
)
virtual

Saves the object to a file using a default encoding.

Parameters
filenameThe file to save the object to.
glg_objectThe object to save.
Returns
false if the file is not accessible for writing, true if the object was successfully saved.

This method invokes the corresponding method of the GlgObject class. See SaveObject for more information.

◆ SaveObject() [2/2]

virtual bool SaveObject ( GlgObject  glg_object,
String  filename,
Encoding  encoding 
)
virtual

Saves an object into a file using the specified charset.

Parameters
filenameThe file to save the object to.
glg_objectThe object to save.
encodingEncoding for string encoding.
Returns
false if the file is not accessible for writing, true if the object was successfully saved.

This method invokes the corresponding method of the GlgObject class. See SaveObject for more information.

◆ SetEnd()

virtual void SetEnd ( GlgObject  container)
virtual

Initializes the container object for the backward traversing.

The method sets the current position pointer past the last element of the container, preparing the container object for the backward traversing with IterateBack.

Parameters
containerA container object.

This method invokes the corresponding method of the GlgObject class.

◆ SetStart()

virtual void SetStart ( GlgObject  container)
virtual

Initializes the container object for the forward traversing.

The method sets the current position pointer before the first element of the container, preparing the container object for the forward traversing with Iterate.

Parameters
containerA container object.

This method invokes the corresponding method of the GlgObject class.

◆ SuspendObject()

virtual GlgObject SuspendObject ( GlgObject  glg_object)
virtual

Suspends the object for editing after it has been drawn.

Parameters
glg_objectAn object to be suspended.
Returns
An object which keeps suspension information. This information should be passed to the ReleaseObject method when the object is released.

This method invokes the corresponding method of the GlgObject class. See SuspendObject for more information.

◆ UnconstrainObject()

virtual bool UnconstrainObject ( GlgObject  glg_object)
virtual

Unconstrains an object's attribute or an object's point.

Parameters
glg_objectThe attribute or point object to be unconstrained.
Returns
Success or failure status.

This method invokes the corresponding method of the GlgObject class. See UnconstrainObject for more information.