DetailingSymbolStyle.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 (DetailingSymbolSettings)
11 DGNPLATFORM_TYPEDEFS (IDetailingSymbol)
12 DGNPLATFORM_TYPEDEFS (DetailingSymbolStyle)
13 DGNPLATFORM_REF_COUNTED_PTR (DetailingSymbolStyle)
14 
16 
17 //=======================================================================================
25 //=======================================================================================
26 
27 
28 /*=================================================================================**/
33 
34 {
35 public:
36 
40  DGNPLATFORM_EXPORT BentleyStatus ScheduleApplyToElement (EditElementHandleR element);
41 
45  DGNPLATFORM_EXPORT BentleyStatus ScheduleRemoveFromElement (EditElementHandleR styleElem);
46 
51  DGNPLATFORM_EXPORT static DetailingSymbolStylePtr Create (WCharCP name, DgnFileR file);
52 
62  DGNPLATFORM_EXPORT static DetailingSymbolStylePtr Create (WCharCP name, DgnFileR file, int sortPriority, bool allowChildNodes, DgnPlatform::ElementId parentId, DgnPlatform::ElementId elemID, XDataTreeOwner& owner);
63 
68  DGNPLATFORM_EXPORT static DetailingSymbolStylePtr GetByName (WCharCP name, DgnFileR file);
69 
73  DGNPLATFORM_EXPORT static DetailingSymbolStylePtr GetFromElement (ElementRefP elementRef);
74 
79  DGNPLATFORM_EXPORT static DetailingSymbolStylePtr GetByID (DgnPlatform::ElementId elemID, DgnFileR file);
80 
85  DGNPLATFORM_EXPORT static BentleyStatus Delete (WCharCP name, DgnFileR file);
86 
90  DGNPLATFORM_EXPORT DetailingSymbolStylePtr CopyToFile (DgnFileR file);
91 
92  DGNPLATFORM_EXPORT DetailingSymbolStylePtr Copy () const;
93  DGNPLATFORM_EXPORT BentleyStatus CopyValues (DetailingSymbolStyleCR source);
94 
97  DGNPLATFORM_EXPORT WCharCP GetName () const;
98 
101  DGNPLATFORM_EXPORT ElementId GetID () const;
102 
105  DGNPLATFORM_EXPORT DgnFileP GetFile () const;
106 
110 
114  DGNPLATFORM_EXPORT BentleyStatus SetName (WCharCP newName);//rename
115 
116  //DGNPLATFORM_EXPORT bool IsValid () const;
117  //For applysymbology related methods like modifylevel and others we need to have Host Admin stuff, with default implementation in dgnplatform if no host is available.
118 
122  DGNPLATFORM_EXPORT BentleyStatus ApplySymbology (IDetailingSymbol* symbolDef) const;
123 
127  DGNPLATFORM_EXPORT BentleyStatus ApplySymbology (EditElementHandleR ehandle) const;
128 
133  DGNPLATFORM_EXPORT bool Validate (WString* errMessage, bvector<std::pair<WString, WString>>* detailMessage) ;//const {return false;}
134 
137  DGNPLATFORM_EXPORT bool IsStyleInUse ();
138 
141  DGNPLATFORM_EXPORT int UpdateStyleUsers ();
142 
145  DGNPLATFORM_EXPORT static void AddTransactionListener (IDetailingSymbolStyleTransactionListener& obj);
146 
149  DGNPLATFORM_EXPORT static void DropTransactionListener (IDetailingSymbolStyleTransactionListener& obj);
150 
156  DGNPLATFORM_EXPORT static void OnDetailingSymbolStyleTransactionEvent (DetailingSymbolStyleCP styleBefore, DetailingSymbolStyleCP styleAfter, StyleEventType eventType, StyleEventSource source);
157 
160  MSCORE_EXPORT static void AddListener (DetailingSymbolStyleEvents& handler);
161 
164  MSCORE_EXPORT static void DropListener (DetailingSymbolStyleEvents& handler);
165 
169  DGNPLATFORM_EXPORT static DetailingSymbolStylePtr GetSettings (DgnFileR file);
170 
175  DGNPLATFORM_EXPORT static BentleyStatus ReplaceSettings (DetailingSymbolStylePtr style, DgnFileR file);
176 
178  DGNPLATFORM_EXPORT static bvector<DetailingSymbolStylePtr> BuildList (DgnFileR file);
179 
184  MSCORE_EXPORT static bvector<DetailingSymbolStylePtr> BuildList (StyleIteratorMode mode);
185 
188  MSCORE_EXPORT static DetailingSymbolStylePtr GetActive ();
189 
193  MSCORE_EXPORT static BentleyStatus SetActive (DetailingSymbolStylePtr style);
194 
197  MSCORE_EXPORT BentleyStatus UpdateFromDgnlib ();
198 
203  MSCORE_EXPORT static DetailingSymbolStylePtr GetByName (WCharCP name, StyleIteratorMode mode);
204 
205  //MSCORE_EXPORT static BentleyStatus UpdateDgnlib ();
206 
209  MSCORE_EXPORT static BentleyStatus UpdateStylesFromDgnlib ();
210 
214  MSCORE_EXPORT static StatusInt EnsureActiveStyle (bool getFromDgnlibIfNotPresent);
215 
220  MSCORE_EXPORT static StatusInt EnsureActiveStyleInFile (DgnFileP file, bool getFromDgnlibIfNotPresent);
221 };
222 
224 /*=================================================================================**/
229 struct DetailingSymbolStyleIterator : std::iterator<std::forward_iterator_tag, DetailingSymbolStyleP const>
230 {
231 
232 public:
235 
237  DGNPLATFORM_EXPORT DetailingSymbolStyleIterator& operator ++();
238 
240  DGNPLATFORM_EXPORT DetailingSymbolStyleP const& operator *() const;
241 
243  DGNPLATFORM_EXPORT bool operator == (DetailingSymbolStyleIterator const &) const;
244 
246  DGNPLATFORM_EXPORT bool operator != (DetailingSymbolStyleIterator const &) const;
247 
249  DGNPLATFORM_EXPORT bool IsValid () const;
250 };
251 
252 /*=================================================================================**/
258 {
259 public:
260 
264 
267 
270 
273 };
274 
276 
278 
const_iterator iterator
only const iteration is possible
Definition: DetailingSymbolStyle.h:266
#define END_BENTLEY_DGNPLATFORM_NAMESPACE
Definition: DgnPlatformBaseType.r.h:69
Open for write access.
iterator begin()
Definition: stdcxx/bstdmap.h:178
A forward iterator to go through the list of DetailingSymbolStyles in a collection.
Definition: DetailingSymbolStyle.h:229
iterator end()
Definition: stdcxx/bstdmap.h:186
A writeable "handle" to an MSElement.
Definition: ElementHandle.h:470
StyleEventSource
Definition: DgnPlatform.h:1672
#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
wchar_t const * WCharCP
Definition: Bentley.h:224
A collection detailingsymbol styles in a file.
Definition: DetailingSymbolStyle.h:257
StyleEventType
Definition: DgnPlatform.h:1661
! Class used to hold XAttribute data that contains the name, sort priority, and ! parent node informa...
Definition: XDataTreeNode.h:60
BentleyStatus
Definition: Bentley.h:208
#define DGNPLATFORM_REF_COUNTED_PTR(_sname_)
Definition: DgnPlatform.h:79
#define DGNPLATFORM_TYPEDEFS(_name_)
Definition: DgnPlatform.h:73
Interface that provides direct and efficient access to element data.
Definition: ElementRefBase.h:120
StyleIteratorMode
Definition: DgnPlatform.h:1653
#define BEGIN_BENTLEY_DGNPLATFORM_NAMESPACE
Definition: DgnPlatformBaseType.r.h:68
DVec3d operator*(Transform const &transform, DVec3d const &vector)
operator overload for multiplication of a transform and a vector li>The vector appears on the left as...
bool operator!=(const BentleyAllocator< _Ty > &, const BentleyAllocator< _Other > &)
Definition: BentleyAllocator.h:152
int StatusInt
Definition: Bentley.h:222
UInt64 ElementId
Definition: DgnPlatformBaseType.r.h:83
Definition: XDataTreeOwner.h:23
Base class for the various detailing symbol types.
Definition: DetailingSymbol.h:275
Definition: DetailingSymbolStyle.h:32
A string class that has many of the same capabilities as std::string, plus additional functions such ...
Definition: WString.h:51
DetailingSymbolStyleIterator const_iterator
Definition: DetailingSymbolStyle.h:265
bool operator==(const BentleyAllocator< _Ty > &, const BentleyAllocator< _Other > &)
Definition: BentleyAllocator.h:146

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