CFx SDK Documentation 2026 SP0
Loading...
Searching...
No Matches
CFxVariant Class Reference

#include <FxVariant.h>

Inheritance diagram for CFxVariant:
FX_VARIANT

Public Types

enum  _Type {
  eNone , eVoid , eDouble , eString ,
  eInt32 , eColor , eCollection , eCollectionElement ,
  eId , ePoint2D , ePoint3D , eTransparency ,
  eAngle , eLineType , eScale
}
 
typedef enum CFxVariant::_Type Type
 

Public Member Functions

 CFxVariant ()
 
 CFxVariant (const CFxVariant &variant)
 
 CFxVariant (const CFxVariant *pVariant)
 
 CFxVariant (const void *value, int size)
 
 CFxVariant (double value, bool useUnitsConversion=true)
 
 CFxVariant (const CFxString &value)
 
 CFxVariant (OdInt32 value)
 
 CFxVariant (const OdCmColor &value)
 
 CFxVariant (const OdCmTransparency &value)
 
 CFxVariant (const CFxVariantCollection &value)
 
 CFxVariant (const CFxVariantCollectionElement &value)
 
 CFxVariant (const OdDbObjectId &value)
 
 CFxVariant (const OdGePoint2d &value)
 
 CFxVariant (const OdGePoint3d &value)
 
void Load (QByteArray &data, CFxDocument *pContext)
 
QByteArray Save () const
 
virtual ~CFxVariant ()
 
bool IsNull () const
 
Type GetType () const
 
bool UseUnitsConversion () const
 
voidGetVoid (int *size=0) const
 
double GetDouble () const
 
CFxString GetString () const
 
OdInt32 GetInt32 () const
 
const OdCmColorGetColor () const
 
const OdCmTransparencyGetTransparency () const
 
CFxVariantCollectionGetCollection ()
 
const CFxVariantCollectionGetCollection () const
 
const CFxVariantCollectionElementGetCollectionElement () const
 
const OdDbObjectIdGetId () const
 
const OdGePoint2dGetPoint2d () const
 
const OdGePoint3dGetPoint3d () const
 
void SetValue (const CFxVariant &value)
 
const CFxVariantoperator+= (const CFxVariant &v)
 

Static Public Attributes

static const char * varies
 
static CFxVariant kNull
 

Static Protected Member Functions

static void GetIdDescription (OdDbObjectId id, CFxString &sPath, CFxString &sObjectName)
 
static bool BuildOwnerPath (OdDbDictionaryPtr pRootDict, OdDbObjectId idTarget, const CFxString &sRootName, CFxString &sPath)
 
static OdDbObjectId ResolvePath (OdDbDictionaryPtr pRootDict, const CFxString &sPath, const CFxString &sObjectName)
 

Protected Attributes

Type m_Type
 
bool m_bUseUnitsConversion
 
- Protected Attributes inherited from FX_VARIANT
voidm_pVoid
 
int m_Size
 
double m_Double
 
bool m_UseUnitsConversion
 
CFxString m_String
 
OdInt32 m_Int32
 
OdCmColor m_Color
 
CFxVariantCollectionElement m_CollectionElement
 
CFxVariantCollection m_Collection
 
OdDbObjectId m_Id
 
OdGePoint2d m_Point2D
 
OdGePoint3d m_Point3D
 
OdCmTransparency m_Transparency
 

Friends

DDKERNEL_API bool operator!= (const CFxVariant &v1, const CFxVariant &v2)
 
DDKERNEL_API bool operator== (const CFxVariant &v1, const CFxVariant &v2)
 

Additional Inherited Members

- Protected Member Functions inherited from FX_VARIANT
 FX_VARIANT ()
 

Detailed Description

Description: Represents the variant. Library: DDKernel

Definition at line 233 of file FxVariant.h.

Member Typedef Documentation

◆ Type

Description: Represents the type of the stored in variant.

Member Enumeration Documentation

◆ _Type

Description: Represents the type of the stored in variant.

Enumerator
eNone 
eVoid 
eDouble 
eString 
eInt32 
eColor 
eCollection 
eCollectionElement 
eId 
ePoint2D 
ePoint3D 
eTransparency 
eAngle 
eLineType 
eScale 

Definition at line 248 of file FxVariant.h.

Constructor & Destructor Documentation

◆ CFxVariant() [1/14]

CFxVariant::CFxVariant ( )

Description: Initializes a new instance of the CFxVariant class with default values.

◆ CFxVariant() [2/14]

CFxVariant::CFxVariant ( const CFxVariant & variant)

Description: Initializes a new instance of the CFxVariant class using an existing CFxVariant object. Arguments:

Parameters
variantThe CFxVariant object to copy.

◆ CFxVariant() [3/14]

CFxVariant::CFxVariant ( const CFxVariant * pVariant)

