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

Primitive.hpp

Go to the documentation of this file.
00001 
00002 //
00003 //       Title           : Primitive.hpp
00004 //       Project         : OSCAR
00005 //       Created         : Dec 16, 1996
00006 //       Author          : Troy Harden
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         : Abstract obstacle .  Defines the obstacle
00027 //                         interface for the various obstacles.
00028 //
00029 //----------------------------------------------------------------------------
00030 //
00031 //       $Revisions$
00032 //
00033 //       $Log: Primitive.hpp,v $
00034 //       Revision 1.17  2007/09/14 21:17:17  acs487
00035 //       Made the solid include path explicit in the .h file so when it was included in other sources the file path wouldn't need to be included in the project.
00036 //
00037 //       Revision 1.16  2007/09/12 21:38:31  acs487
00038 //       Uploaded code associated with collision detection.
00039 //
00040 //       Revision 1.15  2005/12/09 16:07:59  josh
00041 //       Added -D_SOLID to make files. Added solid-3.5/include to include path.
00042 //
00043 //       Revision 1.14  2005/06/16 19:47:04  aspencer
00044 //       Fixed issues with constructors, copy constructors, and operator=
00045 //
00046 //       Revision 1.13  2005/06/16 16:59:35  chetan
00047 //       Issues with base class constructors not being called, etc.
00048 //
00049 //       Revision 1.12  2005/06/16 16:29:03  chetan
00050 //       Added #if defined _SOLID directives correctly to remove SOLID dependency
00051 //
00052 //       Revision 1.11  2005/06/15 15:51:40  aspencer
00053 //       Eliminated warning in Update method.
00054 //
00055 //       Revision 1.10  2005/06/10 17:03:19  josh
00056 //       Added Clone method.
00057 //
00058 //       Revision 1.9  2005/06/07 20:11:53  aspencer
00059 //       Changed over to the new version of Node. Made appropriate changes in other files as a result. LoadRev2File in ObAvData no longer populates a node tree.
00060 //
00061 //       Revision 1.8  2005/06/07 18:20:47  aspencer
00062 //       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.
00063 //
00064 //       Revision 1.7  2005/06/06 23:26:14  aspencer
00065 //       Changed all "SetInfo" functions to be "SetProperties" functions.
00066 //
00067 //       Revision 1.6  2005/06/06 20:16:02  aspencer
00068 //       operator= was not calling base class operator=
00069 //
00070 //       Revision 1.5  2005/06/01 22:27:33  chetan
00071 //       Made changes to copyright headers
00072 //
00073 //       Revision 1.4  2005/06/01 19:51:06  aspencer
00074 //       Made further changes to commenting.
00075 //
00076 //       Revision 1.3  2005/05/31 19:38:43  aspencer
00077 //       Changes to various function names in the primitive classes (trying to fit the "Get/Set" scheme of the rest of OSCAR). Also moved some code in primitive files from .hpp to .cpp, as it should be.
00078 //
00079 //       Revision 1.2  2005/05/27 15:56:49  aspencer
00080 //       Changed "Reference" enumeration to "ReferenceFrame"
00081 //
00082 //       Revision 1.1  2005/05/26 21:02:43  aspencer
00083 //       Changed "obstacle" to "primitive" in both the obstacle and the skeletalobstacle class. Inserted "modeling object" abstract class, which primitive (was obstacle) now inherits from. Updated the rest of OSCAR to reflect this/Initial Commit
00084 //
00085 //       Revision 1.18  2005/04/28 17:29:28  aspencer
00086 //       Completed changeover to using the Local/Global functionality. If SOLID is being used and an updateinfo type function is called on either local or global points, the SOLID object will be destroyed and recreated accordingly.
00087 //
00088 //       Revision 1.17  2005/04/26 22:18:55  aspencer
00089 //       Added the functionality to have SOLID do any cylisphere-cylisphere calculations
00090 //
00091 //       Revision 1.16  2005/04/21 16:28:00  aspencer
00092 //       Inserted a new "skeletalobstacle" abstract class which inherits from obstacle. Planes, spheres and cylispheres now all inherit from this new class.
00093 //
00094 //       Revision 1.15  2005/04/08 18:40:58  aspencer
00095 //       Added solid include file and new solid related member variable
00096 //
00097 //       Revision 1.14  2005/04/01 18:12:00  chetan
00098 //       removed pragma directive and made it specific to MSVC in Base/CommIncludes.h
00099 //
00100 //       Revision 1.13  2005/03/14 22:06:23  aspencer
00101 //       Added to namespace OSCAR and removed "RR" from front of class names.
00102 //
00103 //       Revision 1.12  2004/10/25 20:07:05  aspencer
00104 //       Updated commenting
00105 //
00106 //       Revision 1.11  2004/08/10 16:48:38  aspencer
00107 //       Disabled warning 4786 to prevent the deluge of warnings when building the ob avoid library.
00108 //
00109 //       Revision 1.10  2004/07/07 18:38:42  aspencer
00110 //       Made changes in association with eliminating the individual obstacle types and moving all functionality to "obstacle"
00111 //
00112 //       Revision 1.9  2004/06/04 21:03:07  aspencer
00113 //       -Added Primitive constructor for the creation of a generic obstacle object (not specifically a sphere, plane, cylinder, etc.)
00114 //
00115 //       Revision 1.8  2004/05/28 19:20:20  eswint
00116 //       - Added the \ingroup Primitive Avoidance for Doxygen commenting
00117 //
00118 //       Revision 1.7  2004/05/25 16:41:16  eswint
00119 //       - Corrected commenting
00120 //
00121 //       Revision 1.6  2004/05/23 15:47:58  eswint
00122 //       -Added a normal vector for Obstacles that have 3 or more points
00123 //
00124 //       Revision 1.5  2004/05/20 14:06:41  eswint
00125 //       - Put all files in the OSCAR namespace
00126 //
00127 //       Revision 1.4  2004/05/11 18:56:37  eswint
00128 //       - Using namespace ObstacleAvoidance
00129 //       - Removed "RR" from class names
00130 //
00131 //       Revision 1.3  2004/04/27 21:09:52  eswint
00132 //       - moved point information and methods to Primitive
00133 //
00134 //       Revision 1.2  2004/04/13 21:29:51  eswint
00135 //       - Added/Corrected commenting
00136 //
00137 //       Revision 1.1  2004/04/13 18:06:53  eswint
00138 //       - Changed file extensions to comply with development guidelines
00139 //
00140 //       Revision 1.4  2004/03/15 20:26:53  chetan
00141 //       Changes to ObAvData.C to support loading of spherical obstacle data
00142 //
00143 //       Revision 1.3  2004/01/28 21:37:04  eswint
00144 //       - moved _init, radius from derived es
00145 //
00146 //       Revision 1.2  2004/01/27 21:49:01  eswint
00147 //       - changed parameters to const and/or RRVector3 where appropriate
00148 //       - replaced RRVector3** with vector<vector<RRVector3>>
00149 //
00150 //       Revision 1.1  2003/08/18 18:37:20  eswint
00151 //       Initial Commit
00152 //
00153 //
00155 #ifndef Primitive_h
00156 #define Primitive_h
00157 
00158 //Includes go here
00159 #include "Math/Vector3.h"
00160 #include "Math/MathUtilities.h"
00161 #include "ModelingObject.hpp"
00162 #include <vector>
00163 
00164 #if defined _SOLID
00165 #include "solid-3.5/include/SOLID.h"
00166 
00167 #endif
00168 
00169 
00170 
00171 using std::vector;
00172 
00173 namespace OSCAR { 
00178 class Primitive : public ModelingObject
00179 {
00180 public:
00186   Primitive();
00191   Primitive(const Primitive& arg);
00192 
00196   virtual ~Primitive();
00197 
00198   Primitive& operator=(const Primitive& rhs);
00199 
00200 
00205         virtual Primitive* Clone() const = 0;
00206 
00211   bool SetProperties() { return false; } //Not virtual because # args will vary.
00212 
00222 #if defined _SOLID
00223   const DT_ObjectHandle GetSolidHandle() const {return solidHandle;}
00224 
00225   void AddResponseClass( DT_RespTableHandle respTable ) {respClasses.push_back(DT_GenResponseClass(respTable));}  
00226   
00227   const vector<DT_ResponseClass>& GetResponseClasses() const {return respClasses;}
00228 
00229 
00230 #endif
00231 
00232   virtual bool Update(const Xform& transform){transform.at(0,0); return false;}
00233 
00234 protected:
00235 
00236 //code for SOLID
00237 #if defined _SOLID
00238   DT_ObjectHandle solidHandle;
00239   DT_ShapeHandle shapeHandle;
00240   vector<DT_ResponseClass> respClasses;
00241   virtual bool createSolid(){return false;}
00242   void destroySolid();
00243 #endif
00244 };
00245 
00246 #include "Primitive.ipp"
00247 }  //namespace OSCAR
00248 #endif //Obstacle_h
RRG Homepage OSCAR Overview OSCAR Tutorials Simulations