CAD Exchanger SDK
cadex::ModelData_Appearance Class Reference

Provides an interface to appearance which is a collection of visual styles. More...

Inheritance diagram for cadex::ModelData_Appearance:
cadex::ModelData_BaseObject

Public Types

typedef cadex::internal::ModelData_AppearanceImpl ImplType
 
- Public Types inherited from cadex::ModelData_BaseObject
typedef int IdType
 Defines a type identifier.
 

Public Member Functions

 ModelData_Appearance ()
 Constructor. More...
 
 ModelData_Appearance (initialized)
 
 ModelData_Appearance (ImplType *theImpl)
 Constructor (reserved for internal use).
 
 ModelData_Appearance (const ModelData_Color &theGenericColor)
 
 ModelData_Appearance (const ModelData_ColorObject &theGenericColor)
 
 ModelData_Appearance (const ModelData_Material &theMaterial)
 
 ModelData_Appearance (const ModelData_MaterialObject &theMaterial)
 
void Set (const ModelData_Color &theGenericColor)
 
void Set (const ModelData_ColorObject &theGenericColor)
 
ModelData_ColorObject GenericColor () const
 
void Set (const ModelData_Material &theMaterial)
 
void Set (const ModelData_MaterialObject &theMaterial)
 
ModelData_MaterialObject Material () const
 
bool ToColor (ModelData_Color &theColor) const
 Returns true if there is any style item which allows to retrieve a color. More...
 
bool ToMaterial (ModelData_Material &theMaterial) const
 Returns true if there is any style item which allows to convert this appearance to a material. More...
 
bool HasLineProperties () const
 Returns true if the line properties are defined.
 
void Set (const ModelData_LineProperties &theValue)
 
const ModelData_LinePropertiesLineProperties () const
 
void CopyAndOverrideWith (const ModelData_Appearance &theOther)
 Copies internal contents and overrides with attributes in another appearance. More...
 
void CopyAndCombineWith (const ModelData_Appearance &theOther)
 Copies internal contents and combines with set attributes from another appearance. More...
 
- Public Member Functions inherited from cadex::ModelData_BaseObject
 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
 Returns an object name. More...
 
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).
 

Static Public Member Functions

static IdType GetTypeId ()
 

Additional Inherited Members

- Protected Member Functions inherited from cadex::ModelData_BaseObject
 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

Provides an interface to appearance which is a collection of visual styles.

Examples:
modelexplorer/main.cxx.

Constructor & Destructor Documentation

◆ ModelData_Appearance()

cadex::ModelData_Appearance::ModelData_Appearance ( )

Constructor.

If theToInitialize is false then creates a null object (see IsNull()).

Member Function Documentation

◆ CopyAndCombineWith()

void cadex::ModelData_Appearance::CopyAndCombineWith ( const ModelData_Appearance theOther)

Copies internal contents and combines with set attributes from another appearance.

Makes a deep copy so that any other object referring to this will not be modified. Copies attributes (material, generic color, line properties) set in the theOther to override respective attributes in this object. If the respective attribute is not set in theOther then retains a current value.

See also
CopyAndOverrideWith().

◆ CopyAndOverrideWith()

void cadex::ModelData_Appearance::CopyAndOverrideWith ( const ModelData_Appearance theOther)

Copies internal contents and overrides with attributes in another appearance.

Makes a deep copy so that any other object referring to this will not be modified and assigns all attributes from theOther.

See also
CopyAndCombineWith().

◆ GetTypeId()

ModelData_Appearance::IdType cadex::ModelData_Appearance::GetTypeId ( )
static

Implementation details: Does not provide extra data objects. Uses references with id's of respective styles (e.g. ModelData_ColorObject, ModelData_MaterialObject) to find objects.

If sets the style which already existed in the appearance attribute then the previously used style can become orphan.

◆ ToColor()

bool cadex::ModelData_Appearance::ToColor ( ModelData_Color theColor) const

Returns true if there is any style item which allows to retrieve a color.

If the attribute has GenericColor() then theColor will be assigned its value. Otherwise, if the attribute has Material() then theColor will be assigned its diffuse color value.

Otherwise returns false.

Examples:
modelexplorer/main.cxx.

◆ ToMaterial()

bool cadex::ModelData_Appearance::ToMaterial ( ModelData_Material theMaterial) const

Returns true if there is any style item which allows to convert this appearance to a material.

If there is a Material() then theMaterial will be assigned its value. If there is a GenericColor() then theMaterial will have diffuse color of that value and other default colors will have default values.

Otherwise returns false.