Mercurial > hg > orthanc-stone
changeset 1895:14c8f339d480
removed redundant definitions Point2D, Point3D and Vector3D from DicomStructureSetUtils.h
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 19 Jan 2022 14:51:55 +0100 |
parents | 438071a29f77 |
children | b3c08e607d9f |
files | OrthancStone/Sources/Loaders/DicomStructureSetLoader.cpp OrthancStone/Sources/Toolbox/DicomStructure2.cpp OrthancStone/Sources/Toolbox/DicomStructure2.h OrthancStone/Sources/Toolbox/DicomStructurePolygon2.cpp OrthancStone/Sources/Toolbox/DicomStructurePolygon2.h OrthancStone/Sources/Toolbox/DicomStructureSet.cpp OrthancStone/Sources/Toolbox/DicomStructureSet.h OrthancStone/Sources/Toolbox/DicomStructureSetUtils.cpp OrthancStone/Sources/Toolbox/DicomStructureSetUtils.h OrthancStone/Sources/Volumes/DicomStructureSetSlicer2.cpp OrthancStone/UnitTestsSources/TestStructureSet.cpp RenderingPlugin/Sources/Plugin.cpp |
diffstat | 12 files changed, 396 insertions(+), 428 deletions(-) [+] |
line wrap: on
line diff
--- a/OrthancStone/Sources/Loaders/DicomStructureSetLoader.cpp Wed Jan 19 14:25:59 2022 +0100 +++ b/OrthancStone/Sources/Loaders/DicomStructureSetLoader.cpp Wed Jan 19 14:51:55 2022 +0100 @@ -30,7 +30,7 @@ #include <Toolbox.h> #if STONE_TIME_BLOCKING_OPS -# include <boost/date_time/posix_time/posix_time.hpp> +# include <boost/date_time/posix_time/posix_time.hpp> #endif #include <algorithm> @@ -371,7 +371,7 @@ const Color& color = content_.GetStructureColor(i); #if USE_BOOST_UNION_FOR_POLYGONS == 1 - std::vector< std::vector<Point2D> > polygons; + std::vector< std::vector<ScenePoint2D> > polygons; if (content_.ProjectStructure(polygons, i, cuttingPlane)) { @@ -382,14 +382,14 @@ for (size_t k = 0; k < polygons[j].size(); k++) { - chain[k] = ScenePoint2D(polygons[j][k].x, polygons[j][k].y); + chain[k] = ScenePoint2D(polygons[j][k].GetX(), polygons[j][k].GetY()); } layer->AddChain(chain, true /* closed */, color); } } #else - std::vector< std::pair<Point2D, Point2D> > segments; + std::vector< std::pair<ScenePoint2D, ScenePoint2D> > segments; if (content_.ProjectStructure(segments, i, cuttingPlane)) { @@ -398,8 +398,8 @@ PolylineSceneLayer::Chain chain; chain.resize(2); - chain[0] = ScenePoint2D(segments[j].first.x, segments[j].first.y); - chain[1] = ScenePoint2D(segments[j].second.x, segments[j].second.y); + chain[0] = ScenePoint2D(segments[j].first.GetX(), segments[j].first.GetY()); + chain[1] = ScenePoint2D(segments[j].second.GetX(), segments[j].second.GetY()); layer->AddChain(chain, false /* NOT closed */, color); }
--- a/OrthancStone/Sources/Toolbox/DicomStructure2.cpp Wed Jan 19 14:25:59 2022 +0100 +++ b/OrthancStone/Sources/Toolbox/DicomStructure2.cpp Wed Jan 19 14:51:55 2022 +0100 @@ -195,7 +195,7 @@ } - bool DicomStructure2::Project(std::vector< std::pair<Point2D, Point2D> > & segments, const CoordinateSystem3D & plane) const + bool DicomStructure2::Project(std::vector< std::pair<ScenePoint2D, ScenePoint2D> > & segments, const CoordinateSystem3D & plane) const { segments.clear(); @@ -237,7 +237,7 @@ // let's compute the intersection between the polygon and the plane // intersections are in plane coords - std::vector<Point2D> intersections; + std::vector<ScenePoint2D> intersections; polygons_[i].ProjectOnConstantPlane(intersections, plane); @@ -257,12 +257,12 @@ for (size_t iRect = 0; iRect < numRects; ++iRect) { RtStructRectangleInSlab rectangle; - ORTHANC_ASSERT(LinearAlgebra::IsNear(intersections[2 * iRect].y, intersections[2 * iRect + 1].y)); + ORTHANC_ASSERT(LinearAlgebra::IsNear(intersections[2 * iRect].GetY(), intersections[2 * iRect + 1].GetY())); ORTHANC_ASSERT((2 * iRect + 1) < intersections.size()); - double x1 = intersections[2 * iRect].x; - double x2 = intersections[2 * iRect + 1].x; - double y1 = intersections[2 * iRect].y - sliceThickness_ * 0.5; - double y2 = intersections[2 * iRect].y + sliceThickness_ * 0.5; + double x1 = intersections[2 * iRect].GetX(); + double x2 = intersections[2 * iRect + 1].GetX(); + double y1 = intersections[2 * iRect].GetY() - sliceThickness_ * 0.5; + double y2 = intersections[2 * iRect].GetY() + sliceThickness_ * 0.5; rectangle.xmin = std::min(x1, x2); rectangle.xmax = std::max(x1, x2);
--- a/OrthancStone/Sources/Toolbox/DicomStructure2.h Wed Jan 19 14:25:59 2022 +0100 +++ b/OrthancStone/Sources/Toolbox/DicomStructure2.h Wed Jan 19 14:51:55 2022 +0100 @@ -113,7 +113,7 @@ connected rectangles together. Connected, here, means sharing at least part of an edge --> union/find data structures and algorithm. */ - bool Project(std::vector< std::pair<Point2D, Point2D> >& polygons, const CoordinateSystem3D& plane) const; + bool Project(std::vector< std::pair<ScenePoint2D, ScenePoint2D> >& polygons, const CoordinateSystem3D& plane) const; std::string interpretation_; std::string name_; @@ -146,7 +146,7 @@ void ComputeSliceThickness(); std::vector<DicomStructurePolygon2> polygons_; - Vector3D normal_; + Vector normal_; double sliceThickness_; /*
--- a/OrthancStone/Sources/Toolbox/DicomStructurePolygon2.cpp Wed Jan 19 14:25:59 2022 +0100 +++ b/OrthancStone/Sources/Toolbox/DicomStructurePolygon2.cpp Wed Jan 19 14:51:55 2022 +0100 @@ -37,7 +37,7 @@ for (size_t j = 0; j < points_.size(); ++j) { // TODO: move to AddPoint! - const Point3D& p = points_[j]; + const Vector& p = points_[j]; if (p[0] < minX_) minX_ = p[0]; if (p[0] > maxX_) @@ -83,7 +83,7 @@ void DicomStructurePolygon2::ProjectOnConstantPlane( - std::vector<Point2D>& intersections, const CoordinateSystem3D& plane) const + std::vector<ScenePoint2D>& intersections, const CoordinateSystem3D& plane) const { // the plane can either have constant X, or constant Y. // - for constant Z planes, use the ProjectOnParallelPlane method @@ -177,10 +177,10 @@ // in that case, we choose to label both points as an intersection double x, y; plane.ProjectPoint(x, y, points_[iPoint]); - intersections.push_back(Point2D(x, y)); + intersections.push_back(ScenePoint2D(x, y)); plane.ProjectPoint(x, y, points_[iPoint + 1]); - intersections.push_back(Point2D(x, y)); + intersections.push_back(ScenePoint2D(x, y)); } else { @@ -235,7 +235,7 @@ for (size_t i = 0; i < uIntersections.size(); ++i) { double x = uIntersections[i]; - intersections.push_back(Point2D(x, minZ_)); + intersections.push_back(ScenePoint2D(x, minZ_)); } } // end of if (pointCount >= 3) else @@ -245,7 +245,7 @@ } void DicomStructurePolygon2::ProjectOnParallelPlane( - std::vector< std::pair<Point2D, Point2D> >& segments, + std::vector< std::pair<ScenePoint2D, ScenePoint2D> >& segments, const CoordinateSystem3D& plane) const { if (points_.size() < 3) @@ -268,29 +268,29 @@ { // segment between point j and j+1 - const Point3D& point0 = GetPoint(j); + const Vector& point0 = GetPoint(j); // subtract plane origin x and y - Point2D p0(point0[0] - planeOriginX, point0[1] - planeOriginY); + ScenePoint2D p0(point0[0] - planeOriginX, point0[1] - planeOriginY); - const Point3D& point1 = GetPoint(j+1); + const Vector& point1 = GetPoint(j+1); // subtract plane origin x and y - Point2D p1(point1[0] - planeOriginX, point1[1] - planeOriginY); + ScenePoint2D p1(point1[0] - planeOriginX, point1[1] - planeOriginY); - segments.push_back(std::pair<Point2D, Point2D>(p0,p1)); + segments.push_back(std::pair<ScenePoint2D, ScenePoint2D>(p0,p1)); } // final segment - const Point3D& point0 = GetPoint(points_.size() - 1); + const Vector& point0 = GetPoint(points_.size() - 1); // subtract plane origin x and y - Point2D p0(point0[0] - planeOriginX, point0[1] - planeOriginY); + ScenePoint2D p0(point0[0] - planeOriginX, point0[1] - planeOriginY); - const Point3D& point1 = GetPoint(0); + const Vector& point1 = GetPoint(0); // subtract plane origin x and y - Point2D p1(point1[0] - planeOriginX, point1[1] - planeOriginY); + ScenePoint2D p1(point1[0] - planeOriginX, point1[1] - planeOriginY); - segments.push_back(std::pair<Point2D, Point2D>(p0, p1)); + segments.push_back(std::pair<ScenePoint2D, ScenePoint2D>(p0, p1)); } double DicomStructurePolygon2::GetZ() const
--- a/OrthancStone/Sources/Toolbox/DicomStructurePolygon2.h Wed Jan 19 14:25:59 2022 +0100 +++ b/OrthancStone/Sources/Toolbox/DicomStructurePolygon2.h Wed Jan 19 14:51:55 2022 +0100 @@ -75,13 +75,13 @@ return points_.size(); } - const Point3D& GetPoint(size_t i) const + const Vector& GetPoint(size_t i) const { ORTHANC_ASSERT(state_ == Valid); return points_.at(i); } - void AddPoint(const Point3D& v) + void AddPoint(const Vector& v) { ORTHANC_ASSERT(state_ == Building); points_.push_back(v); @@ -99,7 +99,7 @@ on the plane, in the plane coordinate system. */ void ProjectOnParallelPlane( - std::vector< std::pair<Point2D,Point2D> >& segments, + std::vector< std::pair<ScenePoint2D, ScenePoint2D> >& segments, const CoordinateSystem3D& plane) const; /** @@ -108,7 +108,7 @@ constant Y) */ void ProjectOnConstantPlane( - std::vector<Point2D>& intersections, + std::vector<ScenePoint2D>& intersections, const CoordinateSystem3D& plane) const; /** @@ -121,7 +121,7 @@ /** The normal sign is left undefined for now */ - Vector3D GetNormal() const + Vector GetNormal() const { return normal_; } @@ -149,8 +149,8 @@ }; std::string referencedSopInstanceUid_; CoordinateSystem3D geometry_; - std::vector<Point3D> points_; - Vector3D normal_; // sign is irrelevant for now + std::vector<Vector> points_; + Vector normal_; // sign is irrelevant for now State state_; double minX_, maxX_, minY_, maxY_, minZ_, maxZ_; Type type_;
--- a/OrthancStone/Sources/Toolbox/DicomStructureSet.cpp Wed Jan 19 14:25:59 2022 +0100 +++ b/OrthancStone/Sources/Toolbox/DicomStructureSet.cpp Wed Jan 19 14:51:55 2022 +0100 @@ -22,14 +22,12 @@ #include "DicomStructureSet.h" -#include "DicomStructureSetUtils.h" - -#include "GeometryToolbox.h" -#include "GenericToolbox.h" - -#include "OrthancDatasets/DicomDatasetReader.h" +#include "DicomStructureSetUtils.h" // TODO REMOVE #include "BucketAccumulator2D.h" +#include "GenericToolbox.h" +#include "GeometryToolbox.h" +#include "OrthancDatasets/DicomDatasetReader.h" #include <Logging.h> #include <OrthancException.h> @@ -41,7 +39,7 @@ #endif #if STONE_TIME_BLOCKING_OPS -# include <boost/date_time/posix_time/posix_time.hpp> +# include <boost/date_time/posix_time/posix_time.hpp> #endif #include <limits> @@ -61,7 +59,7 @@ #endif - typedef boost::geometry::model::d2::point_xy<double> BoostPoint; +typedef boost::geometry::model::d2::point_xy<double> BoostPoint; typedef boost::geometry::model::polygon<BoostPoint> BoostPolygon; typedef boost::geometry::model::multi_polygon<BoostPolygon> BoostMultiPolygon; @@ -833,9 +831,9 @@ bool DicomStructureSet::ProjectStructure( #if USE_BOOST_UNION_FOR_POLYGONS == 1 - std::vector< std::vector<Point2D> >& polygons, + std::vector< std::vector<ScenePoint2D> >& polygons, #else - std::vector< std::pair<Point2D, Point2D> >& segments, + std::vector< std::pair<ScenePoint2D, ScenePoint2D> >& segments, #endif const Structure& structure, const CoordinateSystem3D& sourceSlice) const @@ -861,26 +859,26 @@ if (polygon->IsOnSlice(slice)) { #if USE_BOOST_UNION_FOR_POLYGONS == 1 - polygons.push_back(std::vector<Point2D>()); + polygons.push_back(std::vector<ScenePoint2D>()); for (Points::const_iterator p = polygon->GetPoints().begin(); p != polygon->GetPoints().end(); ++p) { double x, y; slice.ProjectPoint2(x, y, *p); - polygons.back().push_back(Point2D(x, y)); + polygons.back().push_back(ScenePoint2D(x, y)); } #else // we need to add all the segments corresponding to this polygon const std::vector<Vector>& points3D = polygon->GetPoints(); if (points3D.size() >= 3) { - Point2D prev2D; + ScenePoint2D prev2D; { Vector prev = points3D[0]; double prevX, prevY; slice.ProjectPoint2(prevX, prevY, prev); - prev2D = Point2D(prevX, prevY); + prev2D = ScenePoint2D(prevX, prevY); } size_t pointCount = points3D.size(); @@ -889,8 +887,8 @@ Vector next = points3D[ipt]; double nextX, nextY; slice.ProjectPoint2(nextX, nextY, next); - Point2D next2D(nextX, nextY); - segments.push_back(std::pair<Point2D, Point2D>(prev2D, next2D)); + ScenePoint2D next2D(nextX, nextY); + segments.push_back(std::pair<ScenePoint2D, ScenePoint2D>(prev2D, next2D)); prev2D = next2D; } } @@ -1012,7 +1010,7 @@ polygons[i].resize(outer.size()); for (size_t j = 0; j < outer.size(); j++) { - polygons[i][j] = Point2D(outer[j].x(), outer[j].y()); + polygons[i][j] = ScenePoint2D(outer[j].x(), outer[j].y()); } } #endif @@ -1024,7 +1022,7 @@ double x1, y1, x2, y2; if (polygon->Project(x1, y1, x2, y2, slice)) { - std::vector<Point2D> p(4); + std::vector<ScenePoint2D> p(4); p[0] = std::make_pair(x1, y1); p[1] = std::make_pair(x2, y1); p[2] = std::make_pair(x2, y2); @@ -1049,7 +1047,7 @@ const Color& color) const { #if USE_BOOST_UNION_FOR_POLYGONS == 1 - std::vector< std::vector<Point2D> > polygons; + std::vector< std::vector<ScenePoint2D> > polygons; if (ProjectStructure(polygons, structureIndex, plane)) { for (size_t j = 0; j < polygons.size(); j++) @@ -1067,15 +1065,15 @@ } #else - std::vector< std::pair<Point2D, Point2D> > segments; + std::vector< std::pair<ScenePoint2D, ScenePoint2D> > segments; if (ProjectStructure(segments, structureIndex, plane)) { for (size_t j = 0; j < segments.size(); j++) { std::vector<ScenePoint2D> chain(2); - chain[0] = ScenePoint2D(segments[j].first.x, segments[j].first.y); - chain[1] = ScenePoint2D(segments[j].second.x, segments[j].second.y); + chain[0] = ScenePoint2D(segments[j].first.GetX(), segments[j].first.GetY()); + chain[1] = ScenePoint2D(segments[j].second.GetX(), segments[j].second.GetY()); layer.AddChain(chain, false, color.GetRed(), color.GetGreen(), color.GetBlue()); } }
--- a/OrthancStone/Sources/Toolbox/DicomStructureSet.h Wed Jan 19 14:25:59 2022 +0100 +++ b/OrthancStone/Sources/Toolbox/DicomStructureSet.h Wed Jan 19 14:51:55 2022 +0100 @@ -29,7 +29,6 @@ # error The macro ORTHANC_ENABLE_DCMTK must be defined #endif -#include "DicomStructureSetUtils.h" #include "CoordinateSystem3D.h" #include "Extent2D.h" #include "OrthancDatasets/FullOrthancDataset.h" @@ -163,9 +162,9 @@ bool ProjectStructure( #if USE_BOOST_UNION_FOR_POLYGONS == 1 - std::vector< std::vector<Point2D> >& polygons, + std::vector< std::vector<ScenePoint2D> >& polygons, #else - std::vector< std::pair<Point2D, Point2D> >& segments, + std::vector< std::pair<ScenePoint2D, ScenePoint2D> >& segments, #endif const Structure& structure, const CoordinateSystem3D& slice) const; @@ -209,14 +208,14 @@ Vector GetNormal() const; #if USE_BOOST_UNION_FOR_POLYGONS == 1 - bool ProjectStructure(std::vector< std::vector<Point2D> >& polygons, + bool ProjectStructure(std::vector< std::vector<ScenePoint2D> >& polygons, size_t index, const CoordinateSystem3D& slice) const { return ProjectStructure(polygons, GetStructure(index), slice); } #else - bool ProjectStructure(std::vector< std::pair<Point2D, Point2D> >& segments, + bool ProjectStructure(std::vector< std::pair<ScenePoint2D, ScenePoint2D> >& segments, size_t index, const CoordinateSystem3D& slice) const {
--- a/OrthancStone/Sources/Toolbox/DicomStructureSetUtils.cpp Wed Jan 19 14:25:59 2022 +0100 +++ b/OrthancStone/Sources/Toolbox/DicomStructureSetUtils.cpp Wed Jan 19 14:51:55 2022 +0100 @@ -118,12 +118,12 @@ // static void ProcessBoundaryList( - std::vector< std::pair<Point2D, Point2D> > & segments, + std::vector< std::pair<ScenePoint2D, ScenePoint2D> > & segments, const std::vector<std::pair<double, RectangleBoundaryKind> > & boundaries, double y) { - Point2D start; - Point2D end; + ScenePoint2D start; + ScenePoint2D end; int curNumberOfSegments = 0; // we count the number of segments. we only draw if it is 1 (not 0 or 2) for (size_t i = 0; i < boundaries.size(); ++i) { @@ -138,14 +138,12 @@ break; case 1: // a new segment has begun! - start.x = boundaries[i].first; - start.y = y; + start = ScenePoint2D(boundaries[i].first, y); break; case 2: // an extra segment has begun : stop the current one (we don't draw overlaps) - end.x = boundaries[i].first; - end.y = y; - segments.push_back(std::pair<Point2D, Point2D>(start, end)); + end = ScenePoint2D(boundaries[i].first, y); + segments.push_back(std::pair<ScenePoint2D, ScenePoint2D>(start, end)); break; default: //assert(false); // seen IRL ! @@ -158,14 +156,12 @@ { case 0: // a lone (thus active) segment has ended. - end.x = boundaries[i].first; - end.y = y; - segments.push_back(std::pair<Point2D, Point2D>(start, end)); + end = ScenePoint2D(boundaries[i].first, y); + segments.push_back(std::pair<ScenePoint2D, ScenePoint2D>(start, end)); break; case 1: // an extra segment has ended : start a new one one - start.x = boundaries[i].first; - start.y = y; + start = ScenePoint2D(boundaries[i].first, y); break; default: // this should not happen! @@ -182,7 +178,7 @@ #if 0 void ConvertListOfSlabsToSegments( - std::vector< std::pair<Point2D, Point2D> >& segments, + std::vector< std::pair<ScenePoint2D, ScenePoint2D> >& segments, const std::vector<RtStructRectanglesInSlab>& slabCuts, const size_t totalRectCount) { @@ -191,7 +187,7 @@ #else // See https://www.dropbox.com/s/bllco6q8aazxk44/2019-09-18-rtstruct-cut-algorithm-rect-merge.png void ConvertListOfSlabsToSegments( - std::vector< std::pair<Point2D, Point2D> > & segments, + std::vector< std::pair<ScenePoint2D, ScenePoint2D> > & segments, const std::vector<RtStructRectanglesInSlab> & slabCuts, const size_t totalRectCount) { @@ -210,14 +206,14 @@ { const RtStructRectangleInSlab& rect = slabCuts[iSlab][iRect]; { - Point2D p1(rect.xmin, rect.ymin); - Point2D p2(rect.xmin, rect.ymax); - segments.push_back(std::pair<Point2D, Point2D>(p1, p2)); + ScenePoint2D p1(rect.xmin, rect.ymin); + ScenePoint2D p2(rect.xmin, rect.ymax); + segments.push_back(std::pair<ScenePoint2D, ScenePoint2D>(p1, p2)); } { - Point2D p1(rect.xmax, rect.ymin); - Point2D p2(rect.xmax, rect.ymax); - segments.push_back(std::pair<Point2D, Point2D>(p1, p2)); + ScenePoint2D p1(rect.xmax, rect.ymin); + ScenePoint2D p2(rect.xmax, rect.ymax); + segments.push_back(std::pair<ScenePoint2D, ScenePoint2D>(p1, p2)); } } }
--- a/OrthancStone/Sources/Toolbox/DicomStructureSetUtils.h Wed Jan 19 14:25:59 2022 +0100 +++ b/OrthancStone/Sources/Toolbox/DicomStructureSetUtils.h Wed Jan 19 14:51:55 2022 +0100 @@ -25,37 +25,11 @@ #include <vector> #include <utility> +#include "../Scene2D/ScenePoint2D.h" #include "../Toolbox/LinearAlgebra.h" namespace OrthancStone { -#if 0 - struct Point3D - { - Point3D(double x, double y, double z) : x(x), y(y), z(z) {} - Point3D() : x(0), y(0), z(0) {} - double x, y, z; - }; - - struct Vector3D - { - Vector3D(double x, double y, double z) : x(x), y(y), z(z) {} - Vector3D() : x(0), y(0), z(0) {} - double x, y, z; - }; -#else - typedef Vector Vector3D; - typedef Vector Point3D; -#endif - - struct Point2D - { - Point2D(double x, double y) : x(x), y(y) {} - Point2D() : x(0), y(0) {} - double x, y; - }; - - /** Internal */ struct RtStructRectangleInSlab { @@ -75,12 +49,12 @@ #endif /** Internal */ - void ConvertListOfSlabsToSegments(std::vector< std::pair<Point2D, Point2D> >& segments, const std::vector<RtStructRectanglesInSlab>& slabCuts, const size_t totalRectCount); + void ConvertListOfSlabsToSegments(std::vector< std::pair<ScenePoint2D, ScenePoint2D> >& segments, const std::vector<RtStructRectanglesInSlab>& slabCuts, const size_t totalRectCount); /** Internal */ void AddSlabBoundaries(std::vector<std::pair<double, RectangleBoundaryKind> >& boundaries, const std::vector<RtStructRectanglesInSlab>& slabCuts, size_t iSlab); /** Internal */ - void ProcessBoundaryList(std::vector< std::pair<Point2D, Point2D> >& segments, const std::vector<std::pair<double, RectangleBoundaryKind> >& boundaries, double y); + void ProcessBoundaryList(std::vector< std::pair<ScenePoint2D, ScenePoint2D> >& segments, const std::vector<std::pair<double, RectangleBoundaryKind> >& boundaries, double y); }
--- a/OrthancStone/Sources/Volumes/DicomStructureSetSlicer2.cpp Wed Jan 19 14:25:59 2022 +0100 +++ b/OrthancStone/Sources/Volumes/DicomStructureSetSlicer2.cpp Wed Jan 19 14:51:55 2022 +0100 @@ -90,7 +90,7 @@ { const Color& color = structure.GetColor(); - std::vector< std::pair<Point2D, Point2D> > segments; + std::vector< std::pair<ScenePoint2D, ScenePoint2D> > segments; if (structure.Project(segments, cuttingPlane)) { @@ -99,8 +99,8 @@ PolylineSceneLayer::Chain chain; chain.resize(2); - chain[0] = ScenePoint2D(segments[j].first.x, segments[j].first.y); - chain[1] = ScenePoint2D(segments[j].second.x, segments[j].second.y); + chain[0] = ScenePoint2D(segments[j].first.GetX(), segments[j].first.GetY()); + chain[1] = ScenePoint2D(segments[j].second.GetX(), segments[j].second.GetY()); layer->AddChain(chain, false /* NOT closed */, color); }
--- a/OrthancStone/UnitTestsSources/TestStructureSet.cpp Wed Jan 19 14:25:59 2022 +0100 +++ b/OrthancStone/UnitTestsSources/TestStructureSet.cpp Wed Jan 19 14:51:55 2022 +0100 @@ -72,7 +72,7 @@ for (size_t i = 0; i < polygon.GetPointCount(); ++i) { - const Point3D& point = polygon.GetPoint(i); + const Vector& point = polygon.GetPoint(i); // loop over X, Y then Z. for (size_t j = 0; j < 3; ++j) @@ -244,7 +244,7 @@ #ifdef BGO_ENABLE_DICOMSTRUCTURESETLOADER2 static bool CutStructureWithPlane( - std::vector< std::pair<Point2D, Point2D> >& segments, + std::vector< std::pair<ScenePoint2D, ScenePoint2D> >& segments, const DicomStructure2& structure, const double originX, const double originY, const double originZ, const double axisX_X, const double axisX_Y, const double axisX_Z, @@ -253,7 +253,7 @@ { // create an AXIAL cutting plane, too far away from the volume // (> sliceThickness/2) - Point3D origin, axisX, axisY; + Vector origin, axisX, axisY; LinearAlgebra::AssignVector(origin, originX, originY, originZ); LinearAlgebra::AssignVector(axisX, axisX_X, axisX_Y, axisX_Z); LinearAlgebra::AssignVector(axisY, axisY_X, axisY_Y, axisY_Z); @@ -286,7 +286,7 @@ DicomStructurePolygon2 polygon("Oblomptu", "CLOSED_PLANAR"); for (size_t ip = 0; ip < pointsCoord1Count; ++ip) { - Point3D pt; + Vector pt; double pt0 = pointsCoord1[ip]; double pt1 = pointsCoord2[ip]; double pt2 = 4 * (static_cast<double>(slice) - 1); // -4, 0, 4 @@ -303,7 +303,7 @@ { DicomStructure2 structure; CreateBasicStructure(structure); - std::vector< std::pair<Point2D, Point2D> > segments; + std::vector< std::pair<ScenePoint2D, ScenePoint2D> > segments; // create an AXIAL cutting plane, too far away from the volume // (> sliceThickness/2) @@ -319,7 +319,7 @@ { DicomStructure2 structure; CreateBasicStructure(structure); - std::vector< std::pair<Point2D, Point2D> > segments; + std::vector< std::pair<ScenePoint2D, ScenePoint2D> > segments; // create an AXIAL cutting plane, too far away from the volume // (> sliceThickness/2) @@ -334,7 +334,7 @@ { DicomStructure2 structure; CreateBasicStructure(structure); - std::vector< std::pair<Point2D, Point2D> > segments; + std::vector< std::pair<ScenePoint2D, ScenePoint2D> > segments; // create an AXIAL cutting plane in the volume bool ok = CutStructureWithPlane(segments, structure, @@ -349,12 +349,12 @@ EXPECT_LT(i, POLYGON_POINT_COUNT); EXPECT_LT(i, POLYGON_POINT_COUNT); - const Point2D& pt = segments[i].first; + const ScenePoint2D& pt = segments[i].first; // ...should be at the same location as the 3D coords since the plane // is rooted at 0,0,0 with normal 0,0,1 - EXPECT_NEAR(pt.x, pointsCoord1[i], DELTA_MAX); - EXPECT_NEAR(pt.y, pointsCoord2[i], DELTA_MAX); + EXPECT_NEAR(pt.GetX(), pointsCoord1[i], DELTA_MAX); + EXPECT_NEAR(pt.GetY(), pointsCoord2[i], DELTA_MAX); } } @@ -363,10 +363,10 @@ { DicomStructure2 structure; CreateBasicStructure(structure); - std::vector< std::pair<Point2D, Point2D> > segments; + std::vector< std::pair<ScenePoint2D, ScenePoint2D> > segments; // create an AXIAL cutting plane - Point3D origin, axisX, axisY; + Vector origin, axisX, axisY; LinearAlgebra::AssignVector(origin, 0, 0, 0); LinearAlgebra::AssignVector(axisX, 1, 0, 0); LinearAlgebra::AssignVector(axisY, 0, 1, 0); @@ -383,12 +383,12 @@ EXPECT_LT(i, pointsCoord2Count); // the 2D points of the projected polygon - const Point2D& pt = segments[i].first; + const ScenePoint2D& pt = segments[i].first; // ...should be at the same location as the 3D coords since the plane // is rooted at 0,0,0 with normal 0,0,1 - EXPECT_NEAR(pt.x, pointsCoord1[i], DELTA_MAX); - EXPECT_NEAR(pt.y, pointsCoord2[i], DELTA_MAX); + EXPECT_NEAR(pt.GetX(), pointsCoord1[i], DELTA_MAX); + EXPECT_NEAR(pt.GetY(), pointsCoord2[i], DELTA_MAX); } } @@ -396,10 +396,10 @@ { DicomStructure2 structure; CreateBasicStructure(structure); - std::vector< std::pair<Point2D, Point2D> > segments; + std::vector< std::pair<ScenePoint2D, ScenePoint2D> > segments; // create an X,Z cutting plane, outside of the volume - Point3D origin, axisX, axisY; + Vector origin, axisX, axisY; LinearAlgebra::AssignVector(origin, 0, 0, 0); LinearAlgebra::AssignVector(axisX, 1, 0, 0); LinearAlgebra::AssignVector(axisY, 0, 0, 1); @@ -416,7 +416,7 @@ CreateBasicStructure(structure); // create an X,Z cutting plane, outside of the volume - Point3D origin, axisX, axisY; + Vector origin, axisX, axisY; LinearAlgebra::AssignVector(origin, 0, 3, 0); LinearAlgebra::AssignVector(axisX, 1, 0, 0); LinearAlgebra::AssignVector(axisY, 0, 0, 1); @@ -432,19 +432,19 @@ // let's compute the intersection between the polygon and the plane // intersections are in plane coords - std::vector<Point2D> intersects; + std::vector<ScenePoint2D> intersects; topSlab.ProjectOnConstantPlane(intersects, cuttingPlane); ASSERT_EQ(4u, intersects.size()); - EXPECT_NEAR(2, intersects[0].x, DELTA_MAX); - EXPECT_NEAR(4, intersects[1].x, DELTA_MAX); - EXPECT_NEAR(7, intersects[2].x, DELTA_MAX); - EXPECT_NEAR(8, intersects[3].x, DELTA_MAX); + EXPECT_NEAR(2, intersects[0].GetX(), DELTA_MAX); + EXPECT_NEAR(4, intersects[1].GetX(), DELTA_MAX); + EXPECT_NEAR(7, intersects[2].GetX(), DELTA_MAX); + EXPECT_NEAR(8, intersects[3].GetX(), DELTA_MAX); for (size_t i = 0; i < 4u; ++i) { - EXPECT_NEAR(polygonZ, intersects[i].y, DELTA_MAX); + EXPECT_NEAR(polygonZ, intersects[i].GetY(), DELTA_MAX); } } } @@ -453,10 +453,10 @@ { DicomStructure2 structure; CreateBasicStructure(structure); - std::vector< std::pair<Point2D, Point2D> > segments; + std::vector< std::pair<ScenePoint2D, ScenePoint2D> > segments; // create an X,Z cutting plane, outside of the volume - Point3D origin, axisX, axisY; + Vector origin, axisX, axisY; LinearAlgebra::AssignVector(origin, 0, 3, 0); LinearAlgebra::AssignVector(axisX, 1, 0, 0); LinearAlgebra::AssignVector(axisY, 0, 0, 1); @@ -470,9 +470,9 @@ for (size_t iSegment = 0; iSegment < segments.size(); ++iSegment) { // count the NON vertical very short segments - if (LinearAlgebra::IsNear(segments[iSegment].first.x, segments[iSegment].second.x)) + if (LinearAlgebra::IsNear(segments[iSegment].first.GetX(), segments[iSegment].second.GetX())) { - if (LinearAlgebra::IsNear(segments[iSegment].first.y, segments[iSegment].second.y)) + if (LinearAlgebra::IsNear(segments[iSegment].first.GetY(), segments[iSegment].second.GetY())) { numberOfVeryShortSegments++; } @@ -551,10 +551,10 @@ { DicomStructure2 structure; CreateBasicStructure(structure); - std::vector< std::pair<Point2D, Point2D> > segments; + std::vector< std::pair<ScenePoint2D, ScenePoint2D> > segments; // create an X,Z cutting plane, inside of the volume - Point3D origin, axisX, axisY; + Vector origin, axisX, axisY; LinearAlgebra::AssignVector(origin, 0, 3, 0); LinearAlgebra::AssignVector(axisX, 1, 0, 0); LinearAlgebra::AssignVector(axisY, 0, 0, 1); @@ -629,7 +629,7 @@ /* void ProcessBoundaryList( - std::vector< std::pair<Point2D, Point2D> >& segments, + std::vector< std::pair<ScenePoint2D, ScenePoint2D> >& segments, const std::vector<std::pair<double, RectangleBoundaryKind> >& boundaries, double y) */ @@ -731,7 +731,7 @@ std::vector<std::pair<double, RectangleBoundaryKind> > boundaries; FillTestRectangleList(slabCuts); boundaries.clear(); - std::vector< std::pair<Point2D, Point2D> > segments; + std::vector< std::pair<ScenePoint2D, ScenePoint2D> > segments; ASSERT_NO_THROW(ProcessBoundaryList(segments, boundaries, 42.0)); ASSERT_EQ(0u, segments.size()); } @@ -743,22 +743,22 @@ // top row { - std::vector< std::pair<Point2D, Point2D> > segments; + std::vector< std::pair<ScenePoint2D, ScenePoint2D> > segments; std::vector<std::pair<double, RectangleBoundaryKind> > boundaries; AddSlabBoundaries(boundaries, slabCuts, 0); ProcessBoundaryList(segments, boundaries, slabCuts[0][0].ymin); ASSERT_EQ(2u, segments.size()); - ASSERT_NEAR( 5.0, segments[0].first.x, DELTA_MAX); - ASSERT_NEAR(31.0, segments[0].second.x, DELTA_MAX); - ASSERT_NEAR( 0.0, segments[0].first.y, DELTA_MAX); - ASSERT_NEAR( 0.0, segments[0].second.y, DELTA_MAX); + ASSERT_NEAR( 5.0, segments[0].first.GetX(), DELTA_MAX); + ASSERT_NEAR(31.0, segments[0].second.GetX(), DELTA_MAX); + ASSERT_NEAR( 0.0, segments[0].first.GetY(), DELTA_MAX); + ASSERT_NEAR( 0.0, segments[0].second.GetY(), DELTA_MAX); - ASSERT_NEAR(36.0, segments[1].first.x, DELTA_MAX); - ASSERT_NEAR(50.0, segments[1].second.x, DELTA_MAX); - ASSERT_NEAR( 0.0, segments[1].first.y, DELTA_MAX); - ASSERT_NEAR( 0.0, segments[1].second.y, DELTA_MAX); + ASSERT_NEAR(36.0, segments[1].first.GetX(), DELTA_MAX); + ASSERT_NEAR(50.0, segments[1].second.GetX(), DELTA_MAX); + ASSERT_NEAR( 0.0, segments[1].first.GetY(), DELTA_MAX); + ASSERT_NEAR( 0.0, segments[1].second.GetY(), DELTA_MAX); } } @@ -772,7 +772,7 @@ { std::vector<std::pair<double, RectangleBoundaryKind> > boundaries; AddSlabBoundaries(boundaries, slabCuts, 0); - std::vector< std::pair<Point2D, Point2D> > segments; + std::vector< std::pair<ScenePoint2D, ScenePoint2D> > segments; ProcessBoundaryList(segments, boundaries, slabCuts[0][0].ymin); } @@ -781,50 +781,50 @@ std::vector<std::pair<double, RectangleBoundaryKind> > boundaries; AddSlabBoundaries(boundaries, slabCuts, 0); AddSlabBoundaries(boundaries, slabCuts, 1); - std::vector< std::pair<Point2D, Point2D> > segments; + std::vector< std::pair<ScenePoint2D, ScenePoint2D> > segments; ProcessBoundaryList(segments, boundaries, slabCuts[0][0].ymax); ASSERT_EQ(4u, segments.size()); - ASSERT_NEAR(05.0, segments[0].first.x, DELTA_MAX); - ASSERT_NEAR(20.0, segments[0].second.x, DELTA_MAX); - ASSERT_NEAR(05.0, segments[0].first.y, DELTA_MAX); - ASSERT_NEAR(05.0, segments[0].second.y, DELTA_MAX); + ASSERT_NEAR(05.0, segments[0].first.GetX(), DELTA_MAX); + ASSERT_NEAR(20.0, segments[0].second.GetX(), DELTA_MAX); + ASSERT_NEAR(05.0, segments[0].first.GetY(), DELTA_MAX); + ASSERT_NEAR(05.0, segments[0].second.GetY(), DELTA_MAX); - ASSERT_NEAR(31.0, segments[1].first.x, DELTA_MAX); - ASSERT_NEAR(36.0, segments[1].second.x, DELTA_MAX); - ASSERT_NEAR(05.0, segments[1].first.y, DELTA_MAX); - ASSERT_NEAR(05.0, segments[1].second.y, DELTA_MAX); + ASSERT_NEAR(31.0, segments[1].first.GetX(), DELTA_MAX); + ASSERT_NEAR(36.0, segments[1].second.GetX(), DELTA_MAX); + ASSERT_NEAR(05.0, segments[1].first.GetY(), DELTA_MAX); + ASSERT_NEAR(05.0, segments[1].second.GetY(), DELTA_MAX); - ASSERT_NEAR(45.0, segments[2].first.x, DELTA_MAX); - ASSERT_NEAR(50.0, segments[2].second.x, DELTA_MAX); - ASSERT_NEAR(05.0, segments[2].first.y, DELTA_MAX); - ASSERT_NEAR(05.0, segments[2].second.y, DELTA_MAX); + ASSERT_NEAR(45.0, segments[2].first.GetX(), DELTA_MAX); + ASSERT_NEAR(50.0, segments[2].second.GetX(), DELTA_MAX); + ASSERT_NEAR(05.0, segments[2].first.GetY(), DELTA_MAX); + ASSERT_NEAR(05.0, segments[2].second.GetY(), DELTA_MAX); - ASSERT_NEAR(52.0, segments[3].first.x, DELTA_MAX); - ASSERT_NEAR(70.0, segments[3].second.x, DELTA_MAX); - ASSERT_NEAR(05.0, segments[3].first.y, DELTA_MAX); - ASSERT_NEAR(05.0, segments[3].second.y, DELTA_MAX); + ASSERT_NEAR(52.0, segments[3].first.GetX(), DELTA_MAX); + ASSERT_NEAR(70.0, segments[3].second.GetX(), DELTA_MAX); + ASSERT_NEAR(05.0, segments[3].first.GetY(), DELTA_MAX); + ASSERT_NEAR(05.0, segments[3].second.GetY(), DELTA_MAX); } // bottom row { std::vector<std::pair<double, RectangleBoundaryKind> > boundaries; AddSlabBoundaries(boundaries, slabCuts, 1); - std::vector< std::pair<Point2D, Point2D> > segments; + std::vector< std::pair<ScenePoint2D, ScenePoint2D> > segments; ProcessBoundaryList(segments, boundaries, slabCuts[1][0].ymax); ASSERT_EQ(2u, segments.size()); - ASSERT_NEAR(20.0, segments[0].first.x, DELTA_MAX); - ASSERT_NEAR(45.0, segments[0].second.x, DELTA_MAX); - ASSERT_NEAR(10.0, segments[0].first.y, DELTA_MAX); - ASSERT_NEAR(10.0, segments[0].second.y, DELTA_MAX); + ASSERT_NEAR(20.0, segments[0].first.GetX(), DELTA_MAX); + ASSERT_NEAR(45.0, segments[0].second.GetX(), DELTA_MAX); + ASSERT_NEAR(10.0, segments[0].first.GetY(), DELTA_MAX); + ASSERT_NEAR(10.0, segments[0].second.GetY(), DELTA_MAX); - ASSERT_NEAR(52.0, segments[1].first.x, DELTA_MAX); - ASSERT_NEAR(70.0, segments[1].second.x, DELTA_MAX); - ASSERT_NEAR(10.0, segments[1].first.y, DELTA_MAX); - ASSERT_NEAR(10.0, segments[1].second.y, DELTA_MAX); + ASSERT_NEAR(52.0, segments[1].first.GetX(), DELTA_MAX); + ASSERT_NEAR(70.0, segments[1].second.GetX(), DELTA_MAX); + ASSERT_NEAR(10.0, segments[1].first.GetY(), DELTA_MAX); + ASSERT_NEAR(10.0, segments[1].second.GetY(), DELTA_MAX); } } @@ -834,7 +834,7 @@ std::vector< RtStructRectanglesInSlab > slabCuts; std::vector<std::pair<double, RectangleBoundaryKind> > boundaries; - std::vector< std::pair<Point2D, Point2D> > segments; + std::vector< std::pair<ScenePoint2D, ScenePoint2D> > segments; ASSERT_NO_THROW(ConvertListOfSlabsToSegments(segments, slabCuts, 0)); ASSERT_EQ(0u, segments.size()); @@ -846,312 +846,312 @@ std::vector<std::pair<double, RectangleBoundaryKind> > boundaries; size_t totalRectCount = FillTestRectangleList(slabCuts); - std::vector< std::pair<Point2D, Point2D> > segments; + std::vector< std::pair<ScenePoint2D, ScenePoint2D> > segments; ASSERT_NO_THROW(ConvertListOfSlabsToSegments(segments, slabCuts, totalRectCount)); ASSERT_EQ(60u, segments.size()); size_t i = 0; - ASSERT_NEAR(segments[i].first.x, 5.0000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].first.y, 0.0000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.x, 5.0000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.y, 5.0000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetX(), 5.0000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetY(), 0.0000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetX(), 5.0000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetY(), 5.0000000000000000, DELTA_MAX); i++; - ASSERT_NEAR(segments[i].first.x, 31.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].first.y, 0.0000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.x, 31.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.y, 5.0000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetX(), 31.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetY(), 0.0000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetX(), 31.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetY(), 5.0000000000000000, DELTA_MAX); i++; - ASSERT_NEAR(segments[i].first.x, 36.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].first.y, 0.0000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.x, 36.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.y, 5.0000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetX(), 36.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetY(), 0.0000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetX(), 36.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetY(), 5.0000000000000000, DELTA_MAX); i++; - ASSERT_NEAR(segments[i].first.x, 50.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].first.y, 0.0000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.x, 50.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.y, 5.0000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetX(), 50.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetY(), 0.0000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetX(), 50.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetY(), 5.0000000000000000, DELTA_MAX); i++; - ASSERT_NEAR(segments[i].first.x, 20.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].first.y, 5.0000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.x, 20.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.y, 10.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetX(), 20.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetY(), 5.0000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetX(), 20.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetY(), 10.000000000000000, DELTA_MAX); i++; - ASSERT_NEAR(segments[i].first.x, 45.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].first.y, 5.0000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.x, 45.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.y, 10.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetX(), 45.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetY(), 5.0000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetX(), 45.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetY(), 10.000000000000000, DELTA_MAX); i++; - ASSERT_NEAR(segments[i].first.x, 52.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].first.y, 5.0000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.x, 52.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.y, 10.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetX(), 52.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetY(), 5.0000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetX(), 52.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetY(), 10.000000000000000, DELTA_MAX); i++; - ASSERT_NEAR(segments[i].first.x, 70.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].first.y, 5.0000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.x, 70.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.y, 10.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetX(), 70.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetY(), 5.0000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetX(), 70.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetY(), 10.000000000000000, DELTA_MAX); i++; - ASSERT_NEAR(segments[i].first.x, 0.0000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].first.y, 10.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.x, 0.0000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.y, 15.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetX(), 0.0000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetY(), 10.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetX(), 0.0000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetY(), 15.000000000000000, DELTA_MAX); i++; - ASSERT_NEAR(segments[i].first.x, 32.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].first.y, 10.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.x, 32.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.y, 15.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetX(), 32.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetY(), 10.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetX(), 32.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetY(), 15.000000000000000, DELTA_MAX); i++; - ASSERT_NEAR(segments[i].first.x, 35.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].first.y, 10.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.x, 35.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.y, 15.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetX(), 35.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetY(), 10.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetX(), 35.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetY(), 15.000000000000000, DELTA_MAX); i++; - ASSERT_NEAR(segments[i].first.x, 44.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].first.y, 10.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.x, 44.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.y, 15.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetX(), 44.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetY(), 10.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetX(), 44.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetY(), 15.000000000000000, DELTA_MAX); i++; - ASSERT_NEAR(segments[i].first.x, 60.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].first.y, 10.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.x, 60.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.y, 15.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetX(), 60.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetY(), 10.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetX(), 60.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetY(), 15.000000000000000, DELTA_MAX); i++; - ASSERT_NEAR(segments[i].first.x, 75.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].first.y, 10.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.x, 75.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.y, 15.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetX(), 75.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetY(), 10.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetX(), 75.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetY(), 15.000000000000000, DELTA_MAX); i++; - ASSERT_NEAR(segments[i].first.x, 10.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].first.y, 15.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.x, 10.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.y, 20.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetX(), 10.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetY(), 15.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetX(), 10.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetY(), 20.000000000000000, DELTA_MAX); i++; - ASSERT_NEAR(segments[i].first.x, 41.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].first.y, 15.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.x, 41.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.y, 20.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetX(), 41.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetY(), 15.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetX(), 41.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetY(), 20.000000000000000, DELTA_MAX); i++; - ASSERT_NEAR(segments[i].first.x, 46.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].first.y, 15.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.x, 46.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.y, 20.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetX(), 46.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetY(), 15.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetX(), 46.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetY(), 20.000000000000000, DELTA_MAX); i++; - ASSERT_NEAR(segments[i].first.x, 80.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].first.y, 15.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.x, 80.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.y, 20.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetX(), 80.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetY(), 15.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetX(), 80.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetY(), 20.000000000000000, DELTA_MAX); i++; - ASSERT_NEAR(segments[i].first.x, 34.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].first.y, 20.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.x, 34.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.y, 25.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetX(), 34.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetY(), 20.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetX(), 34.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetY(), 25.000000000000000, DELTA_MAX); i++; - ASSERT_NEAR(segments[i].first.x, 42.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].first.y, 20.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.x, 42.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.y, 25.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetX(), 42.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetY(), 20.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetX(), 42.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetY(), 25.000000000000000, DELTA_MAX); i++; - ASSERT_NEAR(segments[i].first.x, 90.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].first.y, 20.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.x, 90.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.y, 25.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetX(), 90.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetY(), 20.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetX(), 90.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetY(), 25.000000000000000, DELTA_MAX); i++; - ASSERT_NEAR(segments[i].first.x, 96.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].first.y, 20.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.x, 96.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.y, 25.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetX(), 96.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetY(), 20.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetX(), 96.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetY(), 25.000000000000000, DELTA_MAX); i++; - ASSERT_NEAR(segments[i].first.x, 1.0000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].first.y, 25.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.x, 1.0000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.y, 30.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetX(), 1.0000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetY(), 25.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetX(), 1.0000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetY(), 30.000000000000000, DELTA_MAX); i++; - ASSERT_NEAR(segments[i].first.x, 33.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].first.y, 25.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.x, 33.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.y, 30.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetX(), 33.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetY(), 25.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetX(), 33.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetY(), 30.000000000000000, DELTA_MAX); i++; - ASSERT_NEAR(segments[i].first.x, 40.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].first.y, 25.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.x, 40.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.y, 30.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetX(), 40.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetY(), 25.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetX(), 40.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetY(), 30.000000000000000, DELTA_MAX); i++; - ASSERT_NEAR(segments[i].first.x, 43.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].first.y, 25.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.x, 43.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.y, 30.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetX(), 43.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetY(), 25.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetX(), 43.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetY(), 30.000000000000000, DELTA_MAX); i++; - ASSERT_NEAR(segments[i].first.x, 51.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].first.y, 25.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.x, 51.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.y, 30.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetX(), 51.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetY(), 25.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetX(), 51.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetY(), 30.000000000000000, DELTA_MAX); i++; - ASSERT_NEAR(segments[i].first.x, 61.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].first.y, 25.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.x, 61.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.y, 30.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetX(), 61.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetY(), 25.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetX(), 61.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetY(), 30.000000000000000, DELTA_MAX); i++; - ASSERT_NEAR(segments[i].first.x, 76.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].first.y, 25.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.x, 76.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.y, 30.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetX(), 76.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetY(), 25.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetX(), 76.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetY(), 30.000000000000000, DELTA_MAX); i++; - ASSERT_NEAR(segments[i].first.x, 95.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].first.y, 25.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.x, 95.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.y, 30.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetX(), 95.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetY(), 25.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetX(), 95.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetY(), 30.000000000000000, DELTA_MAX); i++; - ASSERT_NEAR(segments[i].first.x, 5.0000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].first.y, 0.0000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.x, 31.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.y, 0.0000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetX(), 5.0000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetY(), 0.0000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetX(), 31.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetY(), 0.0000000000000000, DELTA_MAX); i++; - ASSERT_NEAR(segments[i].first.x, 36.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].first.y, 0.0000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.x, 50.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.y, 0.0000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetX(), 36.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetY(), 0.0000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetX(), 50.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetY(), 0.0000000000000000, DELTA_MAX); i++; - ASSERT_NEAR(segments[i].first.x, 5.0000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].first.y, 5.0000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.x, 20.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.y, 5.0000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetX(), 5.0000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetY(), 5.0000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetX(), 20.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetY(), 5.0000000000000000, DELTA_MAX); i++; - ASSERT_NEAR(segments[i].first.x, 31.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].first.y, 5.0000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.x, 36.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.y, 5.0000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetX(), 31.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetY(), 5.0000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetX(), 36.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetY(), 5.0000000000000000, DELTA_MAX); i++; - ASSERT_NEAR(segments[i].first.x, 45.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].first.y, 5.0000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.x, 50.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.y, 5.0000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetX(), 45.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetY(), 5.0000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetX(), 50.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetY(), 5.0000000000000000, DELTA_MAX); i++; - ASSERT_NEAR(segments[i].first.x, 52.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].first.y, 5.0000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.x, 70.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.y, 5.0000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetX(), 52.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetY(), 5.0000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetX(), 70.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetY(), 5.0000000000000000, DELTA_MAX); i++; - ASSERT_NEAR(segments[i].first.x, 0.0000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].first.y, 10.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.x, 20.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.y, 10.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetX(), 0.0000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetY(), 10.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetX(), 20.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetY(), 10.000000000000000, DELTA_MAX); i++; - ASSERT_NEAR(segments[i].first.x, 32.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].first.y, 10.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.x, 35.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.y, 10.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetX(), 32.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetY(), 10.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetX(), 35.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetY(), 10.000000000000000, DELTA_MAX); i++; - ASSERT_NEAR(segments[i].first.x, 44.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].first.y, 10.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.x, 45.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.y, 10.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetX(), 44.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetY(), 10.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetX(), 45.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetY(), 10.000000000000000, DELTA_MAX); i++; - ASSERT_NEAR(segments[i].first.x, 52.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].first.y, 10.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.x, 60.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.y, 10.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetX(), 52.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetY(), 10.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetX(), 60.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetY(), 10.000000000000000, DELTA_MAX); i++; - ASSERT_NEAR(segments[i].first.x, 70.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].first.y, 10.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.x, 75.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.y, 10.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetX(), 70.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetY(), 10.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetX(), 75.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetY(), 10.000000000000000, DELTA_MAX); i++; - ASSERT_NEAR(segments[i].first.x, 0.0000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].first.y, 15.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.x, 10.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.y, 15.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetX(), 0.0000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetY(), 15.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetX(), 10.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetY(), 15.000000000000000, DELTA_MAX); i++; - ASSERT_NEAR(segments[i].first.x, 32.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].first.y, 15.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.x, 35.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.y, 15.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetX(), 32.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetY(), 15.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetX(), 35.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetY(), 15.000000000000000, DELTA_MAX); i++; - ASSERT_NEAR(segments[i].first.x, 41.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].first.y, 15.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.x, 44.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.y, 15.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetX(), 41.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetY(), 15.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetX(), 44.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetY(), 15.000000000000000, DELTA_MAX); i++; - ASSERT_NEAR(segments[i].first.x, 46.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].first.y, 15.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.x, 60.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.y, 15.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetX(), 46.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetY(), 15.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetX(), 60.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetY(), 15.000000000000000, DELTA_MAX); i++; - ASSERT_NEAR(segments[i].first.x, 75.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].first.y, 15.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.x, 80.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.y, 15.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetX(), 75.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetY(), 15.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetX(), 80.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetY(), 15.000000000000000, DELTA_MAX); i++; - ASSERT_NEAR(segments[i].first.x, 10.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].first.y, 20.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.x, 34.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.y, 20.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetX(), 10.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetY(), 20.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetX(), 34.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetY(), 20.000000000000000, DELTA_MAX); i++; - ASSERT_NEAR(segments[i].first.x, 41.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].first.y, 20.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.x, 42.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.y, 20.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetX(), 41.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetY(), 20.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetX(), 42.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetY(), 20.000000000000000, DELTA_MAX); i++; - ASSERT_NEAR(segments[i].first.x, 46.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].first.y, 20.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.x, 80.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.y, 20.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetX(), 46.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetY(), 20.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetX(), 80.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetY(), 20.000000000000000, DELTA_MAX); i++; - ASSERT_NEAR(segments[i].first.x, 90.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].first.y, 20.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.x, 96.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.y, 20.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetX(), 90.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetY(), 20.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetX(), 96.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetY(), 20.000000000000000, DELTA_MAX); i++; - ASSERT_NEAR(segments[i].first.x, 1.0000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].first.y, 25.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.x, 33.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.y, 25.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetX(), 1.0000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetY(), 25.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetX(), 33.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetY(), 25.000000000000000, DELTA_MAX); i++; - ASSERT_NEAR(segments[i].first.x, 34.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].first.y, 25.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.x, 40.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.y, 25.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetX(), 34.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetY(), 25.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetX(), 40.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetY(), 25.000000000000000, DELTA_MAX); i++; - ASSERT_NEAR(segments[i].first.x, 42.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].first.y, 25.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.x, 43.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.y, 25.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetX(), 42.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetY(), 25.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetX(), 43.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetY(), 25.000000000000000, DELTA_MAX); i++; - ASSERT_NEAR(segments[i].first.x, 51.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].first.y, 25.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.x, 61.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.y, 25.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetX(), 51.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetY(), 25.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetX(), 61.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetY(), 25.000000000000000, DELTA_MAX); i++; - ASSERT_NEAR(segments[i].first.x, 76.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].first.y, 25.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.x, 90.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.y, 25.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetX(), 76.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetY(), 25.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetX(), 90.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetY(), 25.000000000000000, DELTA_MAX); i++; - ASSERT_NEAR(segments[i].first.x, 95.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].first.y, 25.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.x, 96.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.y, 25.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetX(), 95.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetY(), 25.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetX(), 96.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetY(), 25.000000000000000, DELTA_MAX); i++; - ASSERT_NEAR(segments[i].first.x, 1.0000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].first.y, 30.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.x, 33.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.y, 30.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetX(), 1.0000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetY(), 30.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetX(), 33.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetY(), 30.000000000000000, DELTA_MAX); i++; - ASSERT_NEAR(segments[i].first.x, 40.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].first.y, 30.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.x, 43.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.y, 30.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetX(), 40.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetY(), 30.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetX(), 43.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetY(), 30.000000000000000, DELTA_MAX); i++; - ASSERT_NEAR(segments[i].first.x, 51.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].first.y, 30.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.x, 61.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.y, 30.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetX(), 51.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetY(), 30.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetX(), 61.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetY(), 30.000000000000000, DELTA_MAX); i++; - ASSERT_NEAR(segments[i].first.x, 76.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].first.y, 30.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.x, 95.000000000000000, DELTA_MAX); - ASSERT_NEAR(segments[i].second.y, 30.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetX(), 76.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].first.GetY(), 30.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetX(), 95.000000000000000, DELTA_MAX); + ASSERT_NEAR(segments[i].second.GetY(), 30.000000000000000, DELTA_MAX); } #if defined(BGO_ENABLE_DICOMSTRUCTURESETLOADER2) && (ORTHANC_SANDBOXED != 1)
--- a/RenderingPlugin/Sources/Plugin.cpp Wed Jan 19 14:25:59 2022 +0100 +++ b/RenderingPlugin/Sources/Plugin.cpp Wed Jan 19 14:51:55 2022 +0100 @@ -772,6 +772,7 @@ accessor.GetRtStruct().GetStructurePoints(polygons, structureIndex, parameters->GetSopInstanceUid()); } + // We use a "XOR" filler for the polygons in order to deal with holes in the RT-STRUCT XorFiller filler(parameters->GetWidth(), parameters->GetHeight()); OrthancStone::AffineTransform2D transform = dataAugmentation.ComputeTransform(parameters->GetWidth(), parameters->GetHeight());