CFx SDK Documentation  2022 SP0
DbManagerSubentData.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2017, Open Design Alliance (the "Alliance").
3 // All rights reserved.
4 //
5 // This software and its documentation and related materials are owned by
6 // the Alliance. The software may only be incorporated into application
7 // programs owned by members of the Alliance, subject to a signed
8 // Membership Agreement and Supplemental Software License Agreement with the
9 // Alliance. The structure and organization of this software are the valuable
10 // trade secrets of the Alliance and its suppliers. The software is also
11 // protected by copyright law and international treaty provisions. Application
12 // programs incorporating this software must include the following statement
13 // with their copyright notices:
14 //
15 // This application incorporates Teigha(R) software pursuant to a license
16 // agreement with Open Design Alliance.
17 // Teigha(R) Copyright (C) 2002-2017 by Open Design Alliance.
18 // All rights reserved.
19 //
20 // By use of this software, its documentation or related materials, you
21 // acknowledge and accept the above terms.
23 
24 #ifndef _DBMANAGERSUBENTDATA_INCLUDED_
25 #define _DBMANAGERSUBENTDATA_INCLUDED_
26 
27 #include <OdaCommon.h>
28 #include "UInt32Array.h"
29 #include "DoubleArray.h"
30 
38 {
39  kUnknown = 0,
40  kFace = 3,
41  kEdge = 4,
43  kFillet = 6
44 };
45 
53 {
54 public:
56  virtual ~SubentDataBase() {};
57  virtual OdResult init(const OdUInt32Array& arr) = 0;
58 };
59 
67 {
68 
76 {
77  //The number ids in second part.
78  //Usually it is 1 and sec number contain sec number in persubent attribute.
79  //There are another case.
80  //For example 5(m_lNumbIds) 1000000000 1001 1000000000 1002 1000000000 1003 1000000000 1004 1000000000 1
81  OdUInt32Array m_lEntTplIdArr;
82 
83 public:
85  {}
86 
87  void set(const OdUInt32* pStart, OdUInt32& iShiftArr)
88  {
89  OdUInt32 iNumbIds = *(pStart + iShiftArr++);
90  if(iNumbIds > 0)
91  {
92  iNumbIds = iNumbIds*2;
93  m_lEntTplIdArr.resize(iNumbIds);
94  for (OdUInt32 i = 0; i < iNumbIds; ++i)
95  {
96  m_lEntTplIdArr.setAt(i, *(pStart + iShiftArr++));
97  }
98  }
99  }
100 
101  OdUInt32Array& SubentDataArr() { return m_lEntTplIdArr; }
102 };
104 
112 {
118 };
120 
127 class EdgeData : public SubentDataBase
128 {
129  OdUInt32 m_iStIndex;
130  PerSubentData m_mainSubEntity; //The subentity which was used in operation. (For example set color)
131  PerSubentDataArray m_arrFaces;
132  OdUInt32 m_ivtxIndex1, m_ivtxIndex2;
133  PerSubentData m_vtxSubEntity1, m_vtxSubEntity2; //Vertices of the edge.
134  PerSubentDataArray m_arrFacesVtx1, m_arrFacesVtx2;//Arrays of faces which includes the vertex.
135  OdUInt32Array m_arrFPart1, m_arrFPart2;
136 public:
137  EdgeData() : m_ivtxIndex1(0), m_ivtxIndex2(0), m_iStIndex(0) {};
138  virtual ~EdgeData() {};
139  virtual OdResult init(const OdUInt32Array& arr);
140 };
141 
148 class FaceData : public SubentDataBase
149 {
150  PerSubentData m_mainSubEntity; //The subentity which was used in operation. (For example set color)
151  PerSubentDataArray m_arrPerSubData;
152  OdUInt32Array m_arrLastPart;
153 public:
154  FaceData() {};
155  virtual ~FaceData() {};
156  virtual OdResult init(const OdUInt32Array& arr);
158 };
159 
167 {
168  SubentType m_SubentType;
169 
170  OdUInt32 m_iFSize;// The size for first block ???
171  SubentDataBase* m_pSubData;
172 public:
174  virtual ~FilletSubentData()
175  {
176  if (m_pSubData)
177  delete m_pSubData;
178  };
179  SubentType& getSubentType() {return m_SubentType;};
180  OdResult parseSubData(const OdUInt32Array& arr, OdUInt32& iShiftArr);
181 ;};
183 
191 {
192  FilletSubentDataArray m_dataArr;
193 public:
195  virtual ~FilletData() {};
196  virtual OdResult init(const OdUInt32Array& arr);
197 };
198 
206 {
207  PerSubentData m_mainSubEntity; //The subentity which was used in operation. (For example set color)
208  PerSubentDataArray m_arrPerSubData;
209  OdUInt32Array m_arrLastPart;
210 public:
212  virtual ~FilletInternalData() {};
213  virtual OdResult init(const OdUInt32Array& arr);
214 };
215 
216 };
217 
225 {
226  SubentType m_SubentType; // 3 - face, 4 - edge, 6 - chamfer, fillet.
227  //First elemet is history element id. (SubentColor, SubEntMaterial, Fillet, chamfer)
228  //Array indexes of entities in composite entity. (First number in persubent attribute.)
229  //In case face. Array faces and after it array edges.
232 
234  {}
236  {
237  if (m_pSubData)
238  {
239  delete m_pSubData;
240  m_pSubData = NULL;
242  }
243  };
244 };
246 
247 #endif //_DBMANAGERSUBENTDATA_INCLUDED_
248 
@ kFillet
@ kUnknown
@ kFilletPart
OdArray< SubentData > SubentDataArray
#define NULL
Definition: GsProperties.h:177
unsigned int OdUInt32
OdResult
Definition: OdResult.h:29
OdArray & setAt(size_type arrayIndex, const T &value)
Definition: OdArray.h:1162
void resize(size_type logicalLength, const T &value)
Definition: OdArray.h:834
virtual OdResult init(const OdUInt32Array &arr)
virtual OdResult init(const OdUInt32Array &arr)
virtual OdResult init(const OdUInt32Array &arr)
virtual OdResult init(const OdUInt32Array &arr)
OdResult parseSubData(const OdUInt32Array &arr, OdUInt32 &iShiftArr)
void set(const OdUInt32 *pStart, OdUInt32 &iShiftArr)
virtual ~SubentDataBase()
virtual OdResult init(const OdUInt32Array &arr)=0
OdArray< FilletSubentData > FilletSubentDataArray
OdArray< PerSubentData > PerSubentDataArray
OdArray< SubentRWData > SubentRWDataArray
SubentType m_SubentType
SubentDataBase * m_pSubData
OdUInt32Array m_arrMgrEntityId