DgnECTypes.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 #pragma managed(push, off)
11 
12 DGNPLATFORM_TYPEDEFS (DgnECExtendedType);
13 DGNPLATFORM_TYPEDEFS (IDgnECTypeAdapterContext);
14 DGNPLATFORM_TYPEDEFS (IDgnECTypeAdapter);
15 DGNPLATFORM_TYPEDEFS (IDgnECStandaloneTypeAdapterContext);
16 DGNPLATFORM_TYPEDEFS (DgnECUnit);
17 
19 
21 
24 
25 
26 /*=================================================================================**/
34  {
35  friend struct DgnECTypeRegistry;
36 
37 private:
38  virtual void MakeClassAbstract() = 0;
39 public:
40 
41  /*=================================================================================**/
47  {
49  ElementType = 1,
51  Level = 2,
53  Color = 3,
55  Weight = 4,
57  Style = 5,
59  ElementClass = 6,
61  Coordinates = 7,
63  Distance = 8,
65  Area = 9,
67  Volume = 10,
69  Angle = 11,
71  TextStyle = 15,
73  RenderingMaterial = 16,
75  DirectionAngle = 17,
77  UnitlessPoint = 18,
79  NamedScale = 19,
81  ProjectionNamedGroup = 20,
83  FileSize = 24,
85  FileSizeLong = 25,
87  DisplayPriority = 26,
88 
90  FontName = 27,
92  BigFontName = 28,
94  ElementID = 29,
96  HatchCell = 30,
98  XyzRotations = 57,
101  };
102  };
103 
104 /*=================================================================================**/
113 struct IDgnECTypeAdapterContext : ECN::IECTypeAdapterContext
114  {
115 public:
122  DGNPLATFORM_EXPORT static IDgnECTypeAdapterContextPtr Create (ECN::ECPropertyCR ecproperty, DgnECInstanceCR instance, WCharCP accessString, UInt32 componentIndex = COMPONENT_INDEX_None);
134  DGNPLATFORM_EXPORT static IDgnECStandaloneTypeAdapterContextPtr CreateStandalone (ECN::ECPropertyCR ecproperty, ECN::IECInstanceCR instance, WCharCP accessString, UInt32 componentIndex=COMPONENT_INDEX_None, DgnFileP dgnFile=NULL, DgnModelRefP modelRef=NULL, ElementRefP elemRef=NULL);
135  };
136 
137 /*=================================================================================**/
143  {
144 public:
155  DGNPLATFORM_EXPORT bool ReInitialize (ECN::ECPropertyCR ecproperty, ECN::IECInstanceCR instance, WCharCP accessString, UInt32 componentIndex=COMPONENT_INDEX_None, DgnFileP dgnFile=NULL, DgnModelRefP modelRef=NULL, ElementRefP elemRef=NULL);
156  };
157 
158 /*=================================================================================**/
165 struct IDgnECTypeAdapter : ECN::IECTypeAdapter
166  {
167 public:
172  DGNPLATFORM_EXPORT bool Validate (ECN::ECValueCR v, IDgnECTypeAdapterContextCR context) const;
173 
178  DGNPLATFORM_EXPORT bool GetStandardValues (StandardValuesCollection& values, IDgnECTypeAdapterContextCR context) const;
179 
183  DGNPLATFORM_EXPORT static IDgnECTypeAdapterR GetForProperty (ECN::ECPropertyCR ecProperty);
184 
188  DGNPLATFORM_EXPORT static IDgnECTypeAdapterR GetForArrayMember (ECN::ArrayECPropertyCR arrayProperty);
189 
190  };
191 
192 
193 /*=================================================================================**/
198 struct DgnECUnit
199  {
200 public:
204  {
209  Unspecified = 0xFF
210  };
211 private:
212  WString m_ecunitName;
213  WorkingUnit m_workingUnit;
214 public:
217  DgnECUnit (WorkingUnit workingUnit = Unspecified) : m_workingUnit(workingUnit) { }
220  DgnECUnit (WCharCP standardECUnitName) : m_ecunitName (standardECUnitName), m_workingUnit (Unspecified) { }
221 
223  bool IsSpecified() const { return IsECUnit() || IsWorkingUnit(); }
225  bool IsECUnit() const { return !m_ecunitName.empty(); }
227  bool IsWorkingUnit() const { return Unspecified != m_workingUnit; }
228 
230  DGNPLATFORM_EXPORT WCharCP GetECUnitName() const { return !m_ecunitName.empty() ? m_ecunitName.c_str() : NULL; }
232  WorkingUnit GetWorkingUnit() const { return m_workingUnit; }
234  DGNPLATFORM_EXPORT WCharCP GetID() const;
238  DGNPLATFORM_EXPORT static DgnECUnit FromID (WCharCP id);
239  };
242 
243 #pragma managed(pop)
RefCountedPtr< IDgnECStandaloneTypeAdapterContext > IDgnECStandaloneTypeAdapterContextPtr
Definition: DgnECTypes.h:112
WorkingUnit
The units describe a quantity stored in UORs and presented in the working units of the DgnECInstance'...
Definition: DgnECTypes.h:203
Distance dimensional constraint.
#define END_BENTLEY_DGNPLATFORM_NAMESPACE
Definition: DgnPlatformBaseType.r.h:69
bool IsWorkingUnit() const
Definition: DgnECTypes.h:227
bool IsSpecified() const
Definition: DgnECTypes.h:223
DgnECExtendedType::Volume, stored in UORs cubed.
Definition: DgnECTypes.h:207
DGNPLATFORM_TYPEDEFS(DgnECExtendedType)
DgnECUnit(WorkingUnit workingUnit=Unspecified)
Construct a working or unspecified unit.
Definition: DgnECTypes.h:217
Area dimensional constraint.
DgnECExtendedType::Angle, stored in radians.
Definition: DgnECTypes.h:208
#define DGNPLATFORM_EXPORT
Definition: DgnPlatform/ExportMacros.h:58
ECValue const & ECValueCR
Definition: ECObjects.h:46
A DgnFile is an in-memory representation of a physical file, regardless of its format.
Definition: DgnFile.h:308
DgnECUnit(WCharCP standardECUnitName)
Construct a standard ECUnit.
Definition: DgnECTypes.h:220
wchar_t const * WCharCP
Definition: Bentley.h:224
bool IsECUnit() const
Definition: DgnECTypes.h:225
uint32_t UInt32
Definition: Bentley.r.h:128
#define NULL
Definition: Bentley.h:157
Describes the units associated with a Dgn-based ECProperty.
Definition: DgnECTypes.h:198
DgnECExtendedType::Area, stored in UORs squared.
Definition: DgnECTypes.h:206
A DgnModelRef provides access to a model in a Bentley::DgnPlatform::DgnFile.
Definition: DgnModelRef.h:172
DGNPLATFORM_EXPORT WCharCP GetECUnitName() const
Definition: DgnECTypes.h:230
ECProperty const & ECPropertyCR
Definition: ECObjects.h:56
A shared pointer template for reference-counted objects.
Definition: RefCounted.h:119
IECInstance const & IECInstanceCR
Definition: ECObjects.h:67
Interface that provides direct and efficient access to element data.
Definition: ElementRefBase.h:120
Provides methods for converting to and from an ECProperty's internal type to a user-friendly represen...
Definition: DgnECTypes.h:165
#define BEGIN_BENTLEY_DGNPLATFORM_NAMESPACE
Definition: DgnPlatformBaseType.r.h:68
StandardType
Standard extended types which can be specified by integer ID in an ECSchema.
Definition: DgnECTypes.h:46
RefCountedPtr< IDgnECTypeAdapterContext > IDgnECTypeAdapterContextPtr
Supplies the context in which an IDgnECTypeAdapter operates.
Definition: DgnECTypes.h:111
A UnitDefinition describes a unit which is a context in which users and applications express distance...
Definition: UnitDefinition.h:98
The Angle class has static methods for typical angle computations.
Definition: Angle.h:14
ArrayECProperty const & ArrayECPropertyCR
Definition: ECObjects.h:60
This structure is not intended to be used directly, and supports file storage.
Definition: DgnPlatform.r.h:710
struct DgnPlatform::DgnECInstance const & DgnECInstanceCR
Definition: DgnPlatform.h:199
DgnECExtendedType::Distance, stored in UORs.
Definition: DgnECTypes.h:205
RefCountedPtr< IDgnECTypeAdapter > IDgnECTypeAdapterPtr
Definition: DgnECTypes.h:20
WorkingUnit GetWorkingUnit() const
Definition: DgnECTypes.h:232
An ECSchema may define an extended type for an ECProperty.
Definition: DgnECTypes.h:33
A string class that has many of the same capabilities as std::string, plus additional functions such ...
Definition: WString.h:51
A reusable IDgnECTypeAdapterContext.
Definition: DgnECTypes.h:142

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