//=========================================================================== // 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 CURVETESSELATOR_H 00016 #define CURVETESSELATOR_H 00017 00018 #include "GoTools/tesselator/Tesselator.h" 00019 #include "GoTools/tesselator/LineStrip.h" 00020 #include "GoTools/geometry/ParamCurve.h" 00021 00025 namespace Go 00026 { 00027 00028 class CurveTesselator : public Tesselator 00029 { 00030 public: 00031 CurveTesselator(const ParamCurve& curve) 00032 : curve_(curve) 00033 { 00034 mesh_ = boost::shared_ptr<LineStrip>(new LineStrip(500)); 00035 } 00036 00037 virtual ~CurveTesselator(); 00038 00039 void tesselate(); 00040 00041 boost::shared_ptr<LineStrip> getMesh() 00042 { 00043 return mesh_; 00044 } 00045 00046 // 00047 // 010430: I'm not sure if we're going to need these functions, an 00048 // alternative is to trigger these actions when asking for 00049 // pointers to the discretizations, which will be done by 00050 // the 'painter' when that one is requested to redraw the scene... 00051 // (jon) 00052 // 00053 00054 void changeRes(int n) 00055 { 00056 mesh_->resize(n); 00057 tesselate(); 00058 } 00059 void getRes(int& n) 00060 { 00061 n = mesh_->numVertices(); 00062 } 00063 00064 private: 00065 const ParamCurve& curve_; 00066 boost::shared_ptr<LineStrip> mesh_; 00067 }; 00068 00069 } // namespace Go 00070 00071 #endif // CURVETESSELATOR_H 00072
Generated on Tue Sep 21 15:44:17 2010 for GoTools Core by  doxygen 1.6.3