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_Cone_HeaderFile
0017 #define VrmlData_Cone_HeaderFile
0018 
0019 #include <VrmlData_Geometry.hxx>
0020 
0021 /**
0022  *  Implementation of the Cone node.
0023  *  The cone is located with its middle of the height segment in (0., 0., 0.) 
0024  *  The height is oriented along OY.
0025  */
0026 class VrmlData_Cone : public VrmlData_Geometry
0027 {
0028  public:
0029   // ---------- PUBLIC METHODS ----------
0030 
0031   /**
0032    * Empty constructor
0033    */
0034   inline VrmlData_Cone ()
0035     : myBottomRadius    (1.),
0036       myHeight          (2.),
0037       myHasSide         (Standard_True),
0038       myHasBottom       (Standard_True)
0039   {}
0040 
0041   /**
0042    * Constructor
0043    */
0044   inline VrmlData_Cone (const VrmlData_Scene&   theScene,
0045                         const char              * theName,
0046                         const Standard_Real     theBottomRadius = 1.,
0047                         const Standard_Real     theHeight = 2.)
0048     : VrmlData_Geometry (theScene, theName),
0049       myBottomRadius    (theBottomRadius),
0050       myHeight          (theHeight),
0051       myHasSide         (Standard_True),
0052       myHasBottom       (Standard_True)
0053   {}
0054 
0055   /**
0056    * Query the Bottom Radius
0057    */
0058   inline Standard_Real    BottomRadius  () const    { return myBottomRadius; }
0059 
0060   /**
0061    * Query the Height
0062    */
0063   inline Standard_Real    Height        () const    { return myHeight; }
0064 
0065   /**
0066    * Query if the bottom circle is included
0067    */
0068   inline Standard_Boolean HasBottom     () const    { return myHasBottom; }
0069 
0070   /**
0071    * Query if the side surface is included
0072    */
0073   inline Standard_Boolean HasSide       () const    { return myHasSide; }
0074 
0075   /**
0076    * Set the Bottom Radius
0077    */
0078   inline void             SetBottomRadius (const Standard_Real theRadius)
0079   { myBottomRadius = theRadius; SetModified(); }
0080 
0081   /**
0082    * Set the Height
0083    */
0084   inline void             SetHeight     (const Standard_Real theHeight)
0085   { myHeight = theHeight; SetModified(); }
0086 
0087   /**
0088    * Set which faces are included
0089    */
0090   inline void             SetFaces      (const Standard_Boolean hasBottom,
0091                                          const Standard_Boolean hasSide)
0092   { myHasBottom = hasBottom; myHasSide = hasSide; SetModified(); }
0093 
0094   /**
0095    * Query the primitive topology. This method returns a Null shape if there
0096    * is an internal error during the primitive creation (zero radius, etc.)
0097    */
0098   Standard_EXPORT virtual const Handle(TopoDS_TShape)&  TShape () Standard_OVERRIDE;
0099 
0100   /**
0101    * Create a copy of this node.
0102    * If the parameter is null, a new copied node is created. Otherwise new node
0103    * is not created, but rather the given one is modified.
0104    */
0105   Standard_EXPORT virtual Handle(VrmlData_Node)
0106                         Clone   (const Handle(VrmlData_Node)& theOther) const Standard_OVERRIDE;
0107 
0108   /**
0109    * Fill the Node internal data from the given input stream.
0110    */
0111   Standard_EXPORT virtual VrmlData_ErrorStatus
0112                         Read    (VrmlData_InBuffer& theBuffer) Standard_OVERRIDE;
0113 
0114   /**
0115    * Write the Node to output stream.
0116    */
0117   Standard_EXPORT virtual VrmlData_ErrorStatus
0118                         Write   (const char * thePrefix) const Standard_OVERRIDE;
0119 
0120 
0121  protected:
0122   // ---------- PROTECTED METHODS ----------
0123 
0124 
0125 
0126  private:
0127   // ---------- PRIVATE FIELDS ----------
0128 
0129   Standard_Real         myBottomRadius;
0130   Standard_Real         myHeight;
0131   Standard_Boolean      myHasSide       : 1;
0132   Standard_Boolean      myHasBottom     : 1;
0133 
0134 
0135  public:
0136 // Declaration of CASCADE RTTI
0137 DEFINE_STANDARD_RTTI_INLINE(VrmlData_Cone,VrmlData_Geometry)
0138 };
0139 
0140 // Definition of HANDLE object using Standard_DefineHandle.hxx
0141 DEFINE_STANDARD_HANDLE (VrmlData_Cone, VrmlData_Geometry)
0142 
0143 
0144 #endif