1 // Created on: 2006-05-25
2 // Created by: Alexander GRIGORIEV
3 // Copyright (c) 2006-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
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
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.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #ifndef VrmlData_Box_HeaderFile
17 #define VrmlData_Box_HeaderFile
19 #include <VrmlData_Geometry.hxx>
23 * Inplementation of the Box node.
24 * This node is defined by Size vector, assumong that the box center is located
25 * in (0., 0., 0.) and that each corner is 0.5*|Size| distance from the center.
27 class VrmlData_Box : public VrmlData_Geometry
30 // ---------- PUBLIC METHODS ----------
35 inline VrmlData_Box ()
42 inline VrmlData_Box (const VrmlData_Scene& theScene,
44 const Standard_Real sizeX = 2.,
45 const Standard_Real sizeY = 2.,
46 const Standard_Real sizeZ = 2.)
47 : VrmlData_Geometry (theScene, theName),
48 mySize (sizeX, sizeY, sizeZ)
54 inline const gp_XYZ& Size () const { return mySize; }
59 inline void SetSize (const gp_XYZ& theSize)
60 { mySize = theSize; SetModified(); }
63 * Query the primitive topology. This method returns a Null shape if there
64 * is an internal error during the primitive creation (zero radius, etc.)
66 Standard_EXPORT virtual const Handle(TopoDS_TShape)&
70 * Create a copy of this node.
71 * If the parameter is null, a new copied node is created. Otherwise new node
72 * is not created, but rather the given one is modified.
74 Standard_EXPORT virtual Handle(VrmlData_Node)
75 Clone (const Handle(VrmlData_Node)& theOther)const;
78 * Fill the Node internal data from the given input stream.
80 Standard_EXPORT virtual VrmlData_ErrorStatus
81 Read (VrmlData_InBuffer& theBuffer);
84 * Write the Node to output stream.
86 Standard_EXPORT virtual VrmlData_ErrorStatus
87 Write (const char * thePrefix) const;
90 // ---------- PRIVATE FIELDS ----------
95 // Declaration of CASCADE RTTI
96 DEFINE_STANDARD_RTTI (VrmlData_Box, VrmlData_Geometry)
99 // Definition of HANDLE object using Standard_DefineHandle.hxx
100 DEFINE_STANDARD_HANDLE (VrmlData_Box, VrmlData_Geometry)