00001 #ifndef CD_BasicStyle_h 00002 #define CD_BasicStyle_h 1 00003 00004 #pragma warning( disable : 4786 ) 00005 00006 #include "CollisionDetectors\CD_Linear.h" 00007 #include "CollisionDetectors\CD_JointLimits.h" 00008 #include "Kinematics\DH_Link.h" 00009 #include <map> 00010 #include "math\PairInt.h" 00011 #include <vector> 00012 00013 class FrameManager; 00014 class RobotBase; 00015 class Universe; 00016 00017 class CD_BasicStyle 00018 : 00019 virtual public CD_Linear, 00020 virtual public CD_JointLimits 00021 { 00022 public: 00023 //## Constructors (specified) 00024 //## Operation: CD_BasicStyle%928344297 00025 CD_BasicStyle (const Universe& universe); 00026 00027 //## Operation: CD_BasicStyle%928344299 00028 CD_BasicStyle (const CD_BasicStyle& right); 00029 00030 //## Destructor (generated) 00031 virtual ~CD_BasicStyle(); 00032 00033 //allows access to the frame manager 00034 FrameManager* GetFrameManager(); 00035 00036 //## Other Operations (specified) 00037 //## Operation: SetConfiguration%928373070 00038 virtual bool SetConfiguration (const Configuration& config); 00039 00040 //returns the type of the joint 00041 virtual DH_Parameter JointType( const unsigned int jointNum ) const; 00042 00043 // returns the frame number associated with given joint 00044 virtual unsigned int JointFrameNum ( const unsigned int jointNum ) const; 00045 00046 //## Operation: JointMin%928263330 00047 virtual double JointMin (const unsigned int jointNum) const; 00048 00049 //## Operation: JointWraps%928263335 00050 virtual bool JointWraps (const unsigned int jointNum) const; 00051 00052 //## Operation: JointMax%928263329 00053 virtual double JointMax (const unsigned int jointNum) const; 00054 00055 //## Operation: Clone%930364108 00056 // this virtual function provides a copy of the object 00057 virtual CollisionDetectorBase* Clone () const = 0; 00058 00059 //## Operation: ShouldPerformCollisionCheck%928344291 00060 virtual bool ShouldPerformCollisionCheck (unsigned int frameA, unsigned int frameB) const; 00061 00062 //## Operation: DOF%930942582 00063 virtual unsigned int DOF () const; 00064 00065 //## Operation: DeactivateFrames%931291663 00066 // deactivates a pair of frames from collision checking 00067 virtual void DeactivateFrames (const unsigned int frame1, const unsigned int frame2); 00068 00069 //## Operation: ActivateFrames%931291664 00070 // activates a pair of frames for the collision checking 00071 virtual void ActivateFrames (const unsigned int frame1, const unsigned int frame2); 00072 00073 //## Operation: PermDeactivateFrames%931892328 00074 // deactivates a pair of frames from collision checking 00075 virtual void PermDeactivateFrames (const unsigned int frame1, const unsigned int frame2); 00076 00077 //## Operation: PermActivateFrames%931892329 00078 // activates a pair of frames for the collision checking 00079 virtual void PermActivateFrames (const unsigned int frame1, const unsigned int frame2); 00080 00081 //## Operation: FramePairPermEnabled%931892330 00082 bool FramePairPermEnabled (const unsigned int frame1, const unsigned int frame2) const; 00083 00084 //## Operation: DeactivateAllFrames%940546750 00085 void DeactivateAllFrames (); 00086 00087 std::vector<Entity*> GetAllElements() const; 00088 std::vector<LinkBase*> GetAllLinks() const; 00089 RobotBase* GetRobot( const int index ) const; 00090 protected: 00091 virtual void PermActivateAll (); 00092 virtual void PermDeactivateFramesWithThemselves (); 00093 virtual void PermDeactivateAll (); 00094 std::map< PairInt, bool > collisionMatrix; 00095 std::map< PairInt, bool > permCollisionMatrix; 00096 std::vector<Entity*> entities; 00097 std::vector<LinkBase*> links; 00098 FrameManager theFrameManager; 00099 00100 private: 00101 }; 00102 #endif