00001 //=========================================================================== 00002 /* 00003 This file is part of the CHAI 3D visualization and haptics libraries. 00004 Copyright (C) 2003-2009 by CHAI 3D. All rights reserved. 00005 00006 This library is free software; you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License("GPL") version 2 00008 as published by the Free Software Foundation. 00009 00010 For using the CHAI 3D libraries with software that can not be combined 00011 with the GNU GPL, and for taking advantage of the additional benefits 00012 of our support services, please contact CHAI 3D about acquiring a 00013 Professional Edition License. 00014 00015 \author <http://www.chai3d.org> 00016 \author Francois Conti 00017 \version 2.0.0 $Rev: 251 $ 00018 */ 00019 //=========================================================================== 00020 00021 //--------------------------------------------------------------------------- 00022 #ifndef CShapeTorusH 00023 #define CShapeTorusH 00024 //--------------------------------------------------------------------------- 00025 #include "scenegraph/CGenericObject.h" 00026 #include "graphics/CMaterial.h" 00027 #include "graphics/CTexture2D.h" 00028 //--------------------------------------------------------------------------- 00029 00030 //=========================================================================== 00038 //=========================================================================== 00039 00040 //=========================================================================== 00048 //=========================================================================== 00049 class cShapeTorus : public cGenericObject 00050 { 00051 public: 00052 00053 //----------------------------------------------------------------------- 00054 // CONSTRUCTOR & DESTRUCTOR: 00055 //----------------------------------------------------------------------- 00056 00058 cShapeTorus(const double& a_insideRadius, const double& a_outsideRadius); 00059 00061 virtual ~cShapeTorus() {}; 00062 00063 00064 //----------------------------------------------------------------------- 00065 // METHODS: 00066 //----------------------------------------------------------------------- 00067 00069 virtual void render(const int a_renderMode=0); 00070 00072 virtual void updateBoundaryBox(); 00073 00075 virtual void scaleObject(const cVector3d& a_scaleFactors); 00076 00078 virtual void computeLocalInteraction(const cVector3d& a_toolPos, 00079 const cVector3d& a_toolVel, 00080 const unsigned int a_IDN); 00081 00083 void setSize(const double& a_innerRadius, const double& a_outerRadius) 00084 { m_innerRadius = cAbs(a_innerRadius); m_outerRadius = cAbs(a_outerRadius);} 00085 00087 double getInnerRadius() { return (m_innerRadius); } 00088 00090 double getOuterRadius() { return (m_outerRadius); } 00091 00092 00093 protected: 00094 00095 //----------------------------------------------------------------------- 00096 // MEMBERS: 00097 //----------------------------------------------------------------------- 00098 00100 double m_innerRadius; 00101 00103 double m_outerRadius; 00104 00106 unsigned int m_resolution; 00107 }; 00108 00109 //--------------------------------------------------------------------------- 00110 #endif 00111 //---------------------------------------------------------------------------