0025180: Visualization - Homogeneous transformation API in TKV3d
[occt.git] / src / Prs3d / Prs3d_ShadingAspect.hxx
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
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
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.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _Prs3d_ShadingAspect_HeaderFile
18 #define _Prs3d_ShadingAspect_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
22
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;
29 class Quantity_Color;
30 class Graphic3d_MaterialAspect;
31
32
33 class Prs3d_ShadingAspect;
34 DEFINE_STANDARD_HANDLE(Prs3d_ShadingAspect, Prs3d_BasicAspect)
35
36 //! A framework to define the display of shading.
37 //! The attributes which make up this definition include:
38 //! -   fill aspect
39 //! -   color, and
40 //! -   material
41 class Prs3d_ShadingAspect : public Prs3d_BasicAspect
42 {
43
44 public:
45
46   
47   //! Constructs an empty framework to display shading.
48   Standard_EXPORT Prs3d_ShadingAspect();
49   
50   Standard_EXPORT Prs3d_ShadingAspect(const Handle(Graphic3d_AspectFillArea3d)& theAspect);
51   
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);
54   
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);
57   
58   //! Change the polygons material aspect.
59   Standard_EXPORT void SetMaterial (const Graphic3d_MaterialAspect& aMaterial, const Aspect_TypeOfFacingModel aModel = Aspect_TOFM_BOTH_SIDE);
60   
61   Standard_EXPORT void SetMaterial (const Graphic3d_NameOfMaterial aMaterial, const Aspect_TypeOfFacingModel aModel = Aspect_TOFM_BOTH_SIDE);
62   
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);
66   
67   //! Returns the polygons color.
68   Standard_EXPORT const Quantity_Color& Color (const Aspect_TypeOfFacingModel aModel = Aspect_TOFM_FRONT_SIDE) const;
69   
70   //! Returns the polygons material aspect.
71   Standard_EXPORT const Graphic3d_MaterialAspect& Material (const Aspect_TypeOfFacingModel aModel = Aspect_TOFM_FRONT_SIDE) const;
72   
73   //! Returns the polygons transparency value.
74   Standard_EXPORT Standard_Real Transparency (const Aspect_TypeOfFacingModel aModel = Aspect_TOFM_FRONT_SIDE) const;
75   
76   //! Returns the polygons aspect properties.
77   Standard_EXPORT Handle(Graphic3d_AspectFillArea3d) Aspect() const;
78   
79   Standard_EXPORT void SetAspect (const Handle(Graphic3d_AspectFillArea3d)& theAspect);
80
81
82
83
84   DEFINE_STANDARD_RTTIEXT(Prs3d_ShadingAspect,Prs3d_BasicAspect)
85
86 protected:
87
88
89
90
91 private:
92
93
94   Handle(Graphic3d_AspectFillArea3d) myAspect;
95
96
97 };
98
99
100
101
102
103
104
105 #endif // _Prs3d_ShadingAspect_HeaderFile