//=========================================================================== // GoTools Core - SINTEF Geometry Tools Core library, version 2.0.1 // // Copyright (C) 2000-2007, 2010 SINTEF ICT, Applied Mathematics, Norway. // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation version 2 of the License. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., // 59 Temple Place - Suite 330, // Boston, MA 02111-1307, USA. // // Contact information: E-mail: tor.dokken@sintef.no // SINTEF ICT, Department of Applied Mathematics, // P.O. Box 124 Blindern, // 0314 Oslo, Norway. // // Other licenses are also available for this software, notably licenses // for: // - Building commercial software. // - Building software whose source code you wish to keep private. //=========================================================================== 00015 #ifndef PARAMETRICSURFACETESSELATOR_H 00016 #define PARAMETRICSURFACETESSELATOR_H 00017 00018 #include "GoTools/tesselator/Tesselator.h" 00019 #include "GoTools/tesselator/RegularMesh.h" 00020 #include "GoTools/geometry/ParamSurface.h" 00021 #include "GoTools/tesselator/GenericTriMesh.h" 00022 #include <boost/shared_ptr.hpp> 00023 #include "GoTools/utils/config.h" 00024 00025 namespace Go 00026 { 00027 00032 class GO_API ParametricSurfaceTesselator : public Tesselator 00033 { 00034 public: 00035 ParametricSurfaceTesselator(const ParamSurface& surf) 00036 : surf_(surf), m_(20), n_(20) 00037 { 00038 // Use of texture coordinates in mesh_ seems to be buggy - 00039 // commenting out for now. @jbt 00040 // mesh_ = boost::shared_ptr<GenericTriMesh>(new GenericTriMesh(0,0,true,true)); 00041 mesh_ = boost::shared_ptr<GenericTriMesh>(new GenericTriMesh(0,0,true,false)); 00042 } 00043 00044 virtual ~ParametricSurfaceTesselator(); 00045 00046 virtual void tesselate(); 00047 00048 boost::shared_ptr<GenericTriMesh> getMesh() 00049 { 00050 return mesh_; 00051 } 00052 00053 void changeRes(int n, int m); 00054 00055 void getRes(int& n, int& m) 00056 { 00057 m = m_; 00058 n = n_; 00059 } 00060 00061 private: 00062 const ParamSurface& surf_; 00063 boost::shared_ptr<GenericTriMesh> mesh_; 00064 int m_; 00065 int n_; 00066 00067 }; 00068 00069 } // namespace Go 00070 00071 00072 00073 00074 #endif // PARAMETRICSURFACETESSELATOR_H 00075