Spline1FunctionInt.h

00001 //===========================================================================
00002 // GoTools - SINTEF Geometry Tools
00003 //
00004 // GoTools module: Intersections, version 1.0
00005 //
00006 // Copyright (C) 2000-2007 SINTEF ICT, Applied Mathematics, Norway.
00007 //
00008 // This program is free software; you can redistribute it and/or          
00009 // modify it under the terms of the GNU General Public License            
00010 // as published by the Free Software Foundation version 2 of the License. 
00011 //
00012 // This program is distributed in the hope that it will be useful,        
00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of         
00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          
00015 // GNU General Public License for more details.                           
00016 //
00017 // You should have received a copy of the GNU General Public License      
00018 // along with this program; if not, write to the Free Software            
00019 // Foundation, Inc.,                                                      
00020 // 59 Temple Place - Suite 330,                                           
00021 // Boston, MA  02111-1307, USA.                                           
00022 //
00023 // Contact information: E-mail: tor.dokken@sintef.no                      
00024 // SINTEF ICT, Department of Applied Mathematics,                         
00025 // P.O. Box 124 Blindern,                                                 
00026 // 0314 Oslo, Norway.                                                     
00027 //
00028 // Other licenses are also available for this software, notably licenses
00029 // for:
00030 // - Building commercial software.                                        
00031 // - Building software whose source code you wish to keep private.        
00032 //===========================================================================
00033 #ifndef _SPLINE1FUNCTIONINT_H
00034 #define _SPLINE1FUNCTIONINT_H
00035 
00036 
00037 #include "Param1FunctionInt.h"
00038 
00039 
00040 namespace Go {
00043 
00044 
00045 
00046 class SplineCurve;
00047 
00048 
00051 
00052 class Spline1FunctionInt : public Param1FunctionInt {
00053 public:
00059     explicit Spline1FunctionInt(boost::shared_ptr<ParamCurve> curve);
00060 
00067     explicit Spline1FunctionInt(boost::shared_ptr<ParamCurve> curve, 
00068                                 ParamFunctionInt *parent);
00069 
00071     virtual ~Spline1FunctionInt() {};
00072 
00079     virtual boost::shared_ptr<Param1FunctionInt> 
00080     makeIntFunction(boost::shared_ptr<ParamCurve> curve);
00081     
00086     virtual bool hasInnerKnots(int pardir) const;
00087 
00092     virtual bool hasCriticalValsOrKnots(int pardir) const;
00093 
00098     virtual std::vector<double> getInnerKnotVals(int pardir,
00099                                                  bool sort = false) const;
00100 
00105     virtual std::vector<double> getCriticalValsAndKnots(int pardir) const; 
00106 
00111     virtual int getMeshSize(int dir);
00112 
00118     virtual double paramFromMesh(int dir, int idx);
00119 
00122     virtual std::vector<double>::iterator getMesh();
00123 
00124     // Accepts non-strict monotonicity, as long as sf is not totally flat.
00130     virtual bool monotone(Point& dir, double tol=1.0e-15) const;
00131 
00132     // Functions used for coincidence testint
00133 
00134     // Find the interval in which t lies, if t is within tol of an
00135     // existing knot, t will be changed to that knot.
00141     virtual int knotIntervalFuzzy(double& t, double tol) const;
00142 
00148     virtual double nextSegmentVal(double par, bool forward) const;
00149 
00150 protected:
00151 
00152     // Data members
00153     boost::shared_ptr<SplineCurve> spcv_; // Same cv as in
00154                                           // Param1FunctionInt, casted
00155                                           // to spline.
00156 
00157 };
00158 
00159 
00161 } // namespace Go
00162 
00163 
00164 #endif // _SPLINE1FUNCTIONINT_H
00165 
00166     
00167 

Generated on Fri Nov 23 12:24:33 2007 for GoTools Intersections Library by  doxygen 1.5.1