ElementTemplateUtils.h
Go to the documentation of this file.
1 /*--------------------------------------------------------------------------------------+
2 |
3 | Supplied under applicable software license agreement.
4 |
5 | Copyright (c) 2018 Bentley Systems, Incorporated. All rights reserved.
6 |
7 +---------------------------------------------------------------------------------------*/
8 #pragma once
9 
10 DGNPLATFORM_TYPEDEFS(ElementTemplateNode);
11 DGNPLATFORM_REF_COUNTED_PTR(ElementTemplateNode);
12 
14 
17 
20  {
62  ETSTATUS_Error = BSIERROR, // 0x8000
63  };
64 
65 
66 /*=================================================================================**/
75 {
76 public:
80  DGNPLATFORM_EXPORT static ElementTemplateStatus RemoveTemplateReferenceFromElement (ElementRefP elemRef);
81 
86  DGNPLATFORM_EXPORT static ElementTemplateStatus ScheduleTemplateReferenceRemoval (EditElementHandleR graphicElemHandle);
87 
92  DGNPLATFORM_EXPORT static ElementTemplateStatus AttachMaterialLinkages (EditElementHandleR graphicElemHandle, ElementTemplateNodeR templateNode);
93 
98  DGNPLATFORM_EXPORT static ElementTemplateStatus GetPathForReferencedTemplate (WString& templatePath, ElementRefP elemRef);
99 
103  DGNPLATFORM_EXPORT static ElementTemplateNodePtr GetReferencedTemplate (ElementRefP elemRef);
104 
110  DGNPLATFORM_EXPORT static ElementTemplateStatus GetPathForTemplate (WString* templatePath, DgnPlatform::ElementId templateID, DgnModelRefP modelRef);
111 
117  DGNPLATFORM_EXPORT static ElementTemplateStatus GetTemplateIDFromPath (DgnPlatform::ElementId* pTemplateID, WCharCP wPath, DgnFileP dgnFileP);
118 
124  DGNPLATFORM_EXPORT static ElementTemplateStatus GetReferencedTemplateData (WString* elementTemplatePath, DgnPlatform::ElementId* templateId, ElementRefP elementRef);
125 
130  DGNPLATFORM_EXPORT static ElementTemplateStatus GetReferencedTemplateID (DgnPlatform::ElementId& pTemplateID, ElementRefP elemRef);
131 
135  DGNPLATFORM_EXPORT static ElementId GetReferencedTemplateIDFromHandle (ElementHandleCR graphicElemHandle);
136 
142  DGNPLATFORM_EXPORT static ElementTemplateStatus SetReferencedTemplateID (EditElementHandleR graphicElemHandle, DgnPlatform::ElementId templateID, bool applyDefaultSymbology);
143 
148  DGNPLATFORM_EXPORT static ElementTemplateStatus SetReferencedTemplateID (ElementRefP elementRef, DgnPlatform::ElementId templateID);
149 
154  DGNPLATFORM_EXPORT static ElementTemplateStatus ScheduleTemplateReferenceAttachment (EditElementHandleR graphicElemHandle, ElementTemplateNode& templateNode);
155 
160  DGNPLATFORM_EXPORT static ElementTemplateStatus DeleteFromFile (ElementTemplateNode& templateNode);
161 
165  DGNPLATFORM_EXPORT static ElementTemplateStatus DeleteTemplateNode (ElementTemplateNodePtr& templateNode);
166 
172  DGNPLATFORM_EXPORT static ElementTemplateStatus CreateByPath (ElementTemplateNodePtr& templateNode, WCharCP fullPath, XDataTreeOwner& owner);
173 
179  DGNPLATFORM_EXPORT static ElementTemplateStatus CreateByPath (ElementTemplateNodePtr& templateNode, WCharCP fullPath, DgnFileR dgnFile);
180 
185  DGNPLATFORM_EXPORT static ElementTemplateNodePtr FindTemplateNodeByPath (WCharCP elementTemplatePath, XDataTreeOwner& owner);
186 
191  DGNPLATFORM_EXPORT static ElementTemplateNodePtr FindTemplateNodeByPath (WCharCP elementTemplatePath, DgnFileR dgnFile);
192 
196  DGNPLATFORM_EXPORT static ElementTemplateNodePtr GetTemplateNodeUsingDependentElement (ElementRefP elementRef);
197 
201  DGNPLATFORM_EXPORT static bool IsTemplateInUse (ElementTemplateNodeCR templateNode, bool loadAllModels=false);
202 
207  DGNPLATFORM_EXPORT static ElementTemplateStatus AddItemToTemplate (ElementTemplateNodeCR templateNode, ECN::StandaloneECInstanceCR itemInstance);
208 
213  DGNPLATFORM_EXPORT static ElementTemplateStatus AttachItemToElement (ElementRefP elemRef, ECN::StandaloneECInstanceCR itemInstance);
214 
218  DGNPLATFORM_EXPORT static ElementTemplateStatus WriteTemplateNode (ElementTemplateNodeR templateNode);
219 
221  DGNPLATFORM_EXPORT static Bentley::DgnPlatform::HandlerId GetElementTemplateHandlerId ();
222 };
223 
225 
Definition: ElementTemplateUtils.h:21
Definition: ElementTemplateUtils.h:55
Definition: ElementTemplateUtils.h:44
Definition: ElementTemplateUtils.h:34
#define END_BENTLEY_DGNPLATFORM_NAMESPACE
Definition: DgnPlatformBaseType.r.h:69
Definition: ElementTemplateUtils.h:57
StandaloneECInstance const & StandaloneECInstanceCR
Definition: ECObjects.h:86
Definition: ElementTemplateUtils.h:45
Definition: ElementTemplateUtils.h:31
Definition: ElementTemplateUtils.h:38
The ElementTemplateUtils class is a utility class used to locate, write, and delete Element Templates...
Definition: ElementTemplateUtils.h:74
Definition: ElementTemplateUtils.h:33
A writeable "handle" to an MSElement.
Definition: ElementHandle.h:470
#define DGNPLATFORM_EXPORT
Definition: DgnPlatform/ExportMacros.h:58
A DgnFile is an in-memory representation of a physical file, regardless of its format.
Definition: DgnFile.h:308
Definition: ElementTemplateUtils.h:52
wchar_t const * WCharCP
Definition: Bentley.h:224
Definition: ElementTemplateUtils.h:42
Definition: ElementTemplateUtils.h:51
Definition: ElementTemplateUtils.h:24
Definition: ElementTemplateUtils.h:27
Definition: ElementTemplateUtils.h:59
ElementTemplateStatus
Indicates status from ElementTemplate API methods.
Definition: ElementTemplateUtils.h:19
Definition: ElementTemplateUtils.h:23
struct DgnPlatform::ElementTemplateNode const & ElementTemplateNodeCR
Definition: DgnPlatform.h:299
A DgnModelRef provides access to a model in a Bentley::DgnPlatform::DgnFile.
Definition: DgnModelRef.h:172
DGNPLATFORM_TYPEDEFS(ElementTemplateNode)
Definition: ElementTemplateUtils.h:25
Definition: ElementTemplateUtils.h:35
Definition: ElementTemplateUtils.h:30
Definition: Bentley.h:211
Definition: ElementTemplateUtils.h:56
Definition: ElementTemplateUtils.h:53
Definition: ElementTemplateUtils.h:41
Definition: ElementTemplateUtils.h:47
Interface that provides direct and efficient access to element data.
Definition: ElementRefBase.h:120
Definition: ElementTemplateUtils.h:48
Definition: ElementTemplateUtils.h:60
Definition: ElementTemplateUtils.h:49
#define BEGIN_BENTLEY_DGNPLATFORM_NAMESPACE
Definition: DgnPlatformBaseType.r.h:68
Definition: ElementTemplateUtils.h:62
UInt64 ElementId
Definition: DgnPlatformBaseType.r.h:83
Definition: ElementTemplateUtils.h:46
Definition: XDataTreeOwner.h:23
Definition: ElementTemplateUtils.h:39
Definition: ElementTemplateUtils.h:58
Definition: ElementTemplateUtils.h:26
Element templates define symbology properties.
Definition: ElementTemplateNode.h:156
Definition: ElementTemplateUtils.h:40
Definition: ElementTemplateUtils.h:37
Definition: ElementTemplateUtils.h:50
struct DgnPlatform::ElementHandle const & ElementHandleCR
Definition: DgnPlatform.h:260
DGNPLATFORM_REF_COUNTED_PTR(ElementTemplateNode)
Definition: ElementTemplateUtils.h:43
Definition: ElementTemplateUtils.h:54
A string class that has many of the same capabilities as std::string, plus additional functions such ...
Definition: WString.h:51
Definition: Bentley.h:213
Definition: ElementTemplateUtils.h:22
A two-part identifier, consisting of a major ID and a minor ID.
Definition: DgnCore.h:21

Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.