mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0028738: Data Exchange, XCAFPrs_Style - add transparency property
Use Quantity_ColorRGBA as surface color to store a transparency in XCAFPrs_Style.
This commit is contained in:
@@ -85,6 +85,9 @@ public:
|
||||
//! Modifies the color of the interior of the face
|
||||
void SetInteriorColor (const Quantity_Color& theColor) { myInteriorColor.SetRGB (theColor); }
|
||||
|
||||
//! Modifies the color of the interior of the face
|
||||
void SetInteriorColor (const Quantity_ColorRGBA& theColor) { myInteriorColor = theColor; }
|
||||
|
||||
//! Return back interior color.
|
||||
const Quantity_Color& BackInteriorColor() const { return myBackInteriorColor.GetRGB(); }
|
||||
|
||||
@@ -94,6 +97,9 @@ public:
|
||||
//! Modifies the color of the interior of the back face
|
||||
void SetBackInteriorColor (const Quantity_Color& theColor) { myBackInteriorColor.SetRGB (theColor); }
|
||||
|
||||
//! Modifies the color of the interior of the back face
|
||||
void SetBackInteriorColor (const Quantity_ColorRGBA& theColor) { myBackInteriorColor = theColor; }
|
||||
|
||||
//! Returns the surface material of external faces
|
||||
const Graphic3d_MaterialAspect& FrontMaterial() const { return myFrontMaterial; }
|
||||
|
||||
|
@@ -92,9 +92,12 @@ public:
|
||||
//! Modifies the ambient and diffuse color of the surface.
|
||||
Standard_EXPORT void SetColor (const Quantity_Color& theColor);
|
||||
|
||||
//! Returns the transparency coefficient of the surface.
|
||||
//! Returns the transparency coefficient of the surface (1.0 - Alpha); 0.0 means opaque.
|
||||
Standard_ShortReal Transparency() const { return myTransparencyCoef; }
|
||||
|
||||
//! Returns the alpha coefficient of the surface (1.0 - Transparency); 1.0 means opaque.
|
||||
Standard_ShortReal Alpha() const { return 1.0f - myTransparencyCoef; }
|
||||
|
||||
//! Modifies the transparency coefficient of the surface, where 0 is opaque and 1 is fully 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.
|
||||
@@ -102,6 +105,9 @@ public:
|
||||
//! Warning: Raises MaterialDefinitionError if given value is a negative value or greater than 1.0.
|
||||
Standard_EXPORT void SetTransparency (const Standard_ShortReal theValue);
|
||||
|
||||
//! Modifies the alpha coefficient of the surface, where 1.0 is opaque and 0.0 is fully transparent.
|
||||
void SetAlpha (Standard_ShortReal theValue) { SetTransparency (1.0f - theValue); }
|
||||
|
||||
//! Returns the ambient color of the surface.
|
||||
const Quantity_Color& AmbientColor() const { return myColors[Graphic3d_TOR_AMBIENT]; }
|
||||
|
||||
|
Reference in New Issue
Block a user