CurvePrimitiveId.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 
15 typedef struct CurvePrimitiveId const& CurvePrimitiveIdCR;
16 typedef struct CurvePrimitiveId const* CurvePrimitiveIdCP;
17 typedef RefCountedPtr<struct CurvePrimitiveId> CurvePrimitiveIdPtr;
18 
19 /*=================================================================================**/
35 struct CurvePrimitiveId : RefCountedBase
37  {
39  enum Type
40  {
41  Type_ParaSolidCut = 0, // SS2 - Parasolid EdgeId/FaceId.
42  Type_UnusedWasFacetSet = 1, // SS3 - (not used)
43  Type_ACISCut = 2, // SS2 - ACIS EdgeId/FaceId.
44  Type_CachedEdge = 3, // SS3 - CVE. ProxyHLEdgeSegmentId.
45  Type_CachedCut = 4, // SS3 - CVE. CurveTopologyId.
46  Type_CachedUnderlay = 5, // SS3 - CVE. CurveTopologyId.
47  Type_ParaSolidBody = 6, // Vancouver. CurveTopologyId.
48  Type_SolidPrimitive = 7, // Vancouver. CurveTopologyId.
49  Type_CurveVector = 8, // Vancouver. CurveTopologyId.
50  Type_PolyfaceCut = 9, // Vancouver. CurveTopologyId.
51  Type_PolyfaceEdge = 10, // Vancouver. CurveTopologyId.
52  Type_UnspecifiedTopologyId = 11, // Vancouver. CurveTopologyId.
55  Type_CutGeometry = 99 // SS3 - Cut Associations.
56  };
57 
58 private:
59  Type m_type;
60  bvector<uint8_t> m_idData;
61 
62  CompoundDrawStatePtr m_compoundDrawState;
63 
64 
65  CurvePrimitiveId (Type edgeType, void const* edgeId, size_t edgeIdSize, CompoundDrawStateP cds);
66  CurvePrimitiveId (Type edgeType, struct CurveTopologyId const& topologyId, CompoundDrawStateP cds);
67  CurvePrimitiveId (void const* data, size_t size);
68 
69 public:
71  GEOMDLLIMPEXP static CurvePrimitiveIdPtr Create (Type type, void const* id, size_t size, CompoundDrawStateP cds);
73  GEOMDLLIMPEXP static CurvePrimitiveIdPtr Create (Type type, struct CurveTopologyId const& topologyId, CompoundDrawStateP cds);
75  GEOMDLLIMPEXP static CurvePrimitiveIdPtr Create (void const* data, size_t size);
77  GEOMDLLIMPEXP static CurvePrimitiveIdPtr Create (CurvePrimitiveIdCR id);
79  CompoundDrawStatePtr GetCompoundDrawState () { return m_compoundDrawState; }
81  void SetCompoundDrawState(CompoundDrawStatePtr& compoundDrawState) { m_compoundDrawState = compoundDrawState; }
83  GEOMDLLIMPEXP WString GetDebugString() const;
85  GEOMDLLIMPEXP WString GetRawIdString() const;
87  GEOMDLLIMPEXP Type GetType() const;
89  GEOMDLLIMPEXP struct CurveTopologyId GetCurveTopologyId () const;
91  GEOMDLLIMPEXP bool operator == (CurvePrimitiveIdCR rhs) const;
93  GEOMDLLIMPEXP bool operator < (CurvePrimitiveIdCR rhs) const;
95  GEOMDLLIMPEXP uint8_t const* PeekId () const;
97  GEOMDLLIMPEXP size_t GetIdSize () const;
99  GEOMDLLIMPEXP CurvePrimitiveIdPtr Clone () const;
101  GEOMDLLIMPEXP BentleyStatus GetParasolidBodyId (struct CurveTopologyId& id) const;
103  GEOMDLLIMPEXP BentleyStatus GetSolidPrimitiveId (struct CurveTopologyId& id) const;
104 
106  GEOMDLLIMPEXP BentleyStatus GetLineStringAssociationIds (int& topologyType, bvector<uint32_t>& ids, size_t nTargetIds);
108  GEOMDLLIMPEXP void Store (bvector<uint8_t>& data) const;
109 
110  }; // CurvePrimitiveId
111 
112 
Definition: CurvePrimitiveId.h:43
struct CurveTopologyId GetCurveTopologyId() const
Return the topologyId object. This may fail (and return defaulted structure) for some types...
Definition: CurvePrimitiveId.h:54
RefCountedPtr< struct CompoundDrawState > CompoundDrawStatePtr
Definition: CompoundDrawState.h:15
Definition: CurvePrimitiveId.h:55
BentleyStatus GetSolidPrimitiveId(struct CurveTopologyId &id) const
Copy data to target object if this is a solid primitive.
Definition: CurvePrimitiveId.h:45
#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
BentleyStatus GetParasolidBodyId(struct CurveTopologyId &id) const
Copy data to target object if this is a parasolid body.
Type GetType() const
Get the type code.
typedefBEGIN_BENTLEY_GEOMETRY_NAMESPACE struct CurvePrimitiveId * CurvePrimitiveIdP
Definition: CurvePrimitiveId.h:13
Definition: CurvePrimitiveId.h:48
CurvePrimitiveIdPtr Clone() const
Return a copy.
Definition: CurvePrimitiveId.h:46
size_t GetIdSize() const
Return size of the id data array.
Definition: CurvePrimitiveId.h:50
void SetCompoundDrawState(CompoundDrawStatePtr &compoundDrawState)
Set the compound draw state.
Definition: CurvePrimitiveId.h:81
Definition: CurvePrimitiveId.h:44
Definition: CurvePrimitiveId.h:51
struct CurvePrimitiveId & CurvePrimitiveIdR
Definition: CurvePrimitiveId.h:14
Definition: CurvePrimitiveId.h:53
The CurveTopologyId class identifies the source of a curve within a larger wireframe entity such as a...
Definition: CurveTopologyId.h:32
BentleyStatus
Definition: Bentley.h:208
RefCountedPtr< struct CurvePrimitiveId > CurvePrimitiveIdPtr
Definition: CurvePrimitiveId.h:17
Definition: CurvePrimitiveId.h:49
bool operator==(CurvePrimitiveIdCR rhs) const
bitwise equality test.
struct CurvePrimitiveId const & CurvePrimitiveIdCR
Definition: CurvePrimitiveId.h:15
Definition: CurvePrimitiveId.h:41
uint8_t const * PeekId() const
Return interior pointer to id data.
Type
enumeration of sources of CurvePrimitiveId
Definition: CurvePrimitiveId.h:39
void Store(bvector< uint8_t > &data) const
Copy the id data into bytes.
struct CurvePrimitiveId const * CurvePrimitiveIdCP
Definition: CurvePrimitiveId.h:16
CurvePrimitiveId is a class that identifies the source of a curvePrimitive.
Definition: CurvePrimitiveId.h:36
Definition: CurvePrimitiveId.h:47
BentleyStatus GetLineStringAssociationIds(int &topologyType, bvector< uint32_t > &ids, size_t nTargetIds)
If this is a Type_PolyfaceCut with exactly nTargetIds id values, copy out the topology type and the i...
WString GetDebugString() const
Get debug string.
static CurvePrimitiveIdPtr Create(Type type, void const *id, size_t size, CompoundDrawStateP cds)
Allocate and fill with type and data.
WString GetRawIdString() const
Get hex form of the ids.
#define BEGIN_BENTLEY_GEOMETRY_NAMESPACE
Definition: Bentley.r.h:29
Definition: CurvePrimitiveId.h:52
bool operator<(CurvePrimitiveIdCR rhs) const
bitwise less than test.
size_type size() const
Definition: stdcxx/bstdmap.h:214
Definition: CurvePrimitiveId.h:42
CompoundDrawStatePtr GetCompoundDrawState()
Query the compound draw state (refCounted)
Definition: CurvePrimitiveId.h:79
unsigned char uint8_t
Definition: Bentley.r.h:89

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