1 // Created on: 1993-04-26
2 // Created by: Jean-Louis Frenkel
3 // Copyright (c) 1993-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _Prs3d_ShadingAspect_HeaderFile
18 #define _Prs3d_ShadingAspect_HeaderFile
20 #include <Aspect_TypeOfFacingModel.hxx>
21 #include <Graphic3d_AspectFillArea3d.hxx>
22 #include <Graphic3d_MaterialAspect.hxx>
23 #include <Prs3d_BasicAspect.hxx>
25 //! A framework to define the display of shading.
26 //! The attributes which make up this definition include:
30 class Prs3d_ShadingAspect : public Prs3d_BasicAspect
32 DEFINE_STANDARD_RTTIEXT(Prs3d_ShadingAspect, Prs3d_BasicAspect)
35 //! Constructs an empty framework to display shading.
36 Standard_EXPORT Prs3d_ShadingAspect();
38 //! Constructor with initialization.
39 Prs3d_ShadingAspect (const Handle(Graphic3d_AspectFillArea3d)& theAspect) : myAspect (theAspect) {}
41 //! Change the polygons interior color and material ambient color.
42 Standard_EXPORT void SetColor (const Quantity_Color& aColor, const Aspect_TypeOfFacingModel aModel = Aspect_TOFM_BOTH_SIDE);
44 //! Change the polygons material aspect.
45 Standard_EXPORT void SetMaterial (const Graphic3d_MaterialAspect& aMaterial, const Aspect_TypeOfFacingModel aModel = Aspect_TOFM_BOTH_SIDE);
47 //! Change the polygons transparency value.
48 //! Warning : aValue must be in the range 0,1. 0 is the default (NO transparent)
49 Standard_EXPORT void SetTransparency (const Standard_Real aValue, const Aspect_TypeOfFacingModel aModel = Aspect_TOFM_BOTH_SIDE);
51 //! Returns the polygons color.
52 Standard_EXPORT const Quantity_Color& Color (const Aspect_TypeOfFacingModel aModel = Aspect_TOFM_FRONT_SIDE) const;
54 //! Returns the polygons material aspect.
55 Standard_EXPORT const Graphic3d_MaterialAspect& Material (const Aspect_TypeOfFacingModel aModel = Aspect_TOFM_FRONT_SIDE) const;
57 //! Returns the polygons transparency value.
58 Standard_EXPORT Standard_Real Transparency (const Aspect_TypeOfFacingModel aModel = Aspect_TOFM_FRONT_SIDE) const;
60 //! Returns the polygons aspect properties.
61 const Handle(Graphic3d_AspectFillArea3d)& Aspect() const { return myAspect; }
63 void SetAspect (const Handle(Graphic3d_AspectFillArea3d)& theAspect) { myAspect = theAspect; }
67 Handle(Graphic3d_AspectFillArea3d) myAspect;
71 DEFINE_STANDARD_HANDLE(Prs3d_ShadingAspect, Prs3d_BasicAspect)
73 #endif // _Prs3d_ShadingAspect_HeaderFile