// This file is generated by WOK (CPPExt). // Please do not edit this file; modify original file instead. // The copyright and license terms as defined for the original file apply to // this header file considered to be the "object code" form of the original source. #ifndef _Graphic3d_MaterialAspect_HeaderFile #define _Graphic3d_MaterialAspect_HeaderFile #ifndef _Standard_HeaderFile #include #endif #ifndef _Standard_Macro_HeaderFile #include #endif #ifndef _Standard_ShortReal_HeaderFile #include #endif #ifndef _Quantity_Color_HeaderFile #include #endif #ifndef _Standard_Boolean_HeaderFile #include #endif #ifndef _Graphic3d_TypeOfMaterial_HeaderFile #include #endif #ifndef _Graphic3d_NameOfMaterial_HeaderFile #include #endif #ifndef _TCollection_AsciiString_HeaderFile #include #endif #ifndef _Standard_Real_HeaderFile #include #endif #ifndef _Graphic3d_TypeOfReflection_HeaderFile #include #endif #ifndef _Standard_CString_HeaderFile #include #endif #ifndef _Standard_Integer_HeaderFile #include #endif class Graphic3d_MaterialDefinitionError; class Standard_OutOfRange; class Quantity_Color; //! This class allows the definition of the type of a surface.
//! Keywords: Material, FillArea, Shininess, Ambient, Color, Diffuse,
//! Specular, Transparency, Emissive, ReflectionMode,
//! BackFace, FrontFace, Reflection, Absorbtion
class Graphic3d_MaterialAspect { public: void* operator new(size_t,void* anAddress) { return anAddress; } void* operator new(size_t size) { return Standard::Allocate(size); } void operator delete(void *anAddress) { if (anAddress) Standard::Free((Standard_Address&)anAddress); } //! Creates a material from default values.
Standard_EXPORT Graphic3d_MaterialAspect(); //! Creates a generic material calls
Standard_EXPORT Graphic3d_MaterialAspect(const Graphic3d_NameOfMaterial AName); //! Increases or decreases the luminosity of .
//! is a signed percentage.
Standard_EXPORT void IncreaseShine(const Standard_Real ADelta) ; //! Modifies the reflection properties of the surface.
//! Category: Methods to modify the class definition
//! Warning: Raises MaterialDefinitionError if is
//! a negative value or greater than 1.0.
Standard_EXPORT void SetAmbient(const Standard_Real AValue) ; //! Modifies the reflection properties of the surface.
//! Category: Methods to modify the class definition
//! Warning: Raises MaterialDefinitionError if is a
//! negative value or greater than 1.0.
Standard_EXPORT void SetDiffuse(const Standard_Real AValue) ; //! Modifies the reflection properties of the surface.
//! Category: Methods to modify the class definition
//! Warning: Raises MaterialDefinitionError if is a
//! negative value or greater than 1.0.
Standard_EXPORT void SetEmissive(const Standard_Real AValue) ; //! Modifies the luminosity of the surface.
//! Category: Methods to modify the class definition
//! Warning: Raises MaterialDefinitionError if is a
//! negative value or greater than 1.0.
Standard_EXPORT void SetShininess(const Standard_Real AValue) ; //! Modifies the reflection properties of the surface.
//! Category: Methods to modify the class definition
//! Warning: Raises MaterialDefinitionError if is a
//! negative value or greater than 1.0.
Standard_EXPORT void SetSpecular(const Standard_Real AValue) ; //! Modifies the transparency coefficient of the surface.
//! = 0. opaque. (default)
//! = 1. transparent.
//! Transparency is applicable to materials that have at least
//! one of reflection modes (ambient, diffuse, specular or emissive)
//! enabled. See also SetReflectionModeOn() and SetReflectionModeOff() methods.
//!
//! NOTE: In order for transparency specified through this method to
//! take effect, it is necessary to enable transparency
//! in the viewer. This can be done either directly -
//! see Visual3d_ViewManager::SetTransparency(Standard_Boolean),
//! or indirectly - by calling AIS_InteractiveObject::SetTransparency()
//! before an object is added to an interactive context, or by
//! calling AIS_InteractiveContext::SetTransparency() for a given
//! interactive object already displayed.
//! Category: Methods to modify the class definition
//! Warning: Raises MaterialDefinitionError if is a
//! negative value or greater than 1.0.
Standard_EXPORT void SetTransparency(const Standard_Real AValue) ; //! Modifies the ambient colour of the surface.
//! Category: Methods to modify the class definition
Standard_EXPORT void SetColor(const Quantity_Color& AColor) ; //! Modifies the ambient colour of the surface.
Standard_EXPORT void SetAmbientColor(const Quantity_Color& AColor) ; //! Modifies the difuse colour of the surface.
Standard_EXPORT void SetDiffuseColor(const Quantity_Color& AColor) ; //! Modifies the specular colour of the surface.
Standard_EXPORT void SetSpecularColor(const Quantity_Color& AColor) ; //! Modifies the emissive colour of the surface.
Standard_EXPORT void SetEmissiveColor(const Quantity_Color& AColor) ; //! Activates the reflective properties of the surface .
Standard_EXPORT void SetReflectionModeOn(const Graphic3d_TypeOfReflection AType) ; //! Deactivates the reflective properties of
//! the surface .
Standard_EXPORT void SetReflectionModeOff(const Graphic3d_TypeOfReflection AType) ; //! Set MyMaterialType to the value of parameter
Standard_EXPORT void SetMaterialType(const Graphic3d_TypeOfMaterial AType) ; //! The current matarial become a "UserDefined" material.
//! Set the name of the "UserDefined" material.
Standard_EXPORT void SetMaterialName(const Standard_CString AName) ; Standard_EXPORT void SetEnvReflexion(const Standard_ShortReal AValue) ; //! Resets the material with the original values according to
//! the material name but leave the current color values untouched
//! for the material of type ASPECT.
Standard_EXPORT void Reset() ; //! Returns the ambient colour of the surface.
Standard_EXPORT Quantity_Color Color() const; //! Returns the ambient colour of the surface.
Standard_EXPORT Quantity_Color AmbientColor() const; //! Returns the diffuse colour of the surface.
Standard_EXPORT Quantity_Color DiffuseColor() const; //! Returns the specular colour of the surface.
Standard_EXPORT Quantity_Color SpecularColor() const; //! Returns the emissive colour of the surface.
Standard_EXPORT Quantity_Color EmissiveColor() const; //! Returns the reflection properties of the surface.
Standard_EXPORT Standard_Real Ambient() const; //! Returns the reflection properties of the surface.
Standard_EXPORT Standard_Real Diffuse() const; //! Returns the reflection properties of the surface.
Standard_EXPORT Standard_Real Specular() const; //! Returns the transparency coefficient of the surface.
Standard_EXPORT Standard_Real Transparency() const; //! Returns the emissive coefficient of the surface.
Standard_EXPORT Standard_Real Emissive() const; //! Returns the luminosity of the surface.
Standard_EXPORT Standard_Real Shininess() const; //! Returns Standard_True if the reflection mode is active,
//! Standard_False otherwise.
Standard_EXPORT Standard_Boolean ReflectionMode(const Graphic3d_TypeOfReflection AType) const; //! Returns Standard_True if MyMaterialType equal the parameter AType,
//! Standard_False otherwise.
Standard_EXPORT Standard_Boolean MaterialType(const Graphic3d_TypeOfMaterial AType) const; Standard_EXPORT Standard_ShortReal EnvReflexion() const; //! Returns the material name.
Standard_EXPORT Graphic3d_NameOfMaterial Name() const; //! Returns Standard_True if the materials and
//! are different.
Standard_EXPORT Standard_Boolean IsDifferent(const Graphic3d_MaterialAspect& Other) const; Standard_Boolean operator !=(const Graphic3d_MaterialAspect& Other) const { return IsDifferent(Other); } //! Returns Standard_True if the materials and
//! are identical.
Standard_EXPORT Standard_Boolean IsEqual(const Graphic3d_MaterialAspect& Other) const; Standard_Boolean operator ==(const Graphic3d_MaterialAspect& Other) const { return IsEqual(Other); } //! Returns the number of predefined textures.
Standard_EXPORT static Standard_Integer NumberOfMaterials() ; //! Returns the name of the predefined material of rank
//! Trigger: when is < 1 or > NumberOfMaterials.
Standard_EXPORT static Standard_CString MaterialName(const Standard_Integer aRank) ; //! Returns the name of this material
Standard_EXPORT Standard_CString MaterialName() const; //! Returns the type of the predefined material of rank
//! Trigger: when is < 1 or > NumberOfMaterials.
Standard_EXPORT static Graphic3d_TypeOfMaterial MaterialType(const Standard_Integer aRank) ; protected: private: Standard_EXPORT void Init(const Graphic3d_NameOfMaterial AName) ; Standard_ShortReal MyDiffuseCoef; Quantity_Color MyDiffuseColor; Standard_Boolean MyDiffuseActivity; Standard_ShortReal MyAmbientCoef; Quantity_Color MyAmbientColor; Standard_Boolean MyAmbientActivity; Standard_ShortReal MySpecularCoef; Quantity_Color MySpecularColor; Standard_Boolean MySpecularActivity; Standard_ShortReal MyEmissiveCoef; Quantity_Color MyEmissiveColor; Standard_Boolean MyEmissiveActivity; Standard_ShortReal MyTransparencyCoef; Standard_ShortReal MyShininess; Standard_ShortReal MyEnvReflexion; Graphic3d_TypeOfMaterial MyMaterialType; Graphic3d_NameOfMaterial MyMaterialName; Graphic3d_NameOfMaterial MyRequestedMaterialName; TCollection_AsciiString MyStringName; }; // other Inline functions and methods (like "C++: function call" methods) #endif