Eliminate newly appeared warnings
[occt.git] / src / VrmlData / VrmlData_Cylinder.hxx
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
20
21
22 #ifndef VrmlData_Cylinder_HeaderFile
23 #define VrmlData_Cylinder_HeaderFile
24
25 #include <VrmlData_Geometry.hxx>
26
27 /**
28  *  Implementation of the Cylinder node
29  */
30 class VrmlData_Cylinder : public VrmlData_Geometry
31 {
32  public:
33   // ---------- PUBLIC METHODS ----------
34
35   /**
36    * Empty constructor
37    */
38   inline VrmlData_Cylinder ()
39     : myRadius          (1.),
40       myHeight          (2.),
41       myHasBottom       (Standard_True),
42       myHasSide         (Standard_True),
43       myHasTop          (Standard_True)
44   {}
45   /**
46    * Constructor
47    */
48   inline VrmlData_Cylinder (const VrmlData_Scene& theScene,
49                             const char          * theName,
50                             const Standard_Real   theRadius = 1.,
51                             const Standard_Real   theHeight = 2.)
52     : VrmlData_Geometry (theScene, theName),
53       myRadius          (theRadius),
54       myHeight          (theHeight),
55       myHasBottom       (Standard_True),
56       myHasSide         (Standard_True),
57       myHasTop          (Standard_True)
58   {}
59
60   /**
61    * Query the Radius
62    */
63   inline Standard_Real    Radius        () const    { return myRadius; }
64
65   /**
66    * Query the Height
67    */
68   inline Standard_Real    Height        () const    { return myHeight; }
69
70   /**
71    * Query if the bottom circle is included
72    */
73   inline Standard_Boolean HasBottom     () const    { return myHasBottom; }
74
75   /**
76    * Query if the side surface is included
77    */
78   inline Standard_Boolean HasSide       () const    { return myHasSide; }
79
80   /**
81    * Query if the top surface is included
82    */
83   inline Standard_Boolean HasTop        () const    { return myHasTop; }
84
85   /**
86    * Set the Radius
87    */
88   inline void             SetRadius     (const Standard_Real theRadius)
89   { myRadius = theRadius; SetModified(); }
90
91   /**
92    * Set the Height
93    */
94   inline void             SetHeight     (const Standard_Real theHeight)
95   { myHeight = theHeight; SetModified(); }
96
97   /**
98    * Set which faces are included
99    */
100   inline void             SetFaces      (const Standard_Boolean hasBottom,
101                                          const Standard_Boolean hasSide,
102                                          const Standard_Boolean hasTop)
103   { myHasBottom = hasBottom; myHasSide = hasSide;
104     myHasTop = hasTop; SetModified(); }
105
106   /**
107    * Query the primitive topology. This method returns a Null shape if there
108    * is an internal error during the primitive creation (zero radius, etc.)
109    */
110   Standard_EXPORT virtual const Handle(TopoDS_TShape)&  TShape ();
111
112   /**
113    * Create a copy of this node.
114    * If the parameter is null, a new copied node is created. Otherwise new node
115    * is not created, but rather the given one is modified.
116    */
117   Standard_EXPORT virtual Handle(VrmlData_Node)
118                         Clone     (const Handle(VrmlData_Node)& theOther)const;
119
120   /**
121    * Fill the Node internal data from the given input stream.
122    */
123   Standard_EXPORT virtual VrmlData_ErrorStatus
124                           Read          (VrmlData_InBuffer& theBuffer);
125
126   /**
127    * Write the Node to output stream.
128    */
129   Standard_EXPORT virtual VrmlData_ErrorStatus
130                           Write         (const char * thePrefix) const;
131
132  protected:
133   // ---------- PROTECTED METHODS ----------
134
135
136
137  private:
138   // ---------- PRIVATE FIELDS ----------
139   Standard_Real         myRadius;
140   Standard_Real         myHeight;
141   Standard_Boolean      myHasBottom : 1;
142   Standard_Boolean      myHasSide   : 1;
143   Standard_Boolean      myHasTop    : 1;
144
145  public:
146 // Declaration of CASCADE RTTI
147 DEFINE_STANDARD_RTTI (VrmlData_Cylinder)
148 };
149
150 // Definition of HANDLE object using Standard_DefineHandle.hxx
151 DEFINE_STANDARD_HANDLE (VrmlData_Cylinder, VrmlData_Geometry)
152
153
154 #endif