diff --git a/libsrc/csg/csgeom.hpp b/libsrc/csg/csgeom.hpp index 3106326e..e925cb72 100644 --- a/libsrc/csg/csgeom.hpp +++ b/libsrc/csg/csgeom.hpp @@ -144,7 +144,7 @@ namespace netgen string filename; /// store splinesurfaces, such that added ones do not get deleted before geometry does - std::vector> spline_surfaces; + Array> spline_surfaces; public: CSGeometry (); @@ -320,7 +320,7 @@ namespace netgen virtual const Refinement & GetRefinement () const; - void AddSplineSurface (shared_ptr ss) { spline_surfaces.push_back(ss); } + void AddSplineSurface (shared_ptr ss) { spline_surfaces.Append(ss); } }; diff --git a/libsrc/csg/python_csg.cpp b/libsrc/csg/python_csg.cpp index b61a9934..a59f6f1f 100644 --- a/libsrc/csg/python_csg.cpp +++ b/libsrc/csg/python_csg.cpp @@ -211,7 +211,7 @@ DLL_HEADER void ExportCSG(py::module &m) .def("__init__", FunctionPointer ([](SplineSurface* instance, shared_ptr base, py::list cuts) { auto primitive = dynamic_cast (base->GetSolid()->GetPrimitive()); - auto acuts = make_shared>>(); + auto acuts = make_shared>>(); for(int i = 0; i> sps(cuts[i]); @@ -219,7 +219,7 @@ DLL_HEADER void ExportCSG(py::module &m) throw NgException("Cut must be SurfacePrimitive in constructor of SplineSurface!"); auto sp = dynamic_cast(sps()->GetSolid()->GetPrimitive()); if(sp) - acuts->push_back(shared_ptr(sp)); + acuts->Append(shared_ptr(sp)); else throw NgException("Cut must be SurfacePrimitive in constructor of SplineSurface!"); } diff --git a/libsrc/csg/splinesurface.cpp b/libsrc/csg/splinesurface.cpp index 65a0f988..a6e1124a 100644 --- a/libsrc/csg/splinesurface.cpp +++ b/libsrc/csg/splinesurface.cpp @@ -6,14 +6,14 @@ namespace netgen void SplineSurface :: AppendPoint(const Point<3> & p, const double reffac, const bool hpref) { auto pp = Point<3>(p); - geompoints.push_back(GeomPoint<3>(pp,reffac)); - geompoints.back().hpref = hpref; + geompoints.Append(GeomPoint<3>(pp,reffac)); + geompoints.Last().hpref = hpref; } void SplineSurface :: AppendSegment(shared_ptr> sp, string & bcname, double amaxh) { - splines.push_back(sp); - bcnames.push_back(bcname); + splines.Append(sp); + bcnames.Append(bcname); maxh.Append(amaxh); } @@ -21,7 +21,7 @@ void SplineSurface :: AppendPoint(const Point<3> & p, const double reffac, const { double eps = 1e-5; - for(int i=0; i(splines[i]->GetPoint(0)); Project(pp1); @@ -35,14 +35,14 @@ void SplineSurface :: AppendPoint(const Point<3> & p, const double reffac, const return "default"; } - const shared_ptr>> SplineSurface :: CreateCuttingSurfaces() + const shared_ptr>> SplineSurface :: CreateCuttingSurfaces() { if(all_cuts) return all_cuts; - auto cuttings = make_shared>>(); + auto cuttings = make_shared>>(); for (auto cut : *cuts) - cuttings->push_back(cut); - for(int i = 0; iAppend(cut); + for(int i = 0; i*>(spline.get()); @@ -58,7 +58,7 @@ void SplineSurface :: AppendPoint(const Point<3> & p, const double reffac, const { plane->SetMaxH(maxh[i]); } - cuttings->push_back(plane); + cuttings->Append(plane); } else throw NgException("Spline type not implemented for SplineSurface!"); diff --git a/libsrc/csg/splinesurface.hpp b/libsrc/csg/splinesurface.hpp index 0bc5494c..e17f3eef 100644 --- a/libsrc/csg/splinesurface.hpp +++ b/libsrc/csg/splinesurface.hpp @@ -7,27 +7,27 @@ namespace netgen class SplineSurface : public OneSurfacePrimitive { protected: - std::vector> geompoints; - std::vector>> splines; - std::vector bcnames; + Array> geompoints; + Array>> splines; + Array bcnames; Array maxh; shared_ptr baseprimitive; - shared_ptr>> cuts; - shared_ptr>> all_cuts; + shared_ptr>> cuts; + shared_ptr>> all_cuts; public: - SplineSurface(shared_ptr abaseprimitive, shared_ptr>> acuts) : + SplineSurface(shared_ptr abaseprimitive, shared_ptr>> acuts) : OneSurfacePrimitive(), baseprimitive(abaseprimitive), cuts(acuts) { ; } virtual ~SplineSurface() { ; } const auto & GetSplines() const { return splines; } - int GetNSplines() const { return splines.size(); } - const std::vector>& GetPoints() const { return geompoints; } + int GetNSplines() const { return splines.Size(); } + const Array>& GetPoints() const { return geompoints; } string GetSplineType(const int i) const { return splines[i]->GetType(); } SplineSeg<3> & GetSpline(const int i) { return *splines[i]; } const SplineSeg<3> & GetSpline(const int i) const { return *splines[i]; } - int GetNP() const { return geompoints.size(); } + int GetNP() const { return geompoints.Size(); } const GeomPoint<3> & GetPoint(int i) const { return geompoints[i]; } string GetBCName(int i) const { return bcnames[i]; } string GetBCNameOf(Point<3> p1, Point<3> p2) const; @@ -35,8 +35,8 @@ namespace netgen DLL_HEADER void AppendPoint(const Point<3> & p, const double reffac = 1., const bool hpref=false); void AppendSegment(shared_ptr> spline, string & bcname, double amaxh = -1); - const shared_ptr>> CreateCuttingSurfaces(); - const shared_ptr>> GetCuts() const { return all_cuts; } + const shared_ptr>> CreateCuttingSurfaces(); + const shared_ptr>> GetCuts() const { return all_cuts; } const shared_ptr GetBase() const { return baseprimitive; } virtual void Project (Point<3> & p3d) const { baseprimitive->Project(p3d); }