Element templates define symbology properties. More...
#include <ElementTemplateNode.h>
Public Member Functions | |
DGNPLATFORM_EXPORT ECN::IECInstancePtr | GetDefaultInstance () const |
Return the "default" IECInstance used to store symbology paraemeters in Element Templates. More... | |
DGNPLATFORM_EXPORT ECN::IECInstancePtr | GetOrCreateDefaultInstance () |
Return the "default" IECInstance used to store symbology paraemeters in Element Templates. More... | |
![]() | |
DGNPLATFORM_EXPORT void | SortParent () |
Sort all children of the parent of this node. More... | |
DGNPLATFORM_EXPORT void | SortChildren () |
Sort all children of this node if this node contains child nodes. More... | |
DGNPLATFORM_EXPORT WString | GetFullPath () const |
Return the full heirarchial path to the XDataTreeNode. More... | |
DGNPLATFORM_EXPORT WCharCP | GetNameCP () const |
Return pointer to the name of the XDataTreeNode. More... | |
DGNPLATFORM_EXPORT void | SetName (WCharCP name) |
Set the name of the XDataTreeNode. More... | |
DGNPLATFORM_EXPORT bool | AllowChildNodes () const |
Return true if node is allowed to have child nodes. More... | |
DGNPLATFORM_EXPORT DgnPlatform::ElementId | GetParentId () const |
Return the ElementId of the parent node. If the node is a root node a value of 0 is returned. More... | |
DGNPLATFORM_EXPORT int | GetSortPriority () const |
Return the Sort Priority which is used to determine the postion of the node under its parent node. More... | |
DGNPLATFORM_EXPORT void | SetSortPriority (int sortPriority) |
Set the Sort Priority which is used to determine the position of the node under its parent node. More... | |
DGNPLATFORM_EXPORT DgnPlatform::ElementId | GetId () const |
Return the ElementId of the Type 66 element that serves as a host for the node. More... | |
DGNPLATFORM_EXPORT ElementRefP | GetElementRef () const |
Return the ElementRef of the Type 66 element that serves as a host for the node. More... | |
DGNPLATFORM_EXPORT StatusInt | Write () |
Write any node changes to the owner, which is typically a DgnFile. More... | |
DGNPLATFORM_EXPORT DgnPlatform::HandlerId | GetHandlerId () const |
Return the HandlerId for the node. This is use to determine the type of data the node contains, such as Element Template, Task, NamedTools, Detailing Symbol Styles, etc. More... | |
DGNPLATFORM_EXPORT XInstanceContainer * | GetXInstanceContainer () |
Return a pointer to the XInstanceContainer that holds a list of ECXAInstance associated with the node. A NULL will be return if no instances are held by the node. More... | |
DGNPLATFORM_EXPORT XDataTreeOwner * | GetOwner () const |
Return the XDataTreeOwner that hold the XDataTree that contains the XDataTree node. More... | |
DGNPLATFORM_EXPORT void | ClearCachedInstances () |
Clear the cached instances held by the XInstanceContainer. More... | |
DGNPLATFORM_EXPORT BentleyStatus | ReloadXAttributeData () |
Reload the XAttribute data which holds the node name, sort priority, and parent node specification. More... | |
DGNPLATFORM_EXPORT WCharCP | GetPathSeparatorCP () const |
Return the separator character used to separate the individual node names to form the fullpath for the node. More... | |
DGNPLATFORM_EXPORT ECN::IECInstancePtr | GetECInstanceBySchemaName (WCharCP fullSchemaName) const |
Return a pointer to an IECIntance that is held in the node XInstanceContainer. More... | |
DGNPLATFORM_EXPORT ECN::IECInstancePtr | GetECInstanceByClassName (WCharCP className) const |
Return a pointer to an IECIntance that is held in the node XInstanceContainer. More... | |
![]() | |
void * | operator new (size_t size) |
void | operator delete (void *rawMemory, size_t size) |
UInt32 | AddRef () const |
UInt32 | Release () const |
RefCounted () | |
RefCounted (RefCounted const &rhs) | |
RefCounted & | operator= (RefCounted const &rhs) |
UInt32 | GetRefCount () const |
Static Public Member Functions | |
static DGNPLATFORM_EXPORT ElementTemplateNodePtr | FindByElementId (ElementId elemID, XDataTreeOwner &owner) |
Return a pointer to an ElementTemplateNode for an existing element. More... | |
static DGNPLATFORM_EXPORT ElementTemplateNodePtr | CreateNode (WCharCP name, ElementId parentId, bool allowChildNodes, int sortPriority, XDataTreeOwner &owner, XInstanceContainer *seedContainer=NULL) |
Create and return a pointer to an ElementTemplateNode. More... | |
static DGNPLATFORM_EXPORT ElementTemplateNodePtr | CreateNode (WCharCP name, ElementTemplateNodeP parentNode, bool allowChildNodes, int sortPriority, XDataTreeOwner &owner, XInstanceContainer *seedContainer=NULL) |
Create and return a pointer to an ElementTemplateNode. More... | |
static DGNPLATFORM_EXPORT ElementTemplateNodePtr | CreateNode (WCharCP name, ElementTemplateNodePtr &parentNode, bool allowChildNodes, int sortPriority, XDataTreeOwner &owner, XInstanceContainer *seedContainer=NULL) |
Create and return a pointer to an ElementTemplateNode. More... | |
static DGNPLATFORM_EXPORT ElementTemplateNodePtr | FromXDataTreeNodePtr (XDataTreeNodeP xDataTreeNode) |
Return a pointer to an ElementTemplateNode given a pointer to an XDataTreeNode. More... | |
static DGNPLATFORM_EXPORT HandlerId | GetNodeHandlerId () |
Return the HandlerId used to designate an element as an ElementTemplate Node. More... | |
![]() | |
static DGNPLATFORM_EXPORT XDataTreeNodePtr | FindByElementId (DgnPlatform::ElementId elemID, DgnPlatform::HandlerId handlerId, XDataTreeOwner &owner) |
Return a reference counted pointer to an XDataTreeNode. More... | |
static DGNPLATFORM_EXPORT XDataTreeNodePtr | Create (WStringR name, int sortPriority, bool allowChildNodes, XDataTreeNodeP parentNodeP, XDataTreeOwner &owner, DgnPlatform::HandlerId handlerId, XInstanceContainer *seedInstances) |
Create and return a new XDataTreeNode. More... | |
Additional Inherited Members | |
![]() | |
virtual | ~RefCounted () |
![]() | |
virtual | ~IRefCounted () |
void * | operator new (size_t size) |
void | operator delete (void *rawMemory, size_t size) |
Element templates define symbology properties.
Element templates are contained in template groups. Template groups are arranged in a hierarchy, where one group may contain another template group. Both the groups and templates are stored in DGN or DGNLib files. A template can be used by MicroStation to set the active symbology setting, they can be reference by elements so the symbology defined in the template is applied to an element. Templates can also be used by Standard Checker to validate element symbology. The ElementTemplateNode is the in-memory object used to store the Element Template groups and its containing templates in a hierarchical tree structure in memory. The in-memory representation of the tree structure is called an XDataTree.
A new element template may be created by:
To create a template using ElementTemplateNode::CreateNode a parent group must first be located and then the new template inserted in that group. Once the template (ElementTemplateNodePtr) is created the adding of the properties IECInstance is done as in the above example.
The steps to read element property data are:
The steps to update element property data are:
The steps to update an element template are:
The steps to associate an element template with an element are:
Given an element the associated element template can be returned as:
|
static |
Create and return a pointer to an ElementTemplateNode.
[in] | name | The name of the Element Template or Element Template Group being created. |
[in] | parentId | The ElementId of the parent Template Group. If the Template Group is a root level node then the parentId should be set to 0. |
[in] | allowChildNodes | If true the node is considered a Template Group that holds Element Template nodes. A Template Group does not hold any symbology parameters. |
[in] | sortPriority | The sort priority determines the order the template nodes are shown in the user interface. |
[in] | owner | Owner of the XDataTree which is to contains the ElementTemplateNode. |
[in] | seedContainer | Optional container of IECInstance data containing Element Template data. |
|
static |
Create and return a pointer to an ElementTemplateNode.
[in] | name | The name of the Element Template or Element Template Group being created. |
[in] | parentNode | Pointer to the Parent Template Group. If the Template Group is a root level node then NULL should be passed in. |
[in] | allowChildNodes | If true the node is considered a Template Group that holds Element Template nodes. A Template Group does not hold any symbology parameters. |
[in] | sortPriority | The sort priority determines the order the template nodes are shown in the user interface. |
[in] | owner | Owner of the XDataTree which is to contains the ElementTemplateNode. |
[in] | seedContainer | Optional container of IECInstance data containing Element Template data. |
|
static |
Create and return a pointer to an ElementTemplateNode.
[in] | name | The name of the Element Template or Element Template Group being created. |
[in] | parentNode | Pointer to the Parent Template Group. If the Template Group is a root level node then an ElementTemplateNodePtr set to NULL should be passed in. |
[in] | allowChildNodes | If true the node is considered a Template Group that holds Element Template nodes. A Template Group does not hold any symbology parameters. |
[in] | sortPriority | The sort priority determines the order the template nodes are shown in the user interface. |
[in] | owner | Owner of the XDataTree which is to contains the ElementTemplateNode. |
[in] | seedContainer | Optional container of IECInstance data containing Element Template data.L |
|
static |
Return a pointer to an ElementTemplateNode for an existing element.
[in] | elemID | The ElementId of the Type 66 element that holds the element template XAttribute data. |
[in] | owner | The owner of the node. The owner can be determined by the DgnFileP. See XDataTreeManager::GetDgnXDataTreeOwner. |
|
static |
Return a pointer to an ElementTemplateNode given a pointer to an XDataTreeNode.
If the XDataTreeNode is not for an Element Template a NULL pointer in returned.
[in] | xDataTreeNode | The XDataTreeNode that is potentially an Element Template node. |
DGNPLATFORM_EXPORT ECN::IECInstancePtr GetDefaultInstance | ( | ) | const |
Return the "default" IECInstance used to store symbology paraemeters in Element Templates.
It is possible for an element template to hold instance data for other applications. The default instance holds the symbology parameters used by MicroStation and its derivatives.
|
static |
Return the HandlerId used to designate an element as an ElementTemplate Node.
DGNPLATFORM_EXPORT ECN::IECInstancePtr GetOrCreateDefaultInstance | ( | ) |
Return the "default" IECInstance used to store symbology paraemeters in Element Templates.
It is possible for an element template to hold instance data for other applications. The default instance holds the symbology parameters used by MicroStation and its derivatives. This method with create an instance so it can be populated if one does not exist.