Hide menu

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)
 Constructor. More...
 
 ModelData_Appearance (ImplType *theImpl)
 Constructor (reserved for internal use).
 
 ModelData_Appearance (const ModelData_Color &theGenericColor)
 Constructor. More...
 
 ModelData_Appearance (const ModelData_ColorObject &theGenericColor)
 Constructor. More...
 
 ModelData_Appearance (const ModelData_Material &theMaterial)
 Constructor. More...
 
 ModelData_Appearance (const ModelData_MaterialObject &theMaterial)
 Constructor. More...
 
void Set (const ModelData_Color &theGenericColor)
 Sets the color of appearance. More...
 
void Set (const ModelData_ColorObject &theGenericColor)
 Sets the color of appearance. More...
 
ModelData_ColorObject GenericColor () const
 Returns the color of appearance.
 
void Set (const ModelData_Material &theMaterial)
 Sets the material of appearance. More...
 
void Set (const ModelData_MaterialObject &theMaterial)
 Sets the material of appearance. More...
 
ModelData_MaterialObject Material () const
 Returns the material of appearance.
 
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)
 Sets the line properties of appearance.
 
const ModelData_LinePropertiesLineProperties () const
 Retuns the line properties of appearance. More...
 
void SetTextureSet (const ModelData_TextureSet &theTextureSet)
 Sets the texture set of appearance.
 
void Add (const ModelData_Texture &theTexture)
 Adds a texture to the texture set of appearance.
 
ModelData_TextureSet TextureSet () const
 Retuns the texture set of appearance.
 
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
 
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.
 

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.

The possible types of visual styles that an appearance can contain:

  • color;
  • material;
  • line properties;
  • texture set.
Examples
exploring/appearance/main.cxx, modeling/assembly/main.cxx, modeling/metadata/main.cxx, and visualization/qtquick_qml/pmiviewer/main.cxx.

Constructor & Destructor Documentation

◆ ModelData_Appearance() [1/6]

cadex::ModelData_Appearance::ModelData_Appearance ( )

Constructor.

Creates a null object (see IsNull()).

◆ ModelData_Appearance() [2/6]

cadex::ModelData_Appearance::ModelData_Appearance ( initialized  )

Constructor.

Creates a non-null object (see IsNull()) but without any style items.

◆ ModelData_Appearance() [3/6]

cadex::ModelData_Appearance::ModelData_Appearance ( const ModelData_Color theGenericColor)

Constructor.

Creates an appearance with the supplied color as the sole style item.

◆ ModelData_Appearance() [4/6]

cadex::ModelData_Appearance::ModelData_Appearance ( const ModelData_ColorObject &  theGenericColor)

Constructor.

Creates an appearance with the supplied color as the sole style item.

◆ ModelData_Appearance() [5/6]

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

Constructor.

Creates an appearance with the supplied material as the sole style item.

◆ ModelData_Appearance() [6/6]

cadex::ModelData_Appearance::ModelData_Appearance ( const ModelData_MaterialObject &  theMaterial)

Constructor.

Creates an appearance with the supplied material as the sole style item.

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.

◆ LineProperties()

const ModelData_LineProperties & cadex::ModelData_Appearance::LineProperties ( ) const

Retuns the line properties of appearance.

Using the retrieved value when HasLineProperties() returns false is undefined behavior.

◆ Set() [1/4]

void cadex::ModelData_Appearance::Set ( const ModelData_Color theGenericColor)

Sets the color of appearance.

If this object has color and theGenericColor is null the color is unset.

◆ Set() [2/4]

void cadex::ModelData_Appearance::Set ( const ModelData_ColorObject &  theGenericColor)

Sets the color of appearance.

If this object has color and theGenericColor is null the color is unset.

◆ Set() [3/4]

void cadex::ModelData_Appearance::Set ( const ModelData_Material theMaterial)

Sets the material of appearance.

If this object has material and theGenericMaterial is null the material is unset.

◆ Set() [4/4]

void cadex::ModelData_Appearance::Set ( const ModelData_MaterialObject &  theMaterial)

Sets the material of appearance.

If this object has material and theGenericMaterial is null the material is unset.

◆ 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. In both cases the function returns true.

Otherwise returns false.

◆ 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 material's colors will have default values. In both cases the function returns true.

Otherwise returns false.