b311480e |
1 | // Created on: 2006-05-25 |
2 | // Created by: Alexander GRIGORIEV |
3 | // Copyright (c) 2006-2012 OPEN CASCADE SAS |
4 | // |
5 | // The content of this file is subject to the Open CASCADE Technology Public |
6 | // License Version 6.5 (the "License"). You may not use the content of this file |
7 | // except in compliance with the License. Please obtain a copy of the License |
8 | // at http://www.opencascade.org and read it completely before using this file. |
9 | // |
10 | // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its |
11 | // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. |
12 | // |
13 | // The Original Code and all software distributed under the License is |
14 | // distributed on an "AS IS" basis, without warranty of any kind, and the |
15 | // Initial Developer hereby disclaims all such warranties, including without |
16 | // limitation, any warranties of merchantability, fitness for a particular |
17 | // purpose or non-infringement. Please see the License for the specific terms |
18 | // and conditions governing the rights and limitations under the License. |
19 | |
7fd59977 |
20 | |
21 | |
22 | #ifndef VrmlData_ShapeNode_HeaderFile |
23 | #define VrmlData_ShapeNode_HeaderFile |
24 | |
25 | #include <VrmlData_Appearance.hxx> |
26 | #include <VrmlData_Geometry.hxx> |
27 | |
28 | /** |
29 | * Implementation of the Shape node type |
30 | */ |
31 | class VrmlData_ShapeNode : public VrmlData_Node |
32 | { |
33 | public: |
34 | // ---------- PUBLIC METHODS ---------- |
35 | |
36 | /** |
37 | * Empty constructor |
38 | */ |
39 | inline VrmlData_ShapeNode () {} |
40 | |
41 | /** |
42 | * Constructor |
43 | */ |
44 | inline VrmlData_ShapeNode (const VrmlData_Scene& theScene, |
45 | const char * theName) |
46 | : VrmlData_Node (theScene, theName) {} |
47 | |
48 | /** |
49 | * Query the Appearance. |
50 | */ |
51 | inline const Handle(VrmlData_Appearance)& |
52 | Appearance () const { return myAppearance; } |
53 | |
54 | /** |
55 | * Query the Geometry. |
56 | */ |
57 | inline const Handle(VrmlData_Geometry)& |
58 | Geometry () const { return myGeometry; } |
59 | |
60 | /** |
61 | * Set the Appearance |
62 | */ |
63 | inline void SetAppearance (const Handle(VrmlData_Appearance)& theAppear) |
64 | { myAppearance = theAppear; } |
65 | |
66 | /** |
67 | * Set the Geometry |
68 | */ |
69 | inline void SetGeometry (const Handle(VrmlData_Geometry)& theGeometry) |
70 | { myGeometry = theGeometry; } |
71 | |
72 | /** |
73 | * Create a copy of this node. |
74 | * If the parameter is null, a new copied node is created. Otherwise new node |
75 | * is not created, but rather the given one is modified. |
76 | */ |
77 | Standard_EXPORT virtual Handle(VrmlData_Node) |
78 | Clone (const Handle(VrmlData_Node)& theOther)const; |
79 | |
80 | /** |
81 | * Fill the Node internal data from the given input stream. |
82 | */ |
83 | Standard_EXPORT virtual VrmlData_ErrorStatus |
84 | Read (VrmlData_InBuffer& theBuffer); |
85 | |
86 | /** |
87 | * Write the Node to output stream. |
88 | */ |
89 | Standard_EXPORT virtual VrmlData_ErrorStatus |
90 | Write (const char * thePrefix) const; |
91 | |
92 | /** |
93 | * Check if the Shape Node is writeable. |
94 | */ |
95 | Standard_EXPORT virtual Standard_Boolean |
96 | IsDefault () const; |
97 | |
98 | protected: |
99 | // ---------- PROTECTED METHODS ---------- |
100 | |
101 | |
102 | |
103 | private: |
104 | // ---------- PRIVATE FIELDS ---------- |
105 | |
106 | Handle(VrmlData_Appearance) myAppearance; |
107 | Handle(VrmlData_Geometry) myGeometry; |
108 | |
109 | public: |
110 | // Declaration of CASCADE RTTI |
111 | DEFINE_STANDARD_RTTI (VrmlData_ShapeNode) |
112 | }; |
113 | |
114 | // Definition of HANDLE object using Standard_DefineHandle.hxx |
115 | DEFINE_STANDARD_HANDLE (VrmlData_ShapeNode, VrmlData_Node) |
116 | |
117 | |
118 | #endif |