AssocRegionHandler.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 "CellHeaderHandler.h"
13 
14 
16 
17 enum class RegionLoops
18  {
19  Ignore = 0,
20  Outer = 1,
21  Alternating = 2,
22  };
23 
24 enum class RegionType
25  {
26  Flood = 0,
27  Union = 1,
28  Intersection = 2,
29  Difference = 3,
30  ExclusiveOr = 4,
31  };
32 
34  {
36  };
37 
39  {
41  private:
42 
43  RegionType m_type;
44  RegionLoops m_regionLoops;
45 
46  bool m_associative;
47  bool m_invisibleBoundary;
48  bool m_interiorText;
49  bool m_forcePlanar;
50  bool m_dirty;
51 
52  UInt32 m_reservedFlags;
53 
54  double m_gapTolerance;
55  double m_textMarginFactor;
56 
57  RotMatrix m_flatten;
58 
60  public:
61 
63 
64  DGNPLATFORM_EXPORT void SetType (RegionType regionType);
65  DGNPLATFORM_EXPORT void SetFloodParams (RegionLoops regionLoops, double gapTolerance);
66  DGNPLATFORM_EXPORT void SetInteriorText (bool interiorText, double textMarginFactor);
67  DGNPLATFORM_EXPORT void SetAssociative (bool yesNo);
68  DGNPLATFORM_EXPORT void SetInvisibleBoundary (bool yesNo);
69  DGNPLATFORM_EXPORT void SetFlattenBoundary (bool yesNo, RotMatrixCP flatten);
70  DGNPLATFORM_EXPORT void SetDirty (bool yesNo);
71 
72  DGNPLATFORM_EXPORT RegionType GetType () const;
73  DGNPLATFORM_EXPORT RegionLoops GetFloodParams (double* gapTolerance) const;
74  DGNPLATFORM_EXPORT bool GetInteriorText (double* textMarginFactor) const;
75  DGNPLATFORM_EXPORT bool GetAssociative () const;
76  DGNPLATFORM_EXPORT bool GetInvisibleBoundary () const;
77  DGNPLATFORM_EXPORT bool GetFlattenBoundary (RotMatrixP flatten) const;
78  DGNPLATFORM_EXPORT bool GetDirty () const;
79  }; // RegionParams
80 
83 
84 /*=================================================================================**/
93 {
94 public:
95 
96 struct LoopData
97  {
99  bvector<DependencyRoot> m_loopRoots;
100  };
101 
102 private:
103  virtual void MakeClassAbstract() = 0;
104 public:
105 public:
106 
111 DGNPLATFORM_EXPORT BentleyStatus GetParams (ElementHandleCR eh, RegionParams& params) const;
112 
117 DGNPLATFORM_EXPORT BentleyStatus GetSeedPoints (ElementHandleCR eh, bvector<DPoint3d>* points) const;
118 
124 DGNPLATFORM_EXPORT BentleyStatus GetRoots (ElementHandleCR eh, bvector<DependencyRoot>* roots) const;
125 
130 DGNPLATFORM_EXPORT BentleyStatus GetLoopData (ElementHandleCR eh, bvector<LoopData>* loopData) const;
131 
132 }; // IAssocRegionQuery
133 
135 
136 /*=================================================================================**/
144 
147 /*=================================================================================**/
160 {
163 private:
164  virtual void MakeClassAbstract() = 0;
165 public:
166 public:
167 
188 DGNPLATFORM_EXPORT static bool IsValidRegionBoundaryType (ElementHandleCR eh);
189 
196 DGNPLATFORM_EXPORT static BentleyStatus SetLoopRoots (EditElementHandleR eeh, DependencyRoot const* boundaryRoots, size_t numBoundaryRoots);
197 
203 DGNPLATFORM_EXPORT static BentleyStatus SetLoopOedCode (EditElementHandleR eeh, int loopCode);
204 
220 DGNPLATFORM_EXPORT static BentleyStatus CreateAssocRegionElement
221 (
223 ElementAgendaR boundary,
224 DependencyRoot const* boundaryRoots,
225 size_t numBoundaryRoots,
226 DPoint3dCP seedPoints,
227 size_t numSeedPoints,
228 RegionParams const& params,
229 WCharCP cellName
230 );
231 
232 }; // AssocRegionCellHeaderHandler
233 
235 
236 
238 
struct RotMatrix const * RotMatrixCP
Definition: msgeomstructs_typedefs.h:135
3x3 matrix commonly used for pure rotations, but in general may also have scales and non-perpendicula...
Definition: rotmatrix.h:21
Only consider outermost interior loops.
#define END_BENTLEY_DGNPLATFORM_NAMESPACE
Definition: DgnPlatformBaseType.r.h:69
struct DPoint3d const * DPoint3dCP
Definition: msgeomstructs_typedefs.h:79
Base class for application defined cells that want to be treated as a single object.
Definition: CellHeaderHandler.h:82
Limit on the number of seed points in a flood type region.
Definition: AssocRegionHandler.h:35
Region created by searching for closed loops around seed points.
#define ELEMENTHANDLER_DECLARE_MEMBERS(__classname__, __exporter__)
Definition: Handler.h:86
RegionConstants
Definition: AssocRegionHandler.h:33
Definition: AssocRegionHandler.h:38
Region created by difference of closed curves.
Provides methods for changing the area properties of an element.
Definition: IAreaFillProperties.h:81
RegionType
Definition: AssocRegionHandler.h:24
A writeable "handle" to an MSElement.
Definition: ElementHandle.h:470
#define DGNPLATFORM_EXPORT
Definition: DgnPlatform/ExportMacros.h:58
wchar_t const * WCharCP
Definition: Bentley.h:224
Associative Region elements are planar surfaces that may have multiple boundary loops.
Definition: AssocRegionHandler.h:92
Modify an element that represents an open or closed path.
Definition: ElementGeometry.h:48
uint32_t UInt32
Definition: Bentley.r.h:128
Don't look for interior loops.
int m_loopCode
Definition: AssocRegionHandler.h:98
Describes a reference from a dependent to a root in a DependencyLinkage.
Definition: DependencyManagerLinkage.h:307
#define CLRPUBLIC
Definition: DgnPlatform/ExportMacros.h:12
Use parity rules and find all interior loops.
BentleyStatus
Definition: Bentley.h:208
Region created by intersection of closed curves.
A bvector of EditElementHandle entries to be used for operating on groups of elements.
Definition: ElementAgenda.h:257
bvector< DependencyRoot > m_loopRoots
Definition: AssocRegionHandler.h:99
Region created by union of closed curves.
#define DEFINE_T_SUPER(B)
Definition: Bentley.h:167
#define BEGIN_BENTLEY_DGNPLATFORM_NAMESPACE
Definition: DgnPlatformBaseType.r.h:68
Region created by using parity rules for hole loops.
RegionLoops
Definition: AssocRegionHandler.h:17
struct DgnPlatform::ElementHandle const & ElementHandleCR
Definition: DgnPlatform.h:260
Definition: AssocRegionHandler.h:96
The Associative Region cell can represent one or more planar regions that can be a shape...
Definition: AssocRegionHandler.h:156

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