Description: Initializes a new instance of the CFxVariant class using a pointer to an existing CFxVariant object. Arguments:

Parameters
pVariantThe pointer to the CFxVariant object to copy.

◆ CFxVariant() [4/14]

CFxVariant::CFxVariant ( const void * value,
int size )

Description: Initializes a new instance of the CFxVariant class using a pointer to a value and its size. Arguments:

Parameters
valueThe pointer to the value to be used.
sizeThe size of the value.

◆ CFxVariant() [5/14]

CFxVariant::CFxVariant ( double value,
bool useUnitsConversion = true )

Description: Initializes a new instance of the CFxVariant class using a double value. Arguments:

Parameters
valueThe double value to initialize the variant with.
useUnitsConversionIndicates whether to use units conversion.

◆ CFxVariant() [6/14]

CFxVariant::CFxVariant ( const CFxString & value)

Description: Initializes a new instance of the CFxVariant class using a CFxString value. Arguments:

Parameters
valueThe CFxString value to initialize the variant with.

◆ CFxVariant() [7/14]

CFxVariant::CFxVariant ( OdInt32 value)

Description: Initializes a new instance of the CFxVariant class using an OdInt32 value. Arguments:

Parameters
valueThe OdInt32 value to initialize the variant with.

◆ CFxVariant() [8/14]

CFxVariant::CFxVariant ( const OdCmColor & value)

Description: Initializes a new instance of the CFxVariant class using an OdCmColor value. Arguments:

Parameters
valueThe OdCmColor value to initialize the variant with.

◆ CFxVariant() [9/14]

CFxVariant::CFxVariant ( const OdCmTransparency & value)

Description: Initializes a new instance of the CFxVariant class using an OdCmTransparency value. Arguments:

Parameters
valueThe OdCmTransparency value to initialize the variant with.

◆ CFxVariant() [10/14]

CFxVariant::CFxVariant ( const CFxVariantCollection & value)

Description: Initializes a new instance of the CFxVariant class using a CFxVariantCollection value. Arguments:

Parameters
valueThe CFxVariantCollection value to initialize the variant with.

◆ CFxVariant() [11/14]

CFxVariant::CFxVariant ( const CFxVariantCollectionElement & value)

Description: Initializes a new instance of the CFxVariant class using a CFxVariantCollectionElement value. Arguments:

Parameters
valueThe CFxVariantCollectionElement value to initialize the variant with.

◆ CFxVariant() [12/14]

CFxVariant::CFxVariant ( const OdDbObjectId & value)

Description: Initializes a new instance of the CFxVariant class using an OdDbObjectId value. Arguments:

Parameters
valueThe OdDbObjectId value to initialize the variant with.

◆ CFxVariant() [13/14]

CFxVariant::CFxVariant ( const OdGePoint2d & value)

Description: Initializes a new instance of the CFxVariant class using an OdGePoint2d value. Arguments:

Parameters
valueThe OdGePoint2d value to initialize the variant with.

◆ CFxVariant() [14/14]

CFxVariant::CFxVariant ( const OdGePoint3d & value)

Description: Initializes a new instance of the CFxVariant class using an OdGePoint3d value. Arguments:

Parameters
valueThe OdGePoint3d value to initialize the variant with.

◆ ~CFxVariant()

virtual CFxVariant::~CFxVariant ( )
virtual

Description: Destructor for CFxVariant class that handles cleanup based on the type of variant.

Member Function Documentation

◆ BuildOwnerPath()

static bool CFxVariant::BuildOwnerPath ( OdDbDictionaryPtr pRootDict,
OdDbObjectId idTarget,
const CFxString & sRootName,
CFxString & sPath )
staticprotected

Description: Builds and checks the path for a given target ID in a nested dictionary structure Arguments:

Parameters
pRootDictThe root dictionary to start the search from.
idTargetThe target object ID to find the path for
sRootNameRoot name string.
sPathThe string to store the resulting path if the target is found Return Value: Returns true if the target ID is found in the root dictionary, otherwise false.

◆ GetCollection() [1/2]

CFxVariantCollection & CFxVariant::GetCollection ( )

Description: Returns a reference to the CFxVariantCollection stored in the variant

◆ GetCollection() [2/2]

const CFxVariantCollection & CFxVariant::GetCollection ( ) const

Description: Returns a const reference to the CFxVariantCollection stored in the variant

◆ GetCollectionElement()

const CFxVariantCollectionElement & CFxVariant::GetCollectionElement ( ) const

Description: Returns a const reference to the CFxVariantCollectionElement stored in the variant

◆ GetColor()

const OdCmColor & CFxVariant::GetColor ( ) const

Description: Retrieves the color value stored in the variant.

◆ GetDouble()

double CFxVariant::GetDouble ( ) const

Description: Retrieves the double value stored in the variant.

◆ GetId()

const OdDbObjectId & CFxVariant::GetId ( ) const

