00001 #ifndef independent_contact_regions_h___ 00002 #define independent_contact_regions_h___ 00003 00004 #include <iostream> 00005 #include "utilities.h" 00006 00007 namespace ICR 00008 { 00009 //-------------------------------------------------------------------- 00010 //-------------------------------------------------------------------- 00017 class IndependentContactRegions 00018 { 00019 00020 private: 00021 00022 SearchZonesPtr search_zones_; 00023 GraspPtr grasp_; 00024 bool icr_computed_; 00025 std::vector<ContactRegion*> contact_regions_; 00026 uint num_contact_regions_; 00032 bool primitiveSearchZoneInclusionTest(PrimitiveSearchZone* prim_sz,WrenchCone const* wc)const; 00033 bool searchZoneInclusionTest(uint region_id,Patch const* patch)const; 00034 void computeContactRegion(uint region_id); 00035 00036 public: 00037 IndependentContactRegions(); 00038 IndependentContactRegions(const SearchZonesPtr search_zones,const GraspPtr grasp); 00040 IndependentContactRegions(IndependentContactRegions const& src); 00042 IndependentContactRegions& operator=(IndependentContactRegions const& src); 00043 friend std::ostream& operator<<(std::ostream& stream, IndependentContactRegions const& icr); 00044 ~IndependentContactRegions(); 00045 00046 void clear(); 00047 void computeICR(); 00048 bool icrComputed()const; 00049 ContactRegion const* getContactRegion(uint id)const; 00050 uint getNumContactRegions()const; 00051 const SearchZonesPtr getSearchZones()const; 00052 const GraspPtr getGrasp()const {return grasp_;} 00053 GraspPtr getGrasp() {return grasp_;} 00056 bool hasInitializedGrasp(); 00060 void setSearchZones(SearchZonesPtr sz_in); 00061 00065 void setGrasp(GraspPtr g_in); }; 00066 //-------------------------------------------------------------------- 00067 //-------------------------------------------------------------------- 00068 }//;namespace ICR 00069 #endif