DgnPlatform/LineStyle.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 "IViewDraw.h" // For LineStyleParams
11 #include "DgnHost.h"
13 
14 
18 
19 
22 
25 
28 
31 
43 
44 
45 
46 
47 typedef bvector <LsComponentPtr> LsComponentVector;
48 
49 
50 /*----------------------------------------------------------------------+
51 | |
52 | LineStyleNameInfo |
53 | |
54 | Information returned from the mdlLineStyle_nameQuery function |
55 | |
56 +----------------------------------------------------------------------*/
58 {
59  UInt32 rscFile; // Resource file handle
60  UInt32 rscType; // Resource type
61  ElementId rscID; // Resource ID
62  UInt32 attributes; // Name Attributes
63  long styleID; // Style ID for MASTERFILE
64 };
65 
66 
68 
70 {
73  STYLE_ByLevel = 0x7fffffff,
74  STYLE_ByCell = 0x7ffffffe,
75  STYLE_Invalid = 0x7fffff00
76 };
77 
79 
80 enum class LsElementType
81 {
82  Unknown = 0,
83  PointSymbol = 1,
84  Compound = 2,
85  LineCode = 3,
86  LinePoint = 4,
87  Internal = 6,
88  RasterImage = 7,
89 };
90 
92 
93 enum class LsLocationType
94 {
95  Unknown = 0,
96  ResourceFile = 1,
97  DgnFile = 2,
98  System = 3,
99  LinFile = 4,
100  Importer = 5,
101 };
102 
104 
105 enum class LsResourceType
106 {
107  Unknown = 1,
108  Internal = 0,
109  Compound = 'lsLS',
110  LineCode = 'lsLC',
111  LinePoint = 'lsLP',
112  PointSymbol = 'l8PS',
113  PointSymbolV7 = 'lsPS',
114  RasterImage = 'lsRI',
115  NameEntry = 'lsNm',
116 };
117 
119 enum class LsCapMode
120 {
122  LCCAP_Closed = 0,
124  LCCAP_Open = 1,
126  LCCAP_Extended = 2,
128  LCCAP_Hexagon = 3,
130  LCCAP_Octagon = 4,
132  LCCAP_Decagon = 5,
133  LCCAP_Arc = 30,
134 };
135 
137 enum class LsUnit
138 {
139  Master = 0,
140  Uor = 1,
141  Device = 2
142 };
143 
144 //=======================================================================================
146 // @remark Required library : DgnPlatform<ApiNumber>.lib i.e. DgnPlatform5.lib
147 // @bsiclass Bentley Systems
149  {
150 public:
152  DGNPLATFORM_EXPORT WString GetStyleName () const;
156  DGNPLATFORM_EXPORT Int32 GetStyleNumber () const;
157 
161  DGNPLATFORM_EXPORT LsLocationType GetDefinitionLocation () const;
162 
164  DGNPLATFORM_EXPORT WString GetSourceFileName () const;
165 
166 };
167 
168 //=======================================================================================
176 // @remark Required library : DgnPlatform<ApiNumber>.lib i.e. DgnPlatform5.lib
177 // @bsiclass Bentley Systems
179 {
180 private:
181  LsMapEntry ();
182 
183 public:
185  DGNPLATFORM_EXPORT WString GetStyleName () const;
189  DGNPLATFORM_EXPORT Int32 GetStyleNumber () const;
191  DGNPLATFORM_EXPORT LsEntryCP GetLineStyleEntry () const;
192 
193 };
194 
195 //=======================================================================================
206 struct LsMapIterator : std::iterator<std::forward_iterator_tag, const LsMapEntry>
207  {
208 private:
209  friend struct LsMap;
210  LsMapIterator (LsMapCP map, bool wantBegin); // ctors are private. Therefore, callers cannot construct an instance. Since we don't define a private copy constructor, callers can make copies. That should be safe, since we don't define a destructor.
211  LsMapIterator () {}
212 private:
213  int m_index;
214  void const* m_node;
215  intptr_t m_auxData;
216 
217 public:
218  DGNPLATFORM_EXPORT LsMapIteratorR operator++();
220  LsMapEntryCP operator->() const {return &operator*();}
223  };
224 
225 //=======================================================================================
233 // @remark Required library : DgnPlatform<ApiNumber>.lib i.e. DgnPlatform5.lib
234 // @bsiclass Bentley Systems
236  {
237 private:
238  virtual void MakeClassAbstract() = 0;
239 public:
240 public:
241  DGNPLATFORM_EXPORT LsLocationType GetType () const;
242  DGNPLATFORM_EXPORT WString GetFileName () const;
243 
250  DGNPLATFORM_EXPORT LsEntryCP GetLineStyleEntry (WCharCP lsName) const;
260  DGNPLATFORM_EXPORT LsEntryCP GetLineStyleEntry (Int32 styleId) const;
261 
264 
271  };
272 
273 //=======================================================================================
296 // @remark Required library : DgnPlatform<ApiNumber>.lib i.e. DgnPlatform5.lib
297 // @bsiclass Bentley Systems
298 struct LsResourceFileMap : public LsMap
299  {
300 
309  DGNPLATFORM_EXPORT static LsResourceFileMapPtr OpenFile (LineStyleStatus& status, WCharCP fileName, bool readonly);
315  DGNPLATFORM_EXPORT static LineStyleStatus CreateNewFile (WCharCP fileName);
316 
320  DGNPLATFORM_EXPORT RscFileHandle GetRscHandle() const;
321  };
322 
323 //=======================================================================================
326 // @remark Required library : DgnPlatform<ApiNumber>.lib i.e. DgnPlatform5.lib
327 // @bsiclass Bentley Systems
329 {
330 public:
332  DGNPLATFORM_EXPORT static LsSystemMapR GetSystemMapR ();
334  DGNPLATFORM_EXPORT static LsSystemMapCR GetSystemMap ();
335 };
336 
337 //=======================================================================================
339 // @remark Required library : DgnPlatform<ApiNumber>.lib i.e. DgnPlatform5.lib
340 // @bsiclass Bentley Systems
341 struct LsDgnFileMap : public LsMap
342 {
343 public:
346  DGNPLATFORM_EXPORT DgnFileR GetDgnFileR () const;
349  DGNPLATFORM_EXPORT DgnFileCR GetDgnFile () const;
350 
351 };
Definition: DgnPlatform/LineStyle.h:73
RefCountedPtr< LsSystemMap > LsSystemMapPtr
Smart pointer wrapper for LsSystemMap.
Definition: DgnPlatform/LineStyle.h:24
#define END_BENTLEY_DGNPLATFORM_NAMESPACE
Definition: DgnPlatformBaseType.r.h:69
struct DgnPlatform::LsMapEntry const * LsMapEntryCP
Definition: DgnPlatform.h:370
Definition: DgnPlatform/LineStyle.h:74
LsKnownStyleNumber
Special style numbers that form a subset of values that may passed to LineStyleManager::GetNameFromNu...
Definition: DgnPlatform/LineStyle.h:69
UInt32 RscFileHandle
Definition: DgnPlatform/LineStyle.h:12
Used to access the line styles known to a given DgnFile.
Definition: DgnPlatform/LineStyle.h:341
RefCountedPtr< LsRasterImageComponent > LsRasterImageComponentPtr
Definition: DgnPlatform/LineStyle.h:42
1 - No end cap. The stroke is displayed as two parallel lines.
LsMapIterator const_iterator
Definition: DgnPlatform/LineStyle.h:262
Helper class used for iterating through the LsMapEntry entries in an LsMap.
Definition: DgnPlatform/LineStyle.h:206
iterator begin()
Definition: stdcxx/bstdmap.h:178
RefCountedPtr< LineStyleHandle > LineStyleHandlePtr
Definition: DgnPlatform/LineStyle.h:32
struct DgnPlatform::LsMap const * LsMapCP
Definition: DgnPlatform.h:369
UInt32 attributes
Definition: DgnPlatform/LineStyle.h:62
UInt32 rscFile
Definition: DgnPlatform/LineStyle.h:59
RefCountedPtr< LsInternalComponent > LsInternalComponentPtr
Definition: DgnPlatform/LineStyle.h:37
UInt32 rscType
Definition: DgnPlatform/LineStyle.h:60
iterator end()
Definition: stdcxx/bstdmap.h:186
0 - Standard closed polygon (rectangle) strokes.
RefCountedPtr< LsResourceFileMap > LsResourceFileMapPtr
Smart pointer wrapper for LsResourceFileMap.
Definition: DgnPlatform/LineStyle.h:27
struct DgnPlatform::LsMapIterator const & LsMapIteratorCR
Definition: DgnPlatform.h:371
#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
Definition: DgnPlatform/LineStyle.h:72
uint32_t UInt32
Definition: Bentley.r.h:128
Definition: DgnPlatform/LineStyle.h:71
struct DgnPlatform::LsSystemMap const & LsSystemMapCR
Definition: DgnPlatform.h:379
Represents the defintion of a line style.
Definition: DgnPlatform/LineStyle.h:148
struct DgnPlatform::DgnFile const & DgnFileCR
Definition: DgnPlatform.h:206
RefCountedPtr< LsStrokeData > LsStrokeDataPtr
Definition: DgnPlatform/LineStyle.h:40
LineStyleStatus
Definition: DgnPlatformErrors.r.h:208
RefCountedPtr< LsMap > LsMapPtr
Smart pointer wrapper for LsMap.
Definition: DgnPlatform/LineStyle.h:21
#define CLRPUBLIC
Definition: DgnPlatform/ExportMacros.h:12
Definition: DgnPlatform/LineStyle.h:75
struct DgnPlatform::LsEntry const * LsEntryCP
Definition: DgnPlatform.h:368
int32_t Int32
Definition: Bentley.r.h:119
LsSymbolComponent containing V7 graphics.
long styleID
Definition: DgnPlatform/LineStyle.h:63
Used to access the line styles that are in the system map.
Definition: DgnPlatform/LineStyle.h:328
A shared pointer template for reference-counted objects.
Definition: RefCounted.h:119
LsElementType
Values held in line style defintion elements; normally not used by clients of this API...
Definition: DgnPlatform/LineStyle.h:80
const_iterator iterator
only const iteration is possible
Definition: DgnPlatform/LineStyle.h:263
RefCountedPtr< LsDgnFileMap > LsDgnFileMapPtr
Smart pointer wrapper for LsDgnFileMap.
Definition: DgnPlatform/LineStyle.h:30
bvector< LsComponentPtr > LsComponentVector
Definition: DgnPlatform/LineStyle.h:47
2 - The end of the stroke is extended by half the stroke width.
#define BEGIN_BENTLEY_DGNPLATFORM_NAMESPACE
Definition: DgnPlatformBaseType.r.h:68
LsUnit
Defines possible values for LsDefinition::GetUnitsType() and LsDefinition::SetUnitsType().
Definition: DgnPlatform/LineStyle.h:137
RefCountedPtr< LsCompoundComponent > LsCompoundComponentPtr
Definition: DgnPlatform/LineStyle.h:34
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
RefCountedPtr< LsComponent > LsComponentPtr
Definition: DgnPlatform/LineStyle.h:33
Concrete class that can be used to implement the reference-counting pattern.
Definition: RefCounted.h:109
UInt64 ElementId
Definition: DgnPlatformBaseType.r.h:83
RefCountedPtr< LsCompoundInfo > LsCompoundInfoPtr
Definition: DgnPlatform/LineStyle.h:41
LsLocationType
Code indicating the source of the component definition.
Definition: DgnPlatform/LineStyle.h:93
Internal Units (UORS)
Definition: DgnPlatform/LineStyle.h:57
An LsResourceFileMap object is used to access line styles and line style resources without going thro...
Definition: DgnPlatform/LineStyle.h:298
struct DgnPlatform::LsMapEntry const & LsMapEntryCR
Definition: DgnPlatform.h:370
RefCountedPtr< LsPointSymbolComponent > LsPointSymbolComponentPtr
Definition: DgnPlatform/LineStyle.h:35
RefCountedPtr< LsPointSymbolInfo > LsPointSymbolInfoPtr
Definition: DgnPlatform/LineStyle.h:39
>= 3 - cap stroked as an arc and the value indicates the number of vectors in the arc...
LsCapMode
Returned from GetCapMode()
Definition: DgnPlatform/LineStyle.h:119
LsMapEntryCP operator->() const
The value of the current entry.
Definition: DgnPlatform/LineStyle.h:220
ElementId rscID
Definition: DgnPlatform/LineStyle.h:61
A map used to map from line style number to line style name and vice versa.
Definition: DgnPlatform/LineStyle.h:235
LsResourceType
Values held in line style defintion components in resource files.
Definition: DgnPlatform/LineStyle.h:105
RefCountedPtr< LsLinePointComponent > LsLinePointComponentPtr
Definition: DgnPlatform/LineStyle.h:38
An entry in a LsMap; it contains a pointer to an LsDefinition.
Definition: DgnPlatform/LineStyle.h:178
A string class that has many of the same capabilities as std::string, plus additional functions such ...
Definition: WString.h:51
RefCountedPtr< LsLineCodeComponent > LsLineCodeComponentPtr
Definition: DgnPlatform/LineStyle.h:36
unknown status (newly added to system)
bool operator==(const BentleyAllocator< _Ty > &, const BentleyAllocator< _Other > &)
Definition: BentleyAllocator.h:146

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