/* JS, Nov 2007 The 2D/3D template-base classes should go into the libsrc/gprim directory in geom2d only 2D - Geometry classes (with material properties etc.) */ #include "spline.hpp" #ifndef _FILE_SPLINEGEOMETRY #define _FILE_SPLINEGEOMETRY namespace netgen { template < int D > class SplineGeometry { // protected: public: NgArray < GeomPoint > geompoints; NgArray < SplineSeg* > splines; SplineGeometry() : geompoints{}, splines{} { ; } DLL_HEADER ~SplineGeometry(); DLL_HEADER int Load (const NgArray & raw_data, const int startpos = 0); virtual void DoArchive(Archive& ar) { ar & geompoints & splines; } DLL_HEADER void GetRawData (NgArray & raw_data) const; const NgArray*> & GetSplines () const { return splines; } int GetNSplines (void) const { return splines.Size(); } string GetSplineType (const int i) const { return splines[i]->GetType(); } SplineSeg & GetSpline (const int i) {return *splines[i];} const SplineSeg & GetSpline (const int i) const {return *splines[i];} DLL_HEADER void GetBoundingBox (Box & box) const; Box GetBoundingBox () const { Box box; GetBoundingBox (box); return box; } int GetNP () const { return geompoints.Size(); } const GeomPoint & GetPoint(int i) const { return geompoints[i]; } // void SetGrading (const double grading); DLL_HEADER void AppendPoint (const Point & p, const double reffac = 1., const bool hpref = false); void AppendSegment(SplineSeg * spline) { splines.Append (spline); } }; } #endif // _FILE_SPLINEGEOMETRY