Description: Retrieves the database object ID value stored in the variant.

◆ GetIdDescription()

static void CFxVariant::GetIdDescription ( OdDbObjectId id,
CFxString & sPath,
CFxString & sObjectName )
staticprotected

Description: Retrieves the description of an OdDbObjectId Arguments:

Parameters
idThe OdDbObjectId to get the description for.
sPathReference to a CFxString to store the description of the object.
sObjectNameReference to a CFxString to store the name of the object.

◆ GetInt32()

OdInt32 CFxVariant::GetInt32 ( ) const

Description: Retrieves the integer value stored in the variant.

◆ GetPoint2d()

const OdGePoint2d & CFxVariant::GetPoint2d ( ) const

Description: Retrieves the 2D point value stored in the variant.

◆ GetPoint3d()

const OdGePoint3d & CFxVariant::GetPoint3d ( ) const

Description: Retrieves the 3D point value stored in the variant.

◆ GetString()

CFxString CFxVariant::GetString ( ) const

Description: Retrieves the string representation of the variant.

◆ GetTransparency()

const OdCmTransparency & CFxVariant::GetTransparency ( ) const

Description: Retrieves the transparency value stored in the variant.

◆ GetType()

Type CFxVariant::GetType ( ) const

Description: Gets the type of the variant. Return Value: The type of the variant as a CFxVariant::Type enum.

◆ GetVoid()

void * CFxVariant::GetVoid ( int * size = 0) const

Description: Retrieves a void pointer from the CFxVariant object Arguments:

Parameters
sizePointer to an integer where the size of the void data will be stored. Return Value: A void pointer to the data if the type is eVoid, otherwise returns 0.

◆ IsNull()

bool CFxVariant::IsNull ( ) const

Description: Checks if the variant is null. Return Value: True if the variant is null, false otherwise.

◆ Load()

void CFxVariant::Load ( QByteArray & data,
CFxDocument * pContext )

Description: Loads the variant data from a QByteArray. Arguments:

Parameters
dataThe QByteArray containing the data to load.
pContextThe context document used during loading.

◆ operator+=()

const CFxVariant & CFxVariant::operator+= ( const CFxVariant & v)

Description: Adds the given CFxVariant to the current CFxVariant. Arguments:

Parameters
vThe CFxVariant to be added. Return Value: A reference to the current CFxVariant after addition.

◆ ResolvePath()

static OdDbObjectId CFxVariant::ResolvePath ( OdDbDictionaryPtr pRootDict,
const CFxString & sPath,
const CFxString & sObjectName )
staticprotected

Description: Resolves the path to a specific object within a dictionary. Arguments:

Parameters
pRootDictThe root dictionary to start the search from.
sPathThe path to resolve within the dictionary.
sObjectNameThe name of the object to find. Return Value: The object ID of the resolved path, or OdDbObjectId::kNull if not found.

◆ Save()

QByteArray CFxVariant::Save ( ) const

Description: Saves the variant data to a QByteArray. Return Value: A QByteArray containing the saved variant data.

◆ SetValue()

void CFxVariant::SetValue ( const CFxVariant & value)

Description: Sets the value of the CFxVariant Arguments:

Parameters
valueThe CFxVariant object to set as the value.

◆ UseUnitsConversion()

bool CFxVariant::UseUnitsConversion ( ) const

Description: Determines if unit conversion is used. Return Value: True if unit conversion is used, false otherwise.

Friends And Related Symbol Documentation

◆ operator!=

DDKERNEL_API bool operator!= ( const CFxVariant & v1,
const CFxVariant & v2 )
friend

Description: Compares two CFxVariant objects for inequality. Arguments:

Parameters
v1The first CFxVariant object to compare.
v2The second CFxVariant object to compare. Return Value: Returns true if the two CFxVariant objects are not equal, otherwise false.

◆ operator==

DDKERNEL_API bool operator== ( const CFxVariant & v1,
const CFxVariant & v2 )
friend

Description: Compares two CFxVariant objects for equality. Arguments:

Parameters
v1The first CFxVariant object to compare.
v2The second CFxVariant object to compare. Return Value: Returns true if the two CFxVariant objects are equal, otherwise false.

Member Data Documentation

◆ kNull

CFxVariant CFxVariant::kNull
static

Description: Represents a null variant.

Definition at line 243 of file FxVariant.h.

◆ m_bUseUnitsConversion

bool CFxVariant::m_bUseUnitsConversion
protected

Description: Indicates whether units conversion is used or not

Definition at line 552 of file FxVariant.h.

◆ m_Type

Type CFxVariant::m_Type
protected

Description: Represents the type of the variant.

Definition at line 547 of file FxVariant.h.

◆ varies

const char* CFxVariant::varies
static

Description: Represents a constant character pointer to a string "varies".

Definition at line 239 of file FxVariant.h.


The documentation for this class was generated from the following file: