mirror of
https://github.com/NGSolve/netgen.git
synced 2025-01-12 22:20:35 +05:00
Merge branch 'pointnd_to_point' into 'master'
Change some PointNd to Point<N> functions See merge request jschoeberl/netgen!252
This commit is contained in:
commit
80c1459c3e
@ -23,33 +23,27 @@ Meshing2Surfaces :: Meshing2Surfaces (const Surface & asurf,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Meshing2Surfaces :: DefineTransformation (const Point3d & p1, const Point3d & p2,
|
void Meshing2Surfaces :: DefineTransformation (const Point<3> & p1, const Point<3> & p2,
|
||||||
const PointGeomInfo * geominfo1,
|
const PointGeomInfo * geominfo1,
|
||||||
const PointGeomInfo * geominfo2)
|
const PointGeomInfo * geominfo2)
|
||||||
{
|
{
|
||||||
((Surface&)surface).DefineTangentialPlane (p1, p2);
|
((Surface&)surface).DefineTangentialPlane (p1, p2);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Meshing2Surfaces :: TransformToPlain (const Point3d & locpoint,
|
void Meshing2Surfaces :: TransformToPlain (const Point<3> & locpoint,
|
||||||
const MultiPointGeomInfo & geominfo,
|
const MultiPointGeomInfo & geominfo,
|
||||||
Point2d & planepoint,
|
Point<2> & planepoint,
|
||||||
double h, int & zone)
|
double h, int & zone)
|
||||||
{
|
{
|
||||||
Point<2> hp;
|
surface.ToPlane (locpoint, planepoint, h, zone);
|
||||||
surface.ToPlane (locpoint, hp, h, zone);
|
|
||||||
planepoint.X() = hp(0);
|
|
||||||
planepoint.Y() = hp(1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int Meshing2Surfaces :: TransformFromPlain (Point2d & planepoint,
|
int Meshing2Surfaces :: TransformFromPlain (const Point<2> & planepoint,
|
||||||
Point3d & locpoint,
|
Point<3> & locpoint,
|
||||||
PointGeomInfo & gi,
|
PointGeomInfo & gi,
|
||||||
double h)
|
double h)
|
||||||
{
|
{
|
||||||
Point<3> hp;
|
surface.FromPlane (planepoint, locpoint, h);
|
||||||
Point<2> hp2 (planepoint.X(), planepoint.Y());
|
|
||||||
surface.FromPlane (hp2, hp, h);
|
|
||||||
locpoint = hp;
|
|
||||||
gi.trignum = 1;
|
gi.trignum = 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -21,21 +21,22 @@ namespace netgen
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
///
|
///
|
||||||
virtual void DefineTransformation (const Point3d & p1, const Point3d & p2,
|
void DefineTransformation(const Point<3> & p1,
|
||||||
const PointGeomInfo * geominfo1,
|
const Point<3> & p2,
|
||||||
const PointGeomInfo * geominfo2);
|
const PointGeomInfo * geominfo1,
|
||||||
|
const PointGeomInfo * geominfo2) override;
|
||||||
///
|
///
|
||||||
virtual void TransformToPlain (const Point3d & locpoint,
|
void TransformToPlain(const Point<3> & locpoint,
|
||||||
const MultiPointGeomInfo & geominfo,
|
const MultiPointGeomInfo & geominfo,
|
||||||
Point2d & plainpoint,
|
Point<2> & plainpoint,
|
||||||
double h, int & zone);
|
double h, int & zone) override;
|
||||||
///
|
///
|
||||||
virtual int TransformFromPlain (Point2d & plainpoint,
|
int TransformFromPlain(const Point<2>& plainpoint,
|
||||||
Point3d & locpoint,
|
Point<3>& locpoint,
|
||||||
PointGeomInfo & gi,
|
PointGeomInfo & gi,
|
||||||
double h);
|
double h) override;
|
||||||
///
|
///
|
||||||
virtual double CalcLocalH (const Point3d & p, double gh) const;
|
double CalcLocalH(const Point3d & p, double gh) const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -63,6 +63,9 @@ namespace netgen
|
|||||||
T & operator() (int i) { return x[i]; }
|
T & operator() (int i) { return x[i]; }
|
||||||
const T & operator() (int i) const { return x[i]; }
|
const T & operator() (int i) const { return x[i]; }
|
||||||
|
|
||||||
|
T& operator[] (int i) { return x[i]; }
|
||||||
|
const T& operator[] (int i) const { return x[i]; }
|
||||||
|
|
||||||
operator const T* () const { return x; }
|
operator const T* () const { return x; }
|
||||||
|
|
||||||
void DoArchive(Archive& archive)
|
void DoArchive(Archive& archive)
|
||||||
@ -120,6 +123,9 @@ namespace netgen
|
|||||||
T & operator() (int i) { return x[i]; }
|
T & operator() (int i) { return x[i]; }
|
||||||
const T & operator() (int i) const { return x[i]; }
|
const T & operator() (int i) const { return x[i]; }
|
||||||
|
|
||||||
|
T& operator[] (int i) { return x[i]; }
|
||||||
|
const T& operator[] (int i) const { return x[i]; }
|
||||||
|
|
||||||
operator const T* () const { return x; }
|
operator const T* () const { return x; }
|
||||||
|
|
||||||
void DoArchive(Archive& archive)
|
void DoArchive(Archive& archive)
|
||||||
|
@ -122,7 +122,7 @@ namespace netgen
|
|||||||
// static Vec3d ex, ey;
|
// static Vec3d ex, ey;
|
||||||
// static Point3d globp1;
|
// static Point3d globp1;
|
||||||
|
|
||||||
void Meshing2 :: DefineTransformation (const Point3d & p1, const Point3d & p2,
|
void Meshing2 :: DefineTransformation (const Point<3> & p1, const Point<3> & p2,
|
||||||
const PointGeomInfo * geominfo1,
|
const PointGeomInfo * geominfo1,
|
||||||
const PointGeomInfo * geominfo2)
|
const PointGeomInfo * geominfo2)
|
||||||
{
|
{
|
||||||
@ -134,28 +134,28 @@ namespace netgen
|
|||||||
ey.Z() = 0;
|
ey.Z() = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Meshing2 :: TransformToPlain (const Point3d & locpoint,
|
void Meshing2 :: TransformToPlain (const Point<3> & locpoint,
|
||||||
const MultiPointGeomInfo & geominf,
|
const MultiPointGeomInfo & geominf,
|
||||||
Point2d & plainpoint, double h, int & zone)
|
Point<2> & plainpoint, double h, int & zone)
|
||||||
{
|
{
|
||||||
Vec3d p1p (globp1, locpoint);
|
Vec3d p1p (globp1, locpoint);
|
||||||
|
|
||||||
// p1p = locpoint - globp1;
|
// p1p = locpoint - globp1;
|
||||||
p1p /= h;
|
p1p /= h;
|
||||||
plainpoint.X() = p1p * ex;
|
plainpoint[0] = p1p * ex;
|
||||||
plainpoint.Y() = p1p * ey;
|
plainpoint[1] = p1p * ey;
|
||||||
zone = 0;
|
zone = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int Meshing2 :: TransformFromPlain (Point2d & plainpoint,
|
int Meshing2 :: TransformFromPlain (const Point<2> & plainpoint,
|
||||||
Point3d & locpoint,
|
Point<3> & locpoint,
|
||||||
PointGeomInfo & gi,
|
PointGeomInfo & gi,
|
||||||
double h)
|
double h)
|
||||||
{
|
{
|
||||||
Vec3d p1p;
|
Vec3d p1p;
|
||||||
gi.trignum = 1;
|
gi.trignum = 1;
|
||||||
|
|
||||||
p1p = plainpoint.X() * ex + plainpoint.Y() * ey;
|
p1p = plainpoint[0] * ex + plainpoint[1] * ey;
|
||||||
p1p *= h;
|
p1p *= h;
|
||||||
locpoint = globp1 + p1p;
|
locpoint = globp1 + p1p;
|
||||||
return 0;
|
return 0;
|
||||||
@ -545,8 +545,12 @@ namespace netgen
|
|||||||
|
|
||||||
|
|
||||||
for (size_t i = 0; i < locpoints.Size(); i++)
|
for (size_t i = 0; i < locpoints.Size(); i++)
|
||||||
TransformToPlain (locpoints[i], mpgeominfo[i],
|
{
|
||||||
plainpoints[i], h, plainzones[i]);
|
Point<2> pp;
|
||||||
|
TransformToPlain (locpoints[i], mpgeominfo[i],
|
||||||
|
pp, h, plainzones[i]);
|
||||||
|
plainpoints[i] = pp;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
for (int i = 1; i <= locpoints.Size(); i++)
|
for (int i = 1; i <= locpoints.Size(); i++)
|
||||||
@ -841,9 +845,11 @@ namespace netgen
|
|||||||
|
|
||||||
for (int i = oldnp+1; i <= plainpoints.Size(); i++)
|
for (int i = oldnp+1; i <= plainpoints.Size(); i++)
|
||||||
{
|
{
|
||||||
|
Point<3> locp;
|
||||||
int err =
|
int err =
|
||||||
TransformFromPlain (plainpoints.Elem(i), locpoints.Elem(i),
|
TransformFromPlain (plainpoints.Elem(i), locp,
|
||||||
upgeominfo.Elem(i), h);
|
upgeominfo.Elem(i), h);
|
||||||
|
locpoints.Elem(i) = locp;
|
||||||
|
|
||||||
if (err)
|
if (err)
|
||||||
{
|
{
|
||||||
|
@ -84,16 +84,16 @@ protected:
|
|||||||
virtual double CalcLocalH (const Point3d & p, double gh) const;
|
virtual double CalcLocalH (const Point3d & p, double gh) const;
|
||||||
|
|
||||||
///
|
///
|
||||||
virtual void DefineTransformation (const Point3d & p1, const Point3d & p2,
|
virtual void DefineTransformation (const Point<3> & p1, const Point<3> & p2,
|
||||||
const PointGeomInfo * geominfo1,
|
const PointGeomInfo * geominfo1,
|
||||||
const PointGeomInfo * geominfo2);
|
const PointGeomInfo * geominfo2);
|
||||||
///
|
///
|
||||||
virtual void TransformToPlain (const Point3d & locpoint, const MultiPointGeomInfo & geominfo,
|
virtual void TransformToPlain (const Point<3> & locpoint, const MultiPointGeomInfo & geominfo,
|
||||||
Point2d & plainpoint, double h, int & zone);
|
Point<2> & plainpoint, double h, int & zone);
|
||||||
/// return 0 .. ok
|
/// return 0 .. ok
|
||||||
/// return >0 .. cannot transform point to true surface
|
/// return >0 .. cannot transform point to true surface
|
||||||
virtual int TransformFromPlain (Point2d & plainpoint,
|
virtual int TransformFromPlain (const Point<2>& plainpoint,
|
||||||
Point3d & locpoint,
|
Point<3> & locpoint,
|
||||||
PointGeomInfo & geominfo,
|
PointGeomInfo & geominfo,
|
||||||
double h);
|
double h);
|
||||||
|
|
||||||
|
@ -432,33 +432,27 @@ namespace netgen
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Meshing2OCCSurfaces :: DefineTransformation (const Point3d & p1, const Point3d & p2,
|
void Meshing2OCCSurfaces :: DefineTransformation (const Point<3> & p1, const Point<3> & p2,
|
||||||
const PointGeomInfo * geominfo1,
|
const PointGeomInfo * geominfo1,
|
||||||
const PointGeomInfo * geominfo2)
|
const PointGeomInfo * geominfo2)
|
||||||
{
|
{
|
||||||
((OCCSurface&)surface).DefineTangentialPlane (p1, *geominfo1, p2, *geominfo2);
|
((OCCSurface&)surface).DefineTangentialPlane (p1, *geominfo1, p2, *geominfo2);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Meshing2OCCSurfaces :: TransformToPlain (const Point3d & locpoint,
|
void Meshing2OCCSurfaces :: TransformToPlain (const Point<3>& locpoint,
|
||||||
const MultiPointGeomInfo & geominfo,
|
const MultiPointGeomInfo & geominfo,
|
||||||
Point2d & planepoint,
|
Point<2> & planepoint,
|
||||||
double h, int & zone)
|
double h, int & zone)
|
||||||
{
|
{
|
||||||
Point<2> hp;
|
surface.ToPlane (locpoint, geominfo.GetPGI(1), planepoint, h, zone);
|
||||||
surface.ToPlane (locpoint, geominfo.GetPGI(1), hp, h, zone);
|
|
||||||
planepoint.X() = hp(0);
|
|
||||||
planepoint.Y() = hp(1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int Meshing2OCCSurfaces :: TransformFromPlain (Point2d & planepoint,
|
int Meshing2OCCSurfaces :: TransformFromPlain (const Point<2> & planepoint,
|
||||||
Point3d & locpoint,
|
Point<3> & locpoint,
|
||||||
PointGeomInfo & gi,
|
PointGeomInfo & gi,
|
||||||
double h)
|
double h)
|
||||||
{
|
{
|
||||||
Point<3> hp;
|
surface.FromPlane (planepoint, locpoint, gi, h);
|
||||||
Point<2> hp2 (planepoint.X(), planepoint.Y());
|
|
||||||
surface.FromPlane (hp2, hp, gi, h);
|
|
||||||
locpoint = hp;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -122,22 +122,22 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
///
|
///
|
||||||
virtual void DefineTransformation (const Point3d & p1, const Point3d & p2,
|
void DefineTransformation (const Point<3> & p1, const Point<3> & p2,
|
||||||
const PointGeomInfo * geominfo1,
|
const PointGeomInfo * geominfo1,
|
||||||
const PointGeomInfo * geominfo2);
|
const PointGeomInfo * geominfo2) override;
|
||||||
///
|
///
|
||||||
virtual void TransformToPlain (const Point3d & locpoint,
|
void TransformToPlain (const Point<3> & locpoint,
|
||||||
const MultiPointGeomInfo & geominfo,
|
const MultiPointGeomInfo & geominfo,
|
||||||
Point2d & plainpoint,
|
Point<2> & plainpoint,
|
||||||
double h, int & zone);
|
double h, int & zone) override;
|
||||||
///
|
///
|
||||||
|
|
||||||
virtual int TransformFromPlain (Point2d & plainpoint,
|
int TransformFromPlain (const Point<2> & plainpoint,
|
||||||
Point3d & locpoint,
|
Point<3> & locpoint,
|
||||||
PointGeomInfo & gi,
|
PointGeomInfo & gi,
|
||||||
double h);
|
double h) override;
|
||||||
///
|
///
|
||||||
virtual double CalcLocalH (const Point3d & p, double gh) const;
|
double CalcLocalH (const Point3d & p, double gh) const override;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -884,7 +884,7 @@ MeshingSTLSurface :: MeshingSTLSurface (STLGeometry & ageom,
|
|||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MeshingSTLSurface :: DefineTransformation (const Point3d & p1, const Point3d & p2,
|
void MeshingSTLSurface :: DefineTransformation (const Point<3> & p1, const Point<3> & p2,
|
||||||
const PointGeomInfo * geominfo,
|
const PointGeomInfo * geominfo,
|
||||||
const PointGeomInfo * geominfo2)
|
const PointGeomInfo * geominfo2)
|
||||||
{
|
{
|
||||||
@ -893,8 +893,8 @@ void MeshingSTLSurface :: DefineTransformation (const Point3d & p1, const Point3
|
|||||||
geom.DefineTangentialPlane(p1, p2, transformationtrig);
|
geom.DefineTangentialPlane(p1, p2, transformationtrig);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MeshingSTLSurface :: TransformToPlain (const Point3d & locpoint, const MultiPointGeomInfo & gi,
|
void MeshingSTLSurface :: TransformToPlain (const Point<3> & locpoint, const MultiPointGeomInfo & gi,
|
||||||
Point2d & plainpoint, double h, int & zone)
|
Point<2> & plainpoint, double h, int & zone)
|
||||||
{
|
{
|
||||||
int trigs[10000];
|
int trigs[10000];
|
||||||
|
|
||||||
@ -910,9 +910,7 @@ void MeshingSTLSurface :: TransformToPlain (const Point3d & locpoint, const Mult
|
|||||||
// int trig = gi.trignum;
|
// int trig = gi.trignum;
|
||||||
// (*testout) << "locpoint = " << locpoint;
|
// (*testout) << "locpoint = " << locpoint;
|
||||||
|
|
||||||
Point<2> hp2d;
|
geom.ToPlane (locpoint, trigs, plainpoint, h, zone, 1);
|
||||||
geom.ToPlane (locpoint, trigs, hp2d, h, zone, 1);
|
|
||||||
plainpoint = hp2d;
|
|
||||||
|
|
||||||
// geom.ToPlane (locpoint, NULL, plainpoint, h, zone, 1);
|
// geom.ToPlane (locpoint, NULL, plainpoint, h, zone, 1);
|
||||||
/*
|
/*
|
||||||
@ -1018,8 +1016,8 @@ GetChartBoundary (NgArray<Point2d > & points,
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
int MeshingSTLSurface :: TransformFromPlain (Point2d & plainpoint,
|
int MeshingSTLSurface :: TransformFromPlain (const Point<2> & plainpoint,
|
||||||
Point3d & locpoint,
|
Point<3> & locpoint,
|
||||||
PointGeomInfo & gi,
|
PointGeomInfo & gi,
|
||||||
double h)
|
double h)
|
||||||
{
|
{
|
||||||
|
@ -27,40 +27,40 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
///
|
///
|
||||||
virtual void DefineTransformation (const Point3d & p1, const Point3d & p2,
|
void DefineTransformation (const Point<3> & p1, const Point<3> & p2,
|
||||||
const PointGeomInfo * geominfo1,
|
const PointGeomInfo * geominfo1,
|
||||||
const PointGeomInfo * geominfo2);
|
const PointGeomInfo * geominfo2) override;
|
||||||
///
|
///
|
||||||
virtual void TransformToPlain (const Point3d & locpoint, const MultiPointGeomInfo & geominfo,
|
void TransformToPlain (const Point<3> & locpoint, const MultiPointGeomInfo & geominfo,
|
||||||
Point2d & plainpoint, double h, int & zone);
|
Point<2> & plainpoint, double h, int & zone) override;
|
||||||
///
|
///
|
||||||
virtual int TransformFromPlain (Point2d & plainpoint,
|
int TransformFromPlain (const Point<2>& plainpoint,
|
||||||
Point3d & locpoint,
|
Point<3> & locpoint,
|
||||||
PointGeomInfo & gi,
|
PointGeomInfo & gi,
|
||||||
double h);
|
double h) override;
|
||||||
///
|
///
|
||||||
virtual int BelongsToActiveChart (const Point3d & p,
|
int BelongsToActiveChart (const Point3d & p,
|
||||||
const PointGeomInfo & gi);
|
const PointGeomInfo & gi) override;
|
||||||
|
|
||||||
///
|
///
|
||||||
virtual int ComputePointGeomInfo (const Point3d & p, PointGeomInfo & gi);
|
int ComputePointGeomInfo (const Point3d & p, PointGeomInfo & gi) override;
|
||||||
///
|
///
|
||||||
virtual int ChooseChartPointGeomInfo (const MultiPointGeomInfo & mpgi,
|
int ChooseChartPointGeomInfo (const MultiPointGeomInfo & mpgi,
|
||||||
PointGeomInfo & pgi);
|
PointGeomInfo & pgi) override;
|
||||||
|
|
||||||
///
|
///
|
||||||
virtual int IsLineVertexOnChart (const Point3d & p1, const Point3d & p2,
|
int IsLineVertexOnChart (const Point3d & p1, const Point3d & p2,
|
||||||
int endpoint, const PointGeomInfo & gi);
|
int endpoint, const PointGeomInfo & gi) override;
|
||||||
|
|
||||||
virtual void GetChartBoundary (NgArray<Point2d > & points,
|
void GetChartBoundary (NgArray<Point2d > & points,
|
||||||
NgArray<Point3d > & poitns3d,
|
NgArray<Point3d > & poitns3d,
|
||||||
NgArray<INDEX_2> & lines, double h) const;
|
NgArray<INDEX_2> & lines, double h) const override;
|
||||||
|
|
||||||
///
|
///
|
||||||
virtual double CalcLocalH (const Point3d & p, double gh) const;
|
double CalcLocalH (const Point3d & p, double gh) const override;
|
||||||
|
|
||||||
///
|
///
|
||||||
virtual double Area () const;
|
double Area () const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user