CurveTopologyId.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 
12 
13 
16 typedef struct CurveTopologyId const* CurveTopologyIdCP;
17 typedef struct CurveTopologyId const& CurveTopologyIdCR;
18 
19 /*=================================================================================**/
31 struct CurveTopologyId
33 {
35 enum
36  {
37  INVALID_Id = 0xffffffff,
39  };
41 enum Type
42  {
44  Type_BRepSharedEdge = 1, // 2 X FaceId (NodeId, Entity Id), Optional sub index for CVE.
45  Type_BRepSheetEdge = 2, // 1 Face/Edge Id (Node Id, Entity Id), Optional sub index for CVE.
46  Type_BRepSilhouette = 3, // FaceId (Node, EntityId)
47  Type_MeshSharedEdge = 4, // 2 X Face Index
48  Type_MeshSheetEdge = 5, // Face Index
49  Type_MeshUnknown = 6, // 2 Values - Primitive Index, Mesh Index.
50  Type_IndexedMeshEdge = 7, // 2 Values - Primitive Index, Chain Index.
51  Type_Wire = 8, // Curve Primitive Index.
52  Type_UnannnouncedSectionShape = 9, // 1 Value - Section Primitive(GPA) Index.
53  Type_UnannouncedSectionWire = 10, // 2 Values - Section Primitive(GPA) Index.
54  Type_VisEdgesAnalytic = 11, // Analytic Surface Curve Index.
55  Type_VisEdgesBoundedPlane = 12, // LoopIndex.
56  Type_GeometryMap = 13, //
57  Type_SweepProfile = 14, // Profile index, Curve Primitive Index
58  Type_SweepLateral = 15, // Lateral Index.
61  Type_VisEdgesIntersection = 18, // None (not currently associable)..
62  Type_SweepSilhouette = 19, // Primitive Index, SilhouetteIndex (cones).
63  Type_BRepIsoIsoline = 20, // 4 Values. - Primitive Index, FaceId (Node, EntityId), Isoline Index.
67  Type_MeshEdgeVertices = 24, // SS3 Sheet edges stored only a single face edge which may not be unique. Replaced by start/end vertex edges.
68  Type_BRepPlanarFace = 25, // Draw Method Index, FaceId. (For Planar Constraints).
70  };
71 
72 private:
73  Type m_type;
74  bvector<uint32_t> m_ids;
75 
76 public:
78 GEOMDLLIMPEXP CurveTopologyId (Type type) : m_type (type) { }
80 GEOMDLLIMPEXP CurveTopologyId (Type, uint32_t id);
82 GEOMDLLIMPEXP CurveTopologyId (Type, uint32_t id0, uint32_t id1);
84 GEOMDLLIMPEXP CurveTopologyId (Type, uint32_t id0, uint32_t id1, uint32_t id2);
86 GEOMDLLIMPEXP CurveTopologyId (Type type, uint32_t const* ids, size_t idCount) { Init (type, ids, idCount); }
88 GEOMDLLIMPEXP CurveTopologyId (uint32_t id, CurveTopologyIdCR CurveId);
90 GEOMDLLIMPEXP BentleyStatus Init (Type type, uint32_t const* ids, size_t idCount);
92 GEOMDLLIMPEXP CurveTopologyId () : m_type (Type_Unknown) { }
94 GEOMDLLIMPEXP CurveTopologyId (CurveTopologyIdCR rhs);
95 
97 GEOMDLLIMPEXP CurveTopologyId (CurveTopologyIdCR curveId, uint32_t id);
99 GEOMDLLIMPEXP CurveTopologyId (void const* data, size_t dataBytes) { Init (data, dataBytes); }
100 
102 GEOMDLLIMPEXP BentleyStatus Init (void const* data, size_t dataBytes);
104 Type GetType () const { return (Type) m_type; }
106 size_t GetCount () const { return m_ids.size(); }
108 uint32_t GetId (size_t index) const { return index >= m_ids.size() ? INVALID_Id : m_ids[index]; }
110 GEOMDLLIMPEXP WString GetDebugString () const;
112 GEOMDLLIMPEXP void Pack (bvector<Byte>& packed) const;
114 bool IsEmpty () const { return m_ids.empty(); }
116 GEOMDLLIMPEXP void Clear ();
118 GEOMDLLIMPEXP bool operator == (CurveTopologyIdCR rhs) const;
120 GEOMDLLIMPEXP bool operator < (CurveTopologyIdCR rhs) const;
122 GEOMDLLIMPEXP static CurveTopologyId FromBRepIsoline (FaceId const& faceId, size_t isolineIndex);
124 GEOMDLLIMPEXP static CurveTopologyId FromBRepSharedEdge (FaceId const& faceId0, FaceId const& faceId1);
126 GEOMDLLIMPEXP static CurveTopologyId FromBRepSheetEdge (FaceId const& edgeId);
128 GEOMDLLIMPEXP static CurveTopologyId FromBRepSilhouette (FaceId const& edgeId);
130 GEOMDLLIMPEXP static CurveTopologyId FromBRepPlanarFace (FaceId const& faceId);
132 GEOMDLLIMPEXP static CurveTopologyId FromSweepProfile (size_t profileIndex);
134 GEOMDLLIMPEXP static CurveTopologyId FromSweepLateral (size_t lateralIndex);
136 GEOMDLLIMPEXP static CurveTopologyId FromSweepSilhouette (size_t silhouetteIndex);
138 GEOMDLLIMPEXP static CurveTopologyId FromMeshSharedEdge (size_t faceIndex0, size_t faceIndex1);
140 GEOMDLLIMPEXP static CurveTopologyId FromMeshEdgeVertices (size_t vertexIndex0, size_t vertexIndex1);
142 GEOMDLLIMPEXP static CurveTopologyId FromGeometryMap ();
144 GEOMDLLIMPEXP static CurveTopologyId FromWire ();
146 GEOMDLLIMPEXP static CurveTopologyId FromUnknownCurve (size_t curveIndex);
148 GEOMDLLIMPEXP static CurveTopologyId FromVisEdgesBoundedPlane (size_t);
150 GEOMDLLIMPEXP static CurveTopologyId FromParasolidGPArrayId (size_t, size_t);
151 
152 GEOMDLLIMPEXP static CurveTopologyId FromVisEdgesAnalytic (size_t curveIndex);
154 GEOMDLLIMPEXP static CurveTopologyId FromVisEdgesIntersection ();
156 GEOMDLLIMPEXP static CurveTopologyId FromCurveVector ();
157 
159 GEOMDLLIMPEXP BentleyStatus GetBRepIsoline (FaceId* faceId, size_t* isolineIndex) const;
161 GEOMDLLIMPEXP BentleyStatus GetBRepSharedEdge (FaceId* faceId0, FaceId* faceId1) const;
163 GEOMDLLIMPEXP BentleyStatus GetBRepSheetEdge (FaceId* edgeId) const;
164 
165 GEOMDLLIMPEXP BentleyStatus GetBRepPlanarFace(FaceId* faceId) const;
166 
167 
168 GEOMDLLIMPEXP static BentleyStatus AddCurveVectorIds (CurveVectorCR curveVector, CurvePrimitiveId::Type type, CurveTopologyIdCR id, CompoundDrawStateP cds);
169 
170 }; // CurveTopologyId
171 
172 
174 
BentleyStatus GetBRepSharedEdge(FaceId *faceId0, FaceId *faceId1) const
extract adjacent faces of brep edge
Definition: CurveTopologyId.h:49
bool IsEmpty() const
Return true if there are no ids.
Definition: CurveTopologyId.h:114
void Clear()
Clear the id array and set the type code to default unknown value.
static CurveTopologyId FromBRepIsoline(FaceId const &faceId, size_t isolineIndex)
construct and return with FaceId and isolineIndex
static CurveTopologyId FromCurveVector()
construct and return for curve vector
Definition: CurveTopologyId.h:57
Definition: CurveTopologyId.h:65
Definition: CurveTopologyId.h:56
static CurveTopologyId FromParasolidGPArrayId(size_t, size_t)
construct and return from Parasolid parasolid GPArray ID
struct CurveTopologyId & CurveTopologyIdR
Definition: CurveTopologyId.h:15
#define END_BENTLEY_GEOMETRY_NAMESPACE
Definition: Bentley.r.h:30
RefCounted object carrying a draw method index and variable size array of size_t. ...
Definition: CompoundDrawState.h:22
static BentleyStatus AddCurveVectorIds(CurveVectorCR curveVector, CurvePrimitiveId::Type type, CurveTopologyIdCR id, CompoundDrawStateP cds)
Definition: CurveTopologyId.h:68
static CurveTopologyId FromSweepLateral(size_t lateralIndex)
construct and return for indexed lateral within sweep.
Definition: CurveTopologyId.h:54
Definition: CurveTopologyId.h:58
Type GetType() const
Return the type code.
Definition: CurveTopologyId.h:104
struct CurveVector const & CurveVectorCR
Definition: msgeomstructs_typedefs.h:172
static CurveTopologyId FromVisEdgesIntersection()
construct and return for intersection curve in visible edges
CurveTopologyId()
Default constructor.
Definition: CurveTopologyId.h:92
Definition: CurveTopologyId.h:66
Type
Enumeration of how the curve originated.
Definition: CurveTopologyId.h:41
BentleyStatus Init(Type type, uint32_t const *ids, size_t idCount)
Initializer with type code and array of ids.
Definition: CurveTopologyId.h:63
Definition: CurveTopologyId.h:50
void Pack(bvector< Byte > &packed) const
Return a packed form of the ids.
static CurveTopologyId FromBRepSheetEdge(FaceId const &edgeId)
Construct and return for brep edge with one face.
static CurveTopologyId FromBRepSharedEdge(FaceId const &faceId0, FaceId const &faceId1)
Construct an return for brep edge with two faces.
typedefBEGIN_BENTLEY_GEOMETRY_NAMESPACE struct CurveTopologyId * CurveTopologyIdP
Definition: CurveTopologyId.h:14
Definition: CurveTopologyId.h:59
Definition: CurveTopologyId.h:38
CurveTopologyId(void const *data, size_t dataBytes)
Constructor with array of id data.
Definition: CurveTopologyId.h:99
BentleyStatus GetBRepPlanarFace(FaceId *faceId) const
uint32_t GetId(size_t index) const
Return id by index.
Definition: CurveTopologyId.h:108
The CurveTopologyId class identifies the source of a curve within a larger wireframe entity such as a...
Definition: CurveTopologyId.h:32
static CurveTopologyId FromBRepPlanarFace(FaceId const &faceId)
Construct and return for brep edge with one face.
Definition: CurveTopologyId.h:37
size_type size() const
Definition: stdcxx/bvector.h:283
struct CurveTopologyId const * CurveTopologyIdCP
Definition: CurveTopologyId.h:16
BentleyStatus
Definition: Bentley.h:208
Definition: CurveTopologyId.h:48
Definition: CurveTopologyId.h:44
struct CurveTopologyId const & CurveTopologyIdCR
Definition: CurveTopologyId.h:17
Definition: CurveTopologyId.h:69
bool operator==(CurveTopologyIdCR rhs) const
Direct equality tests.
Definition: CurveTopologyId.h:55
static CurveTopologyId FromSweepSilhouette(size_t silhouetteIndex)
construct and return for silhouette of sweep
bool empty() const
Definition: stdcxx/bvector.h:297
Definition: CurveTopologyId.h:62
Definition: CurveTopologyId.h:47
static CurveTopologyId FromGeometryMap()
construct and return for geometry map.
BentleyStatus GetBRepSheetEdge(FaceId *edgeId) const
extract adjacent face of brep edge
Definition: CurveTopologyId.h:61
Definition: CurveTopologyId.h:64
static CurveTopologyId FromUnknownCurve(size_t curveIndex)
construct and return for unknown curve
Type
enumeration of sources of CurvePrimitiveId
Definition: CurvePrimitiveId.h:39
bool operator<(CurveTopologyIdCR rhs) const
Lexical sort or (typeCode, idCount, id0, id1...)
Definition: CurveTopologyId.h:46
Definition: CurveTopologyId.h:45
WString GetDebugString() const
Return debug string form.
static CurveTopologyId FromMeshEdgeVertices(size_t vertexIndex0, size_t vertexIndex1)
construct and return for mesh edge with 2 vertices
static CurveTopologyId FromVisEdgesBoundedPlane(size_t)
construct and return for indexed loop in visible edges
size_t GetCount() const
Return the id data count (in UInt32's)
Definition: CurveTopologyId.h:106
Definition: CurveTopologyId.h:53
BentleyStatus GetBRepIsoline(FaceId *faceId, size_t *isolineIndex) const
Extract brep isoline.
#define BEGIN_BENTLEY_GEOMETRY_NAMESPACE
Definition: Bentley.r.h:29
CurveTopologyId(Type type)
Constructor with type code.
Definition: CurveTopologyId.h:78
unsigned int uint32_t
Definition: Bentley.r.h:93
static CurveTopologyId FromBRepSilhouette(FaceId const &edgeId)
Construct and return for brep silhouette edge.
struct Bentley::faceId FaceId
{nodeId, entityId} pair for solid topology references.
static CurveTopologyId FromSweepProfile(size_t profileIndex)
construct and return for index of swept profile curve.
Definition: CurveTopologyId.h:52
Definition: CurveTopologyId.h:67
static CurveTopologyId FromVisEdgesAnalytic(size_t curveIndex)
Definition: CurveTopologyId.h:43
static CurveTopologyId FromWire()
construct and return for wire edge
CurveTopologyId(Type type, uint32_t const *ids, size_t idCount)
Constructor with type code and arrasy of ids.
Definition: CurveTopologyId.h:86
Definition: CurveTopologyId.h:60
Definition: CurveTopologyId.h:51
static CurveTopologyId FromMeshSharedEdge(size_t faceIndex0, size_t faceIndex1)
construct and return for mesh edge with 2 faces

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