00001 //###################################################################### 00002 // 00003 // GraspIt! 00004 // Copyright (C) 2002-2009 Columbia University in the City of New York. 00005 // All rights reserved. 00006 // 00007 // GraspIt! is free software: you can redistribute it and/or modify 00008 // it under the terms of the GNU General Public License as published by 00009 // the Free Software Foundation, either version 3 of the License, or 00010 // (at your option) any later version. 00011 // 00012 // GraspIt! is distributed in the hope that it will be useful, 00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 // GNU General Public License for more details. 00016 // 00017 // You should have received a copy of the GNU General Public License 00018 // along with GraspIt!. If not, see <http://www.gnu.org/licenses/>. 00019 // 00020 // Authors: Steffen Knoop 00021 // Andrew T. Miller 00022 // 00023 // $Id: grasp_directions.h,v 1.2 2009/03/25 22:10:23 cmatei Exp $ 00024 // 00025 //###################################################################### 00026 00027 /***************************************************************************/ 00028 /* FILE: grasp_directions.h */ 00029 /* AUTHOR: Steffen Knoop */ 00030 /* DATE: 03-27-2002 */ 00031 /***************************************************************************/ 00032 00037 #ifndef __GRASP_DIRECTIONS_H__ 00038 #define __GRASP_DIRECTIONS_H__ 00039 00040 enum graspDirectionType{GDT_CYL_SIDES, GDT_CYL_TOP_BOTTOM, 00041 GDT_CUBE_WIDTH, 00042 GDT_CUBE_HEIGHT, 00043 GDT_CUBE_DEPTH, 00044 GDT_SPH, 00045 GDT_CONE_TOP, GDT_CONE_BOTTOM, GDT_CONE_SIDE_PLANE, GDT_CONE_EDGE}; 00046 00047 #include "grasp_coordinates.h" 00048 00050 00056 class GraspDirection 00057 { 00058 protected: 00060 coordinates* point; 00061 00063 coordinates* dir; 00064 00066 bool empty; 00067 00069 graspDirectionType gdType; 00070 00071 public: 00072 GraspDirection(); 00073 virtual ~GraspDirection(); 00074 00076 virtual void set_point(coordinates in) = 0; 00077 coordinates get_point() const; 00078 00080 virtual void set_dir(coordinates in) = 0; 00081 coordinates get_dir() const; 00082 00083 void set_empty(bool in); 00084 bool get_empty() const; 00085 00086 void set_gdType(graspDirectionType); 00087 graspDirectionType get_gdType() const; 00088 00089 bool operator==(const GraspDirection&); 00090 00091 }; 00092 00094 class cartesianGraspDirection : 00095 public GraspDirection 00096 { 00097 public: 00098 cartesianGraspDirection(); 00099 cartesianGraspDirection(GraspDirection*); 00100 cartesianGraspDirection(cartesianGraspDirection*); 00101 cartesianGraspDirection(const cartesianGraspDirection&); 00102 00103 ~cartesianGraspDirection(); 00104 00105 void set_point(coordinates in); 00106 void set_dir(coordinates in); 00107 00108 double distanceTo(cartesianGraspDirection) const; 00109 }; 00110 00112 class cylindricalGraspDirection : 00113 public GraspDirection 00114 { 00115 public: 00116 cylindricalGraspDirection(); 00117 cylindricalGraspDirection(GraspDirection*); 00118 cylindricalGraspDirection(cylindricalGraspDirection*); 00119 cylindricalGraspDirection(const cylindricalGraspDirection&); 00120 00121 ~cylindricalGraspDirection(); 00122 00123 void set_point(coordinates in); 00124 void set_dir(coordinates in); 00125 }; 00126 00127 00129 class sphericalGraspDirection : 00130 public GraspDirection 00131 { 00132 public: 00133 sphericalGraspDirection(); 00134 sphericalGraspDirection(GraspDirection*); 00135 sphericalGraspDirection(sphericalGraspDirection*); 00136 sphericalGraspDirection(const sphericalGraspDirection&); 00137 00138 ~sphericalGraspDirection(); 00139 00140 void set_point(coordinates in); 00141 void set_dir(coordinates in); 00142 }; 00143 00144 #endif 00145 00146 00147 /****************** 00148 Local Variables: 00149 mode:c++ 00150 End: 00151 ******************/ 00152 00153 00154 00155 00156 00157 00158 00159 00160 00161 00162 00163 00164 00165 00166