CFx SDK Documentation  2020SP3
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 
OdResult
OdResult
Definition: OdResult.h:29
NULL
#define NULL
Definition: GsProperties.h:177
OdDbHistoryInternal::SubentRWData::m_iType
OdUInt32 m_iType
Definition: DbManagerSubentData.h:113
OdDbHistoryInternal::SubentRWData::m_arrIdSec
OdUInt32Array m_arrIdSec
Definition: DbManagerSubentData.h:116
OdDbHistoryInternal::FilletSubentData
Definition: DbManagerSubentData.h:167
OdDbHistoryInternal::SubentRWData::m_iMark
OdUInt32 m_iMark
Definition: DbManagerSubentData.h:114
OdDbHistoryInternal::FaceData::FaceData
FaceData()
Definition: DbManagerSubentData.h:154
SubentData::m_pSubData
SubentDataBase * m_pSubData
Definition: DbManagerSubentData.h:231
OdDbHistoryInternal::FaceData
Definition: DbManagerSubentData.h:149
SubentData::SubentData
SubentData()
Definition: DbManagerSubentData.h:233
OdDbHistoryInternal::EdgeData::EdgeData
EdgeData()
Definition: DbManagerSubentData.h:137
DoubleArray.h
OdDbHistoryInternal::FaceData::~FaceData
virtual ~FaceData()
Definition: DbManagerSubentData.h:155
OdArray< OdUInt32, OdMemoryAllocator< OdUInt32 > >
OdDbHistoryInternal::EdgeData::~EdgeData
virtual ~EdgeData()
Definition: DbManagerSubentData.h:138
kUnknown
@ kUnknown
Definition: DbManagerSubentData.h:39
OdUInt32
unsigned int OdUInt32
Definition: OdPlatformSettings.h:783
SubentData::m_arrMgrEntityId
OdUInt32Array m_arrMgrEntityId
Definition: DbManagerSubentData.h:230
OdDbHistoryInternal::SubentRWData
Definition: DbManagerSubentData.h:112
OdDbHistoryInternal::EdgeData::init
virtual OdResult init(const OdUInt32Array &arr)
OdArray::setAt
OdArray & setAt(size_type arrayIndex, const T &value)
Definition: OdArray.h:1162
OdDbHistoryInternal::FilletInternalData::~FilletInternalData
virtual ~FilletInternalData()
Definition: DbManagerSubentData.h:212
OdDbHistoryInternal::FaceData::init
virtual OdResult init(const OdUInt32Array &arr)
kFilletPart
@ kFilletPart
Definition: DbManagerSubentData.h:42
OdDbHistoryInternal::FilletSubentData::FilletSubentData
FilletSubentData()
Definition: DbManagerSubentData.h:173
SubentDataBase::init
virtual OdResult init(const OdUInt32Array &arr)=0
OdDbHistoryInternal
Definition: DbManagerSubentData.h:67
SubentDataArray
OdArray< SubentData > SubentDataArray
Definition: DbManagerSubentData.h:245
SubentData::~SubentData
~SubentData()
Definition: DbManagerSubentData.h:235
OdDbHistoryInternal::SubentRWData::m_arrDouble
OdDoubleArray m_arrDouble
Definition: DbManagerSubentData.h:117
OdDbHistoryInternal::FilletData::~FilletData
virtual ~FilletData()
Definition: DbManagerSubentData.h:195
SubentDataBase::~SubentDataBase
virtual ~SubentDataBase()
Definition: DbManagerSubentData.h:56
OdArray::resize
void resize(size_type logicalLength, const T &value)
Definition: OdArray.h:834
kFillet
@ kFillet
Definition: DbManagerSubentData.h:43
OdDbHistoryInternal::FilletSubentDataArray
OdArray< FilletSubentData > FilletSubentDataArray
Definition: DbManagerSubentData.h:182
OdaCommon.h
OdDbHistoryInternal::PerSubentData
Definition: DbManagerSubentData.h:76
OdDbHistoryInternal::FilletData::FilletData
FilletData()
Definition: DbManagerSubentData.h:194
OdDbHistoryInternal::PerSubentData::set
void set(const OdUInt32 *pStart, OdUInt32 &iShiftArr)
Definition: DbManagerSubentData.h:87
kEdge
@ kEdge
Definition: DbManagerSubentData.h:41
OdDbHistoryInternal::SubentRWDataArray
OdArray< SubentRWData > SubentRWDataArray
Definition: DbManagerSubentData.h:119
OdDbHistoryInternal::FilletInternalData
Definition: DbManagerSubentData.h:206
OdDbHistoryInternal::EdgeData
Definition: DbManagerSubentData.h:128
OdDbHistoryInternal::FilletInternalData::FilletInternalData
FilletInternalData()
Definition: DbManagerSubentData.h:211
kFace
@ kFace
Definition: DbManagerSubentData.h:40
OdDbHistoryInternal::SubentRWData::m_arrIdFirst
OdUInt32Array m_arrIdFirst
Definition: DbManagerSubentData.h:115
SubentData::m_SubentType
SubentType m_SubentType
Definition: DbManagerSubentData.h:226
SubentDataBase::SubentDataBase
SubentDataBase()
Definition: DbManagerSubentData.h:55
SubentDataBase
Definition: DbManagerSubentData.h:53
OdDbHistoryInternal::FilletSubentData::parseSubData
OdResult parseSubData(const OdUInt32Array &arr, OdUInt32 &iShiftArr)
OdDbHistoryInternal::FilletInternalData::init
virtual OdResult init(const OdUInt32Array &arr)
OdDbHistoryInternal::FilletData
Definition: DbManagerSubentData.h:191
SubentType
SubentType
Definition: DbManagerSubentData.h:38
OdDbHistoryInternal::PerSubentData::SubentDataArr
OdUInt32Array & SubentDataArr()
Definition: DbManagerSubentData.h:101
SubentData
Definition: DbManagerSubentData.h:225
OdDbHistoryInternal::PerSubentData::PerSubentData
PerSubentData()
Definition: DbManagerSubentData.h:84
OdDbHistoryInternal::FilletSubentData::getSubentType
SubentType & getSubentType()
Definition: DbManagerSubentData.h:179
OdDbHistoryInternal::FilletData::init
virtual OdResult init(const OdUInt32Array &arr)
UInt32Array.h
OdDbHistoryInternal::PerSubentDataArray
OdArray< PerSubentData > PerSubentDataArray
Definition: DbManagerSubentData.h:103
OdDbHistoryInternal::FilletSubentData::~FilletSubentData
virtual ~FilletSubentData()
Definition: DbManagerSubentData.h:174
OdDbHistoryInternal::FaceData::getNFaces
OdUInt32 & getNFaces()