Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Cone.hpp

Go to the documentation of this file.
00001 
00002 //
00003 //       Title           : Cone.hpp
00004 //       Project         : OSCAR
00005 //       Created         : May 25, 2005
00006 //       Author          : Andrew Spencer
00007 //       Platforms       : All
00008 //       Copyright       : Copyright© The University of Texas at Austin, 2002. All rights reserved.
00009 //                 
00010 //          This software and documentation constitute an unpublished work
00011 //          and contain valuable trade secrets and proprietary information
00012 //          belonging to the University. None of the foregoing material may be
00013 //          copied or duplicated or disclosed without the express, written
00014 //          permission of University. THE UNIVERSITY EXPRESSLY DISCLAIMS ANY
00015 //          AND ALL WARRANTIES CONCERNING THIS SOFTWARE AND DOCUMENTATION,
00016 //          INCLUDING ANY WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
00017 //          PARTICULAR PURPOSE, AND WARRANTIES OF PERFORMANCE, AND ANY WARRANTY
00018 //          THAT MIGHT OTHERWISE ARISE FROM COURSE OF DEALING OR USAGE OF TRADE.
00019 //          NO WARRANTY IS EITHER EXPRESS OR IMPLIED WITH RESPECT TO THE USE OF
00020 //          THE SOFTWARE OR DOCUMENTATION. Under no circumstances shall the
00021 //          University be liable for incidental, special, indirect, direct or
00022 //          consequential damages or loss of profits, interruption of business,
00023 //          or related expenses which may arise from use of software or documentation,
00024 //          including but not limited to those resulting from defects in software
00025 //          and/or documentation, or loss or inaccuracy of data of any kind.
00026 //       Purpose         : A cone obstacle
00027 //
00028 //<<<<<<< Cone.hpp
00029 //       $Log: Cone.hpp,v $
00030 //       Revision 1.10  2005/07/11 20:10:27  mitch
00031 //       Fixed capitalizations and back slashes for Linux compilation
00032 //
00033 //=======
00034 //       $Log: Cone.hpp,v $
00035 //       Revision 1.10  2005/07/11 20:10:27  mitch
00036 //       Fixed capitalizations and back slashes for Linux compilation
00037 //
00038 //       Revision 1.9  2005/06/21 21:41:26  chetan
00039 //       createSolid method was not wrapped in #if defined _SOLID
00040 //
00041 //>>>>>>> 1.9
00042 //       Revision 1.8  2005/06/21 15:31:07  aspencer
00043 //       Re-wrapped the hpp files with _SOLID ifdefs, per chetan.
00044 //
00045 //       Revision 1.7  2005/06/16 19:47:02  aspencer
00046 //       Fixed issues with constructors, copy constructors, and operator=
00047 //
00048 //       Revision 1.6  2005/06/10 17:03:17  josh
00049 //       Added Clone method.
00050 //
00051 //       Revision 1.5  2005/06/07 23:07:59  aspencer
00052 //       Added virtual update function to ModelingObject. Made all inheriting
00053 //       implemented Update functions virtual as well.
00054 //
00055 //       Revision 1.4  2005/06/07 18:20:45  aspencer
00056 //       Changed how SOLID functionality was implemented so that there are no #ifdef _SOLID tags in the header files which would cause errors when the header file was included in another library.
00057 //
00058 //       Revision 1.3  2005/06/06 23:26:12  aspencer
00059 //       Changed all "SetInfo" functions to be "SetProperties" functions.
00060 //
00061 //       Revision 1.2  2005/06/06 14:22:15  chetan
00062 //       Made the naming consistent for Get/Set LocalTransform methods
00063 //
00064 //       Revision 1.1  2005/06/03 18:15:39  aspencer
00065 //       Removed the "Ob" designation from all primitive names (BoxOb is now Box, etc). Changed "CylOb" to "Cylisphere".
00066 //
00067 //
00068 //
00069 //
00071 #ifndef Cone_h
00072 #define Cone_h
00073 
00074 //Includes go here
00075 #include "Primitive.hpp"
00076 #include <vector>
00077 
00078 namespace OSCAR {
00079 
00092 class Cone : public Primitive {
00093 public:
00094 
00103   Cone(const double h, const double r, const Xform& inFrameTransform); //Constructor
00104 
00109   Cone(const Cone& arg) : Primitive() {
00110     this->operator=(arg);
00111   }
00112 
00117   Cone();
00118 
00123         virtual Cone* Clone() const;
00124 
00132   const vector<Vector3>& GetPoints(ReferenceFrame globalOrLocal = Global) const { return point[globalOrLocal]; }
00133 
00134 
00144   bool SetProperties(const double h, const double r, const Xform& inFrameTransform);
00145 
00151   bool SetHeight(const double h);
00152 
00158   bool SetRadius(const double r);
00159 
00164   double GetHeight() const {return height;}
00165 
00170   double GetRadius() const {return radius;}
00171 
00177   bool SetLocalTransform(const Xform& inFrameTransform);
00178 
00184   const Xform& GetLocalTransform() const {return localTransform;}
00185 
00191   virtual bool Update(const Xform& transform);
00192 
00193   Cone& operator=(const Cone& rhs);
00194 
00195 protected:
00196 
00197   double height, radius;
00198   Xform localTransform;
00199   std::vector<Vector3> internalPoint;
00200   bool populatePoints();
00201   bool TransformInternalToLocal();
00202   std::vector<Vector3> point[2];
00203 #if defined _SOLID
00204   virtual bool createSolid();
00205 #endif
00206   };
00207 
00208 #include "Cone.ipp"
00209 }  //namespace OSCAR
00210 #endif //cone_h
RRG Homepage OSCAR Overview OSCAR Tutorials Simulations