netgen/libsrc/csg/explicitcurve2d.hpp

114 lines
2.6 KiB
C++
Raw Normal View History

2009-01-13 04:40:13 +05:00
#ifndef FILE_EXPLICITCURVE2D
#define FILE_EXPLICITCURVE2D
/**************************************************************************/
/* File: explicitcurve2d.hh */
/* Author: Joachim Schoeberl */
/* Date: 14. Oct. 96 */
/**************************************************************************/
2009-09-07 17:50:13 +06:00
namespace netgen
2009-01-13 04:40:13 +05:00
{
2009-09-07 17:50:13 +06:00
/*
2009-01-13 04:40:13 +05:00
2009-09-07 17:50:13 +06:00
Explicit 2D Curve repesentation
2009-01-13 04:40:13 +05:00
2009-09-07 17:50:13 +06:00
*/
///
class ExplicitCurve2d : public Curve2d
{
public:
///
ExplicitCurve2d ();
///
virtual void Project (Point<2> & p) const;
///
virtual double ProjectParam (const Point<2> & p) const = 0;
///
virtual double NumericalProjectParam (const Point<2> & p, double lb, double ub) const;
///
virtual double MinParam () const = 0;
///
virtual double MaxParam () const = 0;
///
virtual Point<2> Eval (double t) const = 0;
///
virtual Vec<2> EvalPrime (double t) const = 0;
///
virtual Vec<2> Normal (double t) const;
///
virtual void NormalVector (const Point<2> & p, Vec<2> & n) const;
///
virtual Vec<2> EvalPrimePrime (double t) const = 0;
///
virtual double MaxCurvature () const;
///
virtual double MaxCurvatureLoc (const Point<2> & p, double rad) const;
///
virtual Point<2> CurvCircle (double t) const;
///
virtual void Print (ostream & /* str */) const { };
2009-01-13 04:40:13 +05:00
2009-09-07 17:50:13 +06:00
///
virtual int SectionUsed (double /* t */) const { return 1; }
///
virtual void Reduce (const Point<2> & /* p */, double /* rad */) { };
///
virtual void UnReduce () { };
};
2009-01-13 04:40:13 +05:00
///
2009-09-07 17:50:13 +06:00
class BSplineCurve2d : public ExplicitCurve2d
{
///
Array<Point<2> > points;
///
Array<int> intervallused;
///
int redlevel;
2009-01-13 04:40:13 +05:00
2009-09-07 17:50:13 +06:00
public:
///
BSplineCurve2d ();
///
void AddPoint (const Point<2> & apoint);
2009-01-13 04:40:13 +05:00
2009-09-07 17:50:13 +06:00
bool Inside (const Point<2> & p, double & dist) const;
2009-01-13 04:40:13 +05:00
2009-09-07 17:50:13 +06:00
///
virtual double ProjectParam (const Point<2> & p) const;
///
virtual double MinParam () const { return 0; }
///
virtual double MaxParam () const { return points.Size(); }
///
virtual Point<2> Eval (double t) const;
///
virtual Vec<2> EvalPrime (double t) const;
///
virtual Vec<2> EvalPrimePrime (double t) const;
///
virtual void Print (ostream & str) const;
///
virtual int SectionUsed (double t) const;
///
virtual void Reduce (const Point<2> & p, double rad);
///
virtual void UnReduce ();
};
}
2009-01-13 04:40:13 +05:00
#endif