DisplayRuleActions.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 
11 #include "DgnPlatform.h"
12 #include "Bentley/RefCounted.h"
13 
14 #include <ECObjects/ECObjects.h>
15 #include <ECObjects/ECValue.h>
18 #include <DgnPlatform/DgnCore.h>
20 #include <DgnPlatform/Material.h>
21 
22 #include <Bentley/bvector.h>
23 #include <Bentley/WString.h>
24 
26 
28 typedef bvector<IDisplayRuleActionPtr> DisplayRuleActionPtrVector;
29 
31 typedef bvector<IDisplayRuleActionCP> DisplayRuleActionCPVector;
32 
33 /*=================================================================================**/
35 
38  {
39  //Order of types is important, because it reflects in which order actions are executed.
40  ElementDisplay = 0,
41  ColorOverride = 1,
42  FillColorOverride = 2,
43  StyleOverride = 3,
44  WeightOverride = 4,
46  ElementPriority = 6,
47  PresentationForm = 7,
48  AreaHatch = 8,
49  AreaPattern = 9,
50  MaterialOverride = 10,
51  LevelOfDetail = 11,
54  };
55 
56 /*=================================================================================**/
60 
64  {
65  /*---------------------------------------------------------------------------------**/
69  public: DGNPLATFORM_EXPORT DisplayRuleActionId GetActionId () const;
70 
71  /*---------------------------------------------------------------------------------**/
75  public: DGNPLATFORM_EXPORT bool Equals (IDisplayRuleActionCR displayRuleAction) const;
76 
77  /*---------------------------------------------------------------------------------**/
81  public: DGNPLATFORM_EXPORT IDisplayRuleActionPtr Clone (DgnFileR dgnFile) const;
82  };
83 
84 /*=================================================================================**/
86 
90  {
91  /*---------------------------------------------------------------------------------**/
97  public: DGNPLATFORM_EXPORT static ElementDisplayActionPtr Create (bool elementDisplayOff);
98 
99  /*---------------------------------------------------------------------------------**/
103  public: DGNPLATFORM_EXPORT bool IsElementDisplayOff () const;
104 
105  /*---------------------------------------------------------------------------------**/
109  public: DGNPLATFORM_EXPORT void SetIsElementDisplayOff (bool value);
110  };
111 
112 /*=================================================================================**/
114 
118  {
119  /*---------------------------------------------------------------------------------**/
125  public: DGNPLATFORM_EXPORT static ColorOverrideActionPtr Create (UInt32 elementColor, DgnFileR dgnFile);
126 
127  /*---------------------------------------------------------------------------------**/
131  public: DGNPLATFORM_EXPORT UInt32 GetElementColor () const;
132 
133  /*---------------------------------------------------------------------------------**/
137  public: DGNPLATFORM_EXPORT void SetElementColor (UInt32 value);
138  };
139 
140 /*=================================================================================**/
142 
146  {
147  /*---------------------------------------------------------------------------------**/
153  public: DGNPLATFORM_EXPORT static FillColorOverrideActionPtr Create (UInt32 fillColor, DgnFileR dgnFile);
154 
155  /*---------------------------------------------------------------------------------**/
159  public: DGNPLATFORM_EXPORT UInt32 GetElementFillColor () const;
160 
161  /*---------------------------------------------------------------------------------**/
165  public: DGNPLATFORM_EXPORT void SetElementFillColor (UInt32 value);
166  };
167 
168 /*=================================================================================**/
170 
174  {
175  /*---------------------------------------------------------------------------------**/
181  public: DGNPLATFORM_EXPORT static StyleOverrideActionPtr Create (Int32 lineStyle, DgnFileR dgnFile);
182 
183  /*---------------------------------------------------------------------------------**/
187  public: DGNPLATFORM_EXPORT Int32 GetLineStyle () const;
188 
189  /*---------------------------------------------------------------------------------**/
193  public: DGNPLATFORM_EXPORT void SetLineStyle (Int32 value);
194  };
195 
196 /*=================================================================================**/
198 
202  {
203  /*---------------------------------------------------------------------------------**/
208  public: DGNPLATFORM_EXPORT static WeightOverrideActionPtr Create (UInt32 lineWeight);
209 
210  /*---------------------------------------------------------------------------------**/
214  public: DGNPLATFORM_EXPORT UInt32 GetLineWeight () const;
215 
216  /*---------------------------------------------------------------------------------**/
220  public: DGNPLATFORM_EXPORT void SetLineWeight (UInt32 value);
221  };
222 
223 /*=================================================================================**/
225 
229  {
230  /*---------------------------------------------------------------------------------**/
235  public: DGNPLATFORM_EXPORT static TransparencyOverrideActionPtr Create (double transparency);
236 
237  /*---------------------------------------------------------------------------------**/
241  public: DGNPLATFORM_EXPORT double GetTransparency () const;
242 
243  /*---------------------------------------------------------------------------------**/
247  public: DGNPLATFORM_EXPORT void SetTransparency (double value);
248  };
249 
250 /*=================================================================================**/
252 
256  {
257  /*---------------------------------------------------------------------------------**/
262  public: DGNPLATFORM_EXPORT static ElementPriorityActionPtr Create (int elementPriority);
263 
264  /*---------------------------------------------------------------------------------**/
268  public: DGNPLATFORM_EXPORT int GetElementPriority () const;
269 
270  /*---------------------------------------------------------------------------------**/
274  public: DGNPLATFORM_EXPORT void SetElementPriority (int elementPriority);
275  };
276 
277 /*=================================================================================**/
279 
283  {
284  struct HatchParams
285  {
286  double m_distance1;
287  double m_angle1;
288  double m_distance2;
289  double m_angle2;
295 
296  /*---------------------------------------------------------------------------------**/
308  DGNPLATFORM_EXPORT HatchParams (double distance1, double angle1, double* distance2=NULL, double* angle2=NULL, bool annotationScaleOn=false, UInt32* color=NULL, UInt32* weight=NULL, Int32* style=NULL);
309  };
310 
311 
312 
313  /*---------------------------------------------------------------------------------**/
319  public: DGNPLATFORM_EXPORT static AreaHatchActionPtr Create (HatchParams const& params, DgnFileR dgnFile);
320 
321 
322  /*---------------------------------------------------------------------------------**/
326  public: DGNPLATFORM_EXPORT HatchParams const& GetParams () const;
327 
328  /*---------------------------------------------------------------------------------**/
332  public: DGNPLATFORM_EXPORT void SetParams (HatchParams const& params);
333  };
334 
335 
336 /*=================================================================================**/
338 
342  {
344  {
346  double m_scale;
348  double m_angle;
353 
354  /*---------------------------------------------------------------------------------**/
365  DGNPLATFORM_EXPORT AreaPatternParams (ElementId cellId, double scale, bool annotationScaleOn=false, double* angle=NULL, UInt32* color=NULL, UInt32* weight=NULL, Int32* style=NULL);
366  };
367 
368 
369 
370  /*---------------------------------------------------------------------------------**/
376  public: DGNPLATFORM_EXPORT static AreaPatternActionPtr Create (AreaPatternParams const& params, DgnFileR dgnFile);
377 
378 
379  /*---------------------------------------------------------------------------------**/
383  public: DGNPLATFORM_EXPORT AreaPatternParams const& GetParams () const;
384 
385  /*---------------------------------------------------------------------------------**/
389  public: DGNPLATFORM_EXPORT void SetParams (AreaPatternParams const& params);
390  };
391 
392 
393 /*=================================================================================**/
395 
399  {
400  /*---------------------------------------------------------------------------------**/
407  public: DGNPLATFORM_EXPORT static DisplayStyleOverrideActionPtr Create (UInt32 styleIndex, DgnFileR dgnFile);
408 
409 
410  /*---------------------------------------------------------------------------------**/
415  public: DGNPLATFORM_EXPORT UInt32 GetDisplayStyleIndex () const;
416 
417  /*---------------------------------------------------------------------------------**/
422  public: DGNPLATFORM_EXPORT void SetDisplayStyleIndex (UInt32 styleIndex);
423  };
424 
425 
428 
UInt32 m_weight
Definition: DisplayRuleActions.h:350
#define END_BENTLEY_DGNPLATFORM_NAMESPACE
Definition: DgnPlatformBaseType.r.h:69
double m_angle2
Definition: DisplayRuleActions.h:289
! A display rule action that allows control of element hatching.
Definition: DisplayRuleActions.h:282
bool m_annotationScaleOn
Definition: DisplayRuleActions.h:290
! A display rule action that allows override of display style.
Definition: DisplayRuleActions.h:398
! A display rule action that allows to override element fill color.
Definition: DisplayRuleActions.h:145
double m_distance1
Definition: DisplayRuleActions.h:286
! A display rule action that allows to override element color.
Definition: DisplayRuleActions.h:117
Definition: DisplayRuleActions.h:284
! A display rule action that allows to control element priority.
Definition: DisplayRuleActions.h:255
#define DGNPLATFORM_EXPORT
Definition: DgnPlatform/ExportMacros.h:58
! A display rule action that allows to override transparency of an element.
Definition: DisplayRuleActions.h:228
A DgnFile is an in-memory representation of a physical file, regardless of its format.
Definition: DgnFile.h:308
uint32_t UInt32
Definition: Bentley.r.h:128
#define NULL
Definition: Bentley.h:157
UInt32 m_color
Definition: DisplayRuleActions.h:291
double m_distance2
Definition: DisplayRuleActions.h:288
Int32 m_style
Definition: DisplayRuleActions.h:292
Identifies count of possible action types.
Int32 m_style
Definition: DisplayRuleActions.h:351
double m_scale
Definition: DisplayRuleActions.h:346
! A display rule action that allows to override line style.
Definition: DisplayRuleActions.h:173
int32_t Int32
Definition: Bentley.r.h:119
bvector< IDisplayRuleActionCP > DisplayRuleActionCPVector
A collection of IDisplayRuleActionCP.
Definition: DisplayRuleActions.h:31
double m_angle1
Definition: DisplayRuleActions.h:287
A shared pointer template for reference-counted objects.
Definition: RefCounted.h:119
PatternParamsModifierFlags m_modifiers
Definition: DisplayRuleActions.h:294
! A display rule action that allows to turn display of an element off.
Definition: DisplayRuleActions.h:89
DisplayRuleActionId
! DisplayRuleAction identifiers.
Definition: DisplayRuleActions.h:37
ElementId m_cellId
Definition: DisplayRuleActions.h:345
bool m_annotationScaleOn
Definition: DisplayRuleActions.h:347
UInt32 m_weight
Definition: DisplayRuleActions.h:293
#define BEGIN_BENTLEY_DGNPLATFORM_NAMESPACE
Definition: DgnPlatformBaseType.r.h:68
PatternParamsModifierFlags m_modifiers
Definition: DisplayRuleActions.h:352
PatternParamsModifierFlags
Flags indicating modification of corresponding field in PatternParams.
Definition: AreaPattern.h:69
Concrete class that can be used to implement the reference-counting pattern.
Definition: RefCounted.h:109
UInt64 ElementId
Definition: DgnPlatformBaseType.r.h:83
double m_angle
Definition: DisplayRuleActions.h:348
struct DgnPlatform::IDisplayRuleAction const & IDisplayRuleActionCR
Definition: DgnPlatform.h:543
! A display rule action interface that defines an action that needs to be applied on ! a element...
Definition: DisplayRuleActions.h:63
bvector< IDisplayRuleActionPtr > DisplayRuleActionPtrVector
A collection of IDisplayRuleActionPtr.
Definition: DisplayRuleActions.h:28
! A display rule action that allows to override line weight.
Definition: DisplayRuleActions.h:201
! A display rule action that allows control of area patterning
Definition: DisplayRuleActions.h:341
UInt32 m_color
Definition: DisplayRuleActions.h:349

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