From e6af8372c66ff96c75206d6ee54a7522b5d8811a Mon Sep 17 00:00:00 2001 From: Thomas Fischer <thomas.fischer@ufz.de> Date: Mon, 14 May 2012 15:09:48 +0200 Subject: [PATCH] [class template TemplatePoint] - renamed method to access coordinates from getData() to getCoords() --- FileIO/MeshIO.cpp | 2 +- GeoLib/GEOObjects.cpp | 2 +- GeoLib/Polygon.cpp | 2 +- GeoLib/QuadTree.h | 2 +- GeoLib/TemplatePoint.h | 2 +- GeoLib/Triangle.h | 2 +- MathLib/AnalyticalGeometry.cpp | 6 +++--- MathLib/LinAlg/Dense/Matrix.h | 2 +- MathLib/MathTools.cpp | 2 +- MathLib/Vector3.h | 2 +- MeshLib/Elements/Edge.cpp | 2 +- MeshLib/Elements/Element.cpp | 2 +- MeshLib/Elements/Hex.cpp | 12 ++++++------ MeshLib/Elements/Prism.cpp | 6 +++--- MeshLib/Elements/Pyramid.cpp | 4 ++-- MeshLib/Elements/Quad.cpp | 4 ++-- MeshLib/Elements/Tet.cpp | 2 +- MeshLib/Elements/Tri.cpp | 2 +- MeshLib/FemNode.cpp | 4 ++-- MeshLib/Node.cpp | 2 +- 20 files changed, 32 insertions(+), 32 deletions(-) diff --git a/FileIO/MeshIO.cpp b/FileIO/MeshIO.cpp index ca1931a5aa7..6b12458ccc7 100644 --- a/FileIO/MeshIO.cpp +++ b/FileIO/MeshIO.cpp @@ -203,7 +203,7 @@ int MeshIO::write(std::ostream &out) out << n_nodes << std::endl; for (size_t i(0); i < n_nodes; i++) { - double const* const coords (_mesh->nod_vector[i]->getData()); + double const* const coords (_mesh->nod_vector[i]->getCoords()); out << i << " " << coords[0] << " " << coords[1] << " " << coords[2] << std::endl; } diff --git a/GeoLib/GEOObjects.cpp b/GeoLib/GEOObjects.cpp index 6fd77f76768..6a1dd20d08c 100644 --- a/GeoLib/GEOObjects.cpp +++ b/GeoLib/GEOObjects.cpp @@ -376,7 +376,7 @@ void GEOObjects::mergeGeometries (std::vector<std::string> const & geo_names, st if (dynamic_cast<GEOLIB::Station*>((*pnts)[0]) == NULL) { nPoints = pnts->size(); for (size_t k(0); k<nPoints; k++) { - merged_points->push_back (new GEOLIB::Point (((*pnts)[k])->getData())); + merged_points->push_back (new GEOLIB::Point (((*pnts)[k])->getCoords())); } } if (geo_names.size()-1 > j) diff --git a/GeoLib/Polygon.cpp b/GeoLib/Polygon.cpp index 6fcbcbd6d57..e769a71dae2 100644 --- a/GeoLib/Polygon.cpp +++ b/GeoLib/Polygon.cpp @@ -380,7 +380,7 @@ GEOLIB::Polygon* createPolygonFromCircle (GEOLIB::Point const& middle_pnt, doubl // create points double angle (2.0 * M_PI / resolution); for (size_t k(0); k<resolution; k++) { - GEOLIB::Point *pnt (new GEOLIB::Point(middle_pnt.getData())); + GEOLIB::Point *pnt (new GEOLIB::Point(middle_pnt.getCoords())); (*pnt)[0] += radius * cos (k*angle); (*pnt)[1] += radius * sin (k*angle); pnts.push_back (pnt); diff --git a/GeoLib/QuadTree.h b/GeoLib/QuadTree.h index b13af3d4a72..83b5eb319e1 100644 --- a/GeoLib/QuadTree.h +++ b/GeoLib/QuadTree.h @@ -92,7 +92,7 @@ public: bool pnt_in_quadtree (false); double equal_pnt_dist (MathLib::fastpow(2, _depth) * fabs(_ll[0] - _ur[0]) * 1e-6); for (size_t k(0); k<_pnts.size() && !pnt_in_quadtree; k++) { - const double sqr_dist (MathLib::sqrDist(_pnts[k]->getData(), pnt->getData())); + const double sqr_dist (MathLib::sqrDist(_pnts[k]->getCoords(), pnt->getCoords())); if (sqr_dist < equal_pnt_dist) { pnt_in_quadtree = true; } diff --git a/GeoLib/TemplatePoint.h b/GeoLib/TemplatePoint.h index 41667d8d26e..dd8ff541103 100644 --- a/GeoLib/TemplatePoint.h +++ b/GeoLib/TemplatePoint.h @@ -63,7 +63,7 @@ public: } /** returns an array containing the coordinates of the point */ - const T* getData () const { return _x; } + const T* getCoords () const { return _x; } /** write point coordinates into stream (used from operator<<) * \param os a standard output stream diff --git a/GeoLib/Triangle.h b/GeoLib/Triangle.h index 48a1028ac34..2541ba5d643 100644 --- a/GeoLib/Triangle.h +++ b/GeoLib/Triangle.h @@ -72,7 +72,7 @@ public: bool containsPoint (const Point &pnt) const { - return containsPoint (pnt.getData()); + return containsPoint (pnt.getCoords()); } /** diff --git a/MathLib/AnalyticalGeometry.cpp b/MathLib/AnalyticalGeometry.cpp index efcf96bf5de..108f6d094df 100644 --- a/MathLib/AnalyticalGeometry.cpp +++ b/MathLib/AnalyticalGeometry.cpp @@ -142,7 +142,7 @@ bool isPointInTriangle (const double p[3], const double a[3], const double b[3], bool isPointInTriangle (const GEOLIB::Point* p, const GEOLIB::Point* a, const GEOLIB::Point* b, const GEOLIB::Point* c) { - return isPointInTriangle (p->getData(), a->getData(), b->getData(), c->getData()); + return isPointInTriangle (p->getCoords(), a->getCoords(), b->getCoords(), c->getCoords()); } // NewellPlane from book Real-Time Collision detection p. 494 @@ -199,13 +199,13 @@ void rotatePointsToXY(Vector &plane_normal, double *tmp (NULL); size_t n_pnts(pnts.size()); for (size_t k(0); k < n_pnts; k++) { - tmp = rot_mat * pnts[k]->getData(); + tmp = rot_mat * pnts[k]->getCoords(); for (size_t j(0); j < 3; j++) (*(pnts[k]))[j] = tmp[j]; delete [] tmp; } - tmp = rot_mat * plane_normal.getData(); + tmp = rot_mat * plane_normal.getCoords(); for (size_t j(0); j < 3; j++) plane_normal[j] = tmp[j]; diff --git a/MathLib/LinAlg/Dense/Matrix.h b/MathLib/LinAlg/Dense/Matrix.h index d0a97fb5e08..86b282039d3 100644 --- a/MathLib/LinAlg/Dense/Matrix.h +++ b/MathLib/LinAlg/Dense/Matrix.h @@ -87,7 +87,7 @@ public: */ void write (std::ostream& out) const; - T const* getData () { return data; } + T const* getCoords () { return data; } private: // zero based addressing, but Fortran storage layout diff --git a/MathLib/MathTools.cpp b/MathLib/MathTools.cpp index 88cebe7fae9..d916c8a524f 100644 --- a/MathLib/MathTools.cpp +++ b/MathLib/MathTools.cpp @@ -52,7 +52,7 @@ double calcProjPntToLineAndDists(const double p[3], const double a[3], double sqrNrm2 (const GEOLIB::Point* p0) { - return scpr (p0->getData(), p0->getData(), 3); + return scpr (p0->getCoords(), p0->getCoords(), 3); } double sqrDist (const GEOLIB::Point* p0, const GEOLIB::Point* p1) diff --git a/MathLib/Vector3.h b/MathLib/Vector3.h index dd59d36f856..c7d173f63f6 100644 --- a/MathLib/Vector3.h +++ b/MathLib/Vector3.h @@ -121,7 +121,7 @@ public: /// Returns the squared length double LenSqr(void) const { - return scpr (this->getData (), this->getData (), 3); + return scpr (this->getCoords (), this->getCoords (), 3); } /// Returns the length diff --git a/MeshLib/Elements/Edge.cpp b/MeshLib/Elements/Edge.cpp index 5ebed85fae2..7b27c132ff1 100644 --- a/MeshLib/Elements/Edge.cpp +++ b/MeshLib/Elements/Edge.cpp @@ -44,7 +44,7 @@ Edge::~Edge() double Edge::computeLength() { - return sqrt(MathLib::sqrDist(_nodes[0]->getData(), _nodes[1]->getData())); + return sqrt(MathLib::sqrDist(_nodes[0]->getCoords(), _nodes[1]->getCoords())); } } diff --git a/MeshLib/Elements/Element.cpp b/MeshLib/Elements/Element.cpp index d0d33a6e108..77e8c4a9253 100644 --- a/MeshLib/Elements/Element.cpp +++ b/MeshLib/Elements/Element.cpp @@ -48,7 +48,7 @@ void Element::computeSqrEdgeLengthRange(double &min, double &max) const unsigned nEdges (this->getNEdges()); for (unsigned i=0; i<nEdges; i++) { - double dist (MathLib::sqrDist(getEdgeNode(i,0)->getData(), getEdgeNode(i,1)->getData())); + double dist (MathLib::sqrDist(getEdgeNode(i,0)->getCoords(), getEdgeNode(i,1)->getCoords())); min = (dist<min) ? dist : min; max = (dist>max) ? dist : max; } diff --git a/MeshLib/Elements/Hex.cpp b/MeshLib/Elements/Hex.cpp index 2bdb6028816..55ef9a299cc 100644 --- a/MeshLib/Elements/Hex.cpp +++ b/MeshLib/Elements/Hex.cpp @@ -87,12 +87,12 @@ Hex::~Hex() double Hex::computeVolume() { - return MathLib::calcTetrahedronVolume(_nodes[4]->getData(), _nodes[7]->getData(), _nodes[5]->getData(), _nodes[0]->getData()) - + MathLib::calcTetrahedronVolume(_nodes[5]->getData(), _nodes[3]->getData(), _nodes[1]->getData(), _nodes[0]->getData()) - + MathLib::calcTetrahedronVolume(_nodes[5]->getData(), _nodes[7]->getData(), _nodes[3]->getData(), _nodes[0]->getData()) - + MathLib::calcTetrahedronVolume(_nodes[5]->getData(), _nodes[7]->getData(), _nodes[6]->getData(), _nodes[2]->getData()) - + MathLib::calcTetrahedronVolume(_nodes[1]->getData(), _nodes[3]->getData(), _nodes[5]->getData(), _nodes[2]->getData()) - + MathLib::calcTetrahedronVolume(_nodes[3]->getData(), _nodes[7]->getData(), _nodes[5]->getData(), _nodes[2]->getData()); + return MathLib::calcTetrahedronVolume(_nodes[4]->getCoords(), _nodes[7]->getCoords(), _nodes[5]->getCoords(), _nodes[0]->getCoords()) + + MathLib::calcTetrahedronVolume(_nodes[5]->getCoords(), _nodes[3]->getCoords(), _nodes[1]->getCoords(), _nodes[0]->getCoords()) + + MathLib::calcTetrahedronVolume(_nodes[5]->getCoords(), _nodes[7]->getCoords(), _nodes[3]->getCoords(), _nodes[0]->getCoords()) + + MathLib::calcTetrahedronVolume(_nodes[5]->getCoords(), _nodes[7]->getCoords(), _nodes[6]->getCoords(), _nodes[2]->getCoords()) + + MathLib::calcTetrahedronVolume(_nodes[1]->getCoords(), _nodes[3]->getCoords(), _nodes[5]->getCoords(), _nodes[2]->getCoords()) + + MathLib::calcTetrahedronVolume(_nodes[3]->getCoords(), _nodes[7]->getCoords(), _nodes[5]->getCoords(), _nodes[2]->getCoords()); } const Element* Hex::getFace(unsigned i) const diff --git a/MeshLib/Elements/Prism.cpp b/MeshLib/Elements/Prism.cpp index a90386e1f2e..e75aac59ced 100644 --- a/MeshLib/Elements/Prism.cpp +++ b/MeshLib/Elements/Prism.cpp @@ -83,9 +83,9 @@ Prism::~Prism() double Prism::computeVolume() { - return MathLib::calcTetrahedronVolume(_nodes[0]->getData(), _nodes[1]->getData(), _nodes[2]->getData(), _nodes[3]->getData()) - + MathLib::calcTetrahedronVolume(_nodes[1]->getData(), _nodes[4]->getData(), _nodes[2]->getData(), _nodes[3]->getData()) - + MathLib::calcTetrahedronVolume(_nodes[2]->getData(), _nodes[4]->getData(), _nodes[5]->getData(), _nodes[3]->getData()); + return MathLib::calcTetrahedronVolume(_nodes[0]->getCoords(), _nodes[1]->getCoords(), _nodes[2]->getCoords(), _nodes[3]->getCoords()) + + MathLib::calcTetrahedronVolume(_nodes[1]->getCoords(), _nodes[4]->getCoords(), _nodes[2]->getCoords(), _nodes[3]->getCoords()) + + MathLib::calcTetrahedronVolume(_nodes[2]->getCoords(), _nodes[4]->getCoords(), _nodes[5]->getCoords(), _nodes[3]->getCoords()); } const Element* Prism::getFace(unsigned i) const diff --git a/MeshLib/Elements/Pyramid.cpp b/MeshLib/Elements/Pyramid.cpp index cb3ba05b958..994d4403b31 100644 --- a/MeshLib/Elements/Pyramid.cpp +++ b/MeshLib/Elements/Pyramid.cpp @@ -83,8 +83,8 @@ Pyramid::~Pyramid() double Pyramid::computeVolume() { - return MathLib::calcTetrahedronVolume(_nodes[0]->getData(), _nodes[1]->getData(), _nodes[2]->getData(), _nodes[4]->getData()) - + MathLib::calcTetrahedronVolume(_nodes[2]->getData(), _nodes[3]->getData(), _nodes[0]->getData(), _nodes[4]->getData()); + return MathLib::calcTetrahedronVolume(_nodes[0]->getCoords(), _nodes[1]->getCoords(), _nodes[2]->getCoords(), _nodes[4]->getCoords()) + + MathLib::calcTetrahedronVolume(_nodes[2]->getCoords(), _nodes[3]->getCoords(), _nodes[0]->getCoords(), _nodes[4]->getCoords()); } const Element* Pyramid::getFace(unsigned i) const diff --git a/MeshLib/Elements/Quad.cpp b/MeshLib/Elements/Quad.cpp index 573a738abac..f909f4ae1e5 100644 --- a/MeshLib/Elements/Quad.cpp +++ b/MeshLib/Elements/Quad.cpp @@ -65,8 +65,8 @@ Quad::~Quad() double Quad::computeArea() { - return MathLib::calcTriangleArea(_nodes[0]->getData(), _nodes[1]->getData(), _nodes[2]->getData()) - + MathLib::calcTriangleArea(_nodes[2]->getData(), _nodes[3]->getData(), _nodes[0]->getData()); + return MathLib::calcTriangleArea(_nodes[0]->getCoords(), _nodes[1]->getCoords(), _nodes[2]->getCoords()) + + MathLib::calcTriangleArea(_nodes[2]->getCoords(), _nodes[3]->getCoords(), _nodes[0]->getCoords()); } } diff --git a/MeshLib/Elements/Tet.cpp b/MeshLib/Elements/Tet.cpp index 3da481e49aa..c3878998e59 100644 --- a/MeshLib/Elements/Tet.cpp +++ b/MeshLib/Elements/Tet.cpp @@ -84,7 +84,7 @@ Tet::~Tet() double Tet::computeVolume() { - return MathLib::calcTetrahedronVolume(_nodes[0]->getData(), _nodes[1]->getData(), _nodes[2]->getData(), _nodes[3]->getData()); + return MathLib::calcTetrahedronVolume(_nodes[0]->getCoords(), _nodes[1]->getCoords(), _nodes[2]->getCoords(), _nodes[3]->getCoords()); } const Element* Tet::getFace(unsigned i) const diff --git a/MeshLib/Elements/Tri.cpp b/MeshLib/Elements/Tri.cpp index ebb911d3929..ea8c987cfe9 100644 --- a/MeshLib/Elements/Tri.cpp +++ b/MeshLib/Elements/Tri.cpp @@ -63,7 +63,7 @@ Tri::~Tri() double Tri::computeArea() { - return MathLib::calcTriangleArea(_nodes[0]->getData(), _nodes[1]->getData(), _nodes[2]->getData()); + return MathLib::calcTriangleArea(_nodes[0]->getCoords(), _nodes[1]->getCoords(), _nodes[2]->getCoords()); } } diff --git a/MeshLib/FemNode.cpp b/MeshLib/FemNode.cpp index fc82b38493c..93c458c2dbb 100644 --- a/MeshLib/FemNode.cpp +++ b/MeshLib/FemNode.cpp @@ -20,12 +20,12 @@ FemNode::FemNode(double x, double y, double z, unsigned id) } FemNode::FemNode(const Node &node) - : Node(node.getData(), node.getID()) + : Node(node.getCoords(), node.getID()) { } FemNode::FemNode(const FemNode &node) - : Node(node.getData(), node.getID()) + : Node(node.getCoords(), node.getID()) { } diff --git a/MeshLib/Node.cpp b/MeshLib/Node.cpp index c300b2c3f09..ed3a2fd33e8 100644 --- a/MeshLib/Node.cpp +++ b/MeshLib/Node.cpp @@ -20,7 +20,7 @@ Node::Node(double x, double y, double z, unsigned id) } Node::Node(const Node &node) - : GEOLIB::PointWithID(node.getData(), node.getID()) + : GEOLIB::PointWithID(node.getCoords(), node.getID()) { } -- GitLab