Hide menu
cadex::ModelData_BaseObject Class Reference

Base class for all objects that have private implementation (pimpl) back-end. More...

Inheritance diagram for cadex::ModelData_BaseObject:
cadex::ModelData_Appearance cadex::ModelData_Drawing cadex::ModelData_DrawingElement cadex::ModelData_DrawingLayer cadex::ModelData_DrawingSheet cadex::ModelData_DrawingView cadex::ModelData_Layer cadex::ModelData_PixMap cadex::ModelData_PMICamera cadex::ModelData_PMIData cadex::ModelData_PMIGraphicalElement cadex::ModelData_PMIPlane cadex::ModelData_PMISavedView cadex::ModelData_PMISemanticAttribute cadex::ModelData_PMISemanticElement cadex::ModelData_PMISemanticElementComponent cadex::ModelData_PMITable cadex::ModelData_PolyShape cadex::ModelData_PolyShape2d cadex::ModelData_PropertyTable cadex::ModelData_Representation cadex::ModelData_SceneGraphElement cadex::ModelData_Texture cadex::ModelData_TextureParameters cadex::ModelData_TextureSet

Public Types

typedef int IdType
 Defines a type identifier.

Public Member Functions

 ModelData_BaseObject ()
 Constructor. More...
IdType TypeId () const
 Returns an object type id. More...
template<typename T >
bool IsOfType () const
 Returns true if the object has a type T. More...
void SetName (const Base_UTF16String &theName)
 Sets an object name. More...
Base_UTF16String Name () const
void SetUuid (const Base_Uuid &theUuid)
Base_Uuid Uuid () const
void Nullify ()
 Resets reference to implementation object. More...
bool IsNull () const
 Returns true if the object is nullified. More...
 operator bool () const
 Casts the object to the bool type. More...
internal::ModelData_BaseObjectImpl * Impl () const
 Return a handle to backend (reserved for internal use).
const internal::Base_Handle & HImpl () const
template<typename T >
T * Impl () const
 Reserved for internal use.

Protected Member Functions

 ModelData_BaseObject (const internal::ModelData_BaseObjectImpl *theImpl)
 Constructor (reserved for internal use).
 ModelData_BaseObject (const internal::ModelData_BaseObjectImpl *theImpl, const Base_UTF16String &theName)
 Constructor (reserved for internal use).
template<typename T >
T * GetOrCreateImpl ()
 Reserved for internal use.

Detailed Description

Base class for all objects that have private implementation (pimpl) back-end.

ModelData_BaseObject is a root of a hierarchy where objects represent API.

Implementation objects (returned by Impl()) internally contains reference counter which is used to manage life span of the object.

Subclases of ModelData_BaseObject do not have own data fields. Data is stored inside the implementation object.

Constructor & Destructor Documentation

◆ ModelData_BaseObject()

cadex::ModelData_BaseObject::ModelData_BaseObject ( )


Creates a null object (see IsNull()).

Member Function Documentation

◆ IsNull()

bool cadex::ModelData_BaseObject::IsNull ( ) const

Returns true if the object is nullified.

See also
meshing/remeshing/main.cxx, and modeling/elementremoval/main.cxx.

◆ IsOfType()

template<typename T >
bool cadex::ModelData_BaseObject::IsOfType ( ) const

Returns true if the object has a type T.

Helper method which uses static method T::GetTypeId() to compare with value returned by virtual method TypeId().

advgeom/meshsimplify/main.cxx, exploring/bom/main.cxx, exploring/layers/main.cxx, exploring/polyrepresentation/main.cxx, and meshing/lods/main.cxx.

◆ Name()

Base_UTF16String cadex::ModelData_BaseObject::Name ( ) const

◆ Nullify()

void cadex::ModelData_BaseObject::Nullify ( )

Resets reference to implementation object.

Decrements reference counter and destroys the object if the counter reaches zero.

◆ operator bool()

cadex::ModelData_BaseObject::operator bool ( ) const

Casts the object to the bool type.

Returns IsNull().

◆ SetName()

void cadex::ModelData_BaseObject::SetName ( const Base_UTF16String theName)

Sets an object name.

Accepts a string as a unicode string. Must not be called on IsNull() object. Otherwise behavior is undefined.

See also

◆ SetUuid()

void cadex::ModelData_BaseObject::SetUuid ( const Base_Uuid theUuid)

Sets an object uuid. Must not be called on IsNull() object. Otherwise behavior is undefined.

See also

◆ TypeId()

ModelData_BaseObject::IdType cadex::ModelData_BaseObject::TypeId ( ) const

Returns an object type id.

Type id can be used for faster type check (comparing to dynamic_cast), for instance:

ModelData_Representation a

◆ Uuid()

Base_Uuid cadex::ModelData_BaseObject::Uuid ( ) const

Returns an object uuid. Returns nullable uuid if the object has no uuid (by default).

See also