ParamPointInt.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 _PARAMPOINTINT_H
00034 #define _PARAMPOINTINT_H
00035 
00036 
00037 #include "ParamGeomInt.h"
00038 #include "Values.h"
00039 
00040 
00041 namespace Go {
00044 
00045 
00046 
00047 class RotatedBox;
00048 
00049 
00052 
00053 class ParamPointInt : public ParamGeomInt {
00054 public:
00060     explicit ParamPointInt(boost::shared_ptr<Point> point,
00061                            ParamGeomInt* parent = 0);
00062 
00064     virtual ~ParamPointInt() {};
00065 
00071     virtual void point(Point& pt, const double* tpar) const
00072     { pt = *(point_.get()); }
00073 
00088     virtual void point(std::vector<Point>& pt, 
00089                        const double* tpar, 
00090                        int derivs,  
00091                        const bool* from_right = 0,
00092                        double resolution = 1.0e-12) const
00093     {
00094         DEBUG_ERROR_IF(derivs != 0,
00095                        "Asked for derivatives of a standalone point.");
00096         pt.resize(1);
00097         pt[0] = *(point_.get());
00098     }
00099 
00102     virtual ParamPointInt* getParamPointInt()
00103     { return this; }
00104 
00106     virtual int numParams() const
00107     { return 0; }
00108 
00109         
00118     virtual void getLengthAndWiggle(double *length, double *wiggle) {}
00119 
00124     virtual bool hasInnerKnots(int pardir) const
00125     { return false;  }
00126 
00131     virtual bool hasCriticalVals(int pardir) const
00132     { return false; }
00133 
00138     virtual bool hasCriticalValsOrKnots(int pardir) const
00139     { return false; }
00140 
00144     virtual bool canDivide(int pardir)
00145     { return false; }
00146 
00150     virtual std::vector<double> getCriticalVals(int pardir) const
00151     {
00152         std::vector<double> seg;
00153         return seg;
00154     }
00155 
00160     virtual std::vector<double> getInnerKnotVals(int pardir, 
00161                                                  bool sort=false) const
00162     {
00163         std::vector<double> knots;
00164         return knots;
00165     }
00166 
00171     virtual std::vector<double> getCriticalValsAndKnots(int pardir) const
00172     {
00173         std::vector<double> vals;
00174         return vals;
00175     }
00176 
00181     virtual int getMeshSize(int dir)
00182     { return 1; }  // The point itself
00183 
00190     virtual double paramFromMesh(int dir, int idx)
00191     { return 0.0; }  // Arbitrary
00192 
00194     virtual std::vector<double>::iterator getMesh()
00195     { return coords_.begin(); }
00196 
00200     virtual double startParam(int pardir) const
00201     { return 0.0; }
00202 
00207     virtual double endParam(int pardir) const
00208     { return 0.0; }
00209 
00215     virtual bool boundaryPoint(const double* par, double eps) const 
00216     { return true; }
00217 
00227     virtual void 
00228     subdivide(int pardir, double par, 
00229               std::vector<boost::shared_ptr<ParamGeomInt> >& subdiv_objs,
00230               std::vector<boost::shared_ptr<ParamGeomInt> >& bd_objs) {}
00231 
00234     virtual CompositeBox compositeBox() const;
00235 
00239     virtual DirectionCone directionCone() const;
00240 
00243     virtual void 
00244     getBoundaryObjects(std::vector<boost::
00245                        shared_ptr<BoundaryGeomInt> >& bd_objs);
00246        
00248     virtual int dimension() const
00249     { return dim_; }
00250 
00257     virtual bool isDegenerate(double epsge, int dir, double *par)
00258     { return false; }
00259 
00262     virtual bool isSpline()
00263     { return false; }
00264 
00272     virtual double getOptimizedConeAngle(Point& axis1, Point& axis2)
00273     { return M_PI; }
00274 
00280     RotatedBox getRotatedBox(std::vector<Point>& axis) const;
00281 
00282 protected:
00283     // Data members
00284 
00285     boost::shared_ptr<Point> point_;
00286 
00287     int dim_; // Space dimension.
00288 
00289     ParamCurveInt *parentcurve_;
00290 
00291     mutable std::vector<double> coords_;
00292 
00293 };
00294 
00295 
00297 } // namespace Go
00298 
00299 
00300 #endif // _PARAMPOINTINT_H
00301 

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