Hide menu
Loading...
Searching...
No Matches
cadex::ModelData_BaseObject Class Reference

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

#include <cadex/ModelData_BaseObject.hxx>

Inheritance diagram for cadex::ModelData_BaseObject:
cadex::ModelData_Appearance cadex::ModelData_ConfigurationManager cadex::ModelData_Drawing cadex::ModelData_DrawingElement cadex::ModelData_DrawingLayer cadex::ModelData_DrawingSheet cadex::ModelData_DrawingView cadex::ModelData_Layer 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_PixMap cadex::ModelData_PolyShape cadex::ModelData_PolyShape2d cadex::ModelData_PropertyTable cadex::ModelData_Representation cadex::ModelData_SceneGraphElement cadex::ModelData_TextProperties cadex::ModelData_Texture cadex::ModelData_TextureParameters cadex::ModelData_TextureSet

Public Types

typedef int IdType
 Defines a type identifier.
 

Public Member Functions

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

Examples
exploring/bom/Program.cs, exploring/drawings/Program.cs, and exploring/drawings/main.cxx.

Constructor & Destructor Documentation

◆ ModelData_BaseObject()

cadex::ModelData_BaseObject::ModelData_BaseObject ( )
inline

Constructor.

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
Nullify().
Examples
meshing/remeshing/Program.cs, meshing/remeshing/main.cxx, and modeling/elementremoval/main.cxx.

◆ IsOfType()

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

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().

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

◆ Name()

◆ 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
inline

Casts the object to the bool type.

Returns IsNull().

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
Name().
Examples
modification/renaming/Program.cs, and modification/renaming/main.cxx.

◆ 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
Uuid()
Examples
MTKConverter/Program.cs.

◆ TypeId()

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

◆ 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
SetUuid()
Examples
MTKConverter/Program.cs, and MTKConverter/main.cxx.