CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
ResBuf.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2022, 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 Open Design Alliance software pursuant to a license
16// agreement with Open Design Alliance.
17// Open Design Alliance Copyright (C) 2002-2022 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
25
26
27#if !defined(_ODRESBUF_H___INCLUDED_)
28#define _ODRESBUF_H___INCLUDED_
29
30#include "TD_PackPush.h"
31
32#include "DbExport.h"
33#include "RxObject.h"
34#include "OdString.h"
35#include "DbHandle.h"
36#include "OdError.h"
37
38class OdBinaryData;
39class OdGePoint2d;
40class OdGePoint3d;
41class OdGeVector2d;
42class OdGeVector3d;
43class OdDbObjectId;
44class OdDbDatabase;
45class OdCmColor;
46class OdResBuf;
48
53
54
68{
69public:
70 OdError_InvalidResBuf() : OdError(eInvalidResBuf){}
71};
72
81
108{
109public:
110
112
117
130 void copyFrom( const OdRxObject* pRb );
131
132
145 bool operator==( const OdResBuf& Rb ) const;
146
147
160 bool operator!=( const OdResBuf& Rb ) const;
161
162
167 {
168 //FELIX_CHANGE_BEGIN
169 kRtNorm = 5100, // Normal termination
170 kRtMemErr = -5000, // Global memory error
171 kRtError = -5001, // Some other error
172 kRtCan = -5002, // User cancelled request -- Ctl-C
173 kRtRej = -5003, // Rejected request -- invalid
174 kRtFail = -5004, // Link failure -- Lisp probably died
175 kRtKword = -5005, // Keyword returned from getxxx() routine
176 kRtInputTruncated = -5008, // Input didn't all fit in the buffer
177 //FELIX_CHANGE_END
178
179 kRtNone = 5000,
180 kRtDouble = 5001,
181 kRtPoint2d = 5002,
182 kRtInt16 = 5003,
183 kRtAngle = 5004,
184 kRtString = 5005,
185
186 kRtEntName = 5006, // setObjectId()/getEntName()/getObjectId(0)
187 kRtPickSet = 5007,
188
189 kRtOrient = 5008,
190
191 kRtPoint3d = 5009,
192 kRtInt32 = 5010,
193 kRtColor = 5011,
194
195 kRtVoid = 5014,
196 kRtListBeg = 5016, // list begin
197 kRtListEnd = 5017, // list end
198 kRtDote = 5018, // dot
199 kRtNil = 5019, // nil
200
201
202
203 kRtDXF0 = 5020,
204 kRtT = 5021,
205 kRtResBuf = 5023,
206// kRtModeless = 5027,
207
208 kRtBool = 290,
209 kRtInt8 = 280,
210 kRtVector2d = kRtPoint2d,
211 kRtVector3d = kRtPoint3d,
212 kRtBinaryChunk = 310,
213 kRtHandle = 320,
214 kRtObjectId = 330,
215 kRtSoftPointerId = 330,
216 kRtHardPointerId = 340,
217 kRtSoftOwnershipId = 350,
218 kRtHardOwnershipId = 360,
219
220 kDxfInvalid = -9999,
221
222 kDxfXDictionary = -6,
223 kDxfPReactors = -5,
224 kDxfOperator = -4,
225 kDxfXDataStart = -3,
226 kDxfHeaderId = -2,
227 kDxfFirstEntId = -2,
228 kDxfEnd = -1,
229 kDxfStart = 0,
230 kDxfText = 1,
231 kDxfXRefPath = 1,
232 kDxfShapeName = 2,
233 kDxfBlockName = 2,
234 kDxfAttributeTag = 2,
235 kDxfSymbolTableName = 2,
236 kDxfMstyleName = 2,
237 kDxfSymTableRecName = 2,
238 kDxfAttributePrompt = 3,
239 kDxfDimStyleName = 3,
240 kDxfLinetypeProse = 3,
241 kDxfTextFontFile = 3,
242 kDxfDescription = 3,
243 kDxfDimPostStr = 3,
244 kDxfTextBigFontFile = 4,
245 kDxfDimAPostStr = 4,
246 kDxfCLShapeName = 4,
247 kDxfSymTableRecComments = 4,
248 kDxfHandle = 5,
249 kDxfDimBlk = 5,
250 kDxfDimBlk1 = 6,
251 kDxfLinetypeName = 6,
252 kDxfDimBlk2 = 7,
253 kDxfTextStyleName = 7,
254 kDxfLayerName = 8,
255 kDxfCLShapeText = 9,
256 kDxfXCoord = 10,
257 kDxfYCoord = 20,
258 kDxfZCoord = 30,
259 kDxfElevation = 38,
260 kDxfThickness = 39,
261 kDxfReal = 40,
262 kDxfViewportHeight = 40,
263 kDxfTxtSize = 40,
264 kDxfTxtStyleXScale = 41,
265 kDxfViewWidth = 41,
266 kDxfViewportAspect = 41,
267 kDxfTxtStylePSize = 42,
268 kDxfViewLensLength = 42,
269 kDxfViewFrontClip = 43,
270 kDxfViewBackClip = 44,
271 kDxfShapeXOffset = 44,
272 kDxfShapeYOffset = 45,
273 kDxfViewHeight = 45,
274 kDxfShapeScale = 46,
275 kDxfPixelScale = 47,
276 kDxfLinetypeScale = 48,
277 kDxfDashLength = 49,
278 kDxfMlineOffset = 49,
279 kDxfLinetypeElement = 49,
280 kDxfAngle = 50,
281 kDxfViewportSnapAngle = 50,
282 kDxfViewportTwist = 51,
283 kDxfVisibility = 60,
284 kDxfLayerLinetype = 61,
285 kDxfColor = 62,
286 kDxfHasSubentities = 66,
287 kDxfViewportVisibility = 67,
288 kDxfViewportActive = 68,
289 kDxfViewportNumber = 69,
290 kDxfInt16 = 70,
291 kDxfViewMode = 71,
292 kDxfCircleSides = 72,
293 kDxfViewportZoom = 73,
294 kDxfViewportIcon = 74,
295 kDxfViewportSnap = 75,
296 kDxfViewportGrid = 76,
297 kDxfViewportSnapStyle = 77,
298 kDxfViewportSnapPair = 78,
299 kDxfRegAppFlags = 71,
300 kDxfTxtStyleFlags = 71,
301 kDxfLinetypeAlign = 72,
302 kDxfLinetypePDC = 73,
303 kDxfInt32 = 90,
304 kDxfSubclass = 100,
305 kDxfEmbeddedObjectStart = 101,
306 kDxfControlString = 102,
307 kDxfDimVarHandle = 105,
308 kDxfUCSOrg = 110,
309 kDxfUCSOriX = 111,
310 kDxfUCSOriY = 112,
311 kDxfXReal = 140,
312 // 64-bit integers can only be used with version R24 and higher
313 kDxfInt64 = 160,
314
315 kDxfXInt16 = 170,
316 kDxfNormalX = 210,
317 kDxfNormalY = 220,
318 kDxfNormalZ = 230,
319 kDxfXXInt16 = 270,
320 kDxfInt8 = 280,
321 kDxfRenderMode = 281,
322 kDxfBool = 290,
323 kDxfXTextString = 300,
324 kDxfBinaryChunk = 310,
325 kDxfArbHandle = 320,
326 kDxfSoftPointerId = 330,
327 kDxfHardPointerId = 340,
328 kDxfSoftOwnershipId = 350,
329 kDxfHardOwnershipId = 360,
330 kDxfLineWeight = 370,
331 kDxfPlotStyleNameType = 380,
332 kDxfPlotStyleNameId = 390,
333 kDxfXXXInt16 = 400,
334 kDxfLayoutName = 410,
335 kDxfComment = 999,
336 kDxfXdAsciiString = 1000,
337 kDxfRegAppName = 1001,
338 kDxfXdControlString = 1002,
339 kDxfXdLayerName = 1003,
340 kDxfXdBinaryChunk = 1004,
341 kDxfXdHandle = 1005,
342 kDxfXdXCoord = 1010,
343 kDxfXdYCoord = 1020,
344 kDxfXdZCoord = 1030,
345 kDxfXdWorldXCoord = 1011,
346 kDxfXdWorldYCoord = 1021,
347 kDxfXdWorldZCoord = 1031,
348 kDxfXdWorldXDisp = 1012,
349 kDxfXdWorldYDisp = 1022,
350 kDxfXdWorldZDisp = 1032,
351 kDxfXdWorldXDir = 1013,
352 kDxfXdWorldYDir = 1023,
353 kDxfXdWorldZDir = 1033,
354 kDxfXdReal = 1040,
355 kDxfXdDist = 1041,
356 kDxfXdScale = 1042,
357 kDxfXdInteger16 = 1070,
358 kDxfXdInteger32 = 1071
359 };
360
361
382 int restype() const;
383
384
402 void setRestype( int resType );
403
404
417
418
431
432
451
452
471
472
491
492
513 void setString( const OdString& sValue );
514
515
535 bool getBool() const;
536
537
558 void setBool( bool bValue );
559
560
579
580
602 void setInt8( OdInt8 iValue );
603
604
623
624
646 void setInt16( OdInt16 iValue );
647
648
649
668
669
691 void setInt32( OdInt32 iValue );
692
693
712
713
735 void setInt64( OdInt64 iValue );
736
737
756 double getDouble() const;
757
758
780 void setDouble( double realValue );
781
782
801 const OdGePoint2d& getPoint2d() const;
802
803
824 void setPoint2d( const OdGePoint2d& gePoint );
825
826
845 const OdGePoint3d& getPoint3d() const;
846
847
868 void setPoint3d( const OdGePoint3d& gePoint );
869
870
889 const OdGeVector2d& getVector2d() const;
890
891
912 void setVector2d( const OdGeVector2d& geVector );
913
914
933 const OdGeVector3d& getVector3d() const;
934
935
956 void setVector3d(const OdGeVector3d& val);
957
958
979
980
1003 void setBinaryChunk( const OdBinaryData& bChunk );
1004
1005
1025 const OdCmColor& getColor() const;
1026
1027
1051 void setColor( const OdCmColor& cmColor );
1052
1053
1070
1071
1090 void setResBuf( const OdResBuf* pResBuf );
1091
1092
1113
1114
1138 void setHandle( const OdDbHandle& vHandle );
1139
1140
1162 const OdDbObjectId& getEntName() const;
1163
1164
1190 void setObjectId( const OdDbObjectId& idObject );
1191
1192
1208
1209
1214
1223 void setPickSet(const OdDbSelectionSet* pSSet);
1224
1225
1242 static OdResBufPtr newRb(int resType = OdResBuf::kRtNone);
1243
1261 static OdResBufPtr newRb(int resType, bool resVal)
1262 {
1263 OdResBufPtr pRes = newRb(resType);
1264 pRes->setBool(resVal);
1265 return pRes;
1266 }
1267
1285 static OdResBufPtr newRb(int resType, OdInt8 resVal)
1286 {
1287 OdResBufPtr pRes = newRb(resType);
1288 pRes->setInt8(resVal);
1289 return pRes;
1290 }
1291
1309 static OdResBufPtr newRb(int resType, OdUInt8 resVal)
1310 {
1311 OdResBufPtr pRes = newRb(resType);
1312 pRes->setInt8(resVal);
1313 return pRes;
1314 }
1315
1333 static OdResBufPtr newRb(int resType, OdInt16 resVal)
1334 {
1335 OdResBufPtr pRes = newRb(resType);
1336 pRes->setInt16(resVal);
1337 return pRes;
1338 }
1339
1357 static OdResBufPtr newRb(int resType, OdUInt16 resVal)
1358 {
1359 OdResBufPtr pRes = newRb(resType);
1360 pRes->setInt16(resVal);
1361 return pRes;
1362 }
1363
1381 static OdResBufPtr newRb(int resType, OdInt32 resVal)
1382 {
1383 OdResBufPtr pRes = newRb(resType);
1384 pRes->setInt32(resVal);
1385 return pRes;
1386 }
1387
1405 static OdResBufPtr newRb(int resType, OdUInt32 resVal)
1406 {
1407 OdResBufPtr pRes = newRb(resType);
1408 pRes->setInt32(resVal);
1409 return pRes;
1410 }
1411
1429 static OdResBufPtr newRb(int resType, OdInt64 resVal)
1430 {
1431 OdResBufPtr pRes = newRb(resType);
1432 pRes->setInt64(resVal);
1433 return pRes;
1434 }
1435
1453 static OdResBufPtr newRb(int resType, OdUInt64 resVal)
1454 {
1455 OdResBufPtr pRes = newRb(resType);
1456 pRes->setInt64(resVal);
1457 return pRes;
1458 }
1459
1477 static OdResBufPtr newRb(int resType, double resVal)
1478 {
1479 OdResBufPtr pRes = newRb(resType);
1480 pRes->setDouble(resVal);
1481 return pRes;
1482 }
1483
1501 static OdResBufPtr newRb(int resType, const OdGePoint2d& resVal)
1502 {
1503 OdResBufPtr pRes = newRb(resType);
1504 pRes->setPoint2d(resVal);
1505 return pRes;
1506 }
1507
1525 static OdResBufPtr newRb(int resType, const OdGePoint3d& resVal)
1526 {
1527 OdResBufPtr pRes = newRb(resType);
1528 pRes->setPoint3d(resVal);
1529 return pRes;
1530 }
1531
1549 static OdResBufPtr newRb(int resType, const OdGeVector2d& resVal)
1550 {
1551 OdResBufPtr pRes = newRb(resType);
1552 pRes->setVector2d(resVal);
1553 return pRes;
1554 }
1555
1573 static OdResBufPtr newRb(int resType, const OdGeVector3d& resVal)
1574 {
1575 OdResBufPtr pRes = newRb(resType);
1576 pRes->setVector3d(resVal);
1577 return pRes;
1578 }
1579
1597 static OdResBufPtr newRb(int resType, const OdString& resVal)
1598 {
1599 OdResBufPtr pRes = newRb(resType);
1600 pRes->setString(resVal);
1601 return pRes;
1602 }
1603
1621 static OdResBufPtr newRb(int resType, const OdChar* resVal)
1622 {
1623 OdResBufPtr pRes = newRb(resType);
1624 pRes->setString(resVal);
1625 return pRes;
1626 }
1627
1628#if defined(OD_WINDOWS_DESKTOP) && defined(_MSC_VER)
1646 static OdResBufPtr newRb(int resType, const __wchar_t* resVal)
1647 {
1648 OdResBufPtr pRes = newRb(resType);
1649 pRes->setString(resVal);
1650 return pRes;
1651 }
1652#endif
1653
1671 static OdResBufPtr newRb(int resType, const OdCmColor& resVal)
1672 {
1673 OdResBufPtr pRes = newRb(resType);
1674 pRes->setColor(resVal);
1675 return pRes;
1676 }
1677
1695 static OdResBufPtr newRb(int resType, const OdDbObjectId& id)
1696 {
1697 OdResBufPtr pRes = newRb(resType);
1698 pRes->setObjectId(id);
1699 return pRes;
1700 }
1701
1719 static OdResBufPtr newRb(int resType, const OdDbSelectionSet* pSSet)
1720 {
1721 OdResBufPtr pRes = newRb(resType);
1722 pRes->setPickSet(pSSet);
1723 return pRes;
1724 }
1725
1743 static OdResBufPtr newRb(int resType, const OdResBuf* pNestedRb)
1744 {
1745 OdResBufPtr pRes = newRb(resType);
1746 pRes->setResBuf(pNestedRb);
1747 return pRes;
1748 }
1749 // is used to get assertion with needed call stack only
1752
1756 union Data
1757 {
1758 bool Bool; // Boolean content
1759 OdInt16 Int16; // 8-bit or 16-bit Integer content
1760 OdInt32 Int32; // 32-bit Integer or Color content
1761 OdInt64 Int64; // 64-bit Integer or Handle content
1762 double Double; // double-precision floating-point content
1763 void* Pointer; // pointer to an object
1764 OdUInt8 Bytes[sizeof(OdInt64)]; // Content as an array of bytes
1765 };
1766
1767protected:
1776
1777 int m_nCode; // Group code that defines the data type
1778 Data m_data; // Value that defines the content
1779 OdResBufPtr m_pNext; // Smart pointer to another instance for attaching in a sequence
1780};
1781
1782inline bool
1783OdResBuf::operator!=( const OdResBuf& other ) const
1784{
1785 return !operator==( other );
1786}
1787
1792
1793#include "TD_PackPop.h"
1794
1795#endif //_ODRESBUF_H___INCLUDED_
1796
#define TOOLKIT_EXPORT
Definition: DbExport.h:40
bool operator!=(T left, const OdGiVariant::EnumType right)
Definition: GiVariant.h:403
unsigned int OdUInt32
short OdInt16
signed char OdInt8
unsigned short OdUInt16
int OdInt32
unsigned char OdUInt8
wchar_t OdChar
TOOLKIT_EXPORT bool oddbCompareRbChains(const OdResBuf *pRb1, const OdResBuf *pRb2)
OdSmartPtr< OdResBuf > OdResBufPtr
Definition: ResBuf.h:80
OdSmartPtr< OdDbSelectionSet > OdDbSelectionSetPtr
Definition: ResBuf.h:52
Definition: Int64.h:43
static void setAssertIndexByNewRb(int index)
static OdResBufPtr newRb(int resType, double resVal)
Definition: ResBuf.h:1477
void setVector2d(const OdGeVector2d &geVector)
static OdResBufPtr newRb(int resType, OdUInt16 resVal)
Definition: ResBuf.h:1357
void setBinaryChunk(const OdBinaryData &bChunk)
void setRestype(int resType)
OdInt32 getInt32() const
static OdResBufPtr newRb(int resType, OdInt16 resVal)
Definition: ResBuf.h:1333
OdInt8 getInt8() const
ODRX_DECLARE_MEMBERS(OdResBuf)
void setObjectId(const OdDbObjectId &idObject)
OdDbSelectionSetPtr getPickSet() const
static OdResBufPtr newRb(int resType, OdUInt8 resVal)
Definition: ResBuf.h:1309
double getDouble() const
OdDbHandle getHandle() const
void setInt16(OdInt16 iValue)
static OdResBufPtr newRb(int resType, const OdGePoint3d &resVal)
Definition: ResBuf.h:1525
int m_nCode
Definition: ResBuf.h:1777
static OdResBufPtr newRb(int resType, bool resVal)
Definition: ResBuf.h:1261
OdResBufPtr m_pNext
Definition: ResBuf.h:1779
static OdResBufPtr newRb(int resType, const OdDbObjectId &id)
Definition: ResBuf.h:1695
static OdResBufPtr newRb(int resType, const OdGeVector2d &resVal)
Definition: ResBuf.h:1549
OdResBufPtr last() const
bool operator==(const OdResBuf &Rb) const
const OdBinaryData & getBinaryChunk() const
static OdResBufPtr newRb(int resType, const OdString &resVal)
Definition: ResBuf.h:1597
static OdResBufPtr newRb(int resType, OdInt32 resVal)
Definition: ResBuf.h:1381
static OdResBufPtr newRb(int resType, const OdGeVector3d &resVal)
Definition: ResBuf.h:1573
const OdCmColor & getColor() const
OdResBufPtr next() const
void setBool(bool bValue)
static OdResBufPtr newRb(int resType, const OdCmColor &resVal)
Definition: ResBuf.h:1671
void setDouble(double realValue)
void setPoint2d(const OdGePoint2d &gePoint)
const OdDbObjectId & getEntName() const
OdDbObjectId getObjectId(const OdDbDatabase *pDb) const
static OdResBufPtr newRb(int resType, const OdChar *resVal)
Definition: ResBuf.h:1621
bool getBool() const
Data m_data
Definition: ResBuf.h:1778
void setResBuf(const OdResBuf *pResBuf)
void setHandle(const OdDbHandle &vHandle)
const OdGeVector2d & getVector2d() const
void setVector3d(const OdGeVector3d &val)
static OdResBufPtr newRb(int resType, const OdDbSelectionSet *pSSet)
Definition: ResBuf.h:1719
OdResBufPtr insert(OdResBuf *pRb)
static OdResBufPtr newRb(int resType=OdResBuf::kRtNone)
void setPickSet(const OdDbSelectionSet *pSSet)
bool operator!=(const OdResBuf &Rb) const
Definition: ResBuf.h:1783
int restype() const
static OdResBufPtr newRb(int resType, OdInt8 resVal)
Definition: ResBuf.h:1285
const OdGeVector3d & getVector3d() const
void copyFrom(const OdRxObject *pRb)
const OdGePoint2d & getPoint2d() const
void setInt64(OdInt64 iValue)
OdInt16 getInt16() const
OdInt64 getInt64() const
static OdResBufPtr newRb(int resType, OdUInt32 resVal)
Definition: ResBuf.h:1405
ValueType
Definition: ResBuf.h:167
@ kRtNone
Definition: ResBuf.h:179
void setInt8(OdInt8 iValue)
OdString getString() const
void setColor(const OdCmColor &cmColor)
OdResBufPtr getResBuf() const
static OdResBufPtr newRb(int resType, OdInt64 resVal)
Definition: ResBuf.h:1429
void setInt32(OdInt32 iValue)
static OdResBufPtr newRb(int resType, const OdGePoint2d &resVal)
Definition: ResBuf.h:1501
void setPoint3d(const OdGePoint3d &gePoint)
const OdGePoint3d & getPoint3d() const
static OdResBufPtr newRb(int resType, OdUInt64 resVal)
Definition: ResBuf.h:1453
static OdResBufPtr newRb(int resType, const OdResBuf *pNestedRb)
Definition: ResBuf.h:1743
void setString(const OdString &sValue)
OdResBufPtr setNext(OdResBuf *pRb)
GLuint index
Definition: gles2_ext.h:265
OdInt32 Int32
Definition: ResBuf.h:1760
OdInt64 Int64
Definition: ResBuf.h:1761
double Double
Definition: ResBuf.h:1762
OdInt16 Int16
Definition: ResBuf.h:1759
void * Pointer
Definition: ResBuf.h:1763