0028832: MMgt_TShared can be replaced by Standard_Transient
[occt.git] / src / VrmlConverter / VrmlConverter_ShadingAspect.hxx
1 // Created on: 1997-03-12
2 // Created by: Alexander BRIVIN
3 // Copyright (c) 1997-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 _VrmlConverter_ShadingAspect_HeaderFile
18 #define _VrmlConverter_ShadingAspect_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
22
23 #include <Vrml_ShapeHints.hxx>
24 #include <Standard_Boolean.hxx>
25 #include <Standard_Transient.hxx>
26 class Vrml_Material;
27 class Vrml_ShapeHints;
28
29
30 class VrmlConverter_ShadingAspect;
31 DEFINE_STANDARD_HANDLE(VrmlConverter_ShadingAspect, Standard_Transient)
32
33 //! qualifies the aspect properties for
34 //! the VRML conversation of ShadedShape .
35 class VrmlConverter_ShadingAspect : public Standard_Transient
36 {
37
38 public:
39
40   
41   //! create a default ShadingAspect.
42   Standard_EXPORT VrmlConverter_ShadingAspect();
43   
44   Standard_EXPORT void SetFrontMaterial (const Handle(Vrml_Material)& aMaterial);
45   
46   Standard_EXPORT Handle(Vrml_Material) FrontMaterial() const;
47   
48   Standard_EXPORT void SetShapeHints (const Vrml_ShapeHints& aShapeHints);
49   
50   Standard_EXPORT Vrml_ShapeHints ShapeHints() const;
51   
52   //! defines necessary of  a  calculation  of  normals for  ShadedShape  to  more
53   //! accurately  display  curved  surfaces,  pacticularly  when  smoooth  or  phong
54   //! shading  is  used  in  VRML  viewer.
55   //! By default False  -  the normals are not calculated,
56   //! True  -  the normals are calculated.
57   //! Warning: If  normals  are  calculated  the  resulting  VRML  file  will
58   //! be  substantially  lager.
59   Standard_EXPORT void SetHasNormals (const Standard_Boolean OnOff);
60   
61   //! returns True if the normals are calculating
62   Standard_EXPORT Standard_Boolean HasNormals() const;
63   
64   //! defines necessary of writing  Material from Vrml into  output  OStream.
65   //! By default False  -  the material is not writing into OStream,
66   //! True  -  the material is writing.
67   Standard_EXPORT void SetHasMaterial (const Standard_Boolean OnOff);
68   
69   //! returns True if the  materials is  writing into OStream.
70   Standard_EXPORT Standard_Boolean HasMaterial() const;
71
72
73
74
75   DEFINE_STANDARD_RTTIEXT(VrmlConverter_ShadingAspect,Standard_Transient)
76
77 protected:
78
79
80
81
82 private:
83
84
85   Handle(Vrml_Material) myFrontMaterial;
86   Vrml_ShapeHints myShapeHints;
87   Standard_Boolean myHasNormals;
88   Standard_Boolean myHasMaterial;
89
90
91 };
92
93
94
95
96
97
98
99 #endif // _VrmlConverter_ShadingAspect_HeaderFile