b311480e |
1 | // Created on: 2006-05-25 |
2 | // Created by: Alexander GRIGORIEV |
973c2be1 |
3 | // Copyright (c) 2006-2014 OPEN CASCADE SAS |
b311480e |
4 | // |
973c2be1 |
5 | // This file is part of Open CASCADE Technology software library. |
b311480e |
6 | // |
d5f74e42 |
7 | // This library is free software; you can redistribute it and/or modify it under |
8 | // the terms of the GNU Lesser General Public License version 2.1 as published |
973c2be1 |
9 | // by the Free Software Foundation, with special exception defined in the file |
10 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
11 | // distribution for complete text of the license and disclaimer of any warranty. |
b311480e |
12 | // |
973c2be1 |
13 | // Alternatively, this file may be used under the terms of Open CASCADE |
14 | // commercial license or contractual agreement. |
7fd59977 |
15 | |
16 | #ifndef VrmlData_Appearance_HeaderFile |
17 | #define VrmlData_Appearance_HeaderFile |
18 | |
19 | #include <VrmlData_Material.hxx> |
20 | #include <VrmlData_Texture.hxx> |
21 | #include <VrmlData_TextureTransform.hxx> |
22 | |
23 | /** |
24 | * Implementation of the Appearance node type |
25 | */ |
26 | class VrmlData_Appearance : public VrmlData_Node |
27 | { |
28 | public: |
29 | // ---------- PUBLIC METHODS ---------- |
30 | |
31 | /** |
32 | * Empty constructor |
33 | */ |
34 | inline VrmlData_Appearance () {} |
35 | |
36 | /** |
37 | * Constructor |
38 | */ |
39 | inline VrmlData_Appearance (const VrmlData_Scene& theScene, |
40 | const char * theName) |
41 | : VrmlData_Node (theScene, theName) {} |
42 | |
43 | /** |
44 | * Query the Material |
45 | */ |
46 | inline const Handle(VrmlData_Material)& |
47 | Material () const { return myMaterial; } |
48 | |
49 | /** |
50 | * Query the Texture |
51 | */ |
52 | inline const Handle(VrmlData_Texture)& |
53 | Texture () const { return myTexture; } |
54 | |
55 | /** |
56 | * Query the TextureTransform |
57 | */ |
58 | inline const Handle(VrmlData_TextureTransform)& |
59 | TextureTransform () const { return myTTransform; } |
60 | |
61 | /** |
62 | * Set the Material |
63 | */ |
64 | inline void SetMaterial (const Handle(VrmlData_Material)& theMat) |
65 | { myMaterial = theMat; } |
66 | |
67 | /** |
68 | * Set the Texture |
69 | */ |
70 | inline void SetTexture (const Handle(VrmlData_Texture)& theTexture) |
71 | { myTexture = theTexture; } |
72 | |
73 | /** |
74 | * Set the Texture Transform |
75 | */ |
76 | inline void SetTextureTransform |
77 | (const Handle(VrmlData_TextureTransform)& theTT) |
78 | { myTTransform = theTT; } |
79 | |
80 | /** |
81 | * Create a copy of this node. |
82 | * If the parameter is null, a new copied node is created. Otherwise new node |
83 | * is not created, but rather the given one is modified.<p> |
84 | */ |
85 | Standard_EXPORT virtual Handle(VrmlData_Node) |
86 | Clone (const Handle(VrmlData_Node)&)const; |
87 | /** |
88 | * Read the node from input stream. |
89 | */ |
90 | Standard_EXPORT virtual VrmlData_ErrorStatus |
91 | Read (VrmlData_InBuffer& theBuffer); |
92 | |
93 | /** |
94 | * Write the Node from input stream. |
95 | */ |
96 | Standard_EXPORT virtual VrmlData_ErrorStatus |
97 | Write (const char * thePrefix) const; |
98 | |
99 | /** |
100 | * Returns True if the node is default, so that it should not be written. |
101 | */ |
102 | Standard_EXPORT virtual Standard_Boolean |
103 | IsDefault () const; |
104 | |
105 | protected: |
106 | // ---------- PROTECTED METHODS ---------- |
107 | |
108 | |
109 | |
110 | private: |
111 | // ---------- PRIVATE FIELDS ---------- |
112 | |
113 | Handle(VrmlData_Material) myMaterial; |
114 | Handle(VrmlData_Texture) myTexture; |
115 | Handle(VrmlData_TextureTransform) myTTransform; |
116 | |
117 | public: |
118 | // Declaration of CASCADE RTTI |
119 | DEFINE_STANDARD_RTTI (VrmlData_Appearance) |
120 | }; |
121 | |
122 | // Definition of HANDLE object using Standard_DefineHandle.hxx |
123 | DEFINE_STANDARD_HANDLE (VrmlData_Appearance, VrmlData_Node) |
124 | |
125 | #endif |