ParamObjectInt.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 _PARAMOBJECTINT_H
00034 #define _PARAMOBJECTINT_H
00035 
00036 
00037 #include "GeomObjectInt.h"
00038 #include "Point.h"
00039 #include <vector>
00040 
00041 
00042 namespace Go {
00045 
00046 
00047 
00048 class CompositeBox;
00049 class ParamPointInt;
00050 class ParamCurveInt;
00051 class ParamSurfaceInt;
00052 
00053 
00056 
00057 class ParamObjectInt : public GeomObjectInt {
00058 public:
00062     ParamObjectInt(ParamObjectInt* parent = 0) : parent_(parent) {}
00063     
00065     virtual ~ParamObjectInt() {}
00066     
00070     virtual ParamPointInt* getParamPointInt()
00071     { return 0; }
00072 
00076     virtual ParamCurveInt* getParamCurveInt()
00077     { return 0; }
00078 
00083     virtual ParamSurfaceInt* getParamSurfaceInt()
00084     { return 0; }
00085 
00090     virtual void point(Point& pt, const double* tpar) const = 0;
00091 
00104     virtual void point(std::vector<Point>& pt, 
00105                        const double* tpar, 
00106                        int derivs,  
00107                        const bool* from_right = 0,
00108                        double resolution = 1.0e-12) const = 0;
00109 
00111     virtual int numParams() const = 0;
00112 
00120     virtual void getLengthAndWiggle(double *length, double *wiggle) = 0;
00121 
00126     virtual bool hasInnerKnots(int pardir) const = 0;
00127 
00132     virtual bool hasCriticalVals(int pardir) const = 0;
00133 
00135     virtual void setCriticalVal(int pardir, double par) 
00136         {;}  // Currently no action
00137 
00142     virtual bool hasCriticalValsOrKnots(int pardir) const = 0;
00143 
00147     virtual bool canDivide(int pardir) = 0;
00148 
00149     virtual bool canDivideTinyTriang(int pardir)
00150         { return true;  // Mostly not an issule 
00151         }
00152 
00157     virtual std::vector<double> getCriticalVals(int pardir) const = 0;
00158 
00163     virtual std::vector<double> getInnerKnotVals(int pardir,
00164                                                  bool sort=false) const = 0;
00165 
00170     virtual std::vector<double> getCriticalValsAndKnots(int pardir) const = 0;
00171 
00175     virtual double startParam(int pardir) const = 0;
00176 
00180     virtual double endParam(int pardir) const = 0;
00181 
00188     virtual bool isDegenerate(double epsge, int dir, double *par)
00189     { return false; }
00190 
00196     virtual bool boundaryPoint(const double* par, double eps) const = 0;
00197 
00200     void setParent(ParamObjectInt* parent)
00201     { parent_ = parent; }
00202 
00204     ParamObjectInt* getParent() const 
00205     { return parent_; }
00206 
00208     virtual CompositeBox compositeBox() const = 0;
00209 
00214     const ParamObjectInt* getSameTypeAncestor() const
00215     {
00216         if (parent_ && (parent_->numParams() == numParams())) {
00217             return parent_->getSameTypeAncestor();
00218         } else {
00219             return this;
00220         }
00221     }
00222 
00228     virtual bool inCorner(const double *par, double epspar) const
00229         {
00230             return false;  // Relevant for surfaces and overriden for those
00231         }
00232 
00233 protected:
00234 
00235     ParamObjectInt* parent_;
00236 
00237 };
00238 
00239 
00241 } // namespace Go
00242 
00243 
00244 #endif // _PARAMOBJECTINT_H
00245 

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