00001 //---------------------------------------------------------------------- 00002 // The Motion Strategy Library (MSL) 00003 //---------------------------------------------------------------------- 00004 // 00005 // Copyright (c) 1998-2000 Iowa State University and Steve LaValle. 00006 // All Rights Reserved. 00007 // 00008 // Permission to use, copy, and distribute this software and its 00009 // documentation is hereby granted free of charge, provided that 00010 // (1) it is not a component of a commercial product, and 00011 // (2) this notice appears in all copies of the software and 00012 // related documentation. 00013 // 00014 // Iowa State University and the author make no representations 00015 // about the suitability or fitness of this software for any purpose. 00016 // It is provided "as is" without express or implied warranty. 00017 //---------------------------------------------------------------------- 00018 00019 #ifndef MSL_3DTRIANGLE_H 00020 #define MSL_3DTRIANGLE_H 00021 00022 #include <LEDA/d3_point.h> 00023 #include <LEDA/polygon.h> 00024 #include <LEDA/segment.h> 00025 00026 #include <LEDA/REDEFINE_NAMES.h> 00027 00029 00030 class Triangle{ 00031 public: 00032 d3_point p1,p2,p3; 00033 00034 Triangle(d3_point pt1, d3_point pt2, d3_point pt3); 00035 Triangle(); 00036 ~Triangle(){} 00037 Triangle(const Triangle& tr); 00038 friend istream& operator>> (istream& is, Triangle& tr) 00039 { is >> tr.p1 >> tr.p2 >> tr.p3; return is; } 00040 friend ostream& operator<< (ostream& os, const Triangle& tr) 00041 { os << tr.p1 << " " << tr.p2 << " " << tr.p3 << endl; return os; } 00042 const Triangle& operator= (const Triangle& tr) 00043 { p1=tr.p1; p2=tr.p2; p3=tr.p3; return (*this);} 00044 }; 00045 00046 00048 list<Triangle> PolygonsToTriangles(const list<polygon> &pl, 00049 double thickness); 00050 00052 list<polygon> TrianglesToPolygons(const list<Triangle> &tl); 00053 00054 #include <LEDA/UNDEFINE_NAMES.h> 00055 00056 #endif