CFx SDK Documentation 2026 SP0
Loading...
Searching...
No Matches
OdValue.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2024, 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-2024 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#ifndef _ODVALUE_INCLUDED_
27#define _ODVALUE_INCLUDED_
28
29#include "TD_PackPush.h"
30#include "StaticRxObject.h"
31#include "OdTimeStamp.h"
32
33class OdValueImpl;
34class OdValue;
36
40class DBENT_EXPORT OdValue : public OdStaticRxObject<OdRxObject>
41{
42public:
44
46 {
47 kUnknown = 0x00,
48 kLong = 0x01,
49 kDouble = 0x02,
50 kString = 0x04,
51 kDate = 0x08,
52 kPoint = 0x10,
53 k3dPoint = 0x20,
54 kObjectId = 0x40,
55 kBuffer = 0x80,
56 kResbuf = 0x100,
57 kGeneral = 0x200,
58 kColor = 0x400
59 };
60
62 {
63 kUnitless = 0x00,
64 kDistance = 0x01,
65 kAngle = 0x02,
66 kArea = 0x04,
67 kVolume = 0x08,
68 kCurrency = 0x10,
70 };
71
81
90
91public:
93
94 OdValue(void);
95 ~OdValue(void);
96
100 OdValue(double value);
101 OdValue(const OdInt64& date);
102 OdValue(double x, double y);
103 OdValue(double x, double y, double z);
104 OdValue(const OdDbObjectId& objectId);
105 OdValue(const OdResBufPtr& resBuf);
106 OdValue(const OdTimeStamp& time);
107 // OdValue(const OdRxVariantValue& var);
108
109 OdValue(const void* buffer, OdInt32 bufferSize);
110
116 bool reset();
140 bool isValid () const;
141
148 operator OdString() const;
149 operator OdInt32() const;
150 operator double() const;
151 operator OdInt64() const;
152 operator OdDbObjectId() const;
153
159 OdValue& operator=(const OdDbObjectId& objectId);
161
162 // OdValue& operator= (const OdRxVariantValue& var);
163
164 // bool get (const OdChar*& pszValue) const;
165
173 bool get(OdString& value) const;
181 bool get(OdInt32& value) const;
189 bool get(double& value) const;
198 bool get(OdInt64& date) const;
208 bool get(double& x, double& y) const;
219 bool get(double& x, double& y, double& z) const;
228 bool get(OdDbObjectId& objectId) const;
237 bool get(OdResBufPtr& resBuf) const;
238
239 // bool get(OdRxVariantValue& var) const;
240
250 bool get(void*& pBuf, OdInt32& bufferSize) const;
251
260 bool get(OdTimeStamp& time) const;
261
270 bool set(const OdValue& value);
279 bool set(const OdString& value);
297 bool set(double value);
306 bool set(const OdInt64& date);
316 bool set(double x, double y);
327 bool set(double x, double y, double z);
336 bool set(const OdDbObjectId& objectId);
345 bool set(const OdResBufPtr& resBuf);
346
347 // bool set (const OdRxVariantValue& var);
348
358 bool set(const void* buffer, OdInt32 bufferSize);
359
368 bool set(const OdTimeStamp& time);
369
370// bool reset (void);
377 bool reset (OdValue::DataType nDataType);
378
385 bool resetValue(void);
386
389 OdString getFormat (void) const;
390 void setFormat (const OdString& pszFormat);
391
392// bool parse (const OdString& pszText,
393// OdValue::DataType nDataType,
394// OdValue::UnitType nUnitType,
395// const ACHAR* pszFormat,
396// OdValue::ParseOption nOption,
397// const AcDbObjectId* pTextStyleId);
398//
399
400 OdString format(OdDbDatabase* pDb = 0) const;
402 OdString format(const OdString& pszFormat, OdValue::FormatOption nOption, OdDbDatabase* pDb = 0);
403 bool format(const OdString& pszFormat, OdString& pszValue, OdDbDatabase* pDb = 0) const;
404
405 bool convertTo (OdValue::DataType nDataType,
406 OdValue::UnitType nUnitType);
407 bool convertTo (OdValue::DataType nDataType,
408 OdValue::UnitType nUnitType,
409 bool bResetIfIncompatible);
410
412 OdDbDwgFiler* pFiler);
413 virtual void dwgOutFields(
414 OdDbDwgFiler* pFiler) const;
415
417 OdDbDxfFiler* pFiler);
418 virtual void dxfOutFields(
419 OdDbDxfFiler* pFiler) const;
420
421protected:
422 OdValue(OdValueImpl* pValImpl);
423
425 OdValueImpl* m_pImpl;
426};
427
428#include "TD_PackPop.h"
429
430#endif // _ODVALUE_INCLUDED_
OdSmartPtr< OdResBuf > OdResBufPtr
Definition DbDatabase.h:105
#define DBENT_EXPORT
Definition DbExport.h:67
int OdInt32
OdResult
Definition OdResult.h:29
OdString OdString
Definition OdString.h:1258
OdSmartPtr< OdValue > OdValuePtr
Definition OdValue.h:35
virtual OdRxObject * x(const OdRxClass *pClass) const
bool resetValue(void)
bool get(OdInt32 &value) const
bool get(double &value) const
@ kDouble
Definition OdValue.h:49
@ kString
Definition OdValue.h:50
@ kBuffer
Definition OdValue.h:55
@ kUnknown
Definition OdValue.h:47
@ kDate
Definition OdValue.h:51
@ kColor
Definition OdValue.h:58
@ kLong
Definition OdValue.h:48
@ kResbuf
Definition OdValue.h:56
@ kPoint
Definition OdValue.h:52
@ kObjectId
Definition OdValue.h:54
@ k3dPoint
Definition OdValue.h:53
@ kGeneral
Definition OdValue.h:57
OdValue & operator=(double value)
bool get(OdString &value) const
OdValue(void)
OdValue(double value)
bool set(const OdTimeStamp &time)
OdString format(OdDbDatabase *pDb=0) const
bool get(void *&pBuf, OdInt32 &bufferSize) const
bool set(const OdString &value)
bool convertTo(OdValue::DataType nDataType, OdValue::UnitType nUnitType)
ParseOption
Definition OdValue.h:73
@ kParseTextForFieldCode
Definition OdValue.h:79
@ kChangeDataType
Definition OdValue.h:78
@ kConvertTextToValue
Definition OdValue.h:77
@ kPreserveMtextFormat
Definition OdValue.h:76
@ kSetDefaultFormat
Definition OdValue.h:75
@ kParseOptionNone
Definition OdValue.h:74
bool set(const OdInt64 &date)
OdValue(const OdTimeStamp &time)
bool get(OdResBufPtr &resBuf) const
virtual OdResult dwgInFields(OdDbDwgFiler *pFiler)
bool get(double &x, double &y) const
bool isValid() const
friend class OdDbSystemInternals
Definition OdValue.h:424
OdString format(const OdString &pszFormat, OdValue::FormatOption nOption, OdDbDatabase *pDb=0)
bool set(OdInt32 value)
OdValue & operator=(OdInt32 value)
bool set(double value)
bool reset()
OdValue & operator=(OdInt64 date)
bool get(OdInt64 &date) const
OdValue(OdValueImpl *pValImpl)
bool set(double x, double y, double z)
bool format(const OdString &pszFormat, OdString &pszValue, OdDbDatabase *pDb=0) const
OdValue(const OdValue &value)
virtual OdResult dxfInFields(OdDbDxfFiler *pFiler)
bool set(const OdDbObjectId &objectId)
bool set(const void *buffer, OdInt32 bufferSize)
OdValue & operator=(const OdString &value)
OdValue & operator=(const OdValue &value)
ODRX_HEAP_OPERATORS()
OdValue::UnitType unitType(void) const
bool get(double &x, double &y, double &z) const
bool set(const OdResBufPtr &resBuf)
OdValue(const void *buffer, OdInt32 bufferSize)
OdValue & operator=(const OdDbObjectId &objectId)
bool convertTo(OdValue::DataType nDataType, OdValue::UnitType nUnitType, bool bResetIfIncompatible)
OdValue(const OdDbObjectId &objectId)
OdValue(OdInt32 value)
ODRX_DECLARE_MEMBERS(OdValue)
bool get(OdTimeStamp &time) const
bool get(OdDbObjectId &objectId) const
~OdValue(void)
bool set(double x, double y)
OdValue(const OdInt64 &date)
virtual void dwgOutFields(OdDbDwgFiler *pFiler) const
bool set(const OdValue &value)
void setUnitType(OdValue::UnitType nUnitType)
OdString format(OdValue::FormatOption nOption, OdDbDatabase *pDb=0)
OdString getFormat(void) const
OdValue & operator=(const OdResBufPtr &resBuf)
OdValue::DataType dataType() const
@ kUnitless
Definition OdValue.h:63
@ kDistance
Definition OdValue.h:64
@ kPercentage
Definition OdValue.h:69
@ kArea
Definition OdValue.h:66
@ kCurrency
Definition OdValue.h:68
@ kVolume
Definition OdValue.h:67
@ kAngle
Definition OdValue.h:65
bool reset(OdValue::DataType nDataType)
OdValue(const OdResBufPtr &resBuf)
OdValueImpl * m_pImpl
Definition OdValue.h:425
virtual void dxfOutFields(OdDbDxfFiler *pFiler) const
FormatOption
Definition OdValue.h:83
@ kForExpression
Definition OdValue.h:86
@ kUseMaximumPrecision
Definition OdValue.h:87
@ kForEditing
Definition OdValue.h:85
@ kFormatOptionNone
Definition OdValue.h:84
@ kIgnoreMtextFormat
Definition OdValue.h:88
OdValue(const OdString &value)
OdValue(double x, double y)
void setFormat(const OdString &pszFormat)
OdValue(double x, double y, double z)
GLfloat GLfloat GLfloat z
Definition gles2_ext.h:318
GLuint buffer
Definition gles2_ext.h:178
GLfloat GLfloat y
Definition gles2_ext.h:316
GLsizei const GLfloat * value
Definition gles2_ext.h:302