0031687: Draw Harness, ViewerTest - extend command vrenderparams with option updating...
[occt.git] / src / VrmlData / VrmlData_Sphere.hxx
CommitLineData
b311480e 1// Created on: 2006-05-26
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_Sphere_HeaderFile
17#define VrmlData_Sphere_HeaderFile
18
19#include <VrmlData_Geometry.hxx>
20
21/**
22 * Implementation of the Sphere node.
23 */
24class VrmlData_Sphere : public VrmlData_Geometry
25{
26 public:
27 // ---------- PUBLIC METHODS ----------
28
29 /**
30 * Empty constructor
31 */
32 inline VrmlData_Sphere ()
33 : myRadius (1.)
34 {}
35
36 /**
37 * Constructor
38 */
39 inline VrmlData_Sphere (const VrmlData_Scene& theScene,
40 const char * theName,
41 const Standard_Real theRadius = 1.)
42 : VrmlData_Geometry (theScene, theName),
43 myRadius (theRadius)
44 {}
45
46 /**
47 * Query the sphere radius
48 */
49 inline Standard_Real Radius () const { return myRadius; }
50
51 /**
52 * Set the spere radius
53 */
54 inline void SetRadius (const Standard_Real theRadius)
55 { myRadius = theRadius; SetModified(); }
56
57 /**
58 * Query the primitive topology. This method returns a Null shape if there
59 * is an internal error during the primitive creation (zero radius, etc.)
60 */
79104795 61 Standard_EXPORT virtual const Handle(TopoDS_TShape)& TShape () Standard_OVERRIDE;
7fd59977 62
63 /**
64 * Create a copy of this node.
65 * If the parameter is null, a new copied node is created. Otherwise new node
66 * is not created, but rather the given one is modified.
67 */
68 Standard_EXPORT virtual Handle(VrmlData_Node)
79104795 69 Clone (const Handle(VrmlData_Node)& theOther)const Standard_OVERRIDE;
7fd59977 70
71 /**
72 * Fill the Node internal data from the given input stream.
73 */
74 Standard_EXPORT virtual VrmlData_ErrorStatus
79104795 75 Read (VrmlData_InBuffer& theBuffer) Standard_OVERRIDE;
7fd59977 76
77 /**
78 * Write the Node to output stream.
79 */
80 Standard_EXPORT virtual VrmlData_ErrorStatus
79104795 81 Write (const char * thePrefix) const Standard_OVERRIDE;
7fd59977 82
83 private:
84 // ---------- PRIVATE FIELDS ----------
85
86 Standard_Real myRadius;
87
88 public:
89// Declaration of CASCADE RTTI
92efcf78 90DEFINE_STANDARD_RTTI_INLINE(VrmlData_Sphere,VrmlData_Geometry)
7fd59977 91};
92
93// Definition of HANDLE object using Standard_DefineHandle.hxx
94DEFINE_STANDARD_HANDLE (VrmlData_Sphere, VrmlData_Geometry)
95
96
97#endif