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 SURFACE_H 00021 #define SURFACE_H 00022 00023 #include <string> 00024 #include <vector> 00025 #include <list> 00026 #include <map> 00027 using namespace std ; 00028 00029 #include <Point.h> 00030 #include <Triangle.h> 00031 00032 #define SurfacesVector vector<Surface> 00033 00041 class Surface : pair< PointVector, TriangleVector >{ 00042 public: 00043 Surface(); 00044 Surface( const vector<Point>& lpo, const vector<Triangle>& ltri ); 00045 Surface( const Surface& surf ); 00046 ~Surface(); 00047 00048 PointVector getPoints() const ; 00049 TriangleVector getTriangles() const ; 00050 00051 void setPoints( const PointVector& pv ) ; 00052 void setTriangles( const TriangleVector& tv ) ; 00053 00054 void saveOogl( string filename ) ; 00055 void printOogl( ostream& os ) ; 00056 SurfacesVector computeComponents() ; 00057 bool contains( Surface s ) ; 00058 bool isContainedIn( Surface s , int a, int b) ; 00059 00060 double computeArea() ; 00061 // double getArea() ; 00062 00063 private: 00064 // double area ; 00065 }; 00066 00067 #endif