42cf5bc1 |
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 | |
42cf5bc1 |
20 | #include <Aspect_TypeOfFacingModel.hxx> |
4e1bc39a |
21 | #include <Graphic3d_AspectFillArea3d.hxx> |
22 | #include <Graphic3d_MaterialAspect.hxx> |
23 | #include <Prs3d_BasicAspect.hxx> |
42cf5bc1 |
24 | |
25 | //! A framework to define the display of shading. |
26 | //! The attributes which make up this definition include: |
27 | //! - fill aspect |
28 | //! - color, and |
29 | //! - material |
30 | class Prs3d_ShadingAspect : public Prs3d_BasicAspect |
31 | { |
4e1bc39a |
32 | DEFINE_STANDARD_RTTIEXT(Prs3d_ShadingAspect, Prs3d_BasicAspect) |
42cf5bc1 |
33 | public: |
34 | |
42cf5bc1 |
35 | //! Constructs an empty framework to display shading. |
36 | Standard_EXPORT Prs3d_ShadingAspect(); |
4e1bc39a |
37 | |
38 | //! Constructor with initialization. |
39 | Prs3d_ShadingAspect (const Handle(Graphic3d_AspectFillArea3d)& theAspect) : myAspect (theAspect) {} |
42cf5bc1 |
40 | |
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); |
43 | |
44 | //! Change the polygons interior color and material ambient color. |
4e1bc39a |
45 | void SetColor (const Quantity_NameOfColor theColor, |
46 | const Aspect_TypeOfFacingModel theModel = Aspect_TOFM_BOTH_SIDE) |
47 | { |
48 | SetColor (Quantity_Color (theColor), theModel); |
49 | } |
50 | |
42cf5bc1 |
51 | //! Change the polygons material aspect. |
52 | Standard_EXPORT void SetMaterial (const Graphic3d_MaterialAspect& aMaterial, const Aspect_TypeOfFacingModel aModel = Aspect_TOFM_BOTH_SIDE); |
4e1bc39a |
53 | |
54 | void SetMaterial (const Graphic3d_NameOfMaterial theMaterial, const Aspect_TypeOfFacingModel theModel = Aspect_TOFM_BOTH_SIDE) |
55 | { |
56 | SetMaterial (Graphic3d_MaterialAspect (theMaterial), theModel); |
57 | } |
42cf5bc1 |
58 | |
59 | //! Change the polygons transparency value. |
60 | //! Warning : aValue must be in the range 0,1. 0 is the default (NO transparent) |
61 | Standard_EXPORT void SetTransparency (const Standard_Real aValue, const Aspect_TypeOfFacingModel aModel = Aspect_TOFM_BOTH_SIDE); |
62 | |
63 | //! Returns the polygons color. |
64 | Standard_EXPORT const Quantity_Color& Color (const Aspect_TypeOfFacingModel aModel = Aspect_TOFM_FRONT_SIDE) const; |
65 | |
66 | //! Returns the polygons material aspect. |
67 | Standard_EXPORT const Graphic3d_MaterialAspect& Material (const Aspect_TypeOfFacingModel aModel = Aspect_TOFM_FRONT_SIDE) const; |
68 | |
69 | //! Returns the polygons transparency value. |
70 | Standard_EXPORT Standard_Real Transparency (const Aspect_TypeOfFacingModel aModel = Aspect_TOFM_FRONT_SIDE) const; |
71 | |
72 | //! Returns the polygons aspect properties. |
4e1bc39a |
73 | const Handle(Graphic3d_AspectFillArea3d)& Aspect() const { return myAspect; } |
42cf5bc1 |
74 | |
4e1bc39a |
75 | void SetAspect (const Handle(Graphic3d_AspectFillArea3d)& theAspect) { myAspect = theAspect; } |
42cf5bc1 |
76 | |
77 | protected: |
78 | |
42cf5bc1 |
79 | Handle(Graphic3d_AspectFillArea3d) myAspect; |
80 | |
42cf5bc1 |
81 | }; |
82 | |
4e1bc39a |
83 | DEFINE_STANDARD_HANDLE(Prs3d_ShadingAspect, Prs3d_BasicAspect) |
42cf5bc1 |
84 | |
85 | #endif // _Prs3d_ShadingAspect_HeaderFile |