00001 #ifndef contact_model_h___ 00002 #define contact_model_h___ 00003 00004 #include "utilities.h" 00005 #include <iostream> 00006 #include "limit_surface.h" 00007 #include "finger.h" 00008 00009 namespace ICR 00010 { 00011 //-------------------------------------------------------------------- 00012 //-------------------------------------------------------------------- 00016 class PointContactModel 00017 { 00018 private: 00019 00020 uint id_; 00021 LimitSurface lim_surf_; 00022 00023 protected: 00024 00025 ModelType model_type_; 00026 PointContactModel(); 00027 00028 public: 00029 00030 EIGEN_MAKE_ALIGNED_OPERATOR_NEW 00031 00032 PointContactModel(FingerParameters const& param); 00033 PointContactModel(FingerParameters param,uint id); 00034 virtual bool operator==(PointContactModel const& other)const; 00035 PointContactModel(PointContactModel const& src); 00036 PointContactModel& operator=(PointContactModel const& src); 00037 friend std::ostream& operator<<(std::ostream& stream, PointContactModel const& pc_model); 00038 virtual ~PointContactModel(); 00039 00040 LimitSurface const* getLimitSurface() const; 00041 ModelType getModelType() const; 00042 uint getId()const; 00043 void setId(uint const id); 00044 }; 00045 //-------------------------------------------------------------------- 00046 //-------------------------------------------------------------------- 00050 class MultiPointContactModel : public PointContactModel 00051 { 00052 private: 00053 00054 InclusionRule inclusion_rule_; 00055 void inclusionRuleSphere(uint center_pt_id,TargetObject const& obj,IndexList& included_points) const; 00056 00057 protected: 00058 00059 MultiPointContactModel(); 00060 00061 public: 00062 00063 MultiPointContactModel(FingerParameters const& param); 00064 MultiPointContactModel(FingerParameters const& param,uint id); 00065 00066 virtual bool operator==(MultiPointContactModel const& other)const; 00067 MultiPointContactModel(MultiPointContactModel const& src); 00068 MultiPointContactModel& operator=(MultiPointContactModel const& src); 00069 virtual ~MultiPointContactModel(); 00070 00071 void computeInclusion(uint center_pt_id,TargetObject const& obj,IndexList& included_points) const; 00072 InclusionRule const* getInclusionRule()const; 00073 00074 }; 00075 //-------------------------------------------------------------------- 00076 //-------------------------------------------------------------------- 00077 } //namespace ICR 00078 #endif