00001 /*************************************************************************** 00002 * Copyright (C) 2007 by Universidad Nacional de Colombia * 00003 * http://www.unal.edu.co * 00004 * * 00005 * This program is free software; you can redistribute it and/or modify * 00006 * it under the terms of the GNU General Public License as published by * 00007 * the Free Software Foundation; either version 2 of the License, or * 00008 * (at your option) any later version. * 00009 * * 00010 * This program is distributed in the hope that it will be useful, * 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00013 * GNU General Public License for more details. * 00014 * * 00015 * You should have received a copy of the GNU General Public License * 00016 * along with this program; if not, write to the * 00017 * Free Software Foundation, Inc., * 00018 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 00019 ***************************************************************************/ 00020 #ifndef TRIANGLE_H 00021 #define TRIANGLE_H 00022 00023 #include <Point.h> 00024 00025 #define TriangleList list<Triangle> 00026 #define TriangleVector vector<Triangle> 00027 00035 class Triangle{ 00036 public: 00037 Triangle(); 00038 Triangle( int id, Point p1, Point p2, Point p3 ); 00039 Triangle( const Triangle& tr ); 00040 bool operator == ( const Triangle& p ) ; 00041 friend bool operator < ( const Triangle& tr1, const Triangle& tr2 ) ; 00042 ~Triangle(); 00043 00044 void setId( int id ) ; 00045 void setPoint1( Point p1 ) ; 00046 void setPoint2( Point p2 ) ; 00047 void setPoint3( Point p3 ) ; 00048 00049 int getId() const ; 00050 Point getPoint1() const ; 00051 Point getPoint2() const ; 00052 Point getPoint3() const ; 00053 00054 void setProcessed( bool processed ); 00055 bool isProcessed() const; 00056 00057 bool contains( Point p ) ; 00058 bool contains( int pointId ) ; 00059 00060 private: 00061 int id ; 00062 Point p1 ; 00063 Point p2 ; 00064 Point p3 ; 00065 bool processed ; 00066 }; 00067 00068 #endif