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 <Standard.hxx>
21 #include <Standard_Type.hxx>
23 #include <Prs3d_BasicAspect.hxx>
24 #include <Aspect_TypeOfFacingModel.hxx>
25 #include <Quantity_NameOfColor.hxx>
26 #include <Graphic3d_NameOfMaterial.hxx>
27 #include <Standard_Real.hxx>
28 class Graphic3d_AspectFillArea3d;
30 class Graphic3d_MaterialAspect;
33 class Prs3d_ShadingAspect;
34 DEFINE_STANDARD_HANDLE(Prs3d_ShadingAspect, Prs3d_BasicAspect)
36 //! A framework to define the display of shading.
37 //! The attributes which make up this definition include:
41 class Prs3d_ShadingAspect : public Prs3d_BasicAspect
47 //! Constructs an empty framework to display shading.
48 Standard_EXPORT Prs3d_ShadingAspect();
50 Standard_EXPORT Prs3d_ShadingAspect(const Handle(Graphic3d_AspectFillArea3d)& theAspect);
52 //! Change the polygons interior color and material ambient color.
53 Standard_EXPORT void SetColor (const Quantity_Color& aColor, const Aspect_TypeOfFacingModel aModel = Aspect_TOFM_BOTH_SIDE);
55 //! Change the polygons interior color and material ambient color.
56 Standard_EXPORT void SetColor (const Quantity_NameOfColor aColor, const Aspect_TypeOfFacingModel aModel = Aspect_TOFM_BOTH_SIDE);
58 //! Change the polygons material aspect.
59 Standard_EXPORT void SetMaterial (const Graphic3d_MaterialAspect& aMaterial, const Aspect_TypeOfFacingModel aModel = Aspect_TOFM_BOTH_SIDE);
61 Standard_EXPORT void SetMaterial (const Graphic3d_NameOfMaterial aMaterial, const Aspect_TypeOfFacingModel aModel = Aspect_TOFM_BOTH_SIDE);
63 //! Change the polygons transparency value.
64 //! Warning : aValue must be in the range 0,1. 0 is the default (NO transparent)
65 Standard_EXPORT void SetTransparency (const Standard_Real aValue, const Aspect_TypeOfFacingModel aModel = Aspect_TOFM_BOTH_SIDE);
67 //! Returns the polygons color.
68 Standard_EXPORT const Quantity_Color& Color (const Aspect_TypeOfFacingModel aModel = Aspect_TOFM_FRONT_SIDE) const;
70 //! Returns the polygons material aspect.
71 Standard_EXPORT const Graphic3d_MaterialAspect& Material (const Aspect_TypeOfFacingModel aModel = Aspect_TOFM_FRONT_SIDE) const;
73 //! Returns the polygons transparency value.
74 Standard_EXPORT Standard_Real Transparency (const Aspect_TypeOfFacingModel aModel = Aspect_TOFM_FRONT_SIDE) const;
76 //! Returns the polygons aspect properties.
77 Standard_EXPORT Handle(Graphic3d_AspectFillArea3d) Aspect() const;
79 Standard_EXPORT void SetAspect (const Handle(Graphic3d_AspectFillArea3d)& theAspect);
84 DEFINE_STANDARD_RTTIEXT(Prs3d_ShadingAspect,Prs3d_BasicAspect)
94 Handle(Graphic3d_AspectFillArea3d) myAspect;
105 #endif // _Prs3d_ShadingAspect_HeaderFile