IAuxCoordSys.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 #include "DgnPlatform.h"
11 #include "ValueFormat.h"
12 
13 
15 
16 //=======================================================================================
20 // @bsiclass Bentley Systems
21 enum class ACSType
22  {
23  None = 0,
24  Rectangular = 1,
25  Cylindrical = 2,
26  Spherical = 3,
27  Extended = 4,
28  };
29 
30 enum class ACSSaveOptions
31  {
32  OverwriteByElemId = 0, // overwrite only, preserving element ID.
33  OverwriteByName = 1, // overwrite only, preserving name.
34  AllowNew = 2, // allow to be saved as new if name doesn't match.
35  };
36 
37 enum class ACSEventType
38  {
39  None = 0,
40  ParameterChanged = (1 << 0), // An ACS nongeometry parameter changed (e.g. description).
41  GeometryChanged = (1 << 1), // An ACS geometry parameter changed (e.g. origin).
42  ChangeWritten = (1 << 2), // An ACS was written to the file.
43  NewACS = (1 << 3), // The ACS written was new.
44  Delete = (1 << 4), // the ACS was deleted from the file.
45  };
46 
48 
49 
51  {
52  None = 0, // used for testing individual bits.
53  Inactive = 0,
54  Active = (1 << 0),
55  Hilite = (1 << 2),
56  Deemphasized = (1 << 1),
57  CheckVisible = (1 << 3),
58  };
59 
61 
62 enum class ACSFlags
63  {
64  None = 0, // Used for testing individual bits.
65  Default = 0,
66  ViewIndependent = (1<<0), // Whether ACS always orients itself to the current view rotations or is a fixed rotation...
67  };
68 
69 ENUM_IS_FLAGS (ACSFlags)
70 
71 
73 
75 // @bsiclass Bentley Systems
77 {
79 
82 virtual UInt32 _GetACSTraversalOptions () = 0;
83 
91 virtual bool _HandleACSTraversal (IAuxCoordSysR acs) = 0;
92 };
93 
94 /*=================================================================================**/
98 struct IACSEvents
99 {
101 virtual void _OnACSEvent (IAuxCoordSysP acs, ACSEventType eventType, DgnModelRefP modelRef) = 0;
102 
103 }; // IACSEvents
104 
105 //=======================================================================================
111 //=======================================================================================
113 {
114 private:
115  virtual void MakeClassAbstract() = 0;
116 public:
117 public:
118 
120 DGNPLATFORM_EXPORT void AddListener (IACSEvents* acsListener);
121 
123 DGNPLATFORM_EXPORT void DropListener (IACSEvents* acsListener);
124 
129 
137 
144 
151 DGNPLATFORM_EXPORT IAuxCoordSysPtr GetByName (WCharCP name, DgnModelRefP modelRef, UInt32 options);
152 
158 DGNPLATFORM_EXPORT bool Traverse (IACSTraversalHandler& handler, DgnModelRefP modelRef);
159 
167 DGNPLATFORM_EXPORT StatusInt Save (IAuxCoordSysP auxCoordSys, DgnModelRefP modelRef, ACSSaveOptions saveOption, ACSEventType eventType);
168 
174 DGNPLATFORM_EXPORT StatusInt Delete (WCharCP name, DgnModelRefP modelRef);
175 
179 
180 }; // IACSManager
181 
182 
183 //=======================================================================================
186 // @remark Required library : DgnPlatform<ApiNumber>.lib i.e. DgnPlatform5.lib
187 // @bsiclass Bentley Systems
188 //=======================================================================================
190 {
191 private:
192  virtual void MakeClassAbstract() = 0;
193 public:
194 public:
195 
198 DGNPLATFORM_EXPORT IAuxCoordSysPtr Clone () const;
199 
202 DGNPLATFORM_EXPORT bool Equals (IAuxCoordSysCP other) const;
203 
206 DGNPLATFORM_EXPORT WString GetName () const;
207 
210 DGNPLATFORM_EXPORT WString GetDescription () const;
211 
214 DGNPLATFORM_EXPORT ACSType GetType () const;
215 
218 DGNPLATFORM_EXPORT WString GetTypeName () const;
219 
222 DGNPLATFORM_EXPORT double GetScale () const;
223 
226 DGNPLATFORM_EXPORT DPoint3dR GetOrigin (DPoint3dR pOrigin) const;
227 
230 DGNPLATFORM_EXPORT RotMatrixR GetRotation (RotMatrixR pRot) const;
231 
234 DGNPLATFORM_EXPORT bool GetIsReadOnly () const;
235 
238 DGNPLATFORM_EXPORT ACSFlags GetFlags () const;
239 
242 DGNPLATFORM_EXPORT StatusInt SetName (WCharCP name);
243 
246 DGNPLATFORM_EXPORT StatusInt SetDescription (WCharCP descr);
247 
250 DGNPLATFORM_EXPORT StatusInt SetType (ACSType type);
251 
254 DGNPLATFORM_EXPORT StatusInt SetScale (double scale);
255 
258 DGNPLATFORM_EXPORT StatusInt SetFlags (ACSFlags flags);
259 
262 DGNPLATFORM_EXPORT StatusInt SetOrigin (DPoint3dCR pOrigin);
263 
266 DGNPLATFORM_EXPORT StatusInt SetRotation (RotMatrixCR pRot);
267 
270 DGNPLATFORM_EXPORT StatusInt PointFromString (DPoint3dR outPoint, WStringR errorMsg, WCharCP inString, bool relative, DPoint3dCP lastPoint, DgnModelRefR modelRef);
271 
274 DGNPLATFORM_EXPORT StatusInt StringFromPoint (WStringR outString, WStringR errorMsg, DPoint3dCR inPoint, bool delta, DPoint3dCP deltaOrigin, DgnModelRefR modelRef, DistanceFormatterR distanceFromatter, DirectionFormatterR directionFormatter);
275 
278 DGNPLATFORM_EXPORT StatusInt SaveToFile (DgnModelRefP modelRef, ACSSaveOptions option);
279 
282 DGNPLATFORM_EXPORT StatusInt DeleteFromFile (DgnModelRefP modelRef);
283 
284 };
285 
Interface to implement to listen for ACS events.
Definition: IAuxCoordSys.h:98
3x3 matrix commonly used for pure rotations, but in general may also have scales and non-perpendicula...
Definition: rotmatrix.h:21
#define ENUM_IS_FLAGS(ENUMTYPE)
Definition: Bentley.r.h:164
ACSDisplayOptions
Definition: IAuxCoordSys.h:50
#define END_BENTLEY_DGNPLATFORM_NAMESPACE
Definition: DgnPlatformBaseType.r.h:69
struct DPoint3d const * DPoint3dCP
Definition: msgeomstructs_typedefs.h:79
ACSType
Definition: IAuxCoordSys.h:21
ACSFlags
Definition: IAuxCoordSys.h:62
struct DgnPlatform::IAuxCoordSys const * IAuxCoordSysCP
Definition: DgnPlatform.h:277
struct RotMatrix const & RotMatrixCR
Definition: msgeomstructs_typedefs.h:135
#define DGNPLATFORM_EXPORT
Definition: DgnPlatform/ExportMacros.h:58
wchar_t const * WCharCP
Definition: Bentley.h:224
uint32_t UInt32
Definition: Bentley.r.h:128
Manager class to provide access to auxiliary coordinate systems.
Definition: IAuxCoordSys.h:112
ACSEventType
Definition: IAuxCoordSys.h:37
3d point coordinates.
Definition: dpoint3d.h:19
A DgnModelRef provides access to a model in a Bentley::DgnPlatform::DgnFile.
Definition: DgnModelRef.h:172
IManager * GetManager()
Return a pointer to the one and only relationship manager.
Callback object for IACSManager::Traverse.
Definition: IAuxCoordSys.h:76
A shared pointer template for reference-counted objects.
Definition: RefCounted.h:119
ACSSaveOptions
Definition: IAuxCoordSys.h:30
#define BEGIN_BENTLEY_DGNPLATFORM_NAMESPACE
Definition: DgnPlatformBaseType.r.h:68
int StatusInt
Definition: Bentley.h:222
Concrete class that can be used to implement the reference-counting pattern.
Definition: RefCounted.h:109
An IAuxCoordSys is an object that holds the data which describes an auxiliary coordinate system...
Definition: IAuxCoordSys.h:189
virtual ~IACSTraversalHandler()
Definition: IAuxCoordSys.h:78
struct DPoint3d const & DPoint3dCR
Definition: msgeomstructs_typedefs.h:79
A string class that has many of the same capabilities as std::string, plus additional functions such ...
Definition: WString.h:51
Definition: DgnViewport.h:186

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