Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:05:32

0001 // Created on: 2006-05-25
0002 // Created by: Alexander GRIGORIEV
0003 // Copyright (c) 2006-2014 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 #ifndef VrmlData_Cylinder_HeaderFile
0017 #define VrmlData_Cylinder_HeaderFile
0018 
0019 #include <VrmlData_Geometry.hxx>
0020 
0021 /**
0022  *  Implementation of the Cylinder node
0023  */
0024 class VrmlData_Cylinder : public VrmlData_Geometry
0025 {
0026  public:
0027   // ---------- PUBLIC METHODS ----------
0028 
0029   /**
0030    * Empty constructor
0031    */
0032   inline VrmlData_Cylinder ()
0033     : myRadius          (1.),
0034       myHeight          (2.),
0035       myHasBottom       (Standard_True),
0036       myHasSide         (Standard_True),
0037       myHasTop          (Standard_True)
0038   {}
0039   /**
0040    * Constructor
0041    */
0042   inline VrmlData_Cylinder (const VrmlData_Scene& theScene,
0043                             const char          * theName,
0044                             const Standard_Real   theRadius = 1.,
0045                             const Standard_Real   theHeight = 2.)
0046     : VrmlData_Geometry (theScene, theName),
0047       myRadius          (theRadius),
0048       myHeight          (theHeight),
0049       myHasBottom       (Standard_True),
0050       myHasSide         (Standard_True),
0051       myHasTop          (Standard_True)
0052   {}
0053 
0054   /**
0055    * Query the Radius
0056    */
0057   inline Standard_Real    Radius        () const    { return myRadius; }
0058 
0059   /**
0060    * Query the Height
0061    */
0062   inline Standard_Real    Height        () const    { return myHeight; }
0063 
0064   /**
0065    * Query if the bottom circle is included
0066    */
0067   inline Standard_Boolean HasBottom     () const    { return myHasBottom; }
0068 
0069   /**
0070    * Query if the side surface is included
0071    */
0072   inline Standard_Boolean HasSide       () const    { return myHasSide; }
0073 
0074   /**
0075    * Query if the top surface is included
0076    */
0077   inline Standard_Boolean HasTop        () const    { return myHasTop; }
0078 
0079   /**
0080    * Set the Radius
0081    */
0082   inline void             SetRadius     (const Standard_Real theRadius)
0083   { myRadius = theRadius; SetModified(); }
0084 
0085   /**
0086    * Set the Height
0087    */
0088   inline void             SetHeight     (const Standard_Real theHeight)
0089   { myHeight = theHeight; SetModified(); }
0090 
0091   /**
0092    * Set which faces are included
0093    */
0094   inline void             SetFaces      (const Standard_Boolean hasBottom,
0095                                          const Standard_Boolean hasSide,
0096                                          const Standard_Boolean hasTop)
0097   { myHasBottom = hasBottom; myHasSide = hasSide;
0098     myHasTop = hasTop; SetModified(); }
0099 
0100   /**
0101    * Query the primitive topology. This method returns a Null shape if there
0102    * is an internal error during the primitive creation (zero radius, etc.)
0103    */
0104   Standard_EXPORT virtual const Handle(TopoDS_TShape)&  TShape () Standard_OVERRIDE;
0105 
0106   /**
0107    * Create a copy of this node.
0108    * If the parameter is null, a new copied node is created. Otherwise new node
0109    * is not created, but rather the given one is modified.
0110    */
0111   Standard_EXPORT virtual Handle(VrmlData_Node)
0112                         Clone     (const Handle(VrmlData_Node)& theOther)const Standard_OVERRIDE;
0113 
0114   /**
0115    * Fill the Node internal data from the given input stream.
0116    */
0117   Standard_EXPORT virtual VrmlData_ErrorStatus
0118                           Read          (VrmlData_InBuffer& theBuffer) Standard_OVERRIDE;
0119 
0120   /**
0121    * Write the Node to output stream.
0122    */
0123   Standard_EXPORT virtual VrmlData_ErrorStatus
0124                           Write         (const char * thePrefix) const Standard_OVERRIDE;
0125 
0126  protected:
0127   // ---------- PROTECTED METHODS ----------
0128 
0129 
0130 
0131  private:
0132   // ---------- PRIVATE FIELDS ----------
0133   Standard_Real         myRadius;
0134   Standard_Real         myHeight;
0135   Standard_Boolean      myHasBottom : 1;
0136   Standard_Boolean      myHasSide   : 1;
0137   Standard_Boolean      myHasTop    : 1;
0138 
0139  public:
0140 // Declaration of CASCADE RTTI
0141 DEFINE_STANDARD_RTTI_INLINE(VrmlData_Cylinder,VrmlData_Geometry)
0142 };
0143 
0144 // Definition of HANDLE object using Standard_DefineHandle.hxx
0145 DEFINE_STANDARD_HANDLE (VrmlData_Cylinder, VrmlData_Geometry)
0146 
0147 
0148 #endif