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); |
4e1bc39a |
43 | |
42cf5bc1 |
44 | //! Change the polygons material aspect. |
45 | Standard_EXPORT void SetMaterial (const Graphic3d_MaterialAspect& aMaterial, const Aspect_TypeOfFacingModel aModel = Aspect_TOFM_BOTH_SIDE); |
4e1bc39a |
46 | |
42cf5bc1 |
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); |
50 | |
51 | //! Returns the polygons color. |
52 | Standard_EXPORT const Quantity_Color& Color (const Aspect_TypeOfFacingModel aModel = Aspect_TOFM_FRONT_SIDE) const; |
53 | |
54 | //! Returns the polygons material aspect. |
55 | Standard_EXPORT const Graphic3d_MaterialAspect& Material (const Aspect_TypeOfFacingModel aModel = Aspect_TOFM_FRONT_SIDE) const; |
56 | |
57 | //! Returns the polygons transparency value. |
58 | Standard_EXPORT Standard_Real Transparency (const Aspect_TypeOfFacingModel aModel = Aspect_TOFM_FRONT_SIDE) const; |
59 | |
60 | //! Returns the polygons aspect properties. |
4e1bc39a |
61 | const Handle(Graphic3d_AspectFillArea3d)& Aspect() const { return myAspect; } |
42cf5bc1 |
62 | |
4e1bc39a |
63 | void SetAspect (const Handle(Graphic3d_AspectFillArea3d)& theAspect) { myAspect = theAspect; } |
42cf5bc1 |
64 | |
0904aa63 |
65 | //! Dumps the content of me into the stream |
bc73b006 |
66 | Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE; |
0904aa63 |
67 | |
42cf5bc1 |
68 | protected: |
69 | |
42cf5bc1 |
70 | Handle(Graphic3d_AspectFillArea3d) myAspect; |
71 | |
42cf5bc1 |
72 | }; |
73 | |
4e1bc39a |
74 | DEFINE_STANDARD_HANDLE(Prs3d_ShadingAspect, Prs3d_BasicAspect) |
42cf5bc1 |
75 | |
76 | #endif // _Prs3d_ShadingAspect_HeaderFile |