diff --git a/Core/src/IfcGeometryConverter/CurveConverter.h b/Core/src/IfcGeometryConverter/CurveConverter.h index ef623c574..93ae615db 100644 --- a/Core/src/IfcGeometryConverter/CurveConverter.h +++ b/Core/src/IfcGeometryConverter/CurveConverter.h @@ -1593,6 +1593,11 @@ namespace OpenInfraPlatform point = getPointOnCurve(curveSegment->ParentCurve.as(), runningLength); direction = getDirectionOfCurve(curveSegment->ParentCurve.as(), runningLength); } + else if (curveSegment->ParentCurve.isOfType()) + { + point = getPointOnCurve(curveSegment->ParentCurve.as(), runningLength); + direction = getDirectionOfCurve(curveSegment->ParentCurve.as(), runningLength); + } segmentPoints.push_back(point); segmentDirections.push_back(direction); // determine next length @@ -1618,6 +1623,7 @@ namespace OpenInfraPlatform if (!segmentPoints.empty()) { + //TODO: implement different rotations around y and z axis //get the local coordinate system carve::geom::vector<3> tangent = segmentDirections[0].normalize(); tangent.y = -tangent.y; @@ -2895,7 +2901,381 @@ namespace OpenInfraPlatform return carve::geom::VECTOR(std::cos(angle), std::sin(angle), 0.); } #endif +#if defined(OIP_MODULE_EARLYBINDING_IFC4X3_RC4) + /*! \brief Calculates an angle of the polynomial curve. + * \param[in] polynomialCurve A pointer to data from \c IfcPolynomialCurve. + * \param[in] parameter The length. + * \return The direction of the curve. + * \note + */ + template <> + carve::geom::vector<3> getDirectionOfCurve(const EXPRESSReference& polynomialCurve, + const typename IfcEntityTypesT::IfcParameterValue& parameter) const noexcept(false) + { + return getDirectionOfCurve(polynomialCurve, parameter * this->UnitConvert()->getLengthInMeterFactor()); + } + template <> + carve::geom::vector<3> getDirectionOfCurve(const EXPRESSReference& polynomialCurve, + const typename IfcEntityTypesT::IfcNonNegativeLengthMeasure& parameter) const noexcept(false) + { + return getDirectionOfCurve(polynomialCurve, parameter * this->UnitConvert()->getLengthInMeterFactor()); + } + template<> + carve::geom::vector<3> getDirectionOfCurve(const EXPRESSReference& polynomialCurve, + const double& parameter) const noexcept(false) + { + //std::vector coefficientsX, coefficientsY, coefficientsZ; + //std::vector polynomialConstantsX, polynomialConstantsY, polynomialConstantsZ; + int polynomialConstantsCntX, polynomialConstantsCntY, polynomialConstantsCntZ; + std::vector polynomialConstantsX, polynomialConstantsY, polynomialConstantsZ; + double angleX, angleY, angleZ; + //get coefficients + if (polynomialCurve->CoefficientsX) + { + //std::vector polynomialConstantsX; + std::vector coefficientsX = polynomialCurve->CoefficientsX; + // convert to double + polynomialConstantsX.resize(coefficientsX.size()); + std::transform(coefficientsX.begin(), coefficientsX.end(), polynomialConstantsX.begin(), [](auto it) { return it; }); + polynomialConstantsCntX = std::size(polynomialConstantsX); + //calculate angle + //angleX = SpiralUtils::AngleByAngleDeviationPolynomial(polynomialConstantsX, polynomialConstantsCntX, parameter); + } + if (polynomialCurve->CoefficientsY) + { + //std::vector polynomialConstantsY; + std::vector coefficientsY = polynomialCurve->CoefficientsY; + //convert to double + polynomialConstantsY.resize(coefficientsY.size()); + std::transform(coefficientsY.begin(), coefficientsY.end(), polynomialConstantsY.begin(), [](auto it) { return it; }); + polynomialConstantsCntY = std::size(polynomialConstantsY); + //calculate angle + //angleY = SpiralUtils::AngleByAngleDeviationPolynomial(polynomialConstantsY, polynomialConstantsCntY, parameter); + } + if (polynomialCurve->CoefficientsZ) + { + //std::vector polynomialConstantsZ; + std::vector coefficientsZ = polynomialCurve->CoefficientsZ; + //convert to double + polynomialConstantsZ.resize(coefficientsZ.size()); + std::transform(coefficientsZ.begin(), coefficientsZ.end(), polynomialConstantsZ.begin(), [](auto it) { return it; }); + polynomialConstantsCntZ = std::size(polynomialConstantsZ); + //calculate angle + //angleZ = SpiralUtils::AngleByAngleDeviationPolynomial(polynomialConstantsZ, polynomialConstantsCntZ, parameter); + } + + // calculate angle between two polynomial curves + //double angle = std::atan2(angleY, angleX); + + if (polynomialConstantsCntX>0 && polynomialConstantsCntY>0) + { + double t = integrateParameter(polynomialConstantsX, polynomialConstantsY, parameter); + double x = calculatePolynomialCurve(polynomialConstantsX, t); + double y = calculatePolynomialCurve(polynomialConstantsY, t); + double angle = std::atan2(y, x); + //double angle = std::atan2(sin(angleY), cos(angleX)); + return carve::geom::VECTOR(std::cos(angle), std::sin(angle), 0.); + } + // Only works if correctly rotation around y axis is in convertIfcCurveSegment + else if (polynomialConstantsCntX>0 && polynomialConstantsCntZ>0) + { + double t = integrateParameter(polynomialConstantsX, polynomialConstantsZ, parameter); + double x = calculatePolynomialCurve(polynomialConstantsX, t); + double z = calculatePolynomialCurve(polynomialConstantsZ, t); + double angle = std::atan2(z, x); //is the angle between the (x,0,z) vector and the +X axis in the X-Z plane. + //double angle = std::atan2(x, z); //is the angle between the (x,0,z) vector and the +Z axis in the Z-X plane. + return carve::geom::VECTOR(std::cos(angle), 0., -std::sin(angle)); + } + // Only works if correctly rotation around x axis is in convertIfcCurveSegment + else if (polynomialConstantsCntY>0 && polynomialConstantsCntZ>0) + { + double t = integrateParameter(polynomialConstantsY, polynomialConstantsZ, parameter); + double y = calculatePolynomialCurve(polynomialConstantsY, t); + double z = calculatePolynomialCurve(polynomialConstantsZ, t); + double angle = std::atan2(z, y); //is the angle between the (0,y,z) vector and the +Y axis in the Y-Z plane. + //double angle = std::atan2(y, z); //is the angle between the (0,y,z) vector and the +Z axis in the Z-Y plane. + return carve::geom::VECTOR(0., std::cos(angleY), std::sin(angleZ)); + } + + //TODO: angle in 3D. At first implement additional code in convertIfcCurveSegment + /*else if (polynomialConstantsCntX>0 && polynomialConstantsCntY>0 && polynomialConstantsCntZ>0) + { + + }*/ + } + +#endif + +#if defined(OIP_MODULE_EARLYBINDING_IFC4X3_RC4) + /*! \brief Calculates a trimming point on the polynomial curve. + * \param[in] polynomialCurve A pointer to data from \c IfcPolynomialCurve. + * \param[in] parameter A pointer to data from \c IfcCurveSegment. + * \return The location of the trimming point. + * \note + */ + template <> + carve::geom::vector<3> getPointOnCurve(const EXPRESSReference& polynomialCurve, + const typename IfcEntityTypesT::IfcParameterValue& parameter) const noexcept(false) + { + return getPointOnCurve(polynomialCurve, parameter * this->UnitConvert()->getLengthInMeterFactor()); + } + template <> + carve::geom::vector<3> getPointOnCurve(const EXPRESSReference& polynomialCurve, + const typename IfcEntityTypesT::IfcNonNegativeLengthMeasure& parameter) const noexcept(false) + { + return getPointOnCurve(polynomialCurve, parameter * this->UnitConvert()->getLengthInMeterFactor()); + } + + carve::geom::vector<3> getPointOnCurve(const EXPRESSReference& polynomialCurve, + const double& parameter) const noexcept(false) + + { + + std::vector coefficientsX, coefficientsY, coefficientsZ; + //typename IfcEntityTypesT::IfcReal x, y, z; + double x, y, z; + int polynomialConstantsCntX, polynomialConstantsCntY, polynomialConstantsCntZ; + std::vector polynomialConstantsX, polynomialConstantsY, polynomialConstantsZ; + + if (polynomialCurve->CoefficientsX) + { + // Interpret coefficients for X + coefficientsX = polynomialCurve->CoefficientsX; + // convert to double + polynomialConstantsX.resize(coefficientsX.size()); + std::transform(coefficientsX.begin(), coefficientsX.end(), polynomialConstantsX.begin(), [](auto it) { return it; }); + polynomialConstantsCntX = std::size(polynomialConstantsX); + //x = SpiralUtils::XbyAngleDeviationPolynomial(polynomialConstantsX, polynomialConstantsCntX, parameter); + //x = SpiralUtils::XbyAngleDeviationPolynomialByTerms( 0., 0., 0., 0., 0., 0., 1., 0., parameter); + } + if (polynomialCurve->CoefficientsY) + { + // Interpret coefficients for Y + coefficientsY = polynomialCurve->CoefficientsY; + //convert to double + polynomialConstantsY.resize(coefficientsY.size()); + std::transform(coefficientsY.begin(), coefficientsY.end(), polynomialConstantsY.begin(), [](auto it) { return it; }); + polynomialConstantsCntY = std::size(polynomialConstantsY); + //y = SpiralUtils::YbyAngleDeviationPolynomial(polynomialConstantsY, polynomialConstantsCntY, parameter); + //y = SpiralUtils::XbyAngleDeviationPolynomialByTerms( 0., 0., 0., 0., 0., 1., 0., 0., parameter); + + } + if (polynomialCurve->CoefficientsZ) + { + // Interpret coefficients for Z + coefficientsZ = polynomialCurve->CoefficientsZ; + //convert to double + polynomialConstantsZ.resize(coefficientsZ.size()); + std::transform(coefficientsZ.begin(), coefficientsZ.end(), polynomialConstantsZ.begin(), [](auto it) { return it; }); + polynomialConstantsCntZ = std::size(polynomialConstantsZ); + } + // Impplement different cases for 2D and 3D + if (polynomialConstantsCntX > 0 && polynomialConstantsCntY > 0) + { + double t = integrateParameter(polynomialConstantsX, polynomialConstantsY, parameter); + x = calculatePolynomialCurve(polynomialConstantsX, t); + y = calculatePolynomialCurve(polynomialConstantsY, t); + return carve::geom::VECTOR(x, y, 0.); + } + + else if (polynomialConstantsCntX > 0 && polynomialConstantsCntZ > 0) + { + double t = integrateParameter(polynomialConstantsX, polynomialConstantsZ, parameter); + x = calculatePolynomialCurve(polynomialConstantsX, t); + z = calculatePolynomialCurve(polynomialConstantsZ, t); + return carve::geom::VECTOR(x, 0., z); + } + + else if (polynomialConstantsCntY > 0 && polynomialConstantsCntZ > 0) + { + double t = integrateParameter(polynomialConstantsY, polynomialConstantsZ, parameter); + y = calculatePolynomialCurve(polynomialConstantsY, t); + z = calculatePolynomialCurve(polynomialConstantsZ, t); + return carve::geom::VECTOR(0., y, z); + } + + else if (polynomialConstantsCntX > 0 && polynomialConstantsCntY > 0 && polynomialConstantsCntZ > 0) + { + double t = integrateParameter(polynomialConstantsX, polynomialConstantsY, polynomialConstantsZ, parameter); + x = calculatePolynomialCurve(polynomialConstantsX, t); + y = calculatePolynomialCurve(polynomialConstantsY, t); + z = calculatePolynomialCurve(polynomialConstantsZ, t); + return carve::geom::VECTOR(x, y, z); + } + } + + /*! \brief Calculates a polinomial curve + * \param[in] coefficients A vector with coeffitients corresponding ordinate from \c IfcPolynomialCurve. + * \param[in] parameter A length during the curve from \c IfcCurveSegment. + * \return The location of the ordinate point. + * \note + */ + typename IfcEntityTypesT::IfcReal calculatePolynomialCurve(std::vector& coefficients, const double& parameter) const noexcept(false) + { + int n = std::size(coefficients); + typename IfcEntityTypesT::IfcReal sum = coefficients[0]; + double factor = 1; + + for (int i = 1; i < n; i++) + { + factor *= parameter; + sum += coefficients[i] * factor; + } + return sum; + } + + /*! \brief Calculates derivative of the polynomial curve + * \param[in] polynomialConstants A vector with coeffitients corresponding ordinate from \c IfcPolynomialCurve. + * \param[in] b Parameter value from integrateParameter + * \return Derivative value. + * \note + */ + double calculatePolynomialDerivative(std::vector& polynomialConstants, double b) const noexcept(false) + { + int polynomialConstantsCnt = std::size(polynomialConstants); + double value; + // check size of the polynomialConstantss + if (polynomialConstantsCnt == 1) return value = 0; + value = polynomialConstants[1]; + int factor = 2; + // derivative of the polynomial + for (int i = 2; i < polynomialConstantsCnt; i++) + { + value += polynomialConstants[i] * factor * b; + b *= b; + factor += 1; + } + return value; + } + /*! \brief Calculates parameter for parametric polynomial curve + * \param[in] polynomialConstantsX A vector with coeffitients axis X from \c IfcPolynomialCurve. + * \param[in] polynomialConstantsY A vector with coeffitients axis Y from \c IfcPolynomialCurve. + * \param[in] length Length of the curve cegment + * \return Parameter value. + * \note + */ + double integrateParameter(std::vector& polynomialConstantsX, std::vector& polynomialConstantsY, const double& length) const noexcept(false) + { + double a = 0.; + double b = 0.; + int n = 1;// small numbers return better values + double value = 0.; + + if (length == 0) { return b; } + // wide steps 0.1 + while (value <= length) + { + value = integral(polynomialConstantsX, polynomialConstantsY, a, b, n); + if (value == length) return b; + b += 0.1; + } + b -= 0.2; + value = integral(polynomialConstantsX, polynomialConstantsY, a, b, n); + // check the error and find the apropriate value + double error = length - value; + double border = 0.0001; + if (error > border) + { + while (value <= length) + { + value = integral(polynomialConstantsX, polynomialConstantsY, a, b, n); + if (value == length) return b; + b += border; + } + } + double parameter = b - 2 * border; + return parameter; + } + + /*! \brief Calculates parameter for parametric polynomial curve in 3D + * \param[in] polynomialConstantsX A vector with coeffitients axis X from \c IfcPolynomialCurve. + * \param[in] polynomialConstantsY A vector with coeffitients axis Y from \c IfcPolynomialCurve. + * \param[in] polynomialConstantsZ A vector with coeffitients axis Z from \c IfcPolynomialCurve. + * \param[in] length Length of the curve cegment + * \return Parameter value. + * \note + */ + double integrateParameter(std::vector& polynomialConstantsX, std::vector& polynomialConstantsY, std::vector& polynomialConstantsZ, const double& length) const noexcept(false) + { + double a = 0.; + double b = 0.; + int n = 1;// small numbers return better values + double value = 0.; + + if (length == 0) return b; + // wide steps 0.1 + while (value <= length) + { + value = integral(polynomialConstantsX, polynomialConstantsY, polynomialConstantsZ, a, b, n); + if (value == length) return b; + b += 0.1; + } + b -= 0.2; + value = integral(polynomialConstantsX, polynomialConstantsY, polynomialConstantsZ, a, b, n); + // check the error and find the apropriate value + double error = length - value; + double border = 0.0001; + if (error > border) + { + while (value <= length) + { + value = integral(polynomialConstantsX, polynomialConstantsY, polynomialConstantsZ, a, b, n); + if (value == length) return b; + b += border; + } + } + double parameter = b - 2 * border; + return parameter; + } + /*! \brief Calculates parameter for parametric polynomial curve in 2D + * \param[in] polynomialConstantsX A vector with coeffitients first axis from \c IfcPolynomialCurve. + * \param[in] polynomialConstantsY A vector with coeffitients second axis from \c IfcPolynomialCurve. + * \param[in] a Low limit of the Integral + * \param[in] b Upper limit of the Integral + * \param[in] n Number of integral steps + * \return Value of the integral. + * \note + */ + // source code https://helloacm.com/c-function-to-compute-numerical-integral-using-function-pointers/ + + double integral(std::vector& polynomialConstantsX, std::vector& polynomialConstantsY, double a, double b, int n) const noexcept(false) + { + double step = (b - a) / n; // width of each small rectangle + double area = 0.0; // signed area + for (int i = 0; i < n; i++) { + //source arcticle https://www.math.usm.edu/lambers/mat169/fall09/lecture31.pdf + area += sqrt(pow(calculatePolynomialDerivative(polynomialConstantsY, (a + (i + 0.5) * step)),2) + + pow(calculatePolynomialDerivative(polynomialConstantsX, (a + (i + 0.5) * step)),2)) * step; // sum up each small rectangle + } + return area; + } + /*! \brief Calculates parameter for parametric polynomial curve in 3D + * \param[in] polynomialConstantsX A vector with coeffitients axis X from \c IfcPolynomialCurve. + * \param[in] polynomialConstantsY A vector with coeffitients axis Y from \c IfcPolynomialCurve. + * \param[in] polynomialConstantsZ A vector with coeffitients axis Z from \c IfcPolynomialCurve. + * \param[in] a Low limit of the Integral + * \param[in] b Upper limit of the Integral + * \param[in] n Number of integral steps + * \return Value of the integral. + * \note + */ + // source code https://helloacm.com/c-function-to-compute-numerical-integral-using-function-pointers/ + + double integral(std::vector& polynomialConstantsX, std::vector& polynomialConstantsY, std::vector& polynomialConstantsZ, double a, double b, int n) const noexcept(false) + { + double step = (b - a) / n; // width of each small rectangle + double area = 0.0; // signed area + for (int i = 0; i < n; i++) { + //source arcticle https://www.math.usm.edu/lambers/mat169/fall09/lecture31.pdf + area += sqrt(pow(calculatePolynomialDerivative(polynomialConstantsY, (a + (i + 0.5) * step)), 2) + + pow(calculatePolynomialDerivative(polynomialConstantsX, (a + (i + 0.5) * step)), 2) + + pow(calculatePolynomialDerivative(polynomialConstantsZ, (a + (i + 0.5) * step)), 2))* step; // sum up each small rectangle + } + return area; + } + +#endif protected: diff --git a/UnitTests/Schemas/IFC4X3_RC4/CMakeLists.txt b/UnitTests/Schemas/IFC4X3_RC4/CMakeLists.txt new file mode 100644 index 000000000..000558209 --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/CMakeLists.txt @@ -0,0 +1,26 @@ +# +# Copyright (c) 2021 Technical University of Munich +# Chair of Computational Modeling and Simulation. +# +# TUM Open Infra Platform is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License Version 3 +# as published by the Free Software Foundation. +# +# TUM Open Infra Platform is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +include(CreateUnitTests) + +# get all subdirectories (that is, unit tests) +SUBDIRLIST(SUBDIRS ${CMAKE_CURRENT_LIST_DIR}) + +# add to the solution +FOREACH(subdir ${SUBDIRS}) + ADD_SUBDIRECTORY(${subdir}) +ENDFOREACH() diff --git a/UnitTests/Schemas/IFC4X3_RC4/bloss-curve_100.0_300_1000_1_Meter/CMakeLists.txt b/UnitTests/Schemas/IFC4X3_RC4/bloss-curve_100.0_300_1000_1_Meter/CMakeLists.txt new file mode 100644 index 000000000..d82ed396c --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/bloss-curve_100.0_300_1000_1_Meter/CMakeLists.txt @@ -0,0 +1,20 @@ +# +# Copyright (c) 2021 Technical University of Munich +# Chair of Computational Modeling and Simulation. +# +# TUM Open Infra Platform is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License Version 3 +# as published by the Free Software Foundation. +# +# TUM Open Infra Platform is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +include(CreateUnitTests) + +CreateIfcFileVisualUnitTestForSchema(bloss-curve_100.0_300_1000_1_Meter IFC4X3_RC4) diff --git a/UnitTests/Schemas/IFC4X3_RC4/bloss-curve_100.0_300_1000_1_Meter/Data/bloss-curve_100.0_300_1000_1_Meter.ifc b/UnitTests/Schemas/IFC4X3_RC4/bloss-curve_100.0_300_1000_1_Meter/Data/bloss-curve_100.0_300_1000_1_Meter.ifc new file mode 100644 index 000000000..e62672c17 --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/bloss-curve_100.0_300_1000_1_Meter/Data/bloss-curve_100.0_300_1000_1_Meter.ifc @@ -0,0 +1,81 @@ +ISO-10303-21; +HEADER; +FILE_DESCRIPTION (('ViewDefinition [CoordinationView]'), '2;1'); +FILE_NAME ('Single-LANDXML.ifc', '2021-05-24T11:00:00', ('IFC Rail Technical Services'), ('buildingSMART International RailwayRoom'), 'RailCOMPLETE\X2\FFAE\X0\', '2019.1.1995.0', ''); +FILE_SCHEMA (('IFC4X3_RC4')); +ENDSEC; +DATA; +#1 = IFCPROJECT('1FNFy8AJeHwwz7wDZHIYIu', #3, 'IFC Rail Referencedata', 'Rail alignment sample', $, 'Longname', 'Design', $, #9); +#2 = IFCAPPLICATION(#5, '2019.1.1995.0', 'RailCOMPLETE\X2\00AE\X0\', $); +#3 = IFCOWNERHISTORY(#6, #2, $, .ADDED., 1320688800, $, $, 1320688800); +#4 = IFCPERSON('TS', 'IFC Rail Technical Services', $, $, $, $, $, $); +#5 = IFCORGANIZATION('bsI RWR', 'buildingSmart International Railway Room', $, $, $); +#6 = IFCPERSONANDORGANIZATION(#4, #5, $); +#7 = IFCSIUNIT(*, .LENGTHUNIT., $, .METRE.); +#8 = IFCSIUNIT(*, .PLANEANGLEUNIT., $, .RADIAN.); +#9 = IFCUNITASSIGNMENT((#7, #8)); +#10 = IFCCARTESIANPOINT((0., 0., 0.)); +#11 = IFCDIRECTION((0., 0., 1.)); +#12 = IFCDIRECTION((1., 0., 0.)); +#13 = IFCAXIS2PLACEMENT3D(#10, #11, #12); +#14 = IFCLOCALPLACEMENT($, #13); +#15 = IFCRAILWAY('1FNFy9AJeHwuVmwDZHIYIu', #3, 'optional Railway Name', 'optional Railway Description', $, #14, $, 'Longname for Railway track geometry (alignment)', $, $); +#16 = IFCDIRECTION((0., 1., 0.)); +#17 = IFCGEOMETRICREPRESENTATIONCONTEXT($, 'MODEL', 3, 1.E-5, #13, #16); +#18 = IFCRELAGGREGATES('1FNFyAAJeHwu6TwDZHIYIu', #3, 'Documentation Container', 'Container for IfcProject, collects relevant products', #1, (#15)); +#19 = IFCRELCONTAINEDINSPATIALSTRUCTURE('1FNFyBAJeHwvmywDZHIYIu', #3, 'IfcProducts contained in myIfcRailway', 'Association between IfcProducts and IfcRailway', (#20), #15); +#20 = IFCALIGNMENT('1FNFyCAJeHwxedwDZHIYIu', #3, 'Spor', 'optional Railway Description', $, #48, #51, $, $); +#21 = IFCALIGNMENTHORIZONTAL('1FNFyDAJeHwv87wDZHIYIu', $, $, $, $, #53, #56); +#23 = IFCRELNESTS('3BJTAQrjCHwvVKbERtTLTf', $, $, $, #20, (#21)); +#28 = IFCCARTESIANPOINT((0., 0.)); +#29 = IFCALIGNMENTHORIZONTALSEGMENT($, $, #28, 0., 300., 1000., 100., $, .BLOSSCURVE.); +#30 = IFCALIGNMENTSEGMENT('1FNFyHAJeHwuDtwDZHIYIu', #3, $, $, $, #37, #40, #29); +#34 = IFCRELNESTS('1FNFyHAJeHwuDtwDZHIYIj', $, $, $, #21, (#30)); +#35 = IFCCOMPOSITECURVE((#36), .F.); +#36 = IFCCURVESEGMENT(.DISCONTINUOUS., #42, IFCPARAMETERVALUE(0.), IFCNONNEGATIVELENGTHMEASURE(100.), #45); +#37 = IFCLOCALPLACEMENT($, #38); +#38 = IFCAXIS2PLACEMENT3D(#39, $, $); +#39 = IFCCARTESIANPOINT((0., 0., 0.)); +#40 = IFCPRODUCTDEFINITIONSHAPE($, $, (#41, #71)); +#41 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve2D', (#36)); +#42 = IFCAXIS2PLACEMENT2D(#43, #44); +#43 = IFCCARTESIANPOINT((0., 0.)); +#44 = IFCDIRECTION((1., 0.)); +#45 = IFCTHIRDORDERPOLYNOMIALSPIRAL(#46, 120.989673502444, -112.624788044361, $, 300.); +#46 = IFCAXIS2PLACEMENT2D(#47, $); +#47 = IFCCARTESIANPOINT((0., 0.)); +#48 = IFCLOCALPLACEMENT($, #49); +#49 = IFCAXIS2PLACEMENT3D(#50, $, $); +#50 = IFCCARTESIANPOINT((0., 0., 0.)); +#51 = IFCPRODUCTDEFINITIONSHAPE($, $, (#52, #77)); +#52 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve3D', (#35)); +#53 = IFCLOCALPLACEMENT($, #54); +#54 = IFCAXIS2PLACEMENT3D(#55, $, $); +#55 = IFCCARTESIANPOINT((0., 0., 0.)); +#56 = IFCPRODUCTDEFINITIONSHAPE($, $, (#57, #60)); +#57 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve2D', (#35)); +#58 = IFCCARTESIANPOINTLIST2D(((0., 0.), (9.9999814830408E-1, 1.66660702367247E-3), (1.99998519015389, 6.66571612238431E-3), (1.99998519015389, 6.66571612238431E-3), (2.99995003756877, 1.49952068558183E-2), (2.99995003756877, 1.49952068558183E-2), (3.99988163910424, 2.66515780763207E-2), (4.99976899741095, 4.16299763019002E-2), (5.99960118627175, 5.99242242291851E-2), (6.9993673671008, 8.15268493802873E-2), (7.99905680489036, 1.06429112877201E-1), (8.99865888359186, 1.34621038337084E-1), (9.99816312091952, 1.66091440881525E-1), (10.9975591825655, 2.00827956252687E-1), (11.9968368958174, 2.38817070029023E-1), (12.9959862625693, 2.80044146933164E-1), (13.99499747172, 3.24493460224389E-1), (14.9938609109516, 3.72148221168085E-1), (15.9925671778843, 4.22990608574494E-1), (16.9911070906025, 4.77001798399067E-1), (17.9894716975512, 5.341619933967E-1), (18.9876522867991, 5.94450452822223E-1), (19.9856403946689, 6.57845522169519E-1), (20.9834278137349, 7.2432466294176E-1), (21.9810066001882, 7.93864482445355E-1), (22.9783690805732, 8.66440763600321E-1), (23.9755078578963, 9.42028494759957E-1), (24.9724158171129, 1.02060189953285), (25.9690861299954, 1.10213446660048), (26.9655122593886, 1.18659897952375), (27.9616879628585, 1.27396754653233), (28.9576072957417, 1.36421163029038), (29.9532646136021, 1.45730207763312), (30.9486545741041, 1.55320914926843), (31.9437721383108, 1.65190254943825), (32.9386125714163, 1.75335145553475), (33.9331714429233, 1.85752454766643), (34.9274446262752, 1.96439003816979), (35.9214282979542, 2.07391570106233), (36.9151189360582, 2.18606890143311), (37.908513318366, 2.30081662476722), (38.9016085199062, 2.41812550620099), (39.8944019100399, 2.53796185970505), (40.8868911490717, 2.66029170719245), (41.8790741844032, 2.78508080754981), (42.8709492462401, 2.91229468558919), (43.8625148428703, 3.04189866091922), (44.8537697555245, 3.17385787673393), (45.8447130328351, 3.30813732851826), (46.8353439849073, 3.4447018926694), (47.8256621770183, 3.58351635503334), (48.8156674229579, 3.72454543935652), (49.8053597780261, 3.86775383565238), (50.7947395317034, 4.01310622848317), (51.7838072000077, 4.16056732515747), (52.7725635175534, 4.31010188384414), (53.7610094293269, 4.46167474160361), (54.7491460821955, 4.6152508423377), (55.7369748161613, 4.77079526465935), (56.7244971553776, 4.92827324968361), (57.7117147989414, 5.08765022874188), (58.6986296114755, 5.24889185102102), (59.685243613516, 5.41196401112941), (60.6715589717178, 5.57683287659224), (61.6575779888932, 5.74346491527803), (62.6433030938952, 5.91182692275899), (63.6287368313606, 6.08188604960751), (64.6138818513245, 6.25360982863141), (65.598740898719, 6.42696620205044), (66.5833168027685, 6.60192354861679), (67.5676124662924, 6.77845071068215), (68.5516308549278, 6.95651702121407), (69.5353749862819, 7.1360923307643), (70.5188479190246, 7.31714703439176), (71.5020527419319, 7.49965209854283), (72.4849925628884, 7.68357908789147), (73.4676704978578, 7.86890019214186), (74.4500896598304, 8.05558825279589), (75.4322531477544, 8.24361678988804), (76.4141640354572, 8.43296002868987), (77.3958253605655, 8.6235929263863), (78.3772401134261, 8.81549119872585), (79.3584112260355, 9.00863134664662), (80.339341560981, 9.20299068288003), (81.3200339003965, 9.39854735853374), (82.3004909349362, 9.59528038965527), (83.2807152527673, 9.79316968377766), (84.2607093285835, 9.99219606644822), (85.2404755126388, 10.1923413077412), (86.220016019801, 10.3935881487552), (87.1993329186224, 10.5959203280951), (88.1784281204274, 10.7993226083402), (89.1573033684097, 11.0037808024963), (90.1359602267385, 11.2092818004339), (91.1144000696649, 11.4158135953092), (92.0926240706238, 11.6233653099698), (93.0706331913225, 11.8319272233412), (94.0484281708084, 12.0414907967956), (95.0260095145044, 12.2520487004976), (96.003377483202, 12.4635948397283), (96.980532082, 12.6761243811822), (97.9574730491742, 12.8896337792367), (98.9341998449656, 13.1041208021889)), $); +#59 = IFCINDEXEDPOLYCURVE(#58, $, $); +#60 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#59)); +#61 = IFCOWNERHISTORY(#63, #65, $, .ADDED., 1630842277, $, $, 1630842277); +#62 = IFCORGANIZATION($, '\X2\0410\X0\\X2\0420\X0\ \X2\0414\X0\\X2\0418\X0\ \X2\0415\X0\\X2\0424\X0\ \X2\041E\X0\\X2\041E\X0\\X2\0414\X0\', 'RDF Ltd.', $, $); +#63 = IFCPERSONANDORGANIZATION(#64, #62, $); +#64 = IFCPERSON($, 'Bonsma', 'Peter', $, $, $, $, $); +#65 = IFCAPPLICATION(#62, '0.99', 'Add Check Library Application', 'TA 1001'); +#66 = IFCRELDEFINESBYPROPERTIES('3uJOQCHMHCCusRBBBCv4yM', #61, $, $, (#21), #67); +#67 = IFCPROPERTYSET('1V36IIaF9BavI3woJMs4AH', #61, 'ValidationPset', $, (#68)); +#68 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(99.9999776852782), $); +#69 = IFCCARTESIANPOINTLIST2D(((0., 0.), (9.9999814830408E-1, 1.66660702367247E-3), (1.99998519015389, 6.66571612238431E-3), (1.99998519015389, 6.66571612238431E-3), (2.99995003756877, 1.49952068558183E-2), (2.99995003756877, 1.49952068558183E-2), (3.99988163910424, 2.66515780763207E-2), (4.99976899741095, 4.16299763019002E-2), (5.99960118627175, 5.99242242291851E-2), (6.9993673671008, 8.15268493802873E-2), (7.99905680489036, 1.06429112877201E-1), (8.99865888359186, 1.34621038337084E-1), (9.99816312091952, 1.66091440881525E-1), (10.9975591825655, 2.00827956252687E-1), (11.9968368958174, 2.38817070029023E-1), (12.9959862625693, 2.80044146933164E-1), (13.99499747172, 3.24493460224389E-1), (14.9938609109516, 3.72148221168085E-1), (15.9925671778843, 4.22990608574494E-1), (16.9911070906025, 4.77001798399067E-1), (17.9894716975512, 5.341619933967E-1), (18.9876522867991, 5.94450452822223E-1), (19.9856403946689, 6.57845522169519E-1), (20.9834278137349, 7.2432466294176E-1), (21.9810066001882, 7.93864482445355E-1), (22.9783690805732, 8.66440763600321E-1), (23.9755078578963, 9.42028494759957E-1), (24.9724158171129, 1.02060189953285), (25.9690861299954, 1.10213446660048), (26.9655122593886, 1.18659897952375), (27.9616879628585, 1.27396754653233), (28.9576072957417, 1.36421163029038), (29.9532646136021, 1.45730207763312), (30.9486545741041, 1.55320914926843), (31.9437721383108, 1.65190254943825), (32.9386125714163, 1.75335145553475), (33.9331714429233, 1.85752454766643), (34.9274446262752, 1.96439003816979), (35.9214282979542, 2.07391570106233), (36.9151189360582, 2.18606890143311), (37.908513318366, 2.30081662476722), (38.9016085199062, 2.41812550620099), (39.8944019100399, 2.53796185970505), (40.8868911490717, 2.66029170719245), (41.8790741844032, 2.78508080754981), (42.8709492462401, 2.91229468558919), (43.8625148428703, 3.04189866091922), (44.8537697555245, 3.17385787673393), (45.8447130328351, 3.30813732851826), (46.8353439849073, 3.4447018926694), (47.8256621770183, 3.58351635503334), (48.8156674229579, 3.72454543935652), (49.8053597780261, 3.86775383565238), (50.7947395317034, 4.01310622848317), (51.7838072000077, 4.16056732515747), (52.7725635175534, 4.31010188384414), (53.7610094293269, 4.46167474160361), (54.7491460821955, 4.6152508423377), (55.7369748161613, 4.77079526465935), (56.7244971553776, 4.92827324968361), (57.7117147989414, 5.08765022874188), (58.6986296114755, 5.24889185102102), (59.685243613516, 5.41196401112941), (60.6715589717178, 5.57683287659224), (61.6575779888932, 5.74346491527803), (62.6433030938952, 5.91182692275899), (63.6287368313606, 6.08188604960751), (64.6138818513245, 6.25360982863141), (65.598740898719, 6.42696620205044), (66.5833168027685, 6.60192354861679), (67.5676124662924, 6.77845071068215), (68.5516308549278, 6.95651702121407), (69.5353749862819, 7.1360923307643), (70.5188479190246, 7.31714703439176), (71.5020527419319, 7.49965209854283), (72.4849925628884, 7.68357908789147), (73.4676704978578, 7.86890019214186), (74.4500896598304, 8.05558825279589), (75.4322531477544, 8.24361678988804), (76.4141640354572, 8.43296002868987), (77.3958253605655, 8.6235929263863), (78.3772401134261, 8.81549119872585), (79.3584112260355, 9.00863134664662), (80.339341560981, 9.20299068288003), (81.3200339003965, 9.39854735853374), (82.3004909349362, 9.59528038965527), (83.2807152527673, 9.79316968377766), (84.2607093285835, 9.99219606644822), (85.2404755126388, 10.1923413077412), (86.220016019801, 10.3935881487552), (87.1993329186224, 10.5959203280951), (88.1784281204274, 10.7993226083402), (89.1573033684097, 11.0037808024963), (90.1359602267385, 11.2092818004339), (91.1144000696649, 11.4158135953092), (92.0926240706238, 11.6233653099698), (93.0706331913225, 11.8319272233412), (94.0484281708084, 12.0414907967956), (95.0260095145044, 12.2520487004976), (96.003377483202, 12.4635948397283), (96.980532082, 12.6761243811822), (97.9574730491742, 12.8896337792367), (98.9341998449656, 13.1041208021889)), $); +#70 = IFCINDEXEDPOLYCURVE(#69, $, $); +#71 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#70)); +#72 = IFCRELDEFINESBYPROPERTIES('0VwfmrFD14WB8uaQOeOpZ_', #61, $, $, (#30), #73); +#73 = IFCPROPERTYSET('0oDMWTAHz3UOvdGBKUiAep', #61, 'ValidationPset', $, (#74)); +#74 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(99.9999776852782), $); +#75 = IFCCARTESIANPOINTLIST2D(((0., 0.), (9.9999814830408E-1, 1.66660702367247E-3), (1.99998519015389, 6.66571612238431E-3), (1.99998519015389, 6.66571612238431E-3), (2.99995003756877, 1.49952068558183E-2), (2.99995003756877, 1.49952068558183E-2), (3.99988163910424, 2.66515780763207E-2), (4.99976899741095, 4.16299763019002E-2), (5.99960118627175, 5.99242242291851E-2), (6.9993673671008, 8.15268493802873E-2), (7.99905680489036, 1.06429112877201E-1), (8.99865888359186, 1.34621038337084E-1), (9.99816312091952, 1.66091440881525E-1), (10.9975591825655, 2.00827956252687E-1), (11.9968368958174, 2.38817070029023E-1), (12.9959862625693, 2.80044146933164E-1), (13.99499747172, 3.24493460224389E-1), (14.9938609109516, 3.72148221168085E-1), (15.9925671778843, 4.22990608574494E-1), (16.9911070906025, 4.77001798399067E-1), (17.9894716975512, 5.341619933967E-1), (18.9876522867991, 5.94450452822223E-1), (19.9856403946689, 6.57845522169519E-1), (20.9834278137349, 7.2432466294176E-1), (21.9810066001882, 7.93864482445355E-1), (22.9783690805732, 8.66440763600321E-1), (23.9755078578963, 9.42028494759957E-1), (24.9724158171129, 1.02060189953285), (25.9690861299954, 1.10213446660048), (26.9655122593886, 1.18659897952375), (27.9616879628585, 1.27396754653233), (28.9576072957417, 1.36421163029038), (29.9532646136021, 1.45730207763312), (30.9486545741041, 1.55320914926843), (31.9437721383108, 1.65190254943825), (32.9386125714163, 1.75335145553475), (33.9331714429233, 1.85752454766643), (34.9274446262752, 1.96439003816979), (35.9214282979542, 2.07391570106233), (36.9151189360582, 2.18606890143311), (37.908513318366, 2.30081662476722), (38.9016085199062, 2.41812550620099), (39.8944019100399, 2.53796185970505), (40.8868911490717, 2.66029170719245), (41.8790741844032, 2.78508080754981), (42.8709492462401, 2.91229468558919), (43.8625148428703, 3.04189866091922), (44.8537697555245, 3.17385787673393), (45.8447130328351, 3.30813732851826), (46.8353439849073, 3.4447018926694), (47.8256621770183, 3.58351635503334), (48.8156674229579, 3.72454543935652), (49.8053597780261, 3.86775383565238), (50.7947395317034, 4.01310622848317), (51.7838072000077, 4.16056732515747), (52.7725635175534, 4.31010188384414), (53.7610094293269, 4.46167474160361), (54.7491460821955, 4.6152508423377), (55.7369748161613, 4.77079526465935), (56.7244971553776, 4.92827324968361), (57.7117147989414, 5.08765022874188), (58.6986296114755, 5.24889185102102), (59.685243613516, 5.41196401112941), (60.6715589717178, 5.57683287659224), (61.6575779888932, 5.74346491527803), (62.6433030938952, 5.91182692275899), (63.6287368313606, 6.08188604960751), (64.6138818513245, 6.25360982863141), (65.598740898719, 6.42696620205044), (66.5833168027685, 6.60192354861679), (67.5676124662924, 6.77845071068215), (68.5516308549278, 6.95651702121407), (69.5353749862819, 7.1360923307643), (70.5188479190246, 7.31714703439176), (71.5020527419319, 7.49965209854283), (72.4849925628884, 7.68357908789147), (73.4676704978578, 7.86890019214186), (74.4500896598304, 8.05558825279589), (75.4322531477544, 8.24361678988804), (76.4141640354572, 8.43296002868987), (77.3958253605655, 8.6235929263863), (78.3772401134261, 8.81549119872585), (79.3584112260355, 9.00863134664662), (80.339341560981, 9.20299068288003), (81.3200339003965, 9.39854735853374), (82.3004909349362, 9.59528038965527), (83.2807152527673, 9.79316968377766), (84.2607093285835, 9.99219606644822), (85.2404755126388, 10.1923413077412), (86.220016019801, 10.3935881487552), (87.1993329186224, 10.5959203280951), (88.1784281204274, 10.7993226083402), (89.1573033684097, 11.0037808024963), (90.1359602267385, 11.2092818004339), (91.1144000696649, 11.4158135953092), (92.0926240706238, 11.6233653099698), (93.0706331913225, 11.8319272233412), (94.0484281708084, 12.0414907967956), (95.0260095145044, 12.2520487004976), (96.003377483202, 12.4635948397283), (96.980532082, 12.6761243811822), (97.9574730491742, 12.8896337792367), (98.9341998449656, 13.1041208021889)), $); +#76 = IFCINDEXEDPOLYCURVE(#75, $, $); +#77 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#76)); +#78 = IFCRELDEFINESBYPROPERTIES('3Qdq1wkfbDsfk_EM4DuNhU', #61, $, $, (#20), #79); +#79 = IFCPROPERTYSET('30qvDhbfLAXg6wdrwoM9Co', #61, 'ValidationPset', $, (#80)); +#80 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(99.9999776852782), $); +ENDSEC; +END-ISO-10303-21; diff --git a/UnitTests/Schemas/IFC4X3_RC4/bloss-curve_100.0_300_1000_1_Meter/src/bloss-curve_100.0_300_1000_1_Meter.cpp b/UnitTests/Schemas/IFC4X3_RC4/bloss-curve_100.0_300_1000_1_Meter/src/bloss-curve_100.0_300_1000_1_Meter.cpp new file mode 100644 index 000000000..a17c2abd3 --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/bloss-curve_100.0_300_1000_1_Meter/src/bloss-curve_100.0_300_1000_1_Meter.cpp @@ -0,0 +1,100 @@ +/* + Copyright (c) 2021 Technical University of Munich + Chair of Computational Modeling and Simulation. + + TUM Open Infra Platform is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License Version 3 + as published by the Free Software Foundation. + + TUM Open Infra Platform is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include +#include + +#include + +#include +#include +#include + +using namespace testing; + +class BlossCurve : public IfcVisualTest { +protected: + + // Test standard values + buw::Image4b _background = buw::Image4b(0, 0); + + virtual void SetUp() override { + IfcVisualTest::SetUp(); + + express_model = OpenInfraPlatform::IFC4X3_RC4::IFC4X3_RC4Reader::FromFile(filename.string()); + + importer = buw::makeReferenceCounted>(); + auto model = importer->collectData(express_model); + + _background = rendererIfc->captureImage(); + rendererIfc->setModel(model[0]); + } + + virtual void TearDown() override { + express_model.reset(); + IfcVisualTest::TearDown(); + } + + virtual std::string TestName() const { return "bloss-curve_100.0_300_1000_1_Meter"; } + virtual std::string Schema() const { return "IFC4X3_RC4"; } + + const boost::filesystem::path filename = dataPath("bloss-curve_100.0_300_1000_1_Meter.ifc"); + + std::shared_ptr express_model = nullptr; + buw::ReferenceCounted> importer = nullptr; +}; + +TEST_F(BlossCurve, AllEntitiesAreRead) { + EXPECT_THAT(express_model->entities.size(), Eq(72)); +} + +TEST_F(BlossCurve, IFCHasAnEssentialEntity) { + auto result1 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto& pair) -> bool { return pair.second->classname() == "IFCCURVESEGMENT"; }); + auto result2 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto& pair) -> bool { return pair.second->classname() == "IFCAXIS2PLACEMENT2D"; }); + auto result3 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto& pair) -> bool { return pair.second->classname() == "IFCTHIRDORDERPOLYNOMIALSPIRAL"; }); + EXPECT_NE(result1, express_model->entities.end()); + EXPECT_NE(result2, express_model->entities.end()); + EXPECT_NE(result3, express_model->entities.end()); +} + +TEST_F(BlossCurve, ImageIsSaved) +{ + // Arrange + buw::Image4b image = rendererIfc->captureImage(); + + // Act + buw::storeImage(testPath("bloss-curve_100.0_300_1000_1_Meter.png").string(), image); + + // Assert + EXPECT_NO_THROW(buw::loadImage4b(testPath("bloss-curve_100.0_300_1000_1_Meter.png").string())); +} + +TEST_F(BlossCurve, PlaneSurfaceViews) +{ + // Arrange + const auto expected_top = buw::loadImage4b(dataPath("bloss-curve_100.0_300_1000_1_Meter_top.png").string()); + + // Act (Top) + rendererIfc->setViewDirection(buw::eViewDirection::Top); + buw::Image4b image_top = CaptureImage(); + + // uncomment following lines to also save the screen shot + //buw::storeImage(testPath("bloss-curve_100.0_300_1000_1_Meter_top.png").string(), image_top); + + // Assert + EXPECT_EQ(image_top, expected_top); +} \ No newline at end of file diff --git a/UnitTests/Schemas/IFC4X3_RC4/circular-arc_100.0_300_1000_1_Meter/CMakeLists.txt b/UnitTests/Schemas/IFC4X3_RC4/circular-arc_100.0_300_1000_1_Meter/CMakeLists.txt new file mode 100644 index 000000000..7c5d2d20b --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/circular-arc_100.0_300_1000_1_Meter/CMakeLists.txt @@ -0,0 +1,20 @@ +# +# Copyright (c) 2021 Technical University of Munich +# Chair of Computational Modeling and Simulation. +# +# TUM Open Infra Platform is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License Version 3 +# as published by the Free Software Foundation. +# +# TUM Open Infra Platform is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +include(CreateUnitTests) + +CreateIfcFileVisualUnitTestForSchema(circular-arc_100.0_300_1000_1_Meter IFC4X3_RC4) diff --git a/UnitTests/Schemas/IFC4X3_RC4/circular-arc_100.0_300_1000_1_Meter/Data/circular-arc_100.0_300_1000_1_Meter.ifc b/UnitTests/Schemas/IFC4X3_RC4/circular-arc_100.0_300_1000_1_Meter/Data/circular-arc_100.0_300_1000_1_Meter.ifc new file mode 100644 index 000000000..feecbaf46 --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/circular-arc_100.0_300_1000_1_Meter/Data/circular-arc_100.0_300_1000_1_Meter.ifc @@ -0,0 +1,81 @@ +ISO-10303-21; +HEADER; +FILE_DESCRIPTION (('ViewDefinition [CoordinationView]'), '2;1'); +FILE_NAME ('Single-LANDXML.ifc', '2021-05-24T11:00:00', ('IFC Rail Technical Services'), ('buildingSMART International RailwayRoom'), 'RailCOMPLETE\X2\FFAE\X0\', '2019.1.1995.0', ''); +FILE_SCHEMA (('IFC4X3_RC4')); +ENDSEC; +DATA; +#1 = IFCPROJECT('1FNFy8AJeHwwz7wDZHIYIu', #3, 'IFC Rail Referencedata', 'Rail alignment sample', $, 'Longname', 'Design', $, #9); +#2 = IFCAPPLICATION(#5, '2019.1.1995.0', 'RailCOMPLETE\X2\00AE\X0\', $); +#3 = IFCOWNERHISTORY(#6, #2, $, .ADDED., 1320688800, $, $, 1320688800); +#4 = IFCPERSON('TS', 'IFC Rail Technical Services', $, $, $, $, $, $); +#5 = IFCORGANIZATION('bsI RWR', 'buildingSmart International Railway Room', $, $, $); +#6 = IFCPERSONANDORGANIZATION(#4, #5, $); +#7 = IFCSIUNIT(*, .LENGTHUNIT., $, .METRE.); +#8 = IFCSIUNIT(*, .PLANEANGLEUNIT., $, .RADIAN.); +#9 = IFCUNITASSIGNMENT((#7, #8)); +#10 = IFCCARTESIANPOINT((0., 0., 0.)); +#11 = IFCDIRECTION((0., 0., 1.)); +#12 = IFCDIRECTION((1., 0., 0.)); +#13 = IFCAXIS2PLACEMENT3D(#10, #11, #12); +#14 = IFCLOCALPLACEMENT($, #13); +#15 = IFCRAILWAY('1FNFy9AJeHwuVmwDZHIYIu', #3, 'optional Railway Name', 'optional Railway Description', $, #14, $, 'Longname for Railway track geometry (alignment)', $, $); +#16 = IFCDIRECTION((0., 1., 0.)); +#17 = IFCGEOMETRICREPRESENTATIONCONTEXT($, 'MODEL', 3, 1.E-5, #13, #16); +#18 = IFCRELAGGREGATES('1FNFyAAJeHwu6TwDZHIYIu', #3, 'Documentation Container', 'Container for IfcProject, collects relevant products', #1, (#15)); +#19 = IFCRELCONTAINEDINSPATIALSTRUCTURE('1FNFyBAJeHwvmywDZHIYIu', #3, 'IfcProducts contained in myIfcRailway', 'Association between IfcProducts and IfcRailway', (#20), #15); +#20 = IFCALIGNMENT('1FNFyCAJeHwxedwDZHIYIu', #3, 'Spor', 'optional Railway Description', $, #48, #51, $, $); +#21 = IFCALIGNMENTHORIZONTAL('1FNFyDAJeHwv87wDZHIYIu', $, $, $, $, #53, #56); +#23 = IFCRELNESTS('3BJTAQrjCHwvVKbERtTLTf', $, $, $, #20, (#21)); +#28 = IFCCARTESIANPOINT((0., 0.)); +#29 = IFCALIGNMENTHORIZONTALSEGMENT($, $, #28, 0., 300., 1000., 100., $, .CIRCULARARC.); +#30 = IFCALIGNMENTSEGMENT('1FNFyHAJeHwuDtwDZHIYIu', #3, $, $, $, #37, #40, #29); +#34 = IFCRELNESTS('1FNFyHAJeHwuDtwDZHIYIj', $, $, $, #21, (#30)); +#35 = IFCCOMPOSITECURVE((#36), .F.); +#36 = IFCCURVESEGMENT(.DISCONTINUOUS., #42, IFCNONNEGATIVELENGTHMEASURE(0.), IFCPARAMETERVALUE(3.33333333333333E-1), #45); +#37 = IFCLOCALPLACEMENT($, #38); +#38 = IFCAXIS2PLACEMENT3D(#39, $, $); +#39 = IFCCARTESIANPOINT((0., 0., 0.)); +#40 = IFCPRODUCTDEFINITIONSHAPE($, $, (#41, #71)); +#41 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve2D', (#36)); +#42 = IFCAXIS2PLACEMENT2D(#43, #44); +#43 = IFCCARTESIANPOINT((0., 0.)); +#44 = IFCDIRECTION((1., 0.)); +#45 = IFCCIRCLE(#46, 300.); +#46 = IFCAXIS2PLACEMENT2D(#47, $); +#47 = IFCCARTESIANPOINT((0., 0.)); +#48 = IFCLOCALPLACEMENT($, #49); +#49 = IFCAXIS2PLACEMENT3D(#50, $, $); +#50 = IFCCARTESIANPOINT((0., 0., 0.)); +#51 = IFCPRODUCTDEFINITIONSHAPE($, $, (#52, #77)); +#52 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve3D', (#35)); +#53 = IFCLOCALPLACEMENT($, #54); +#54 = IFCAXIS2PLACEMENT3D(#55, $, $); +#55 = IFCCARTESIANPOINT((0., 0., 0.)); +#56 = IFCPRODUCTDEFINITIONSHAPE($, $, (#57, #60)); +#57 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve2D', (#35)); +#58 = IFCCARTESIANPOINTLIST2D(((0., 0.), (9.99998148149176E-1, 1.66666512342323E-3), (1.99998518521811, 6.6666419753575E-3), (1.99998518521811, 6.6666419753575E-3), (2.99995000025, 1.4999875000399E-2), (3.99988148253497, 2.6666271607269E-2), (4.99976852173351, 4.16657021694394E-2), (5.99960000799992, 5.99980000266673E-2), (6.99936483210574, 8.16629614869844E-2), (7.99905188556321, 1.06660345828857E-1), (8.99865006074869, 1.34989875303746E-1), (9.99814825102608, 1.66651235139455E-1), (10.9975353508702, 2.01644073543378E-1), (11.9968002559902, 2.39968001706644E-1), (12.9959318634531, 2.81622593808096E-1), (13.9949190718067, 3.26607387019465E-1), (14.9937507812035, 3.74921881510091E-1), (15.9924158935236, 4.26565540452885E-1), (16.9909033124984, 4.81537790029848E-1), (17.9892019438334, 5.3983801943872E-1), (18.9873006953318, 6.01465580899913E-1), (19.9851884770179, 6.66419789663281E-1), (20.9828542012598, 7.34699924016128E-1), (21.9802867828932, 8.06305225290943E-1), (22.9774751393439, 8.81234897873982E-1), (23.9744081907518, 9.59488109214193E-1), (24.9710748600931, 1.04106398983214), (25.9674640733039, 1.12596163333012), (26.9635647594033, 1.21418009640172), (27.9593658506161, 1.30571839884283), (28.954856282496, 1.400575523562), (29.9500249940484, 1.49875041659226), (30.9448609278535, 1.60024198710249), (31.9393530301888, 1.70504910740954), (32.9334902511524, 1.81317061299098), (33.9272615447854, 1.92460530249781), (34.9206558691947, 2.03935193776801), (35.9136621866758, 2.15740924384011), (36.9062694638354, 2.27877590896753), (37.898466671714, 2.40345058463299), (38.8902427859084, 2.53143188556357), (39.8815867866942, 2.66271838974621), (40.8724876591482, 2.79730863844321), (41.8629343932709, 2.93520113620883), (42.8529159841088, 3.07639435090562), (43.8424214318767, 3.22088671372154), (44.8314397420797, 3.36867661918729), (45.8199599256357, 3.51976242519447), (46.8079709989973, 3.67414245301336), (47.7954619842737, 3.83181498731193), (48.7824219093532, 3.99277827617471), (49.7688398080245, 4.15703053112248), (50.7547047200988, 4.32456992713179), (51.7400056915317, 4.4953946026555), (52.7247317745447, 4.66950265964352), (53.7088720277472, 4.84689216356356), (54.6924155162575, 5.02756114342305), (55.6753513118247, 5.21150759179068), (56.6576684929501, 5.39872946481893), (57.6393561450085, 5.58922468226666), (58.6204033603694, 5.78299112752234), (59.6007992385183, 5.98002664762754), (60.5805328861777, 6.18032905330057), (61.5595934174283, 6.38389611896128), (62.5379699538298, 6.59072558275551), (63.5156516245419, 6.8008151465802), (64.4926275664449, 7.01416247610905), (65.4688869242607, 7.23076520081833), (66.4444188506731, 7.45062091401338), (67.4192125064486, 7.67372717285514), (68.3932570605565, 7.90008149838753), (69.3665416902895, 8.12968137556482), (70.3390555813841, 8.36252425327956), (71.3107879281403, 8.59860754439109), (72.2817279335421, 8.83792862575422), (73.2518648093771, 9.0804848382482), (74.2211877763568, 9.32627348680655), (75.1896860642359, 9.57529184044677), (76.1573489119323, 9.82753713230091), (77.1241655676465, 10.083006559646), (78.0901252889811, 10.3416972839356), (79.0552173430604, 10.6036064308308), (80.0194310066493, 10.8687310902328), (80.9827555662723, 11.1370683163148), (81.9451803183335, 11.4086151275548), (82.906694569234, 11.6833685067687), (83.8672876354924, 11.9613254011441), (84.826948843862, 12.242482722274), (85.7856675314506, 12.5268373461908), (86.743433045838, 12.8143861134018), (87.7002347451951, 13.1051258289238), (88.6560619984018, 13.3990532623182), (89.610904185165, 13.6961651477278), (90.564750696137, 13.9964581839124), (91.517590933033, 14.2999290342859), (92.469414308749, 14.6065743269531), (93.4202102474796, 14.9163906547472), (94.3699681848352, 15.2293745752677), (95.3186775679597, 15.5455226109187), (96.2663278556474, 15.8648312489476), (97.2129085184604, 16.1872969414839), (98.1584090388456, 16.5129161055787)), $); +#59 = IFCINDEXEDPOLYCURVE(#58, $, $); +#60 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#59)); +#61 = IFCOWNERHISTORY(#63, #65, $, .ADDED., 1630842292, $, $, 1630842292); +#62 = IFCORGANIZATION($, '\X2\0410\X0\\X2\0420\X0\ \X2\0414\X0\\X2\0418\X0\ \X2\0415\X0\\X2\0424\X0\ \X2\041E\X0\\X2\041E\X0\\X2\0414\X0\', 'RDF Ltd.', $, $); +#63 = IFCPERSONANDORGANIZATION(#64, #62, $); +#64 = IFCPERSON($, 'Bonsma', 'Peter', $, $, $, $, $); +#65 = IFCAPPLICATION(#62, '0.99', 'Add Check Library Application', 'TA 1001'); +#66 = IFCRELDEFINESBYPROPERTIES('3KqUe5hx54buKqk63eXELn', #61, $, $, (#21), #67); +#67 = IFCPROPERTYSET('0B$mbuT0nFJAvJzcqdhEDQ', #61, 'ValidationPset', $, (#68)); +#68 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(99.99995370371), $); +#69 = IFCCARTESIANPOINTLIST2D(((0., 0.), (9.99998148149176E-1, 1.66666512342323E-3), (1.99998518521811, 6.6666419753575E-3), (1.99998518521811, 6.6666419753575E-3), (2.99995000025, 1.4999875000399E-2), (3.99988148253497, 2.6666271607269E-2), (4.99976852173351, 4.16657021694394E-2), (5.99960000799992, 5.99980000266673E-2), (6.99936483210574, 8.16629614869844E-2), (7.99905188556321, 1.06660345828857E-1), (8.99865006074869, 1.34989875303746E-1), (9.99814825102608, 1.66651235139455E-1), (10.9975353508702, 2.01644073543378E-1), (11.9968002559902, 2.39968001706644E-1), (12.9959318634531, 2.81622593808096E-1), (13.9949190718067, 3.26607387019465E-1), (14.9937507812035, 3.74921881510091E-1), (15.9924158935236, 4.26565540452885E-1), (16.9909033124984, 4.81537790029848E-1), (17.9892019438334, 5.3983801943872E-1), (18.9873006953318, 6.01465580899913E-1), (19.9851884770179, 6.66419789663281E-1), (20.9828542012598, 7.34699924016128E-1), (21.9802867828932, 8.06305225290943E-1), (22.9774751393439, 8.81234897873982E-1), (23.9744081907518, 9.59488109214193E-1), (24.9710748600931, 1.04106398983214), (25.9674640733039, 1.12596163333012), (26.9635647594033, 1.21418009640172), (27.9593658506161, 1.30571839884283), (28.954856282496, 1.400575523562), (29.9500249940484, 1.49875041659226), (30.9448609278535, 1.60024198710249), (31.9393530301888, 1.70504910740954), (32.9334902511524, 1.81317061299098), (33.9272615447854, 1.92460530249781), (34.9206558691947, 2.03935193776801), (35.9136621866758, 2.15740924384011), (36.9062694638354, 2.27877590896753), (37.898466671714, 2.40345058463299), (38.8902427859084, 2.53143188556357), (39.8815867866942, 2.66271838974621), (40.8724876591482, 2.79730863844321), (41.8629343932709, 2.93520113620883), (42.8529159841088, 3.07639435090562), (43.8424214318767, 3.22088671372154), (44.8314397420797, 3.36867661918729), (45.8199599256357, 3.51976242519447), (46.8079709989973, 3.67414245301336), (47.7954619842737, 3.83181498731193), (48.7824219093532, 3.99277827617471), (49.7688398080245, 4.15703053112248), (50.7547047200988, 4.32456992713179), (51.7400056915317, 4.4953946026555), (52.7247317745447, 4.66950265964352), (53.7088720277472, 4.84689216356356), (54.6924155162575, 5.02756114342305), (55.6753513118247, 5.21150759179068), (56.6576684929501, 5.39872946481893), (57.6393561450085, 5.58922468226666), (58.6204033603694, 5.78299112752234), (59.6007992385183, 5.98002664762754), (60.5805328861777, 6.18032905330057), (61.5595934174283, 6.38389611896128), (62.5379699538298, 6.59072558275551), (63.5156516245419, 6.8008151465802), (64.4926275664449, 7.01416247610905), (65.4688869242607, 7.23076520081833), (66.4444188506731, 7.45062091401338), (67.4192125064486, 7.67372717285514), (68.3932570605565, 7.90008149838753), (69.3665416902895, 8.12968137556482), (70.3390555813841, 8.36252425327956), (71.3107879281403, 8.59860754439109), (72.2817279335421, 8.83792862575422), (73.2518648093771, 9.0804848382482), (74.2211877763568, 9.32627348680655), (75.1896860642359, 9.57529184044677), (76.1573489119323, 9.82753713230091), (77.1241655676465, 10.083006559646), (78.0901252889811, 10.3416972839356), (79.0552173430604, 10.6036064308308), (80.0194310066493, 10.8687310902328), (80.9827555662723, 11.1370683163148), (81.9451803183335, 11.4086151275548), (82.906694569234, 11.6833685067687), (83.8672876354924, 11.9613254011441), (84.826948843862, 12.242482722274), (85.7856675314506, 12.5268373461908), (86.743433045838, 12.8143861134018), (87.7002347451951, 13.1051258289238), (88.6560619984018, 13.3990532623182), (89.610904185165, 13.6961651477278), (90.564750696137, 13.9964581839124), (91.517590933033, 14.2999290342859), (92.469414308749, 14.6065743269531), (93.4202102474796, 14.9163906547472), (94.3699681848352, 15.2293745752677), (95.3186775679597, 15.5455226109187), (96.2663278556474, 15.8648312489476), (97.2129085184604, 16.1872969414839), (98.1584090388456, 16.5129161055787)), $); +#70 = IFCINDEXEDPOLYCURVE(#69, $, $); +#71 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#70)); +#72 = IFCRELDEFINESBYPROPERTIES('0pmWcLsAj4LuSFQ4xbO_SE', #61, $, $, (#30), #73); +#73 = IFCPROPERTYSET('3yXWIqOh1DCwOOv9CS6tvJ', #61, 'ValidationPset', $, (#74)); +#74 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(99.99995370371), $); +#75 = IFCCARTESIANPOINTLIST2D(((0., 0.), (9.99998148149176E-1, 1.66666512342323E-3), (1.99998518521811, 6.6666419753575E-3), (1.99998518521811, 6.6666419753575E-3), (2.99995000025, 1.4999875000399E-2), (3.99988148253497, 2.6666271607269E-2), (4.99976852173351, 4.16657021694394E-2), (5.99960000799992, 5.99980000266673E-2), (6.99936483210574, 8.16629614869844E-2), (7.99905188556321, 1.06660345828857E-1), (8.99865006074869, 1.34989875303746E-1), (9.99814825102608, 1.66651235139455E-1), (10.9975353508702, 2.01644073543378E-1), (11.9968002559902, 2.39968001706644E-1), (12.9959318634531, 2.81622593808096E-1), (13.9949190718067, 3.26607387019465E-1), (14.9937507812035, 3.74921881510091E-1), (15.9924158935236, 4.26565540452885E-1), (16.9909033124984, 4.81537790029848E-1), (17.9892019438334, 5.3983801943872E-1), (18.9873006953318, 6.01465580899913E-1), (19.9851884770179, 6.66419789663281E-1), (20.9828542012598, 7.34699924016128E-1), (21.9802867828932, 8.06305225290943E-1), (22.9774751393439, 8.81234897873982E-1), (23.9744081907518, 9.59488109214193E-1), (24.9710748600931, 1.04106398983214), (25.9674640733039, 1.12596163333012), (26.9635647594033, 1.21418009640172), (27.9593658506161, 1.30571839884283), (28.954856282496, 1.400575523562), (29.9500249940484, 1.49875041659226), (30.9448609278535, 1.60024198710249), (31.9393530301888, 1.70504910740954), (32.9334902511524, 1.81317061299098), (33.9272615447854, 1.92460530249781), (34.9206558691947, 2.03935193776801), (35.9136621866758, 2.15740924384011), (36.9062694638354, 2.27877590896753), (37.898466671714, 2.40345058463299), (38.8902427859084, 2.53143188556357), (39.8815867866942, 2.66271838974621), (40.8724876591482, 2.79730863844321), (41.8629343932709, 2.93520113620883), (42.8529159841088, 3.07639435090562), (43.8424214318767, 3.22088671372154), (44.8314397420797, 3.36867661918729), (45.8199599256357, 3.51976242519447), (46.8079709989973, 3.67414245301336), (47.7954619842737, 3.83181498731193), (48.7824219093532, 3.99277827617471), (49.7688398080245, 4.15703053112248), (50.7547047200988, 4.32456992713179), (51.7400056915317, 4.4953946026555), (52.7247317745447, 4.66950265964352), (53.7088720277472, 4.84689216356356), (54.6924155162575, 5.02756114342305), (55.6753513118247, 5.21150759179068), (56.6576684929501, 5.39872946481893), (57.6393561450085, 5.58922468226666), (58.6204033603694, 5.78299112752234), (59.6007992385183, 5.98002664762754), (60.5805328861777, 6.18032905330057), (61.5595934174283, 6.38389611896128), (62.5379699538298, 6.59072558275551), (63.5156516245419, 6.8008151465802), (64.4926275664449, 7.01416247610905), (65.4688869242607, 7.23076520081833), (66.4444188506731, 7.45062091401338), (67.4192125064486, 7.67372717285514), (68.3932570605565, 7.90008149838753), (69.3665416902895, 8.12968137556482), (70.3390555813841, 8.36252425327956), (71.3107879281403, 8.59860754439109), (72.2817279335421, 8.83792862575422), (73.2518648093771, 9.0804848382482), (74.2211877763568, 9.32627348680655), (75.1896860642359, 9.57529184044677), (76.1573489119323, 9.82753713230091), (77.1241655676465, 10.083006559646), (78.0901252889811, 10.3416972839356), (79.0552173430604, 10.6036064308308), (80.0194310066493, 10.8687310902328), (80.9827555662723, 11.1370683163148), (81.9451803183335, 11.4086151275548), (82.906694569234, 11.6833685067687), (83.8672876354924, 11.9613254011441), (84.826948843862, 12.242482722274), (85.7856675314506, 12.5268373461908), (86.743433045838, 12.8143861134018), (87.7002347451951, 13.1051258289238), (88.6560619984018, 13.3990532623182), (89.610904185165, 13.6961651477278), (90.564750696137, 13.9964581839124), (91.517590933033, 14.2999290342859), (92.469414308749, 14.6065743269531), (93.4202102474796, 14.9163906547472), (94.3699681848352, 15.2293745752677), (95.3186775679597, 15.5455226109187), (96.2663278556474, 15.8648312489476), (97.2129085184604, 16.1872969414839), (98.1584090388456, 16.5129161055787)), $); +#76 = IFCINDEXEDPOLYCURVE(#75, $, $); +#77 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#76)); +#78 = IFCRELDEFINESBYPROPERTIES('172bKWvED0dxFpOwBpmrZL', #61, $, $, (#20), #79); +#79 = IFCPROPERTYSET('05DXjRcXLEJvMHRyYpLORo', #61, 'ValidationPset', $, (#80)); +#80 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(99.99995370371), $); +ENDSEC; +END-ISO-10303-21; diff --git a/UnitTests/Schemas/IFC4X3_RC4/circular-arc_100.0_300_1000_1_Meter/Data/circular-arc_100.0_300_1000_1_Meter.png b/UnitTests/Schemas/IFC4X3_RC4/circular-arc_100.0_300_1000_1_Meter/Data/circular-arc_100.0_300_1000_1_Meter.png new file mode 100644 index 000000000..67eb369e7 Binary files /dev/null and b/UnitTests/Schemas/IFC4X3_RC4/circular-arc_100.0_300_1000_1_Meter/Data/circular-arc_100.0_300_1000_1_Meter.png differ diff --git a/UnitTests/Schemas/IFC4X3_RC4/circular-arc_100.0_300_1000_1_Meter/Data/circular-arc_100.0_300_1000_1_Meter_top.png b/UnitTests/Schemas/IFC4X3_RC4/circular-arc_100.0_300_1000_1_Meter/Data/circular-arc_100.0_300_1000_1_Meter_top.png new file mode 100644 index 000000000..25a3c05c1 Binary files /dev/null and b/UnitTests/Schemas/IFC4X3_RC4/circular-arc_100.0_300_1000_1_Meter/Data/circular-arc_100.0_300_1000_1_Meter_top.png differ diff --git a/UnitTests/Schemas/IFC4X3_RC4/circular-arc_100.0_300_1000_1_Meter/src/circular-arc_100.0_300_1000_1_Meter.cpp b/UnitTests/Schemas/IFC4X3_RC4/circular-arc_100.0_300_1000_1_Meter/src/circular-arc_100.0_300_1000_1_Meter.cpp new file mode 100644 index 000000000..42f56654f --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/circular-arc_100.0_300_1000_1_Meter/src/circular-arc_100.0_300_1000_1_Meter.cpp @@ -0,0 +1,98 @@ +/* + Copyright (c) 2021 Technical University of Munich + Chair of Computational Modeling and Simulation. + + TUM Open Infra Platform is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License Version 3 + as published by the Free Software Foundation. + + TUM Open Infra Platform is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include +#include + +#include + +#include +#include +#include + +using namespace testing; + +class CircularArc : public IfcVisualTest { +protected: + + // Test standard values + buw::Image4b _background = buw::Image4b(0, 0); + + virtual void SetUp() override { + IfcVisualTest::SetUp(); + + express_model = OpenInfraPlatform::IFC4X3_RC4::IFC4X3_RC4Reader::FromFile(filename.string()); + + importer = buw::makeReferenceCounted>(); + auto model = importer->collectData(express_model); + + _background = rendererIfc->captureImage(); + rendererIfc->setModel(model[0]); + } + + virtual void TearDown() override { + express_model.reset(); + IfcVisualTest::TearDown(); + } + + virtual std::string TestName() const { return "circular-arc_100.0_300_1000_1_Meter"; } + virtual std::string Schema() const { return "IFC4X3_RC4"; } + + const boost::filesystem::path filename = dataPath("circular-arc_100.0_300_1000_1_Meter.ifc"); + + std::shared_ptr express_model = nullptr; + buw::ReferenceCounted> importer = nullptr; +}; + +TEST_F(CircularArc, AllEntitiesAreRead) { + EXPECT_THAT(express_model->entities.size(), Eq(72)); +} + +TEST_F(CircularArc, IFCHasAnEssentialEntity) { + auto result1 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto& pair) -> bool { return pair.second->classname() == "IFCCURVESEGMENT"; }); + auto result2 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto& pair) -> bool { return pair.second->classname() == "IFCCIRCLE"; }); + EXPECT_NE(result1, express_model->entities.end()); + EXPECT_NE(result2, express_model->entities.end()); +} + +TEST_F(CircularArc, ImageIsSaved) +{ + // Arrange + buw::Image4b image = rendererIfc->captureImage(); + + // Act + buw::storeImage(testPath("circular-arc_100.0_300_1000_1_Meter.png").string(), image); + + // Assert + EXPECT_NO_THROW(buw::loadImage4b(testPath("circular-arc_100.0_300_1000_1_Meter.png").string())); +} + +TEST_F(CircularArc, PlaneSurfaceViews) +{ + // Arrange + const auto expected_top = buw::loadImage4b(dataPath("circular-arc_100.0_300_1000_1_Meter_top.png").string()); + + // Act (Top) + rendererIfc->setViewDirection(buw::eViewDirection::Top); + buw::Image4b image_top = CaptureImage(); + + // uncomment following lines to also save the screen shot + //buw::storeImage(testPath("circular-arc_100.0_300_1000_1_Meter_top.png").string(), image_top); + + // Assert + EXPECT_EQ(image_top, expected_top); +} \ No newline at end of file diff --git a/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_-300_-1000_1_Meter/CMakeLists.txt b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_-300_-1000_1_Meter/CMakeLists.txt new file mode 100644 index 000000000..4ec7b7d21 --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_-300_-1000_1_Meter/CMakeLists.txt @@ -0,0 +1,20 @@ +# +# Copyright (c) 2021 Technical University of Munich +# Chair of Computational Modeling and Simulation. +# +# TUM Open Infra Platform is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License Version 3 +# as published by the Free Software Foundation. +# +# TUM Open Infra Platform is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +include(CreateUnitTests) + +CreateIfcFileVisualUnitTestForSchema(clothoid_100.0_-300_-1000_1_Meter IFC4X3_RC4) diff --git a/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_-300_-1000_1_Meter/Data/clothoid_100.0_-300_-1000_1_Meter.ifc b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_-300_-1000_1_Meter/Data/clothoid_100.0_-300_-1000_1_Meter.ifc new file mode 100644 index 000000000..a2eae0569 --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_-300_-1000_1_Meter/Data/clothoid_100.0_-300_-1000_1_Meter.ifc @@ -0,0 +1,81 @@ +ISO-10303-21; +HEADER; +FILE_DESCRIPTION (('ViewDefinition [CoordinationView]'), '2;1'); +FILE_NAME ('Single-LANDXML.ifc', '2021-05-24T11:00:00', ('IFC Rail Technical Services'), ('buildingSMART International RailwayRoom'), 'RailCOMPLETE\X2\FFAE\X0\', '2019.1.1995.0', ''); +FILE_SCHEMA (('IFC4X3_RC4')); +ENDSEC; +DATA; +#1 = IFCPROJECT('1FNFy8AJeHwwz7wDZHIYIu', #3, 'IFC Rail Referencedata', 'Rail alignment sample', $, 'Longname', 'Design', $, #9); +#2 = IFCAPPLICATION(#5, '2019.1.1995.0', 'RailCOMPLETE\X2\00AE\X0\', $); +#3 = IFCOWNERHISTORY(#6, #2, $, .ADDED., 1320688800, $, $, 1320688800); +#4 = IFCPERSON('TS', 'IFC Rail Technical Services', $, $, $, $, $, $); +#5 = IFCORGANIZATION('bsI RWR', 'buildingSmart International Railway Room', $, $, $); +#6 = IFCPERSONANDORGANIZATION(#4, #5, $); +#7 = IFCSIUNIT(*, .LENGTHUNIT., $, .METRE.); +#8 = IFCSIUNIT(*, .PLANEANGLEUNIT., $, .RADIAN.); +#9 = IFCUNITASSIGNMENT((#7, #8)); +#10 = IFCCARTESIANPOINT((0., 0., 0.)); +#11 = IFCDIRECTION((0., 0., 1.)); +#12 = IFCDIRECTION((1., 0., 0.)); +#13 = IFCAXIS2PLACEMENT3D(#10, #11, #12); +#14 = IFCLOCALPLACEMENT($, #13); +#15 = IFCRAILWAY('1FNFy9AJeHwuVmwDZHIYIu', #3, 'optional Railway Name', 'optional Railway Description', $, #14, $, 'Longname for Railway track geometry (alignment)', $, $); +#16 = IFCDIRECTION((0., 1., 0.)); +#17 = IFCGEOMETRICREPRESENTATIONCONTEXT($, 'MODEL', 3, 1.E-5, #13, #16); +#18 = IFCRELAGGREGATES('1FNFyAAJeHwu6TwDZHIYIu', #3, 'Documentation Container', 'Container for IfcProject, collects relevant products', #1, (#15)); +#19 = IFCRELCONTAINEDINSPATIALSTRUCTURE('1FNFyBAJeHwvmywDZHIYIu', #3, 'IfcProducts contained in myIfcRailway', 'Association between IfcProducts and IfcRailway', (#20), #15); +#20 = IFCALIGNMENT('1FNFyCAJeHwxedwDZHIYIu', #3, 'Spor', 'optional Railway Description', $, #48, #51, $, $); +#21 = IFCALIGNMENTHORIZONTAL('1FNFyDAJeHwv87wDZHIYIu', $, $, $, $, #53, #56); +#23 = IFCRELNESTS('3BJTAQrjCHwvVKbERtTLTf', $, $, $, #20, (#21)); +#28 = IFCCARTESIANPOINT((0., 0.)); +#29 = IFCALIGNMENTHORIZONTALSEGMENT($, $, #28, 0., -300., -1000., 100., $, .CLOTHOID.); +#30 = IFCALIGNMENTSEGMENT('1FNFyHAJeHwuDtwDZHIYIu', #3, $, $, $, #37, #40, #29); +#34 = IFCRELNESTS('1FNFyHAJeHwuDtwDZHIYIj', $, $, $, #21, (#30)); +#35 = IFCCOMPOSITECURVE((#36), .F.); +#36 = IFCCURVESEGMENT(.DISCONTINUOUS., #42, IFCPARAMETERVALUE(-142.857142857143), IFCNONNEGATIVELENGTHMEASURE(100.), #45); +#37 = IFCLOCALPLACEMENT($, #38); +#38 = IFCAXIS2PLACEMENT3D(#39, $, $); +#39 = IFCCARTESIANPOINT((0., 0., 0.)); +#40 = IFCPRODUCTDEFINITIONSHAPE($, $, (#41, #71)); +#41 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve2D', (#36)); +#42 = IFCAXIS2PLACEMENT2D(#43, #44); +#43 = IFCCARTESIANPOINT((0., 0.)); +#44 = IFCDIRECTION((1., 0.)); +#45 = IFCCLOTHOID(#46, 207.019667802706); +#46 = IFCAXIS2PLACEMENT2D(#47, $); +#47 = IFCCARTESIANPOINT((0., 0.)); +#48 = IFCLOCALPLACEMENT($, #49); +#49 = IFCAXIS2PLACEMENT3D(#50, $, $); +#50 = IFCCARTESIANPOINT((0., 0., 0.)); +#51 = IFCPRODUCTDEFINITIONSHAPE($, $, (#52, #77)); +#52 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve3D', (#35)); +#53 = IFCLOCALPLACEMENT($, #54); +#54 = IFCAXIS2PLACEMENT3D(#55, $, $); +#55 = IFCCARTESIANPOINT((0., 0., 0.)); +#56 = IFCPRODUCTDEFINITIONSHAPE($, $, (#57, #60)); +#57 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve2D', (#35)); +#58 = IFCCARTESIANPOINTLIST2D(((0., 0.), (9.99998157857806E-1, -1.66277624750011E-3), (1.99998534033737, -6.63553127663813E-3), (2.99995078443388, -1.48948781229196E-2), (3.99988395743782, -2.64173958380876E-2), (4.99977455540432, -4.1179630979115E-2), (5.99961250161492, -5.91580990709488E-2), (6.99938794503112, -8.03292860428473E-2), (7.99909125874164, -1.04669649638966E-1), (8.99871303840128, -1.32155620802715E-1), (9.9982441006641, -1.62763605035658E-1), (10.9976754816092, -1.9646998373071E-1), (11.9969984351606, -2.33251115479936E-1), (12.9962044315006, -2.73083337357159E-1), (13.9952851554776, -3.15942966175447E-1), (14.9942325050079, -3.61806299719717E-1), (15.9930385894722, -4.10649617954609E-1), (16.9916957281071, -4.62449184207771E-1), (17.9901964483906, -5.17181246328756E-1), (18.9885334844241, -5.74822037823713E-1), (19.9866997753087, -6.35347778966028E-1), (20.9846884635177, -6.98734677883087E-1), (21.9824928932642, -7.64958931619348E-1), (22.9801066088656, -8.3399672717593E-1), (23.9775233531034, -9.05824242526805E-1), (24.9747370655795, -9.80417647611907E-1), (25.9717418810694, -1.05775310530723), (26.9685321278716, -1.13780677237212), (27.9651023261544, -1.22055480037402), (28.9614471862989, -1.30597333659077), (29.9575616072401, -1.39403852489063), (30.9534406748047, -1.48472650659029), (31.9490796600466, -1.57801342129105), (32.9444740175805, -1.67387540769325), (33.9396193839125, -1.7722886043893), (34.934511575769, -1.87322915063531), (35.9291465884245, -1.97667318710178), (36.9235205940261, -2.08259685660311), (37.917629939918, -2.19097630480669), (38.9114711469631, -2.30178768092125), (39.9050409078644, -2.41500713836492), (40.8983360854845, -2.53061083541317), (41.8913537111644, -2.64857493582677), (42.8840909830407, -2.76887560945999), (43.876545264363, -2.89148903284927), (44.8687140818095, -3.01639138978243), (45.8605951238025, -3.1435588718488), (46.8521862388234, -3.27296767897033), (47.8434854337273, -3.4045940199139), (48.8344908720567, -3.53841411278501), (49.8252008723562, -3.67440418550317), (50.8156139064857, -3.81254047625903), (51.8057285979343, -3.95279923395342), (52.7955437201347, -4.09515671861883), (53.7850581947767, -4.23958920182302), (54.7742710901217, -4.38607296705531), (55.7631816193174, -4.53458431009577), (56.7517891387125, -4.68509953936722), (57.7400931461725, -4.83759497627051), (58.7280932793957, -4.99204695550315), (59.7157893142296, -5.14843182536153), (60.7031811629884, -5.30672594802689), (61.6902688727712, -5.46690569983528), (62.6770526237805, -5.62894747153172), (63.6635327276425, -5.79282766850863), (64.6497096257275, -5.95852271102892), (65.6355838874716, -6.12600903443384), (66.6211562086995, -6.29526308933569), (67.6064274099483, -6.46626134179582), (68.5913984347923, -6.63898027348787), (69.5760703481696, -6.81339638184667), (70.5604443347088, -6.98948618020278), (71.5445216970581, -7.16722619790308), (72.5283038542152, -7.34659298041741), (73.5117923398582, -7.52756308943165), (74.4949888006787, -7.71011310292723), (75.4778949947155, -7.89421961524751), (76.4605127896901, -8.07985923715089), (77.4428441613439, -8.26700859585133), (78.4248911917762, -8.45564433504591), (79.4066560677843, -8.6457431149301), (80.3881410792052, -8.83728161220067), (81.369348617258, -9.03023652004653), (82.350281172889, -9.22458454812769), (83.3309413351173, -9.42030242254249), (84.3113317893831, -9.61736688578337), (85.2914553158965, -9.81575469668128), (86.2713147879886, -10.0154426303391), (87.2509131704641, -10.2164074780538), (88.2302535179554, -10.4186260472287), (89.2093389732783, -10.6220751612739), (90.1881727657893, -10.8267316594977), (91.1667582097451, -11.0325723969869), (92.1450987026629, -11.2395742444779), (93.1231977236824, -11.4477140882173), (94.1010588319304, -11.6569688298138), (95.0786856648857, -11.8673153860798), (96.0560819367465, -12.0787306888646), (97.0332514367991, -12.291191684878), (98.0101980277882, -12.5046753355058), (98.9869256442884, -12.7191586166162)), $); +#59 = IFCINDEXEDPOLYCURVE(#58, $, $); +#60 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#59)); +#61 = IFCOWNERHISTORY(#63, #65, $, .ADDED., 1630842293, $, $, 1630842293); +#62 = IFCORGANIZATION($, '\X2\0410\X0\\X2\0420\X0\ \X2\0414\X0\\X2\0418\X0\ \X2\0415\X0\\X2\0424\X0\ \X2\041E\X0\\X2\041E\X0\\X2\0414\X0\', 'RDF Ltd.', $, $); +#63 = IFCPERSONANDORGANIZATION(#64, #62, $); +#64 = IFCPERSON($, 'Bonsma', 'Peter', $, $, $, $, $); +#65 = IFCAPPLICATION(#62, '0.99', 'Add Check Library Application', 'TA 1001'); +#66 = IFCRELDEFINESBYPROPERTIES('1CliKEuYX718otBjuJKuED', #61, $, $, (#21), #67); +#67 = IFCPROPERTYSET('0WRkL4e1z9qASMYrrkwNNp', #61, 'ValidationPset', $, (#68)); +#68 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(99.9999785495359), $); +#69 = IFCCARTESIANPOINTLIST2D(((0., 0.), (9.99998157857806E-1, -1.66277624750011E-3), (1.99998534033737, -6.63553127663813E-3), (2.99995078443388, -1.48948781229196E-2), (3.99988395743782, -2.64173958380876E-2), (4.99977455540432, -4.1179630979115E-2), (5.99961250161492, -5.91580990709488E-2), (6.99938794503112, -8.03292860428473E-2), (7.99909125874164, -1.04669649638966E-1), (8.99871303840128, -1.32155620802715E-1), (9.9982441006641, -1.62763605035658E-1), (10.9976754816092, -1.9646998373071E-1), (11.9969984351606, -2.33251115479936E-1), (12.9962044315006, -2.73083337357159E-1), (13.9952851554776, -3.15942966175447E-1), (14.9942325050079, -3.61806299719717E-1), (15.9930385894722, -4.10649617954609E-1), (16.9916957281071, -4.62449184207771E-1), (17.9901964483906, -5.17181246328756E-1), (18.9885334844241, -5.74822037823713E-1), (19.9866997753087, -6.35347778966028E-1), (20.9846884635177, -6.98734677883087E-1), (21.9824928932642, -7.64958931619348E-1), (22.9801066088656, -8.3399672717593E-1), (23.9775233531034, -9.05824242526805E-1), (24.9747370655795, -9.80417647611907E-1), (25.9717418810694, -1.05775310530723), (26.9685321278716, -1.13780677237212), (27.9651023261544, -1.22055480037402), (28.9614471862989, -1.30597333659077), (29.9575616072401, -1.39403852489063), (30.9534406748047, -1.48472650659029), (31.9490796600466, -1.57801342129105), (32.9444740175805, -1.67387540769325), (33.9396193839125, -1.7722886043893), (34.934511575769, -1.87322915063531), (35.9291465884245, -1.97667318710178), (36.9235205940261, -2.08259685660311), (37.917629939918, -2.19097630480669), (38.9114711469631, -2.30178768092125), (39.9050409078644, -2.41500713836492), (40.8983360854845, -2.53061083541317), (41.8913537111644, -2.64857493582677), (42.8840909830407, -2.76887560945999), (43.876545264363, -2.89148903284927), (44.8687140818095, -3.01639138978243), (45.8605951238025, -3.1435588718488), (46.8521862388234, -3.27296767897033), (47.8434854337273, -3.4045940199139), (48.8344908720567, -3.53841411278501), (49.8252008723562, -3.67440418550317), (50.8156139064857, -3.81254047625903), (51.8057285979343, -3.95279923395342), (52.7955437201347, -4.09515671861883), (53.7850581947767, -4.23958920182302), (54.7742710901217, -4.38607296705531), (55.7631816193174, -4.53458431009577), (56.7517891387125, -4.68509953936722), (57.7400931461725, -4.83759497627051), (58.7280932793957, -4.99204695550315), (59.7157893142296, -5.14843182536153), (60.7031811629884, -5.30672594802689), (61.6902688727712, -5.46690569983528), (62.6770526237805, -5.62894747153172), (63.6635327276425, -5.79282766850863), (64.6497096257275, -5.95852271102892), (65.6355838874716, -6.12600903443384), (66.6211562086995, -6.29526308933569), (67.6064274099483, -6.46626134179582), (68.5913984347923, -6.63898027348787), (69.5760703481696, -6.81339638184667), (70.5604443347088, -6.98948618020278), (71.5445216970581, -7.16722619790308), (72.5283038542152, -7.34659298041741), (73.5117923398582, -7.52756308943165), (74.4949888006787, -7.71011310292723), (75.4778949947155, -7.89421961524751), (76.4605127896901, -8.07985923715089), (77.4428441613439, -8.26700859585133), (78.4248911917762, -8.45564433504591), (79.4066560677843, -8.6457431149301), (80.3881410792052, -8.83728161220067), (81.369348617258, -9.03023652004653), (82.350281172889, -9.22458454812769), (83.3309413351173, -9.42030242254249), (84.3113317893831, -9.61736688578337), (85.2914553158965, -9.81575469668128), (86.2713147879886, -10.0154426303391), (87.2509131704641, -10.2164074780538), (88.2302535179554, -10.4186260472287), (89.2093389732783, -10.6220751612739), (90.1881727657893, -10.8267316594977), (91.1667582097451, -11.0325723969869), (92.1450987026629, -11.2395742444779), (93.1231977236824, -11.4477140882173), (94.1010588319304, -11.6569688298138), (95.0786856648857, -11.8673153860798), (96.0560819367465, -12.0787306888646), (97.0332514367991, -12.291191684878), (98.0101980277882, -12.5046753355058), (98.9869256442884, -12.7191586166162)), $); +#70 = IFCINDEXEDPOLYCURVE(#69, $, $); +#71 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#70)); +#72 = IFCRELDEFINESBYPROPERTIES('1llsZgshfEveZa3_b85zGf', #61, $, $, (#30), #73); +#73 = IFCPROPERTYSET('3zRHIkqvbFwf9BFZyDFFI9', #61, 'ValidationPset', $, (#74)); +#74 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(99.9999785495359), $); +#75 = IFCCARTESIANPOINTLIST2D(((0., 0.), (9.99998157857806E-1, -1.66277624750011E-3), (1.99998534033737, -6.63553127663813E-3), (2.99995078443388, -1.48948781229196E-2), (3.99988395743782, -2.64173958380876E-2), (4.99977455540432, -4.1179630979115E-2), (5.99961250161492, -5.91580990709488E-2), (6.99938794503112, -8.03292860428473E-2), (7.99909125874164, -1.04669649638966E-1), (8.99871303840128, -1.32155620802715E-1), (9.9982441006641, -1.62763605035658E-1), (10.9976754816092, -1.9646998373071E-1), (11.9969984351606, -2.33251115479936E-1), (12.9962044315006, -2.73083337357159E-1), (13.9952851554776, -3.15942966175447E-1), (14.9942325050079, -3.61806299719717E-1), (15.9930385894722, -4.10649617954609E-1), (16.9916957281071, -4.62449184207771E-1), (17.9901964483906, -5.17181246328756E-1), (18.9885334844241, -5.74822037823713E-1), (19.9866997753087, -6.35347778966028E-1), (20.9846884635177, -6.98734677883087E-1), (21.9824928932642, -7.64958931619348E-1), (22.9801066088656, -8.3399672717593E-1), (23.9775233531034, -9.05824242526805E-1), (24.9747370655795, -9.80417647611907E-1), (25.9717418810694, -1.05775310530723), (26.9685321278716, -1.13780677237212), (27.9651023261544, -1.22055480037402), (28.9614471862989, -1.30597333659077), (29.9575616072401, -1.39403852489063), (30.9534406748047, -1.48472650659029), (31.9490796600466, -1.57801342129105), (32.9444740175805, -1.67387540769325), (33.9396193839125, -1.7722886043893), (34.934511575769, -1.87322915063531), (35.9291465884245, -1.97667318710178), (36.9235205940261, -2.08259685660311), (37.917629939918, -2.19097630480669), (38.9114711469631, -2.30178768092125), (39.9050409078644, -2.41500713836492), (40.8983360854845, -2.53061083541317), (41.8913537111644, -2.64857493582677), (42.8840909830407, -2.76887560945999), (43.876545264363, -2.89148903284927), (44.8687140818095, -3.01639138978243), (45.8605951238025, -3.1435588718488), (46.8521862388234, -3.27296767897033), (47.8434854337273, -3.4045940199139), (48.8344908720567, -3.53841411278501), (49.8252008723562, -3.67440418550317), (50.8156139064857, -3.81254047625903), (51.8057285979343, -3.95279923395342), (52.7955437201347, -4.09515671861883), (53.7850581947767, -4.23958920182302), (54.7742710901217, -4.38607296705531), (55.7631816193174, -4.53458431009577), (56.7517891387125, -4.68509953936722), (57.7400931461725, -4.83759497627051), (58.7280932793957, -4.99204695550315), (59.7157893142296, -5.14843182536153), (60.7031811629884, -5.30672594802689), (61.6902688727712, -5.46690569983528), (62.6770526237805, -5.62894747153172), (63.6635327276425, -5.79282766850863), (64.6497096257275, -5.95852271102892), (65.6355838874716, -6.12600903443384), (66.6211562086995, -6.29526308933569), (67.6064274099483, -6.46626134179582), (68.5913984347923, -6.63898027348787), (69.5760703481696, -6.81339638184667), (70.5604443347088, -6.98948618020278), (71.5445216970581, -7.16722619790308), (72.5283038542152, -7.34659298041741), (73.5117923398582, -7.52756308943165), (74.4949888006787, -7.71011310292723), (75.4778949947155, -7.89421961524751), (76.4605127896901, -8.07985923715089), (77.4428441613439, -8.26700859585133), (78.4248911917762, -8.45564433504591), (79.4066560677843, -8.6457431149301), (80.3881410792052, -8.83728161220067), (81.369348617258, -9.03023652004653), (82.350281172889, -9.22458454812769), (83.3309413351173, -9.42030242254249), (84.3113317893831, -9.61736688578337), (85.2914553158965, -9.81575469668128), (86.2713147879886, -10.0154426303391), (87.2509131704641, -10.2164074780538), (88.2302535179554, -10.4186260472287), (89.2093389732783, -10.6220751612739), (90.1881727657893, -10.8267316594977), (91.1667582097451, -11.0325723969869), (92.1450987026629, -11.2395742444779), (93.1231977236824, -11.4477140882173), (94.1010588319304, -11.6569688298138), (95.0786856648857, -11.8673153860798), (96.0560819367465, -12.0787306888646), (97.0332514367991, -12.291191684878), (98.0101980277882, -12.5046753355058), (98.9869256442884, -12.7191586166162)), $); +#76 = IFCINDEXEDPOLYCURVE(#75, $, $); +#77 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#76)); +#78 = IFCRELDEFINESBYPROPERTIES('2BaTUDuWb2u8rJ9t_k3wUx', #61, $, $, (#20), #79); +#79 = IFCPROPERTYSET('0adc7ummn9hBqI9t30$zCC', #61, 'ValidationPset', $, (#80)); +#80 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(99.9999785495359), $); +ENDSEC; +END-ISO-10303-21; diff --git a/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_-300_-1000_1_Meter/Data/clothoid_100.0_-300_-1000_1_Meter.png b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_-300_-1000_1_Meter/Data/clothoid_100.0_-300_-1000_1_Meter.png new file mode 100644 index 000000000..43fe3c4e8 Binary files /dev/null and b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_-300_-1000_1_Meter/Data/clothoid_100.0_-300_-1000_1_Meter.png differ diff --git a/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_-300_-1000_1_Meter/Data/clothoid_100.0_-300_-1000_1_Meter_top.png b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_-300_-1000_1_Meter/Data/clothoid_100.0_-300_-1000_1_Meter_top.png new file mode 100644 index 000000000..e06be30cf Binary files /dev/null and b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_-300_-1000_1_Meter/Data/clothoid_100.0_-300_-1000_1_Meter_top.png differ diff --git a/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_-300_-1000_1_Meter/src/clothoid_100.0_-300_-1000_1_Meter.cpp b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_-300_-1000_1_Meter/src/clothoid_100.0_-300_-1000_1_Meter.cpp new file mode 100644 index 000000000..8e1eb8c72 --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_-300_-1000_1_Meter/src/clothoid_100.0_-300_-1000_1_Meter.cpp @@ -0,0 +1,97 @@ +/* + Copyright (c) 2021 Technical University of Munich + Chair of Computational Modeling and Simulation. + + TUM Open Infra Platform is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License Version 3 + as published by the Free Software Foundation. + + TUM Open Infra Platform is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include +#include + +#include + +#include +#include +#include + +using namespace testing; + +class Clothoid : public IfcVisualTest { +protected: + + // Test standard values + buw::Image4b _background = buw::Image4b(0, 0); + + virtual void SetUp() override { + IfcVisualTest::SetUp(); + + express_model = OpenInfraPlatform::IFC4X3_RC4::IFC4X3_RC4Reader::FromFile(filename.string()); + + importer = buw::makeReferenceCounted>(); + auto model = importer->collectData(express_model); + + _background = rendererIfc->captureImage(); + rendererIfc->setModel(model[0]); + } + + virtual void TearDown() override { + express_model.reset(); + IfcVisualTest::TearDown(); + } + + virtual std::string TestName() const { return "clothoid_100.0_-300_-1000_1_Meter"; } + virtual std::string Schema() const { return "IFC4X3_RC4"; } + + const boost::filesystem::path filename = dataPath("clothoid_100.0_-300_-1000_1_Meter.ifc"); + + std::shared_ptr express_model = nullptr; + buw::ReferenceCounted> importer = nullptr; +}; + +TEST_F(Clothoid, AllEntitiesAreRead) { + EXPECT_THAT(express_model->entities.size(), Eq(72)); +} + +TEST_F(Clothoid, IFCHasAnEssentialEntity) { + auto result1 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto &pair) -> bool { return pair.second->classname() == "IFCCURVESEGMENT"; }); + auto result2 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto &pair) -> bool { return pair.second->classname() == "IFCCLOTHOID"; }); + EXPECT_NE(result1, express_model->entities.end()); + EXPECT_NE(result2, express_model->entities.end()); +} + +TEST_F(Clothoid, ImageIsSaved) +{ + // Arrange + buw::Image4b image = rendererIfc->captureImage(); + + // Act + buw::storeImage(testPath("clothoid_100.0_-300_-1000_1_Meter.png").string(), image); + + // Assert + EXPECT_NO_THROW(buw::loadImage4b(testPath("clothoid_100.0_-300_-1000_1_Meter.png").string())); +} + +TEST_F(Clothoid, PlaneSurfaceViews) +{ + // Arrange + const auto expected_top = buw::loadImage4b(dataPath("clothoid_100.0_-300_-1000_1_Meter_top.png").string()); + + // Act (Top) + rendererIfc->setViewDirection(buw::eViewDirection::Top); + buw::Image4b image_top = CaptureImage(); + // uncomment following lines to also save the screen shot + //buw::storeImage(testPath("clothoid_100.0_-300_-1000_1_Meter_top.png").string(), image_top); + + // Assert + EXPECT_EQ(image_top, expected_top); +} \ No newline at end of file diff --git a/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_-inf_300_1_Meter/CMakeLists.txt b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_-inf_300_1_Meter/CMakeLists.txt new file mode 100644 index 000000000..a13211a0e --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_-inf_300_1_Meter/CMakeLists.txt @@ -0,0 +1,20 @@ +# +# Copyright (c) 2021 Technical University of Munich +# Chair of Computational Modeling and Simulation. +# +# TUM Open Infra Platform is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License Version 3 +# as published by the Free Software Foundation. +# +# TUM Open Infra Platform is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +include(CreateUnitTests) + +CreateIfcFileVisualUnitTestForSchema(clothoid_100.0_-inf_300_1_Meter IFC4X3_RC4) diff --git a/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_-inf_300_1_Meter/Data/clothoid_100.0_-inf_300_1_Meter.ifc b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_-inf_300_1_Meter/Data/clothoid_100.0_-inf_300_1_Meter.ifc new file mode 100644 index 000000000..867e78aec --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_-inf_300_1_Meter/Data/clothoid_100.0_-inf_300_1_Meter.ifc @@ -0,0 +1,81 @@ +ISO-10303-21; +HEADER; +FILE_DESCRIPTION (('ViewDefinition [CoordinationView]'), '2;1'); +FILE_NAME ('Single-LANDXML.ifc', '2021-05-24T11:00:00', ('IFC Rail Technical Services'), ('buildingSMART International RailwayRoom'), 'RailCOMPLETE\X2\FFAE\X0\', '2019.1.1995.0', ''); +FILE_SCHEMA (('IFC4X3_RC4')); +ENDSEC; +DATA; +#1 = IFCPROJECT('1FNFy8AJeHwwz7wDZHIYIu', #3, 'IFC Rail Referencedata', 'Rail alignment sample', $, 'Longname', 'Design', $, #9); +#2 = IFCAPPLICATION(#5, '2019.1.1995.0', 'RailCOMPLETE\X2\00AE\X0\', $); +#3 = IFCOWNERHISTORY(#6, #2, $, .ADDED., 1320688800, $, $, 1320688800); +#4 = IFCPERSON('TS', 'IFC Rail Technical Services', $, $, $, $, $, $); +#5 = IFCORGANIZATION('bsI RWR', 'buildingSmart International Railway Room', $, $, $); +#6 = IFCPERSONANDORGANIZATION(#4, #5, $); +#7 = IFCSIUNIT(*, .LENGTHUNIT., $, .METRE.); +#8 = IFCSIUNIT(*, .PLANEANGLEUNIT., $, .RADIAN.); +#9 = IFCUNITASSIGNMENT((#7, #8)); +#10 = IFCCARTESIANPOINT((0., 0., 0.)); +#11 = IFCDIRECTION((0., 0., 1.)); +#12 = IFCDIRECTION((1., 0., 0.)); +#13 = IFCAXIS2PLACEMENT3D(#10, #11, #12); +#14 = IFCLOCALPLACEMENT($, #13); +#15 = IFCRAILWAY('1FNFy9AJeHwuVmwDZHIYIu', #3, 'optional Railway Name', 'optional Railway Description', $, #14, $, 'Longname for Railway track geometry (alignment)', $, $); +#16 = IFCDIRECTION((0., 1., 0.)); +#17 = IFCGEOMETRICREPRESENTATIONCONTEXT($, 'MODEL', 3, 1.E-5, #13, #16); +#18 = IFCRELAGGREGATES('1FNFyAAJeHwu6TwDZHIYIu', #3, 'Documentation Container', 'Container for IfcProject, collects relevant products', #1, (#15)); +#19 = IFCRELCONTAINEDINSPATIALSTRUCTURE('1FNFyBAJeHwvmywDZHIYIu', #3, 'IfcProducts contained in myIfcRailway', 'Association between IfcProducts and IfcRailway', (#20), #15); +#20 = IFCALIGNMENT('1FNFyCAJeHwxedwDZHIYIu', #3, 'Spor', 'optional Railway Description', $, #48, #51, $, $); +#21 = IFCALIGNMENTHORIZONTAL('1FNFyDAJeHwv87wDZHIYIu', $, $, $, $, #53, #56); +#23 = IFCRELNESTS('3BJTAQrjCHwvVKbERtTLTf', $, $, $, #20, (#21)); +#28 = IFCCARTESIANPOINT((0., 0.)); +#29 = IFCALIGNMENTHORIZONTALSEGMENT($, $, #28, 0., 0., -300., 100., $, .CLOTHOID.); +#30 = IFCALIGNMENTSEGMENT('1FNFyHAJeHwuDtwDZHIYIu', #3, $, $, $, #37, #40, #29); +#34 = IFCRELNESTS('1FNFyHAJeHwuDtwDZHIYIj', $, $, $, #21, (#30)); +#35 = IFCCOMPOSITECURVE((#36), .F.); +#36 = IFCCURVESEGMENT(.DISCONTINUOUS., #42, IFCPARAMETERVALUE(0.), IFCNONNEGATIVELENGTHMEASURE(100.), #45); +#37 = IFCLOCALPLACEMENT($, #38); +#38 = IFCAXIS2PLACEMENT3D(#39, $, $); +#39 = IFCCARTESIANPOINT((0., 0., 0.)); +#40 = IFCPRODUCTDEFINITIONSHAPE($, $, (#41, #71)); +#41 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve2D', (#36)); +#42 = IFCAXIS2PLACEMENT2D(#43, #44); +#43 = IFCCARTESIANPOINT((0., 0.)); +#44 = IFCDIRECTION((1., 0.)); +#45 = IFCCLOTHOID(#46, -173.205080756888); +#46 = IFCAXIS2PLACEMENT2D(#47, $); +#47 = IFCCARTESIANPOINT((0., 0.)); +#48 = IFCLOCALPLACEMENT($, #49); +#49 = IFCAXIS2PLACEMENT3D(#50, $, $); +#50 = IFCCARTESIANPOINT((0., 0., 0.)); +#51 = IFCPRODUCTDEFINITIONSHAPE($, $, (#52, #77)); +#52 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve3D', (#35)); +#53 = IFCLOCALPLACEMENT($, #54); +#54 = IFCAXIS2PLACEMENT3D(#55, $, $); +#55 = IFCCARTESIANPOINT((0., 0., 0.)); +#56 = IFCPRODUCTDEFINITIONSHAPE($, $, (#57, #60)); +#57 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve2D', (#35)); +#58 = IFCCARTESIANPOINTLIST2D(((0., 0.), (9.99999999972222E-1, -5.55555555544531E-6), (1.99999999911111, -4.4444444430335E-5), (2.99999999325, -1.49999999758928E-4), (3.99999997155556, -3.55555553749558E-4), (4.99999991319445, -6.9444443583278E-4), (5.999999784, -1.19999996914285E-3), (6.9999995331389, -1.905555464777E-3), (7.99999908977783, -2.8444442132769E-3), (8.99999835975014, -4.0499994727768E-3), (9.99999722222258, -5.55555445326286E-3), (10.999995526362, -7.39444229638793E-3), (11.9999930880018, -9.5999960502864E-3), (12.9999896863093, -1.22055486388336E-2), (13.9999850604518, -1.5244432824794E-2), (14.9999789062637, -1.8749981166303E-2), (15.9999708729134, -2.27555259661264E-2), (16.9999605595701, -2.72943992131425E-2), (17.9999475120709, -3.23999325154911E-2), (18.9999312195875, -3.81054570248335E-2), (19.999911111294, -4.44443033511694E-2), (20.9998865530337, -5.14498014676536E-2), (21.9998568439868, -5.91552806048584E-2), (22.9998212133379, -6.75940691339256E-2), (23.9997788169437, -7.67994944380537E-2), (24.9997287340016, -8.68048827717643E-2), (25.9996699637173, -9.76435591073921E-2), (26.999601421974, -1.09348846968246E-1), (27.9995219380011, -1.21954068247882E-1), (28.9994302510434, -1.35492543014938E-1), (29.9993250070312, -1.49997589302972E-1), (30.9992047552504, -1.6550252288475E-1), (31.9990679450131, -1.8204065703043E-1), (32.9989129223292, -1.99645302249088E-1), (33.9987379265783, -2.18349766013029E-1), (34.9985410871824, -2.38187352464336E-1), (35.9983204202793, -2.59191362103088E-1), (36.9980738253972, -2.81395091456719E-1), (37.9977990821296, -3.04831832729935E-1), (38.9974938468118, -3.29534873434662E-1), (39.9971556491983, -3.55537495999453E-1), (40.9967818891412, -3.82872977357812E-1), (41.9963698332701, -4.11574588514884E-1), (42.9959166116734, -4.41675594091954E-1), (43.9954192145808, -4.73209251848202E-1), (44.9948744890478, -5.06208812179173E-1), (45.9942791356417, -5.40707517591404E-1), (46.9936297051295, -5.76738602152657E-1), (47.9929225951674, -6.14335290917215E-1), (48.9921540469933, -6.53530799325692E-1), (49.9913201421206, -6.94358332578797E-1), (50.9904167990349, -7.36851084984529E-1), (51.9894397698929, -7.81042239278224E-1), (52.9883846372246, -8.26964965914937E-1), (53.9872468106378, -8.74652422333605E-1), (54.9860215235256, -9.24137752192431E-1), (55.9847038297777, -9.75454084574977E-1), (56.9832886004944, -1.02863453316639), (57.9817705207049, -1.08371219539924), (58.9801440860885, -1.14072015156843), (59.978403599701, -1.19969146391466), (60.9765431687038, -1.2606591756758), (61.9745567010989, -1.32365631010581), (62.9724379024677, -1.38871586946054), (63.9701802727149, -1.45587083394989), (64.9677771028175, -1.52515416065589), (65.9652214715793, -1.596598782416), (66.9625062423912, -1.67023760667131), (67.9596240599967, -1.74610351427896), (68.9565673472647, -1.82422935828826), (69.9533283019679, -1.90464796268009), (70.9498988935683, -1.98739212106893), (71.9462708600097, -2.07249459536717), (72.9424357045179, -2.15998811441092), (73.9383846924081, -2.2499053725471), (74.9341088479007, -2.34227902818108), (75.9295989509452, -2.43714170228446), (76.9248455340534, -2.53452597686245), (77.9198388791408, -2.63446439338038), (78.9145690143782, -2.73698945114875), (79.9090257110528, -2.84213360566643), (80.9031984804396, -2.94992926692144), (81.8970765706829, -3.06040879764886), (82.8906489636899, -3.17360451154532), (83.8839043720348, -3.28954867143964), (84.8768312358747, -3.40827348741909), (85.8694177198787, -3.5298111149109), (86.8616517101684, -3.65419365271829), (87.853520811273, -3.78145314101089), (88.845012343097, -3.91162155926881), (89.8361133379021, -4.04473082417998), (90.8268105373045, -4.18081278749035), (91.8170903892865, -4.3198992338064), (92.8069390452241, -4.46202187834967), (93.7963423569304, -4.60721236466255), (94.7852858737162, -4.75550226226533), (95.7737548394674, -4.9069230642636), (96.7617341897404, -5.061506184906), (97.7492085488755, -5.21928295709152), (98.7361622271294, -5.38028462982623), (99.7225792178275, -5.5445423656288)), $); +#59 = IFCINDEXEDPOLYCURVE(#58, $, $); +#60 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#59)); +#61 = IFCOWNERHISTORY(#63, #65, $, .ADDED., 1630842293, $, $, 1630842293); +#62 = IFCORGANIZATION($, '\X2\0410\X0\\X2\0420\X0\ \X2\0414\X0\\X2\0418\X0\ \X2\0415\X0\\X2\0424\X0\ \X2\041E\X0\\X2\041E\X0\\X2\0414\X0\', 'RDF Ltd.', $, $); +#63 = IFCPERSONANDORGANIZATION(#64, #62, $); +#64 = IFCPERSON($, 'Bonsma', 'Peter', $, $, $, $, $); +#65 = IFCAPPLICATION(#62, '0.99', 'Add Check Library Application', 'TA 1001'); +#66 = IFCRELDEFINESBYPROPERTIES('1mhnHyhlv9bfvrZ5zp$Hks', #61, $, $, (#21), #67); +#67 = IFCPROPERTYSET('3c86K6LvT2ffsimWYX$142', #61, 'ValidationPset', $, (#68)); +#68 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(99.9999845682112), $); +#69 = IFCCARTESIANPOINTLIST2D(((0., 0.), (9.99999999972222E-1, -5.55555555544531E-6), (1.99999999911111, -4.4444444430335E-5), (2.99999999325, -1.49999999758928E-4), (3.99999997155556, -3.55555553749558E-4), (4.99999991319445, -6.9444443583278E-4), (5.999999784, -1.19999996914285E-3), (6.9999995331389, -1.905555464777E-3), (7.99999908977783, -2.8444442132769E-3), (8.99999835975014, -4.0499994727768E-3), (9.99999722222258, -5.55555445326286E-3), (10.999995526362, -7.39444229638793E-3), (11.9999930880018, -9.5999960502864E-3), (12.9999896863093, -1.22055486388336E-2), (13.9999850604518, -1.5244432824794E-2), (14.9999789062637, -1.8749981166303E-2), (15.9999708729134, -2.27555259661264E-2), (16.9999605595701, -2.72943992131425E-2), (17.9999475120709, -3.23999325154911E-2), (18.9999312195875, -3.81054570248335E-2), (19.999911111294, -4.44443033511694E-2), (20.9998865530337, -5.14498014676536E-2), (21.9998568439868, -5.91552806048584E-2), (22.9998212133379, -6.75940691339256E-2), (23.9997788169437, -7.67994944380537E-2), (24.9997287340016, -8.68048827717643E-2), (25.9996699637173, -9.76435591073921E-2), (26.999601421974, -1.09348846968246E-1), (27.9995219380011, -1.21954068247882E-1), (28.9994302510434, -1.35492543014938E-1), (29.9993250070312, -1.49997589302972E-1), (30.9992047552504, -1.6550252288475E-1), (31.9990679450131, -1.8204065703043E-1), (32.9989129223292, -1.99645302249088E-1), (33.9987379265783, -2.18349766013029E-1), (34.9985410871824, -2.38187352464336E-1), (35.9983204202793, -2.59191362103088E-1), (36.9980738253972, -2.81395091456719E-1), (37.9977990821296, -3.04831832729935E-1), (38.9974938468118, -3.29534873434662E-1), (39.9971556491983, -3.55537495999453E-1), (40.9967818891412, -3.82872977357812E-1), (41.9963698332701, -4.11574588514884E-1), (42.9959166116734, -4.41675594091954E-1), (43.9954192145808, -4.73209251848202E-1), (44.9948744890478, -5.06208812179173E-1), (45.9942791356417, -5.40707517591404E-1), (46.9936297051295, -5.76738602152657E-1), (47.9929225951674, -6.14335290917215E-1), (48.9921540469933, -6.53530799325692E-1), (49.9913201421206, -6.94358332578797E-1), (50.9904167990349, -7.36851084984529E-1), (51.9894397698929, -7.81042239278224E-1), (52.9883846372246, -8.26964965914937E-1), (53.9872468106378, -8.74652422333605E-1), (54.9860215235256, -9.24137752192431E-1), (55.9847038297777, -9.75454084574977E-1), (56.9832886004944, -1.02863453316639), (57.9817705207049, -1.08371219539924), (58.9801440860885, -1.14072015156843), (59.978403599701, -1.19969146391466), (60.9765431687038, -1.2606591756758), (61.9745567010989, -1.32365631010581), (62.9724379024677, -1.38871586946054), (63.9701802727149, -1.45587083394989), (64.9677771028175, -1.52515416065589), (65.9652214715793, -1.596598782416), (66.9625062423912, -1.67023760667131), (67.9596240599967, -1.74610351427896), (68.9565673472647, -1.82422935828826), (69.9533283019679, -1.90464796268009), (70.9498988935683, -1.98739212106893), (71.9462708600097, -2.07249459536717), (72.9424357045179, -2.15998811441092), (73.9383846924081, -2.2499053725471), (74.9341088479007, -2.34227902818108), (75.9295989509452, -2.43714170228446), (76.9248455340534, -2.53452597686245), (77.9198388791408, -2.63446439338038), (78.9145690143782, -2.73698945114875), (79.9090257110528, -2.84213360566643), (80.9031984804396, -2.94992926692144), (81.8970765706829, -3.06040879764886), (82.8906489636899, -3.17360451154532), (83.8839043720348, -3.28954867143964), (84.8768312358747, -3.40827348741909), (85.8694177198787, -3.5298111149109), (86.8616517101684, -3.65419365271829), (87.853520811273, -3.78145314101089), (88.845012343097, -3.91162155926881), (89.8361133379021, -4.04473082417998), (90.8268105373045, -4.18081278749035), (91.8170903892865, -4.3198992338064), (92.8069390452241, -4.46202187834967), (93.7963423569304, -4.60721236466255), (94.7852858737162, -4.75550226226533), (95.7737548394674, -4.9069230642636), (96.7617341897404, -5.061506184906), (97.7492085488755, -5.21928295709152), (98.7361622271294, -5.38028462982623), (99.7225792178275, -5.5445423656288)), $); +#70 = IFCINDEXEDPOLYCURVE(#69, $, $); +#71 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#70)); +#72 = IFCRELDEFINESBYPROPERTIES('07QPVssPz0rR6$DD1AbolO', #61, $, $, (#30), #73); +#73 = IFCPROPERTYSET('2wbevaTt5EcPyKpgQPuCrg', #61, 'ValidationPset', $, (#74)); +#74 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(99.9999845682112), $); +#75 = IFCCARTESIANPOINTLIST2D(((0., 0.), (9.99999999972222E-1, -5.55555555544531E-6), (1.99999999911111, -4.4444444430335E-5), (2.99999999325, -1.49999999758928E-4), (3.99999997155556, -3.55555553749558E-4), (4.99999991319445, -6.9444443583278E-4), (5.999999784, -1.19999996914285E-3), (6.9999995331389, -1.905555464777E-3), (7.99999908977783, -2.8444442132769E-3), (8.99999835975014, -4.0499994727768E-3), (9.99999722222258, -5.55555445326286E-3), (10.999995526362, -7.39444229638793E-3), (11.9999930880018, -9.5999960502864E-3), (12.9999896863093, -1.22055486388336E-2), (13.9999850604518, -1.5244432824794E-2), (14.9999789062637, -1.8749981166303E-2), (15.9999708729134, -2.27555259661264E-2), (16.9999605595701, -2.72943992131425E-2), (17.9999475120709, -3.23999325154911E-2), (18.9999312195875, -3.81054570248335E-2), (19.999911111294, -4.44443033511694E-2), (20.9998865530337, -5.14498014676536E-2), (21.9998568439868, -5.91552806048584E-2), (22.9998212133379, -6.75940691339256E-2), (23.9997788169437, -7.67994944380537E-2), (24.9997287340016, -8.68048827717643E-2), (25.9996699637173, -9.76435591073921E-2), (26.999601421974, -1.09348846968246E-1), (27.9995219380011, -1.21954068247882E-1), (28.9994302510434, -1.35492543014938E-1), (29.9993250070312, -1.49997589302972E-1), (30.9992047552504, -1.6550252288475E-1), (31.9990679450131, -1.8204065703043E-1), (32.9989129223292, -1.99645302249088E-1), (33.9987379265783, -2.18349766013029E-1), (34.9985410871824, -2.38187352464336E-1), (35.9983204202793, -2.59191362103088E-1), (36.9980738253972, -2.81395091456719E-1), (37.9977990821296, -3.04831832729935E-1), (38.9974938468118, -3.29534873434662E-1), (39.9971556491983, -3.55537495999453E-1), (40.9967818891412, -3.82872977357812E-1), (41.9963698332701, -4.11574588514884E-1), (42.9959166116734, -4.41675594091954E-1), (43.9954192145808, -4.73209251848202E-1), (44.9948744890478, -5.06208812179173E-1), (45.9942791356417, -5.40707517591404E-1), (46.9936297051295, -5.76738602152657E-1), (47.9929225951674, -6.14335290917215E-1), (48.9921540469933, -6.53530799325692E-1), (49.9913201421206, -6.94358332578797E-1), (50.9904167990349, -7.36851084984529E-1), (51.9894397698929, -7.81042239278224E-1), (52.9883846372246, -8.26964965914937E-1), (53.9872468106378, -8.74652422333605E-1), (54.9860215235256, -9.24137752192431E-1), (55.9847038297777, -9.75454084574977E-1), (56.9832886004944, -1.02863453316639), (57.9817705207049, -1.08371219539924), (58.9801440860885, -1.14072015156843), (59.978403599701, -1.19969146391466), (60.9765431687038, -1.2606591756758), (61.9745567010989, -1.32365631010581), (62.9724379024677, -1.38871586946054), (63.9701802727149, -1.45587083394989), (64.9677771028175, -1.52515416065589), (65.9652214715793, -1.596598782416), (66.9625062423912, -1.67023760667131), (67.9596240599967, -1.74610351427896), (68.9565673472647, -1.82422935828826), (69.9533283019679, -1.90464796268009), (70.9498988935683, -1.98739212106893), (71.9462708600097, -2.07249459536717), (72.9424357045179, -2.15998811441092), (73.9383846924081, -2.2499053725471), (74.9341088479007, -2.34227902818108), (75.9295989509452, -2.43714170228446), (76.9248455340534, -2.53452597686245), (77.9198388791408, -2.63446439338038), (78.9145690143782, -2.73698945114875), (79.9090257110528, -2.84213360566643), (80.9031984804396, -2.94992926692144), (81.8970765706829, -3.06040879764886), (82.8906489636899, -3.17360451154532), (83.8839043720348, -3.28954867143964), (84.8768312358747, -3.40827348741909), (85.8694177198787, -3.5298111149109), (86.8616517101684, -3.65419365271829), (87.853520811273, -3.78145314101089), (88.845012343097, -3.91162155926881), (89.8361133379021, -4.04473082417998), (90.8268105373045, -4.18081278749035), (91.8170903892865, -4.3198992338064), (92.8069390452241, -4.46202187834967), (93.7963423569304, -4.60721236466255), (94.7852858737162, -4.75550226226533), (95.7737548394674, -4.9069230642636), (96.7617341897404, -5.061506184906), (97.7492085488755, -5.21928295709152), (98.7361622271294, -5.38028462982623), (99.7225792178275, -5.5445423656288)), $); +#76 = IFCINDEXEDPOLYCURVE(#75, $, $); +#77 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#76)); +#78 = IFCRELDEFINESBYPROPERTIES('20$wPsF2X02g27fhm4_xbN', #61, $, $, (#20), #79); +#79 = IFCPROPERTYSET('1tXOEj$71DXR9czn4fR0HC', #61, 'ValidationPset', $, (#80)); +#80 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(99.9999845682112), $); +ENDSEC; +END-ISO-10303-21; diff --git a/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_-inf_300_1_Meter/Data/clothoid_100.0_-inf_300_1_Meter.png b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_-inf_300_1_Meter/Data/clothoid_100.0_-inf_300_1_Meter.png new file mode 100644 index 000000000..cc1680a71 Binary files /dev/null and b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_-inf_300_1_Meter/Data/clothoid_100.0_-inf_300_1_Meter.png differ diff --git a/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_-inf_300_1_Meter/Data/clothoid_100.0_-inf_300_1_Meter_top.png b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_-inf_300_1_Meter/Data/clothoid_100.0_-inf_300_1_Meter_top.png new file mode 100644 index 000000000..838973fea Binary files /dev/null and b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_-inf_300_1_Meter/Data/clothoid_100.0_-inf_300_1_Meter_top.png differ diff --git a/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_-inf_300_1_Meter/src/clothoid_100.0_-inf_300_1_Meter.cpp b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_-inf_300_1_Meter/src/clothoid_100.0_-inf_300_1_Meter.cpp new file mode 100644 index 000000000..9703b9e40 --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_-inf_300_1_Meter/src/clothoid_100.0_-inf_300_1_Meter.cpp @@ -0,0 +1,98 @@ +/* + Copyright (c) 2021 Technical University of Munich + Chair of Computational Modeling and Simulation. + + TUM Open Infra Platform is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License Version 3 + as published by the Free Software Foundation. + + TUM Open Infra Platform is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include +#include + +#include + +#include +#include +#include + +using namespace testing; + +class Clothoid : public IfcVisualTest { +protected: + + // Test standard values + buw::Image4b _background = buw::Image4b(0, 0); + + virtual void SetUp() override { + IfcVisualTest::SetUp(); + + express_model = OpenInfraPlatform::IFC4X3_RC4::IFC4X3_RC4Reader::FromFile(filename.string()); + + importer = buw::makeReferenceCounted>(); + auto model = importer->collectData(express_model); + + _background = rendererIfc->captureImage(); + rendererIfc->setModel(model[0]); + } + + virtual void TearDown() override { + express_model.reset(); + IfcVisualTest::TearDown(); + } + + virtual std::string TestName() const { return "clothoid_100.0_-inf_300_1_Meter"; } + virtual std::string Schema() const { return "IFC4X3_RC4"; } + + const boost::filesystem::path filename = dataPath("clothoid_100.0_-inf_300_1_Meter.ifc"); + + std::shared_ptr express_model = nullptr; + buw::ReferenceCounted> importer = nullptr; +}; + +TEST_F(Clothoid, AllEntitiesAreRead) { + EXPECT_THAT(express_model->entities.size(), Eq(72)); +} + +TEST_F(Clothoid, IFCHasAnEssentialEntity) { + auto result1 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto &pair) -> bool { return pair.second->classname() == "IFCCURVESEGMENT"; }); + auto result2 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto &pair) -> bool { return pair.second->classname() == "IFCCLOTHOID"; }); + EXPECT_NE(result1, express_model->entities.end()); + EXPECT_NE(result2, express_model->entities.end()); +} + +TEST_F(Clothoid, ImageIsSaved) +{ + // Arrange + buw::Image4b image = rendererIfc->captureImage(); + + // Act + buw::storeImage(testPath("clothoid_100.0_-inf_300_1_Meter.png").string(), image); + + // Assert + EXPECT_NO_THROW(buw::loadImage4b(testPath("clothoid_100.0_-inf_300_1_Meter.png").string())); +} + +TEST_F(Clothoid, PlaneSurfaceViews) +{ + // Arrange + const auto expected_top = buw::loadImage4b(dataPath("clothoid_100.0_-inf_300_1_Meter_top.png").string()); + + // Act (Top) + rendererIfc->setViewDirection(buw::eViewDirection::Top); + buw::Image4b image_top = CaptureImage(); + + // uncomment following lines to also save the screen shot + //buw::storeImage(testPath("clothoid_100.0_-inf_300_1_Meter_top.png").string(), image_top); + + // Assert + EXPECT_EQ(image_top, expected_top); +} \ No newline at end of file diff --git a/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_1000_-300_1_Meter/CMakeLists.txt b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_1000_-300_1_Meter/CMakeLists.txt new file mode 100644 index 000000000..8d727de35 --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_1000_-300_1_Meter/CMakeLists.txt @@ -0,0 +1,20 @@ +# +# Copyright (c) 2021 Technical University of Munich +# Chair of Computational Modeling and Simulation. +# +# TUM Open Infra Platform is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License Version 3 +# as published by the Free Software Foundation. +# +# TUM Open Infra Platform is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +include(CreateUnitTests) + +CreateIfcFileVisualUnitTestForSchema(clothoid_100.0_1000_-300_1_Meter IFC4X3_RC4) diff --git a/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_1000_-300_1_Meter/Data/clothoid_100.0_1000_-300_1_Meter.ifc b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_1000_-300_1_Meter/Data/clothoid_100.0_1000_-300_1_Meter.ifc new file mode 100644 index 000000000..e95614190 --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_1000_-300_1_Meter/Data/clothoid_100.0_1000_-300_1_Meter.ifc @@ -0,0 +1,81 @@ +ISO-10303-21; +HEADER; +FILE_DESCRIPTION (('ViewDefinition [CoordinationView]'), '2;1'); +FILE_NAME ('Single-LANDXML.ifc', '2021-05-24T11:00:00', ('IFC Rail Technical Services'), ('buildingSMART International RailwayRoom'), 'RailCOMPLETE\X2\FFAE\X0\', '2019.1.1995.0', ''); +FILE_SCHEMA (('IFC4X3_RC4')); +ENDSEC; +DATA; +#1 = IFCPROJECT('1FNFy8AJeHwwz7wDZHIYIu', #3, 'IFC Rail Referencedata', 'Rail alignment sample', $, 'Longname', 'Design', $, #9); +#2 = IFCAPPLICATION(#5, '2019.1.1995.0', 'RailCOMPLETE\X2\00AE\X0\', $); +#3 = IFCOWNERHISTORY(#6, #2, $, .ADDED., 1320688800, $, $, 1320688800); +#4 = IFCPERSON('TS', 'IFC Rail Technical Services', $, $, $, $, $, $); +#5 = IFCORGANIZATION('bsI RWR', 'buildingSmart International Railway Room', $, $, $); +#6 = IFCPERSONANDORGANIZATION(#4, #5, $); +#7 = IFCSIUNIT(*, .LENGTHUNIT., $, .METRE.); +#8 = IFCSIUNIT(*, .PLANEANGLEUNIT., $, .RADIAN.); +#9 = IFCUNITASSIGNMENT((#7, #8)); +#10 = IFCCARTESIANPOINT((0., 0., 0.)); +#11 = IFCDIRECTION((0., 0., 1.)); +#12 = IFCDIRECTION((1., 0., 0.)); +#13 = IFCAXIS2PLACEMENT3D(#10, #11, #12); +#14 = IFCLOCALPLACEMENT($, #13); +#15 = IFCRAILWAY('1FNFy9AJeHwuVmwDZHIYIu', #3, 'optional Railway Name', 'optional Railway Description', $, #14, $, 'Longname for Railway track geometry (alignment)', $, $); +#16 = IFCDIRECTION((0., 1., 0.)); +#17 = IFCGEOMETRICREPRESENTATIONCONTEXT($, 'MODEL', 3, 1.E-5, #13, #16); +#18 = IFCRELAGGREGATES('1FNFyAAJeHwu6TwDZHIYIu', #3, 'Documentation Container', 'Container for IfcProject, collects relevant products', #1, (#15)); +#19 = IFCRELCONTAINEDINSPATIALSTRUCTURE('1FNFyBAJeHwvmywDZHIYIu', #3, 'IfcProducts contained in myIfcRailway', 'Association between IfcProducts and IfcRailway', (#20), #15); +#20 = IFCALIGNMENT('1FNFyCAJeHwxedwDZHIYIu', #3, 'Spor', 'optional Railway Description', $, #48, #51, $, $); +#21 = IFCALIGNMENTHORIZONTAL('1FNFyDAJeHwv87wDZHIYIu', $, $, $, $, #53, #56); +#23 = IFCRELNESTS('3BJTAQrjCHwvVKbERtTLTf', $, $, $, #20, (#21)); +#28 = IFCCARTESIANPOINT((0., 0.)); +#29 = IFCALIGNMENTHORIZONTALSEGMENT($, $, #28, 0., -1000., -300., 100., $, .CLOTHOID.); +#30 = IFCALIGNMENTSEGMENT('1FNFyHAJeHwuDtwDZHIYIu', #3, $, $, $, #37, #40, #29); +#34 = IFCRELNESTS('1FNFyHAJeHwuDtwDZHIYIj', $, $, $, #21, (#30)); +#35 = IFCCOMPOSITECURVE((#36), .F.); +#36 = IFCCURVESEGMENT(.DISCONTINUOUS., #42, IFCPARAMETERVALUE(42.8571428571429), IFCNONNEGATIVELENGTHMEASURE(100.), #45); +#37 = IFCLOCALPLACEMENT($, #38); +#38 = IFCAXIS2PLACEMENT3D(#39, $, $); +#39 = IFCCARTESIANPOINT((0., 0., 0.)); +#40 = IFCPRODUCTDEFINITIONSHAPE($, $, (#41, #71)); +#41 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve2D', (#36)); +#42 = IFCAXIS2PLACEMENT2D(#43, #44); +#43 = IFCCARTESIANPOINT((0., 0.)); +#44 = IFCDIRECTION((1., 0.)); +#45 = IFCCLOTHOID(#46, -207.019667802706); +#46 = IFCAXIS2PLACEMENT2D(#47, $); +#47 = IFCCARTESIANPOINT((0., 0.)); +#48 = IFCLOCALPLACEMENT($, #49); +#49 = IFCAXIS2PLACEMENT3D(#50, $, $); +#50 = IFCCARTESIANPOINT((0., 0., 0.)); +#51 = IFCPRODUCTDEFINITIONSHAPE($, $, (#52, #77)); +#52 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve3D', (#35)); +#53 = IFCLOCALPLACEMENT($, #54); +#54 = IFCAXIS2PLACEMENT3D(#55, $, $); +#55 = IFCCARTESIANPOINT((0., 0., 0.)); +#56 = IFCPRODUCTDEFINITIONSHAPE($, $, (#57, #60)); +#57 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve2D', (#35)); +#58 = IFCCARTESIANPOINTLIST2D(((0., 0.), (9.99999830403069E-1, -5.03888846044003E-4), (1.99999861956474, -2.03111040638008E-3), (2.99999526044478, -4.60499633314947E-3), (3.99998857273883, -8.24887698048359E-3), (4.99997730124678, -1.29860812434568E-2), (5.99996011424134, -1.88399363883026E-2), (6.99993560183712, -2.58337678737029E-2), (7.99990227435991, -3.39908991629628E-2), (8.99985856071651, -4.33346515268806E-2), (9.99980280676497, -5.38883438371167E-2), (10.9997332736852, -6.56752923498871E-2), (11.9996481363501, -7.87188104797737E-2), (12.9995454816976, -9.30422085634757E-2), (13.9994233071028, -1.08668793613307E-1), (14.9992795187506, -1.2562186906025E-1), (15.9991119300102, -1.4392473448638E-1), (16.9989182598086, -1.63600685346466E-1), (17.9986961310062, -1.84673012678572E-1), (18.9984430687728, -2.07165002803449E-1), (19.9981564989641, -2.31099937012547E-1), (20.9978337464998, -2.56501091244461E-1), (21.997472033742, -2.83391735749599E-1), (22.9970684788751, -3.11795134742918E-1), (23.9966200942868, -3.41734546044511E-1), (24.9961237849499, -3.73233220707878E-1), (25.9955763468053, -4.06314402635681E-1), (26.9949744651471, -4.41001328182801E-1), (27.9943147130078, -4.77317225746523E-1), (28.9935935495459, -5.15285315343631E-1), (29.9928073184344, -5.54928808174264E-1), (30.9919522462512, -5.96270906172324E-1), (31.9910244408712, -6.39334801542256E-1), (32.9900198898594, -6.8414367628202E-1), (33.9889344588668, -7.30720701692067E-1), (34.9877638900274, -7.79089037870135E-1), (35.9865038003574, -8.29271833191677E-1), (36.9851496801568, -8.81292223775752E-1), (37.9836968914123, -9.35173332936179E-1), (38.9821406662033, -9.90938270617779E-1), (39.9804761051096, -1.04861013281753), (40.9786981756217, -1.10821200099045), (41.9768017105539, -1.16976694144), (42.9747814064595, -1.23329800469288), (43.9726318220491, -1.29882822485802), (44.9703473766114, -1.3663806189695), (45.9679223484373, -1.43597818631341), (46.9653508732465, -1.50764390773828), (47.9626269426183, -1.581400744949), (48.9597444024239, -1.65727163978403), (49.9566969512643, -1.73527951347575), (50.9534781389096, -1.81544726589375), (51.9500813647434, -1.89779777477088), (52.9464998762103, -1.98235389491187), (53.9427267672675, -2.06913845738443), (54.9387549768404, -2.1581742686926), (55.934577287282, -2.24948410993209), (56.9301863228376, -2.34309073592764), (57.9255745481126, -2.43901687435208), (58.9207342665459, -2.53728522482693), (59.9156576188876, -2.63791845800447), (60.9103365816818, -2.74093921463099), (61.9047629657543, -2.84637010459114), (62.8989284147053, -2.95423370593322), (63.892824403408, -3.06455256387512), (64.8864422365122, -3.17734918979098), (65.8797730469537, -3.29264606017818), (66.8728077944701, -3.41046561560459), (67.8655372641216, -3.53083025963599), (68.8579520648188, -3.6537623577434), (69.8500426278569, -3.77928423619018), (70.8417992054558, -3.90741818089882), (71.8332118693077, -4.0381864362972), (72.8242705091311, -4.17161120414414), (73.8149648312322, -4.3077146423342), (74.8052843570739, -4.44651886368148), (75.7952184218511, -4.58804593468233), (76.7847561730758, -4.73231787425675), (77.773886569168, -4.87935665246846), (78.762598378056, -5.02918418922339), (79.7508801757851, -5.18182235294648), (80.7387203451338, -5.33729295923671), (81.7261070742402, -5.49561776950006), (82.7130283552361, -5.65681848956055), (83.6994719828915, -5.82091676824885), (84.6854255532674, -5.98793419596873), (85.6708764623795, -6.15789230324086), (86.6558119048708, -6.3308125592241), (87.6402188726949, -6.50671637021403), (88.6240841538098, -6.68562507811858), (89.607394330882, -6.86755995891074), (90.5901357800018, -7.05254222105807), (91.5722946694093, -7.24059300392917), (92.5538569582331, -7.4317333761766), (93.5348083952385, -7.62598433409654), (94.5151345175903, -7.82336679996479), (95.4948206496252, -8.02390162034921), (96.4738519016389, -8.22760956439826), (97.4522131686845, -8.43451132210584), (98.4298891293845, -8.64462750255204), (99.4068642447564, -8.85797863211992)), $); +#59 = IFCINDEXEDPOLYCURVE(#58, $, $); +#60 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#59)); +#61 = IFCOWNERHISTORY(#63, #65, $, .ADDED., 1630842293, $, $, 1630842293); +#62 = IFCORGANIZATION($, '\X2\0410\X0\\X2\0420\X0\ \X2\0414\X0\\X2\0418\X0\ \X2\0415\X0\\X2\0424\X0\ \X2\041E\X0\\X2\041E\X0\\X2\0414\X0\', 'RDF Ltd.', $, $); +#63 = IFCPERSONANDORGANIZATION(#64, #62, $); +#64 = IFCPERSON($, 'Bonsma', 'Peter', $, $, $, $, $); +#65 = IFCAPPLICATION(#62, '0.99', 'Add Check Library Application', 'TA 1001'); +#66 = IFCRELDEFINESBYPROPERTIES('2aQUVP3eT0PR1FL3vW$Xdi', #61, $, $, (#21), #67); +#67 = IFCPROPERTYSET('0eLppGCwL9w9LnFFF3QoW1', #61, 'ValidationPset', $, (#68)); +#68 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(99.9999785495359), $); +#69 = IFCCARTESIANPOINTLIST2D(((0., 0.), (9.99999830403069E-1, -5.03888846044003E-4), (1.99999861956474, -2.03111040638008E-3), (2.99999526044478, -4.60499633314947E-3), (3.99998857273883, -8.24887698048359E-3), (4.99997730124678, -1.29860812434568E-2), (5.99996011424134, -1.88399363883026E-2), (6.99993560183712, -2.58337678737029E-2), (7.99990227435991, -3.39908991629628E-2), (8.99985856071651, -4.33346515268806E-2), (9.99980280676497, -5.38883438371167E-2), (10.9997332736852, -6.56752923498871E-2), (11.9996481363501, -7.87188104797737E-2), (12.9995454816976, -9.30422085634757E-2), (13.9994233071028, -1.08668793613307E-1), (14.9992795187506, -1.2562186906025E-1), (15.9991119300102, -1.4392473448638E-1), (16.9989182598086, -1.63600685346466E-1), (17.9986961310062, -1.84673012678572E-1), (18.9984430687728, -2.07165002803449E-1), (19.9981564989641, -2.31099937012547E-1), (20.9978337464998, -2.56501091244461E-1), (21.997472033742, -2.83391735749599E-1), (22.9970684788751, -3.11795134742918E-1), (23.9966200942868, -3.41734546044511E-1), (24.9961237849499, -3.73233220707878E-1), (25.9955763468053, -4.06314402635681E-1), (26.9949744651471, -4.41001328182801E-1), (27.9943147130078, -4.77317225746523E-1), (28.9935935495459, -5.15285315343631E-1), (29.9928073184344, -5.54928808174264E-1), (30.9919522462512, -5.96270906172324E-1), (31.9910244408712, -6.39334801542256E-1), (32.9900198898594, -6.8414367628202E-1), (33.9889344588668, -7.30720701692067E-1), (34.9877638900274, -7.79089037870135E-1), (35.9865038003574, -8.29271833191677E-1), (36.9851496801568, -8.81292223775752E-1), (37.9836968914123, -9.35173332936179E-1), (38.9821406662033, -9.90938270617779E-1), (39.9804761051096, -1.04861013281753), (40.9786981756217, -1.10821200099045), (41.9768017105539, -1.16976694144), (42.9747814064595, -1.23329800469288), (43.9726318220491, -1.29882822485802), (44.9703473766114, -1.3663806189695), (45.9679223484373, -1.43597818631341), (46.9653508732465, -1.50764390773828), (47.9626269426183, -1.581400744949), (48.9597444024239, -1.65727163978403), (49.9566969512643, -1.73527951347575), (50.9534781389096, -1.81544726589375), (51.9500813647434, -1.89779777477088), (52.9464998762103, -1.98235389491187), (53.9427267672675, -2.06913845738443), (54.9387549768404, -2.1581742686926), (55.934577287282, -2.24948410993209), (56.9301863228376, -2.34309073592764), (57.9255745481126, -2.43901687435208), (58.9207342665459, -2.53728522482693), (59.9156576188876, -2.63791845800447), (60.9103365816818, -2.74093921463099), (61.9047629657543, -2.84637010459114), (62.8989284147053, -2.95423370593322), (63.892824403408, -3.06455256387512), (64.8864422365122, -3.17734918979098), (65.8797730469537, -3.29264606017818), (66.8728077944701, -3.41046561560459), (67.8655372641216, -3.53083025963599), (68.8579520648188, -3.6537623577434), (69.8500426278569, -3.77928423619018), (70.8417992054558, -3.90741818089882), (71.8332118693077, -4.0381864362972), (72.8242705091311, -4.17161120414414), (73.8149648312322, -4.3077146423342), (74.8052843570739, -4.44651886368148), (75.7952184218511, -4.58804593468233), (76.7847561730758, -4.73231787425675), (77.773886569168, -4.87935665246846), (78.762598378056, -5.02918418922339), (79.7508801757851, -5.18182235294648), (80.7387203451338, -5.33729295923671), (81.7261070742402, -5.49561776950006), (82.7130283552361, -5.65681848956055), (83.6994719828915, -5.82091676824885), (84.6854255532674, -5.98793419596873), (85.6708764623795, -6.15789230324086), (86.6558119048708, -6.3308125592241), (87.6402188726949, -6.50671637021403), (88.6240841538098, -6.68562507811858), (89.607394330882, -6.86755995891074), (90.5901357800018, -7.05254222105807), (91.5722946694093, -7.24059300392917), (92.5538569582331, -7.4317333761766), (93.5348083952385, -7.62598433409654), (94.5151345175903, -7.82336679996479), (95.4948206496252, -8.02390162034921), (96.4738519016389, -8.22760956439826), (97.4522131686845, -8.43451132210584), (98.4298891293845, -8.64462750255204), (99.4068642447564, -8.85797863211992)), $); +#70 = IFCINDEXEDPOLYCURVE(#69, $, $); +#71 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#70)); +#72 = IFCRELDEFINESBYPROPERTIES('0lqHnm8vTCsPzCmlVZM7yC', #61, $, $, (#30), #73); +#73 = IFCPROPERTYSET('3_cTGUWyDFVx7KYiWe7uy3', #61, 'ValidationPset', $, (#74)); +#74 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(99.9999785495359), $); +#75 = IFCCARTESIANPOINTLIST2D(((0., 0.), (9.99999830403069E-1, -5.03888846044003E-4), (1.99999861956474, -2.03111040638008E-3), (2.99999526044478, -4.60499633314947E-3), (3.99998857273883, -8.24887698048359E-3), (4.99997730124678, -1.29860812434568E-2), (5.99996011424134, -1.88399363883026E-2), (6.99993560183712, -2.58337678737029E-2), (7.99990227435991, -3.39908991629628E-2), (8.99985856071651, -4.33346515268806E-2), (9.99980280676497, -5.38883438371167E-2), (10.9997332736852, -6.56752923498871E-2), (11.9996481363501, -7.87188104797737E-2), (12.9995454816976, -9.30422085634757E-2), (13.9994233071028, -1.08668793613307E-1), (14.9992795187506, -1.2562186906025E-1), (15.9991119300102, -1.4392473448638E-1), (16.9989182598086, -1.63600685346466E-1), (17.9986961310062, -1.84673012678572E-1), (18.9984430687728, -2.07165002803449E-1), (19.9981564989641, -2.31099937012547E-1), (20.9978337464998, -2.56501091244461E-1), (21.997472033742, -2.83391735749599E-1), (22.9970684788751, -3.11795134742918E-1), (23.9966200942868, -3.41734546044511E-1), (24.9961237849499, -3.73233220707878E-1), (25.9955763468053, -4.06314402635681E-1), (26.9949744651471, -4.41001328182801E-1), (27.9943147130078, -4.77317225746523E-1), (28.9935935495459, -5.15285315343631E-1), (29.9928073184344, -5.54928808174264E-1), (30.9919522462512, -5.96270906172324E-1), (31.9910244408712, -6.39334801542256E-1), (32.9900198898594, -6.8414367628202E-1), (33.9889344588668, -7.30720701692067E-1), (34.9877638900274, -7.79089037870135E-1), (35.9865038003574, -8.29271833191677E-1), (36.9851496801568, -8.81292223775752E-1), (37.9836968914123, -9.35173332936179E-1), (38.9821406662033, -9.90938270617779E-1), (39.9804761051096, -1.04861013281753), (40.9786981756217, -1.10821200099045), (41.9768017105539, -1.16976694144), (42.9747814064595, -1.23329800469288), (43.9726318220491, -1.29882822485802), (44.9703473766114, -1.3663806189695), (45.9679223484373, -1.43597818631341), (46.9653508732465, -1.50764390773828), (47.9626269426183, -1.581400744949), (48.9597444024239, -1.65727163978403), (49.9566969512643, -1.73527951347575), (50.9534781389096, -1.81544726589375), (51.9500813647434, -1.89779777477088), (52.9464998762103, -1.98235389491187), (53.9427267672675, -2.06913845738443), (54.9387549768404, -2.1581742686926), (55.934577287282, -2.24948410993209), (56.9301863228376, -2.34309073592764), (57.9255745481126, -2.43901687435208), (58.9207342665459, -2.53728522482693), (59.9156576188876, -2.63791845800447), (60.9103365816818, -2.74093921463099), (61.9047629657543, -2.84637010459114), (62.8989284147053, -2.95423370593322), (63.892824403408, -3.06455256387512), (64.8864422365122, -3.17734918979098), (65.8797730469537, -3.29264606017818), (66.8728077944701, -3.41046561560459), (67.8655372641216, -3.53083025963599), (68.8579520648188, -3.6537623577434), (69.8500426278569, -3.77928423619018), (70.8417992054558, -3.90741818089882), (71.8332118693077, -4.0381864362972), (72.8242705091311, -4.17161120414414), (73.8149648312322, -4.3077146423342), (74.8052843570739, -4.44651886368148), (75.7952184218511, -4.58804593468233), (76.7847561730758, -4.73231787425675), (77.773886569168, -4.87935665246846), (78.762598378056, -5.02918418922339), (79.7508801757851, -5.18182235294648), (80.7387203451338, -5.33729295923671), (81.7261070742402, -5.49561776950006), (82.7130283552361, -5.65681848956055), (83.6994719828915, -5.82091676824885), (84.6854255532674, -5.98793419596873), (85.6708764623795, -6.15789230324086), (86.6558119048708, -6.3308125592241), (87.6402188726949, -6.50671637021403), (88.6240841538098, -6.68562507811858), (89.607394330882, -6.86755995891074), (90.5901357800018, -7.05254222105807), (91.5722946694093, -7.24059300392917), (92.5538569582331, -7.4317333761766), (93.5348083952385, -7.62598433409654), (94.5151345175903, -7.82336679996479), (95.4948206496252, -8.02390162034921), (96.4738519016389, -8.22760956439826), (97.4522131686845, -8.43451132210584), (98.4298891293845, -8.64462750255204), (99.4068642447564, -8.85797863211992)), $); +#76 = IFCINDEXEDPOLYCURVE(#75, $, $); +#77 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#76)); +#78 = IFCRELDEFINESBYPROPERTIES('0pfXkW5VL1lPCt1tEDGt6v', #61, $, $, (#20), #79); +#79 = IFCPROPERTYSET('2u2VRrwAn9JRsLLVXtRopr', #61, 'ValidationPset', $, (#80)); +#80 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(99.9999785495359), $); +ENDSEC; +END-ISO-10303-21; diff --git a/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_1000_-300_1_Meter/Data/clothoid_100.0_1000_-300_1_Meter.png b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_1000_-300_1_Meter/Data/clothoid_100.0_1000_-300_1_Meter.png new file mode 100644 index 000000000..1083f852b Binary files /dev/null and b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_1000_-300_1_Meter/Data/clothoid_100.0_1000_-300_1_Meter.png differ diff --git a/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_1000_-300_1_Meter/Data/clothoid_100.0_1000_-300_1_Meter_top.png b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_1000_-300_1_Meter/Data/clothoid_100.0_1000_-300_1_Meter_top.png new file mode 100644 index 000000000..0565be8db Binary files /dev/null and b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_1000_-300_1_Meter/Data/clothoid_100.0_1000_-300_1_Meter_top.png differ diff --git a/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_1000_-300_1_Meter/src/clothoid_100.0_1000_-300_1_Meter.cpp b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_1000_-300_1_Meter/src/clothoid_100.0_1000_-300_1_Meter.cpp new file mode 100644 index 000000000..b3c9ebe10 --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_1000_-300_1_Meter/src/clothoid_100.0_1000_-300_1_Meter.cpp @@ -0,0 +1,98 @@ +/* + Copyright (c) 2021 Technical University of Munich + Chair of Computational Modeling and Simulation. + + TUM Open Infra Platform is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License Version 3 + as published by the Free Software Foundation. + + TUM Open Infra Platform is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include +#include + +#include + +#include +#include +#include + +using namespace testing; + +class Clothoid : public IfcVisualTest { +protected: + + // Test standard values + buw::Image4b _background = buw::Image4b(0, 0); + + virtual void SetUp() override { + IfcVisualTest::SetUp(); + + express_model = OpenInfraPlatform::IFC4X3_RC4::IFC4X3_RC4Reader::FromFile(filename.string()); + + importer = buw::makeReferenceCounted>(); + auto model = importer->collectData(express_model); + + _background = rendererIfc->captureImage(); + rendererIfc->setModel(model[0]); + } + + virtual void TearDown() override { + express_model.reset(); + IfcVisualTest::TearDown(); + } + + virtual std::string TestName() const { return "clothoid_100.0_1000_-300_1_Meter"; } + virtual std::string Schema() const { return "IFC4X3_RC4"; } + + const boost::filesystem::path filename = dataPath("clothoid_100.0_1000_-300_1_Meter.ifc"); + + std::shared_ptr express_model = nullptr; + buw::ReferenceCounted> importer = nullptr; +}; + +TEST_F(Clothoid, AllEntitiesAreRead) { + EXPECT_THAT(express_model->entities.size(), Eq(72)); +} + +TEST_F(Clothoid, IFCHasAnEssentialEntity) { + auto result1 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto &pair) -> bool { return pair.second->classname() == "IFCCURVESEGMENT"; }); + auto result2 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto &pair) -> bool { return pair.second->classname() == "IFCCLOTHOID"; }); + EXPECT_NE(result1, express_model->entities.end()); + EXPECT_NE(result2, express_model->entities.end()); +} + +TEST_F(Clothoid, ImageIsSaved) +{ + // Arrange + buw::Image4b image = rendererIfc->captureImage(); + + // Act + buw::storeImage(testPath("clothoid_100.0_1000_-300_1_Meter.png").string(), image); + + // Assert + EXPECT_NO_THROW(buw::loadImage4b(testPath("clothoid_100.0_1000_-300_1_Meter.png").string())); +} + +TEST_F(Clothoid, PlaneSurfaceViews) +{ + // Arrange + const auto expected_top = buw::loadImage4b(dataPath("clothoid_100.0_1000_-300_1_Meter_top.png").string()); + + // Act (Top) + rendererIfc->setViewDirection(buw::eViewDirection::Top); + buw::Image4b image_top = CaptureImage(); + + // uncomment following lines to also save the screen shot + //buw::storeImage(testPath("clothoid_100.0_1000_-300_1_Meter_top.png").string(), image_top); + + // Assert + EXPECT_EQ(image_top, expected_top); +} \ No newline at end of file diff --git a/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_1000_300_1_Meter/CMakeLists.txt b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_1000_300_1_Meter/CMakeLists.txt new file mode 100644 index 000000000..08808ccfe --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_1000_300_1_Meter/CMakeLists.txt @@ -0,0 +1,20 @@ +# +# Copyright (c) 2021 Technical University of Munich +# Chair of Computational Modeling and Simulation. +# +# TUM Open Infra Platform is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License Version 3 +# as published by the Free Software Foundation. +# +# TUM Open Infra Platform is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +include(CreateUnitTests) + +CreateIfcFileVisualUnitTestForSchema(clothoid_100.0_1000_300_1_Meter IFC4X3_RC4) diff --git a/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_1000_300_1_Meter/Data/clothoid_100.0_1000_300_1_Meter.ifc b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_1000_300_1_Meter/Data/clothoid_100.0_1000_300_1_Meter.ifc new file mode 100644 index 000000000..29c226846 --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_1000_300_1_Meter/Data/clothoid_100.0_1000_300_1_Meter.ifc @@ -0,0 +1,81 @@ +ISO-10303-21; +HEADER; +FILE_DESCRIPTION (('ViewDefinition [CoordinationView]'), '2;1'); +FILE_NAME ('Single-LANDXML.ifc', '2021-05-24T11:00:00', ('IFC Rail Technical Services'), ('buildingSMART International RailwayRoom'), 'RailCOMPLETE\X2\FFAE\X0\', '2019.1.1995.0', ''); +FILE_SCHEMA (('IFC4X3_RC4')); +ENDSEC; +DATA; +#1 = IFCPROJECT('1FNFy8AJeHwwz7wDZHIYIu', #3, 'IFC Rail Referencedata', 'Rail alignment sample', $, 'Longname', 'Design', $, #9); +#2 = IFCAPPLICATION(#5, '2019.1.1995.0', 'RailCOMPLETE\X2\00AE\X0\', $); +#3 = IFCOWNERHISTORY(#6, #2, $, .ADDED., 1320688800, $, $, 1320688800); +#4 = IFCPERSON('TS', 'IFC Rail Technical Services', $, $, $, $, $, $); +#5 = IFCORGANIZATION('bsI RWR', 'buildingSmart International Railway Room', $, $, $); +#6 = IFCPERSONANDORGANIZATION(#4, #5, $); +#7 = IFCSIUNIT(*, .LENGTHUNIT., $, .METRE.); +#8 = IFCSIUNIT(*, .PLANEANGLEUNIT., $, .RADIAN.); +#9 = IFCUNITASSIGNMENT((#7, #8)); +#10 = IFCCARTESIANPOINT((0., 0., 0.)); +#11 = IFCDIRECTION((0., 0., 1.)); +#12 = IFCDIRECTION((1., 0., 0.)); +#13 = IFCAXIS2PLACEMENT3D(#10, #11, #12); +#14 = IFCLOCALPLACEMENT($, #13); +#15 = IFCRAILWAY('1FNFy9AJeHwuVmwDZHIYIu', #3, 'optional Railway Name', 'optional Railway Description', $, #14, $, 'Longname for Railway track geometry (alignment)', $, $); +#16 = IFCDIRECTION((0., 1., 0.)); +#17 = IFCGEOMETRICREPRESENTATIONCONTEXT($, 'MODEL', 3, 1.E-5, #13, #16); +#18 = IFCRELAGGREGATES('1FNFyAAJeHwu6TwDZHIYIu', #3, 'Documentation Container', 'Container for IfcProject, collects relevant products', #1, (#15)); +#19 = IFCRELCONTAINEDINSPATIALSTRUCTURE('1FNFyBAJeHwvmywDZHIYIu', #3, 'IfcProducts contained in myIfcRailway', 'Association between IfcProducts and IfcRailway', (#20), #15); +#20 = IFCALIGNMENT('1FNFyCAJeHwxedwDZHIYIu', #3, 'Spor', 'optional Railway Description', $, #48, #51, $, $); +#21 = IFCALIGNMENTHORIZONTAL('1FNFyDAJeHwv87wDZHIYIu', $, $, $, $, #53, #56); +#23 = IFCRELNESTS('3BJTAQrjCHwvVKbERtTLTf', $, $, $, #20, (#21)); +#28 = IFCCARTESIANPOINT((0., 0.)); +#29 = IFCALIGNMENTHORIZONTALSEGMENT($, $, #28, 0., 1000., 300., 100., $, .CLOTHOID.); +#30 = IFCALIGNMENTSEGMENT('1FNFyHAJeHwuDtwDZHIYIu', #3, $, $, $, #37, #40, #29); +#34 = IFCRELNESTS('1FNFyHAJeHwuDtwDZHIYIj', $, $, $, #21, (#30)); +#35 = IFCCOMPOSITECURVE((#36), .F.); +#36 = IFCCURVESEGMENT(.DISCONTINUOUS., #42, IFCPARAMETERVALUE(42.8571428571429), IFCNONNEGATIVELENGTHMEASURE(100.), #45); +#37 = IFCLOCALPLACEMENT($, #38); +#38 = IFCAXIS2PLACEMENT3D(#39, $, $); +#39 = IFCCARTESIANPOINT((0., 0., 0.)); +#40 = IFCPRODUCTDEFINITIONSHAPE($, $, (#41, #71)); +#41 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve2D', (#36)); +#42 = IFCAXIS2PLACEMENT2D(#43, #44); +#43 = IFCCARTESIANPOINT((0., 0.)); +#44 = IFCDIRECTION((1., 0.)); +#45 = IFCCLOTHOID(#46, 207.019667802706); +#46 = IFCAXIS2PLACEMENT2D(#47, $); +#47 = IFCCARTESIANPOINT((0., 0.)); +#48 = IFCLOCALPLACEMENT($, #49); +#49 = IFCAXIS2PLACEMENT3D(#50, $, $); +#50 = IFCCARTESIANPOINT((0., 0., 0.)); +#51 = IFCPRODUCTDEFINITIONSHAPE($, $, (#52, #77)); +#52 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve3D', (#35)); +#53 = IFCLOCALPLACEMENT($, #54); +#54 = IFCAXIS2PLACEMENT3D(#55, $, $); +#55 = IFCCARTESIANPOINT((0., 0., 0.)); +#56 = IFCPRODUCTDEFINITIONSHAPE($, $, (#57, #60)); +#57 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve2D', (#35)); +#58 = IFCCARTESIANPOINTLIST2D(((0., 0.), (9.99999830403069E-1, 5.03888846044225E-4), (1.99999861956474, 2.03111040638053E-3), (2.99999526044478, 4.60499633315013E-3), (3.99998857273883, 8.24887698048446E-3), (4.99997730124678, 1.29860812434579E-2), (5.99996011424134, 1.88399363883039E-2), (6.99993560183712, 2.58337678737044E-2), (7.99990227435991, 3.39908991629646E-2), (8.99985856071651, 4.33346515268826E-2), (9.99980280676497, 5.3888343837119E-2), (10.9997332736852, 6.56752923498895E-2), (11.9996481363501, 7.87188104797764E-2), (12.9995454816976, 9.30422085634786E-2), (13.9994233071028, 1.0866879361331E-1), (14.9992795187506, 1.25621869060254E-1), (15.9991119300102, 1.43924734486383E-1), (16.9989182598086, 1.6360068534647E-1), (17.9986961310062, 1.84673012678576E-1), (18.9984430687728, 2.07165002803453E-1), (19.9981564989641, 2.31099937012551E-1), (20.9978337464998, 2.56501091244466E-1), (21.997472033742, 2.83391735749604E-1), (22.9970684788751, 3.11795134742923E-1), (23.9966200942868, 3.41734546044516E-1), (24.9961237849499, 3.73233220707883E-1), (25.9955763468053, 4.06314402635686E-1), (26.9949744651471, 4.41001328182807E-1), (27.9943147130078, 4.77317225746529E-1), (28.9935935495459, 5.15285315343638E-1), (29.9928073184344, 5.54928808174271E-1), (30.9919522462512, 5.9627090617233E-1), (31.9910244408712, 6.39334801542263E-1), (32.9900198898594, 6.84143676282027E-1), (33.9889344588668, 7.30720701692075E-1), (34.9877638900274, 7.79089037870142E-1), (35.9865038003574, 8.29271833191685E-1), (36.9851496801568, 8.8129222377576E-1), (37.9836968914123, 9.35173332936187E-1), (38.9821406662033, 9.90938270617788E-1), (39.9804761051096, 1.04861013281754), (40.9786981756217, 1.10821200099046), (41.9768017105539, 1.16976694144001), (42.9747814064595, 1.23329800469289), (43.9726318220491, 1.29882822485803), (44.9703473766114, 1.36638061896951), (45.9679223484373, 1.43597818631342), (46.9653508732465, 1.50764390773829), (47.9626269426183, 1.58140074494901), (48.9597444024239, 1.65727163978404), (49.9566969512643, 1.73527951347576), (50.9534781389096, 1.81544726589376), (51.9500813647434, 1.89779777477089), (52.9464998762103, 1.98235389491188), (53.9427267672675, 2.06913845738445), (54.9387549768404, 2.15817426869261), (55.934577287282, 2.2494841099321), (56.9301863228376, 2.34309073592765), (57.9255745481126, 2.43901687435209), (58.9207342665459, 2.53728522482695), (59.9156576188876, 2.63791845800449), (60.9103365816818, 2.74093921463101), (61.9047629657543, 2.84637010459116), (62.8989284147053, 2.95423370593323), (63.892824403408, 3.06455256387513), (64.8864422365122, 3.177349189791), (65.8797730469537, 3.2926460601782), (66.8728077944701, 3.4104656156046), (67.8655372641216, 3.53083025963601), (68.8579520648188, 3.65376235774342), (69.8500426278569, 3.7792842361902), (70.8417992054558, 3.90741818089884), (71.8332118693077, 4.03818643629721), (72.8242705091311, 4.17161120414415), (73.8149648312322, 4.30771464233421), (74.8052843570739, 4.4465188636815), (75.7952184218511, 4.58804593468235), (76.7847561730758, 4.73231787425677), (77.773886569168, 4.87935665246848), (78.762598378056, 5.02918418922341), (79.7508801757851, 5.1818223529465), (80.7387203451338, 5.33729295923673), (81.7261070742402, 5.49561776950008), (82.7130283552361, 5.65681848956057), (83.6994719828915, 5.82091676824887), (84.6854255532674, 5.98793419596875), (85.6708764623795, 6.15789230324088), (86.6558119048708, 6.33081255922412), (87.6402188726949, 6.50671637021405), (88.6240841538098, 6.6856250781186), (89.607394330882, 6.86755995891076), (90.5901357800018, 7.05254222105809), (91.5722946694093, 7.24059300392919), (92.553856958233, 7.43173337617662), (93.5348083952385, 7.62598433409656), (94.5151345175903, 7.82336679996482), (95.4948206496252, 8.02390162034923), (96.4738519016389, 8.22760956439828), (97.4522131686845, 8.43451132210586), (98.4298891293845, 8.64462750255206), (99.4068642447564, 8.85797863211994)), $); +#59 = IFCINDEXEDPOLYCURVE(#58, $, $); +#60 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#59)); +#61 = IFCOWNERHISTORY(#63, #65, $, .ADDED., 1630842293, $, $, 1630842293); +#62 = IFCORGANIZATION($, '\X2\0410\X0\\X2\0420\X0\ \X2\0414\X0\\X2\0418\X0\ \X2\0415\X0\\X2\0424\X0\ \X2\041E\X0\\X2\041E\X0\\X2\0414\X0\', 'RDF Ltd.', $, $); +#63 = IFCPERSONANDORGANIZATION(#64, #62, $); +#64 = IFCPERSON($, 'Bonsma', 'Peter', $, $, $, $, $); +#65 = IFCAPPLICATION(#62, '0.99', 'Add Check Library Application', 'TA 1001'); +#66 = IFCRELDEFINESBYPROPERTIES('2i9ch$v8jEGR1podDptw3s', #61, $, $, (#21), #67); +#67 = IFCPROPERTYSET('2BEYnr_0rD4APGoGcOKcrD', #61, 'ValidationPset', $, (#68)); +#68 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(99.9999785495359), $); +#69 = IFCCARTESIANPOINTLIST2D(((0., 0.), (9.99999830403069E-1, 5.03888846044225E-4), (1.99999861956474, 2.03111040638053E-3), (2.99999526044478, 4.60499633315013E-3), (3.99998857273883, 8.24887698048446E-3), (4.99997730124678, 1.29860812434579E-2), (5.99996011424134, 1.88399363883039E-2), (6.99993560183712, 2.58337678737044E-2), (7.99990227435991, 3.39908991629646E-2), (8.99985856071651, 4.33346515268826E-2), (9.99980280676497, 5.3888343837119E-2), (10.9997332736852, 6.56752923498895E-2), (11.9996481363501, 7.87188104797764E-2), (12.9995454816976, 9.30422085634786E-2), (13.9994233071028, 1.0866879361331E-1), (14.9992795187506, 1.25621869060254E-1), (15.9991119300102, 1.43924734486383E-1), (16.9989182598086, 1.6360068534647E-1), (17.9986961310062, 1.84673012678576E-1), (18.9984430687728, 2.07165002803453E-1), (19.9981564989641, 2.31099937012551E-1), (20.9978337464998, 2.56501091244466E-1), (21.997472033742, 2.83391735749604E-1), (22.9970684788751, 3.11795134742923E-1), (23.9966200942868, 3.41734546044516E-1), (24.9961237849499, 3.73233220707883E-1), (25.9955763468053, 4.06314402635686E-1), (26.9949744651471, 4.41001328182807E-1), (27.9943147130078, 4.77317225746529E-1), (28.9935935495459, 5.15285315343638E-1), (29.9928073184344, 5.54928808174271E-1), (30.9919522462512, 5.9627090617233E-1), (31.9910244408712, 6.39334801542263E-1), (32.9900198898594, 6.84143676282027E-1), (33.9889344588668, 7.30720701692075E-1), (34.9877638900274, 7.79089037870142E-1), (35.9865038003574, 8.29271833191685E-1), (36.9851496801568, 8.8129222377576E-1), (37.9836968914123, 9.35173332936187E-1), (38.9821406662033, 9.90938270617788E-1), (39.9804761051096, 1.04861013281754), (40.9786981756217, 1.10821200099046), (41.9768017105539, 1.16976694144001), (42.9747814064595, 1.23329800469289), (43.9726318220491, 1.29882822485803), (44.9703473766114, 1.36638061896951), (45.9679223484373, 1.43597818631342), (46.9653508732465, 1.50764390773829), (47.9626269426183, 1.58140074494901), (48.9597444024239, 1.65727163978404), (49.9566969512643, 1.73527951347576), (50.9534781389096, 1.81544726589376), (51.9500813647434, 1.89779777477089), (52.9464998762103, 1.98235389491188), (53.9427267672675, 2.06913845738445), (54.9387549768404, 2.15817426869261), (55.934577287282, 2.2494841099321), (56.9301863228376, 2.34309073592765), (57.9255745481126, 2.43901687435209), (58.9207342665459, 2.53728522482695), (59.9156576188876, 2.63791845800449), (60.9103365816818, 2.74093921463101), (61.9047629657543, 2.84637010459116), (62.8989284147053, 2.95423370593323), (63.892824403408, 3.06455256387513), (64.8864422365122, 3.177349189791), (65.8797730469537, 3.2926460601782), (66.8728077944701, 3.4104656156046), (67.8655372641216, 3.53083025963601), (68.8579520648188, 3.65376235774342), (69.8500426278569, 3.7792842361902), (70.8417992054558, 3.90741818089884), (71.8332118693077, 4.03818643629721), (72.8242705091311, 4.17161120414415), (73.8149648312322, 4.30771464233421), (74.8052843570739, 4.4465188636815), (75.7952184218511, 4.58804593468235), (76.7847561730758, 4.73231787425677), (77.773886569168, 4.87935665246848), (78.762598378056, 5.02918418922341), (79.7508801757851, 5.1818223529465), (80.7387203451338, 5.33729295923673), (81.7261070742402, 5.49561776950008), (82.7130283552361, 5.65681848956057), (83.6994719828915, 5.82091676824887), (84.6854255532674, 5.98793419596875), (85.6708764623795, 6.15789230324088), (86.6558119048708, 6.33081255922412), (87.6402188726949, 6.50671637021405), (88.6240841538098, 6.6856250781186), (89.607394330882, 6.86755995891076), (90.5901357800018, 7.05254222105809), (91.5722946694093, 7.24059300392919), (92.553856958233, 7.43173337617662), (93.5348083952385, 7.62598433409656), (94.5151345175903, 7.82336679996482), (95.4948206496252, 8.02390162034923), (96.4738519016389, 8.22760956439828), (97.4522131686845, 8.43451132210586), (98.4298891293845, 8.64462750255206), (99.4068642447564, 8.85797863211994)), $); +#70 = IFCINDEXEDPOLYCURVE(#69, $, $); +#71 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#70)); +#72 = IFCRELDEFINESBYPROPERTIES('3M2f8_yJj9yO7Dsz$7t7O5', #61, $, $, (#30), #73); +#73 = IFCPROPERTYSET('2A5FhTJ9LE8BW$oP3CGX0l', #61, 'ValidationPset', $, (#74)); +#74 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(99.9999785495359), $); +#75 = IFCCARTESIANPOINTLIST2D(((0., 0.), (9.99999830403069E-1, 5.03888846044225E-4), (1.99999861956474, 2.03111040638053E-3), (2.99999526044478, 4.60499633315013E-3), (3.99998857273883, 8.24887698048446E-3), (4.99997730124678, 1.29860812434579E-2), (5.99996011424134, 1.88399363883039E-2), (6.99993560183712, 2.58337678737044E-2), (7.99990227435991, 3.39908991629646E-2), (8.99985856071651, 4.33346515268826E-2), (9.99980280676497, 5.3888343837119E-2), (10.9997332736852, 6.56752923498895E-2), (11.9996481363501, 7.87188104797764E-2), (12.9995454816976, 9.30422085634786E-2), (13.9994233071028, 1.0866879361331E-1), (14.9992795187506, 1.25621869060254E-1), (15.9991119300102, 1.43924734486383E-1), (16.9989182598086, 1.6360068534647E-1), (17.9986961310062, 1.84673012678576E-1), (18.9984430687728, 2.07165002803453E-1), (19.9981564989641, 2.31099937012551E-1), (20.9978337464998, 2.56501091244466E-1), (21.997472033742, 2.83391735749604E-1), (22.9970684788751, 3.11795134742923E-1), (23.9966200942868, 3.41734546044516E-1), (24.9961237849499, 3.73233220707883E-1), (25.9955763468053, 4.06314402635686E-1), (26.9949744651471, 4.41001328182807E-1), (27.9943147130078, 4.77317225746529E-1), (28.9935935495459, 5.15285315343638E-1), (29.9928073184344, 5.54928808174271E-1), (30.9919522462512, 5.9627090617233E-1), (31.9910244408712, 6.39334801542263E-1), (32.9900198898594, 6.84143676282027E-1), (33.9889344588668, 7.30720701692075E-1), (34.9877638900274, 7.79089037870142E-1), (35.9865038003574, 8.29271833191685E-1), (36.9851496801568, 8.8129222377576E-1), (37.9836968914123, 9.35173332936187E-1), (38.9821406662033, 9.90938270617788E-1), (39.9804761051096, 1.04861013281754), (40.9786981756217, 1.10821200099046), (41.9768017105539, 1.16976694144001), (42.9747814064595, 1.23329800469289), (43.9726318220491, 1.29882822485803), (44.9703473766114, 1.36638061896951), (45.9679223484373, 1.43597818631342), (46.9653508732465, 1.50764390773829), (47.9626269426183, 1.58140074494901), (48.9597444024239, 1.65727163978404), (49.9566969512643, 1.73527951347576), (50.9534781389096, 1.81544726589376), (51.9500813647434, 1.89779777477089), (52.9464998762103, 1.98235389491188), (53.9427267672675, 2.06913845738445), (54.9387549768404, 2.15817426869261), (55.934577287282, 2.2494841099321), (56.9301863228376, 2.34309073592765), (57.9255745481126, 2.43901687435209), (58.9207342665459, 2.53728522482695), (59.9156576188876, 2.63791845800449), (60.9103365816818, 2.74093921463101), (61.9047629657543, 2.84637010459116), (62.8989284147053, 2.95423370593323), (63.892824403408, 3.06455256387513), (64.8864422365122, 3.177349189791), (65.8797730469537, 3.2926460601782), (66.8728077944701, 3.4104656156046), (67.8655372641216, 3.53083025963601), (68.8579520648188, 3.65376235774342), (69.8500426278569, 3.7792842361902), (70.8417992054558, 3.90741818089884), (71.8332118693077, 4.03818643629721), (72.8242705091311, 4.17161120414415), (73.8149648312322, 4.30771464233421), (74.8052843570739, 4.4465188636815), (75.7952184218511, 4.58804593468235), (76.7847561730758, 4.73231787425677), (77.773886569168, 4.87935665246848), (78.762598378056, 5.02918418922341), (79.7508801757851, 5.1818223529465), (80.7387203451338, 5.33729295923673), (81.7261070742402, 5.49561776950008), (82.7130283552361, 5.65681848956057), (83.6994719828915, 5.82091676824887), (84.6854255532674, 5.98793419596875), (85.6708764623795, 6.15789230324088), (86.6558119048708, 6.33081255922412), (87.6402188726949, 6.50671637021405), (88.6240841538098, 6.6856250781186), (89.607394330882, 6.86755995891076), (90.5901357800018, 7.05254222105809), (91.5722946694093, 7.24059300392919), (92.553856958233, 7.43173337617662), (93.5348083952385, 7.62598433409656), (94.5151345175903, 7.82336679996482), (95.4948206496252, 8.02390162034923), (96.4738519016389, 8.22760956439828), (97.4522131686845, 8.43451132210586), (98.4298891293845, 8.64462750255206), (99.4068642447564, 8.85797863211994)), $); +#76 = IFCINDEXEDPOLYCURVE(#75, $, $); +#77 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#76)); +#78 = IFCRELDEFINESBYPROPERTIES('2pAQWBl$5C$xZvi9r4RJxp', #61, $, $, (#20), #79); +#79 = IFCPROPERTYSET('3vkemQKFj5k8YyqN073Fpw', #61, 'ValidationPset', $, (#80)); +#80 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(99.9999785495359), $); +ENDSEC; +END-ISO-10303-21; diff --git a/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_1000_300_1_Meter/Data/clothoid_100.0_1000_300_1_Meter.png b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_1000_300_1_Meter/Data/clothoid_100.0_1000_300_1_Meter.png new file mode 100644 index 000000000..fb47f7add Binary files /dev/null and b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_1000_300_1_Meter/Data/clothoid_100.0_1000_300_1_Meter.png differ diff --git a/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_1000_300_1_Meter/Data/clothoid_100.0_1000_300_1_Meter_top.png b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_1000_300_1_Meter/Data/clothoid_100.0_1000_300_1_Meter_top.png new file mode 100644 index 000000000..dba90bc6e Binary files /dev/null and b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_1000_300_1_Meter/Data/clothoid_100.0_1000_300_1_Meter_top.png differ diff --git a/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_1000_300_1_Meter/src/clothoid_100.0_1000_300_1_Meter.cpp b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_1000_300_1_Meter/src/clothoid_100.0_1000_300_1_Meter.cpp new file mode 100644 index 000000000..da5c64a27 --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_1000_300_1_Meter/src/clothoid_100.0_1000_300_1_Meter.cpp @@ -0,0 +1,98 @@ +/* + Copyright (c) 2021 Technical University of Munich + Chair of Computational Modeling and Simulation. + + TUM Open Infra Platform is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License Version 3 + as published by the Free Software Foundation. + + TUM Open Infra Platform is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include +#include + +#include + +#include +#include +#include + +using namespace testing; + +class Clothoid : public IfcVisualTest { +protected: + + // Test standard values + buw::Image4b _background = buw::Image4b(0, 0); + + virtual void SetUp() override { + IfcVisualTest::SetUp(); + + express_model = OpenInfraPlatform::IFC4X3_RC4::IFC4X3_RC4Reader::FromFile(filename.string()); + + importer = buw::makeReferenceCounted>(); + auto model = importer->collectData(express_model); + + _background = rendererIfc->captureImage(); + rendererIfc->setModel(model[0]); + } + + virtual void TearDown() override { + express_model.reset(); + IfcVisualTest::TearDown(); + } + + virtual std::string TestName() const { return "clothoid_100.0_1000_300_1_Meter"; } + virtual std::string Schema() const { return "IFC4X3_RC4"; } + + const boost::filesystem::path filename = dataPath("clothoid_100.0_1000_300_1_Meter.ifc"); + + std::shared_ptr express_model = nullptr; + buw::ReferenceCounted> importer = nullptr; +}; + +TEST_F(Clothoid, AllEntitiesAreRead) { + EXPECT_THAT(express_model->entities.size(), Eq(72)); +} + +TEST_F(Clothoid, IFCHasAnEssentialEntity) { + auto result1 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto &pair) -> bool { return pair.second->classname() == "IFCCURVESEGMENT"; }); + auto result2 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto &pair) -> bool { return pair.second->classname() == "IFCCLOTHOID"; }); + EXPECT_NE(result1, express_model->entities.end()); + EXPECT_NE(result2, express_model->entities.end()); +} + +TEST_F(Clothoid, ImageIsSaved) +{ + // Arrange + buw::Image4b image = rendererIfc->captureImage(); + + // Act + buw::storeImage(testPath("clothoid_100.0_1000_300_1_Meter.png").string(), image); + + // Assert + EXPECT_NO_THROW(buw::loadImage4b(testPath("clothoid_100.0_1000_300_1_Meter.png").string())); +} + +TEST_F(Clothoid, PlaneSurfaceViews) +{ + // Arrange + const auto expected_top = buw::loadImage4b(dataPath("clothoid_100.0_1000_300_1_Meter_top.png").string()); + + // Act (Top) + rendererIfc->setViewDirection(buw::eViewDirection::Top); + buw::Image4b image_top = CaptureImage(); + + // uncomment following lines to also save the screen shot + //buw::storeImage(testPath("clothoid_100.0_1000_300_1_Meter_top.png").string(), image_top); + + // Assert + EXPECT_EQ(image_top, expected_top); +} \ No newline at end of file diff --git a/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_300_-inf_1_Meter/CMakeLists.txt b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_300_-inf_1_Meter/CMakeLists.txt new file mode 100644 index 000000000..2759ccdae --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_300_-inf_1_Meter/CMakeLists.txt @@ -0,0 +1,20 @@ +# +# Copyright (c) 2021 Technical University of Munich +# Chair of Computational Modeling and Simulation. +# +# TUM Open Infra Platform is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License Version 3 +# as published by the Free Software Foundation. +# +# TUM Open Infra Platform is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +include(CreateUnitTests) + +CreateIfcFileVisualUnitTestForSchema(clothoid_100.0_300_-inf_1_Meter IFC4X3_RC4) diff --git a/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_300_-inf_1_Meter/Data/clothoid_100.0_300_-inf_1_Meter.ifc b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_300_-inf_1_Meter/Data/clothoid_100.0_300_-inf_1_Meter.ifc new file mode 100644 index 000000000..fdedf9c5e --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_300_-inf_1_Meter/Data/clothoid_100.0_300_-inf_1_Meter.ifc @@ -0,0 +1,81 @@ +ISO-10303-21; +HEADER; +FILE_DESCRIPTION (('ViewDefinition [CoordinationView]'), '2;1'); +FILE_NAME ('Single-LANDXML.ifc', '2021-05-24T11:00:00', ('IFC Rail Technical Services'), ('buildingSMART International RailwayRoom'), 'RailCOMPLETE\X2\FFAE\X0\', '2019.1.1995.0', ''); +FILE_SCHEMA (('IFC4X3_RC4')); +ENDSEC; +DATA; +#1 = IFCPROJECT('1FNFy8AJeHwwz7wDZHIYIu', #3, 'IFC Rail Referencedata', 'Rail alignment sample', $, 'Longname', 'Design', $, #9); +#2 = IFCAPPLICATION(#5, '2019.1.1995.0', 'RailCOMPLETE\X2\00AE\X0\', $); +#3 = IFCOWNERHISTORY(#6, #2, $, .ADDED., 1320688800, $, $, 1320688800); +#4 = IFCPERSON('TS', 'IFC Rail Technical Services', $, $, $, $, $, $); +#5 = IFCORGANIZATION('bsI RWR', 'buildingSmart International Railway Room', $, $, $); +#6 = IFCPERSONANDORGANIZATION(#4, #5, $); +#7 = IFCSIUNIT(*, .LENGTHUNIT., $, .METRE.); +#8 = IFCSIUNIT(*, .PLANEANGLEUNIT., $, .RADIAN.); +#9 = IFCUNITASSIGNMENT((#7, #8)); +#10 = IFCCARTESIANPOINT((0., 0., 0.)); +#11 = IFCDIRECTION((0., 0., 1.)); +#12 = IFCDIRECTION((1., 0., 0.)); +#13 = IFCAXIS2PLACEMENT3D(#10, #11, #12); +#14 = IFCLOCALPLACEMENT($, #13); +#15 = IFCRAILWAY('1FNFy9AJeHwuVmwDZHIYIu', #3, 'optional Railway Name', 'optional Railway Description', $, #14, $, 'Longname for Railway track geometry (alignment)', $, $); +#16 = IFCDIRECTION((0., 1., 0.)); +#17 = IFCGEOMETRICREPRESENTATIONCONTEXT($, 'MODEL', 3, 1.E-5, #13, #16); +#18 = IFCRELAGGREGATES('1FNFyAAJeHwu6TwDZHIYIu', #3, 'Documentation Container', 'Container for IfcProject, collects relevant products', #1, (#15)); +#19 = IFCRELCONTAINEDINSPATIALSTRUCTURE('1FNFyBAJeHwvmywDZHIYIu', #3, 'IfcProducts contained in myIfcRailway', 'Association between IfcProducts and IfcRailway', (#20), #15); +#20 = IFCALIGNMENT('1FNFyCAJeHwxedwDZHIYIu', #3, 'Spor', 'optional Railway Description', $, #48, #51, $, $); +#21 = IFCALIGNMENTHORIZONTAL('1FNFyDAJeHwv87wDZHIYIu', $, $, $, $, #53, #56); +#23 = IFCRELNESTS('3BJTAQrjCHwvVKbERtTLTf', $, $, $, #20, (#21)); +#28 = IFCCARTESIANPOINT((0., 0.)); +#29 = IFCALIGNMENTHORIZONTALSEGMENT($, $, #28, 0., -300., 0., 100., $, .CLOTHOID.); +#30 = IFCALIGNMENTSEGMENT('1FNFyHAJeHwuDtwDZHIYIu', #3, $, $, $, #37, #40, #29); +#34 = IFCRELNESTS('1FNFyHAJeHwuDtwDZHIYIj', $, $, $, #21, (#30)); +#35 = IFCCOMPOSITECURVE((#36), .F.); +#36 = IFCCURVESEGMENT(.DISCONTINUOUS., #42, IFCPARAMETERVALUE(-100.), IFCNONNEGATIVELENGTHMEASURE(100.), #45); +#37 = IFCLOCALPLACEMENT($, #38); +#38 = IFCAXIS2PLACEMENT3D(#39, $, $); +#39 = IFCCARTESIANPOINT((0., 0., 0.)); +#40 = IFCPRODUCTDEFINITIONSHAPE($, $, (#41, #71)); +#41 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve2D', (#36)); +#42 = IFCAXIS2PLACEMENT2D(#43, #44); +#43 = IFCCARTESIANPOINT((0., 0.)); +#44 = IFCDIRECTION((1., 0.)); +#45 = IFCCLOTHOID(#46, 173.205080756888); +#46 = IFCAXIS2PLACEMENT2D(#47, $); +#47 = IFCCARTESIANPOINT((0., 0.)); +#48 = IFCLOCALPLACEMENT($, #49); +#49 = IFCAXIS2PLACEMENT3D(#50, $, $); +#50 = IFCCARTESIANPOINT((0., 0., 0.)); +#51 = IFCPRODUCTDEFINITIONSHAPE($, $, (#52, #77)); +#52 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve3D', (#35)); +#53 = IFCLOCALPLACEMENT($, #54); +#54 = IFCAXIS2PLACEMENT3D(#55, $, $); +#55 = IFCCARTESIANPOINT((0., 0., 0.)); +#56 = IFCPRODUCTDEFINITIONSHAPE($, $, (#57, #60)); +#57 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve2D', (#35)); +#58 = IFCCARTESIANPOINTLIST2D(((0., 0.), (9.99998162010282E-1, -1.66110958634486E-3), (1.99998540655037, -6.62219811856807E-3), (2.99995111848775, -1.48498794443812E-2), (3.99988500957765, -2.63107347002508E-2), (4.9997771152241, -4.09713143974142E-2), (5.99961779123027, -5.87981404542712E-2), (6.99939771053855, -7.97577081756171E-2), (7.99910785996089, -1.03816488179266E-1), (8.99873953690001, -1.3094092827057E-1), (9.99828434606158, -1.61097455265321E-1), (10.9977341961583, -1.94252476761617E-1), (11.9970812966063, -2.3037238286118E-1), (12.9963181542133, -2.69423547840615E-1), (13.995437569861, -3.11372331773263E-1), (14.99443263518, -3.56185082102013E-1), (15.9932967292185, -4.03828135163766E-1), (16.9920235151059, -4.54267817665969E-1), (17.9906069367105, -5.07470448115852E-1), (18.9890412152921, -5.63402338202835E-1), (19.9873208461503, -6.22029794134716E-1), (20.9854405952682, -6.83319117928095E-1), (21.9833954959522, -7.47236608653708E-1), (22.9811808454681, -8.13748563637118E-1), (23.978792201674, -8.82821279615344E-1), (24.97622537965, -9.5442105384999E-1), (25.9734764483251, -1.02851418519745), (26.9705417271021, -1.10506697513666), (27.9674177824799, -1.1840457287551), (28.9641014246739, -1.2654167556934), (29.960589704235, -1.34914637104936), (30.956879908667, -1.43520089624168), (31.952969559043, -1.5235466598342), (32.9488564066208, -1.61414999832099), (33.9445384294578, -1.70697725687308), (34.9400138290245, -1.80199479004719), (35.9352810268195, -1.89916896245714), (36.9303386609822, -1.99846614940848), (37.9251855829077, -2.09985273749689), (38.91982085386, -2.20329512517092), (39.9142437415876, -2.30875972325963), (40.9084537169379, -2.41621295546572), (41.9024504504736, -2.52562125882472), (42.8962338090893, -2.6369510841307), (43.8898038526297, -2.75016889632925), (44.8831608305081, -2.86524117487813), (45.8763051783272, -2.98213441407625), (46.8692375145007, -3.10081512336151), (47.8619586368762, -3.22124982757807), (48.8544695193603, -3.34340506721362), (49.846771308545, -3.46724739860722), (50.838865320336, -3.59274339412826), (51.8307530365829, -3.71985964232712), (52.8224361017109, -3.8485627480581), (53.8139163193552, -3.97881933257512), (54.8051956489972, -4.11059603360093), (55.7962762026022, -4.24385950537011), (56.7871602412603, -4.3785764186467), (57.7778501718286, -4.5147134607169), (58.7683485435763, -4.65223733535734), (59.7586580448313, -4.79111476277967), (60.7487814996301, -4.93131247955176), (61.7387218643691, -5.07279723849641), (62.7284822244584, -5.21553580856776), (63.7180657909785, -5.35949497470635), (64.7074758973387, -5.504641537673), (65.6967159959379, -5.65094231386237), (66.685789654828, -5.79836413509665), (67.6747005543797, -5.94687384839988), (68.6634524839499, -6.09643831575357), (69.6520493385519, -6.2470244138341), (70.6404951155283, -6.39859903373245), (71.6287939112249, -6.55112908065694), (72.6169499176679, -6.70458147361937), (73.6049674192428, -6.85892314510517), (74.5928507893753, -7.01412104072823), (75.5806044872145, -7.17014211887078), (76.568233054318, -7.32695335030904), (77.5557411113392, -7.48452171782506), (78.543133354716, -7.64281421580538), (79.5304145533619, -7.80179784982709), (80.5175895453586, -7.96143963623175), (81.5046632346504, -8.12170660168778), (82.4916405877404, -8.28256578274189), (83.4785266303881, -8.44398422536007), (84.4653264443087, -8.60592898445867), (85.4520451638735, -8.76836712342618), (86.4386879728125, -8.93126571363624), (87.4252601009173, -9.09459183395234), (88.4117668207462, -9.25831257022499), (89.3982134443292, -9.42239501478159), (90.3846053198759, -9.58680626590982), (91.3709478284822, -9.75151342733504), (92.3572463808401, -9.91648360769204), (93.3435064139461, -10.0816839199921), (94.3297333878127, -10.2470814810853), (95.3159327821781, -10.4126434111195), (96.3021100932187, -10.5783368329956), (97.2882708302601, -10.7441288718202), (98.2744205124901, -10.9099866543562), (99.2605646656709, -11.0758773084715)), $); +#59 = IFCINDEXEDPOLYCURVE(#58, $, $); +#60 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#59)); +#61 = IFCOWNERHISTORY(#63, #65, $, .ADDED., 1630842293, $, $, 1630842293); +#62 = IFCORGANIZATION($, '\X2\0410\X0\\X2\0420\X0\ \X2\0414\X0\\X2\0418\X0\ \X2\0415\X0\\X2\0424\X0\ \X2\041E\X0\\X2\041E\X0\\X2\0414\X0\', 'RDF Ltd.', $, $); +#63 = IFCPERSONANDORGANIZATION(#64, #62, $); +#64 = IFCPERSON($, 'Bonsma', 'Peter', $, $, $, $, $); +#65 = IFCAPPLICATION(#62, '0.99', 'Add Check Library Application', 'TA 1001'); +#66 = IFCRELDEFINESBYPROPERTIES('2Ls4gx3$b8TxWAnAOuZsz8', #61, $, $, (#21), #67); +#67 = IFCPROPERTYSET('04RJBiBK9138g50R8ACTXj', #61, 'ValidationPset', $, (#68)); +#68 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(99.9999845682112), $); +#69 = IFCCARTESIANPOINTLIST2D(((0., 0.), (9.99998162010282E-1, -1.66110958634486E-3), (1.99998540655037, -6.62219811856807E-3), (2.99995111848775, -1.48498794443812E-2), (3.99988500957765, -2.63107347002508E-2), (4.9997771152241, -4.09713143974142E-2), (5.99961779123027, -5.87981404542712E-2), (6.99939771053855, -7.97577081756171E-2), (7.99910785996089, -1.03816488179266E-1), (8.99873953690001, -1.3094092827057E-1), (9.99828434606158, -1.61097455265321E-1), (10.9977341961583, -1.94252476761617E-1), (11.9970812966063, -2.3037238286118E-1), (12.9963181542133, -2.69423547840615E-1), (13.995437569861, -3.11372331773263E-1), (14.99443263518, -3.56185082102013E-1), (15.9932967292185, -4.03828135163766E-1), (16.9920235151059, -4.54267817665969E-1), (17.9906069367105, -5.07470448115852E-1), (18.9890412152921, -5.63402338202835E-1), (19.9873208461503, -6.22029794134716E-1), (20.9854405952682, -6.83319117928095E-1), (21.9833954959522, -7.47236608653708E-1), (22.9811808454681, -8.13748563637118E-1), (23.978792201674, -8.82821279615344E-1), (24.97622537965, -9.5442105384999E-1), (25.9734764483251, -1.02851418519745), (26.9705417271021, -1.10506697513666), (27.9674177824799, -1.1840457287551), (28.9641014246739, -1.2654167556934), (29.960589704235, -1.34914637104936), (30.956879908667, -1.43520089624168), (31.952969559043, -1.5235466598342), (32.9488564066208, -1.61414999832099), (33.9445384294578, -1.70697725687308), (34.9400138290245, -1.80199479004719), (35.9352810268195, -1.89916896245714), (36.9303386609822, -1.99846614940848), (37.9251855829077, -2.09985273749689), (38.91982085386, -2.20329512517092), (39.9142437415876, -2.30875972325963), (40.9084537169379, -2.41621295546572), (41.9024504504736, -2.52562125882472), (42.8962338090893, -2.6369510841307), (43.8898038526297, -2.75016889632925), (44.8831608305081, -2.86524117487813), (45.8763051783272, -2.98213441407625), (46.8692375145007, -3.10081512336151), (47.8619586368762, -3.22124982757807), (48.8544695193603, -3.34340506721362), (49.846771308545, -3.46724739860722), (50.838865320336, -3.59274339412826), (51.8307530365829, -3.71985964232712), (52.8224361017109, -3.8485627480581), (53.8139163193552, -3.97881933257512), (54.8051956489972, -4.11059603360093), (55.7962762026022, -4.24385950537011), (56.7871602412603, -4.3785764186467), (57.7778501718286, -4.5147134607169), (58.7683485435763, -4.65223733535734), (59.7586580448313, -4.79111476277967), (60.7487814996301, -4.93131247955176), (61.7387218643691, -5.07279723849641), (62.7284822244584, -5.21553580856776), (63.7180657909785, -5.35949497470635), (64.7074758973387, -5.504641537673), (65.6967159959379, -5.65094231386237), (66.685789654828, -5.79836413509665), (67.6747005543797, -5.94687384839988), (68.6634524839499, -6.09643831575357), (69.6520493385519, -6.2470244138341), (70.6404951155283, -6.39859903373245), (71.6287939112249, -6.55112908065694), (72.6169499176679, -6.70458147361937), (73.6049674192428, -6.85892314510517), (74.5928507893753, -7.01412104072823), (75.5806044872145, -7.17014211887078), (76.568233054318, -7.32695335030904), (77.5557411113392, -7.48452171782506), (78.543133354716, -7.64281421580538), (79.5304145533619, -7.80179784982709), (80.5175895453586, -7.96143963623175), (81.5046632346504, -8.12170660168778), (82.4916405877404, -8.28256578274189), (83.4785266303881, -8.44398422536007), (84.4653264443087, -8.60592898445867), (85.4520451638735, -8.76836712342618), (86.4386879728125, -8.93126571363624), (87.4252601009173, -9.09459183395234), (88.4117668207462, -9.25831257022499), (89.3982134443292, -9.42239501478159), (90.3846053198759, -9.58680626590982), (91.3709478284822, -9.75151342733504), (92.3572463808401, -9.91648360769204), (93.3435064139461, -10.0816839199921), (94.3297333878127, -10.2470814810853), (95.3159327821781, -10.4126434111195), (96.3021100932187, -10.5783368329956), (97.2882708302601, -10.7441288718202), (98.2744205124901, -10.9099866543562), (99.2605646656709, -11.0758773084715)), $); +#70 = IFCINDEXEDPOLYCURVE(#69, $, $); +#71 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#70)); +#72 = IFCRELDEFINESBYPROPERTIES('3Zh8dk4$59ZvajJfd4jLD2', #61, $, $, (#30), #73); +#73 = IFCPROPERTYSET('1FbC4zbKbBWPkWE5Du_9vE', #61, 'ValidationPset', $, (#74)); +#74 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(99.9999845682112), $); +#75 = IFCCARTESIANPOINTLIST2D(((0., 0.), (9.99998162010282E-1, -1.66110958634486E-3), (1.99998540655037, -6.62219811856807E-3), (2.99995111848775, -1.48498794443812E-2), (3.99988500957765, -2.63107347002508E-2), (4.9997771152241, -4.09713143974142E-2), (5.99961779123027, -5.87981404542712E-2), (6.99939771053855, -7.97577081756171E-2), (7.99910785996089, -1.03816488179266E-1), (8.99873953690001, -1.3094092827057E-1), (9.99828434606158, -1.61097455265321E-1), (10.9977341961583, -1.94252476761617E-1), (11.9970812966063, -2.3037238286118E-1), (12.9963181542133, -2.69423547840615E-1), (13.995437569861, -3.11372331773263E-1), (14.99443263518, -3.56185082102013E-1), (15.9932967292185, -4.03828135163766E-1), (16.9920235151059, -4.54267817665969E-1), (17.9906069367105, -5.07470448115852E-1), (18.9890412152921, -5.63402338202835E-1), (19.9873208461503, -6.22029794134716E-1), (20.9854405952682, -6.83319117928095E-1), (21.9833954959522, -7.47236608653708E-1), (22.9811808454681, -8.13748563637118E-1), (23.978792201674, -8.82821279615344E-1), (24.97622537965, -9.5442105384999E-1), (25.9734764483251, -1.02851418519745), (26.9705417271021, -1.10506697513666), (27.9674177824799, -1.1840457287551), (28.9641014246739, -1.2654167556934), (29.960589704235, -1.34914637104936), (30.956879908667, -1.43520089624168), (31.952969559043, -1.5235466598342), (32.9488564066208, -1.61414999832099), (33.9445384294578, -1.70697725687308), (34.9400138290245, -1.80199479004719), (35.9352810268195, -1.89916896245714), (36.9303386609822, -1.99846614940848), (37.9251855829077, -2.09985273749689), (38.91982085386, -2.20329512517092), (39.9142437415876, -2.30875972325963), (40.9084537169379, -2.41621295546572), (41.9024504504736, -2.52562125882472), (42.8962338090893, -2.6369510841307), (43.8898038526297, -2.75016889632925), (44.8831608305081, -2.86524117487813), (45.8763051783272, -2.98213441407625), (46.8692375145007, -3.10081512336151), (47.8619586368762, -3.22124982757807), (48.8544695193603, -3.34340506721362), (49.846771308545, -3.46724739860722), (50.838865320336, -3.59274339412826), (51.8307530365829, -3.71985964232712), (52.8224361017109, -3.8485627480581), (53.8139163193552, -3.97881933257512), (54.8051956489972, -4.11059603360093), (55.7962762026022, -4.24385950537011), (56.7871602412603, -4.3785764186467), (57.7778501718286, -4.5147134607169), (58.7683485435763, -4.65223733535734), (59.7586580448313, -4.79111476277967), (60.7487814996301, -4.93131247955176), (61.7387218643691, -5.07279723849641), (62.7284822244584, -5.21553580856776), (63.7180657909785, -5.35949497470635), (64.7074758973387, -5.504641537673), (65.6967159959379, -5.65094231386237), (66.685789654828, -5.79836413509665), (67.6747005543797, -5.94687384839988), (68.6634524839499, -6.09643831575357), (69.6520493385519, -6.2470244138341), (70.6404951155283, -6.39859903373245), (71.6287939112249, -6.55112908065694), (72.6169499176679, -6.70458147361937), (73.6049674192428, -6.85892314510517), (74.5928507893753, -7.01412104072823), (75.5806044872145, -7.17014211887078), (76.568233054318, -7.32695335030904), (77.5557411113392, -7.48452171782506), (78.543133354716, -7.64281421580538), (79.5304145533619, -7.80179784982709), (80.5175895453586, -7.96143963623175), (81.5046632346504, -8.12170660168778), (82.4916405877404, -8.28256578274189), (83.4785266303881, -8.44398422536007), (84.4653264443087, -8.60592898445867), (85.4520451638735, -8.76836712342618), (86.4386879728125, -8.93126571363624), (87.4252601009173, -9.09459183395234), (88.4117668207462, -9.25831257022499), (89.3982134443292, -9.42239501478159), (90.3846053198759, -9.58680626590982), (91.3709478284822, -9.75151342733504), (92.3572463808401, -9.91648360769204), (93.3435064139461, -10.0816839199921), (94.3297333878127, -10.2470814810853), (95.3159327821781, -10.4126434111195), (96.3021100932187, -10.5783368329956), (97.2882708302601, -10.7441288718202), (98.2744205124901, -10.9099866543562), (99.2605646656709, -11.0758773084715)), $); +#76 = IFCINDEXEDPOLYCURVE(#75, $, $); +#77 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#76)); +#78 = IFCRELDEFINESBYPROPERTIES('19K6ODGIz4rRfQq7qUXhP4', #61, $, $, (#20), #79); +#79 = IFCPROPERTYSET('37SPlKOvnEeOJCGCzhSNru', #61, 'ValidationPset', $, (#80)); +#80 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(99.9999845682112), $); +ENDSEC; +END-ISO-10303-21; diff --git a/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_300_-inf_1_Meter/Data/clothoid_100.0_300_-inf_1_Meter.png b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_300_-inf_1_Meter/Data/clothoid_100.0_300_-inf_1_Meter.png new file mode 100644 index 000000000..6fa645d14 Binary files /dev/null and b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_300_-inf_1_Meter/Data/clothoid_100.0_300_-inf_1_Meter.png differ diff --git a/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_300_-inf_1_Meter/Data/clothoid_100.0_300_-inf_1_Meter_top.png b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_300_-inf_1_Meter/Data/clothoid_100.0_300_-inf_1_Meter_top.png new file mode 100644 index 000000000..be822fee1 Binary files /dev/null and b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_300_-inf_1_Meter/Data/clothoid_100.0_300_-inf_1_Meter_top.png differ diff --git a/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_300_-inf_1_Meter/src/clothoid_100.0_300_-inf_1_Meter.cpp b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_300_-inf_1_Meter/src/clothoid_100.0_300_-inf_1_Meter.cpp new file mode 100644 index 000000000..8cf31a0c1 --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_300_-inf_1_Meter/src/clothoid_100.0_300_-inf_1_Meter.cpp @@ -0,0 +1,98 @@ +/* + Copyright (c) 2021 Technical University of Munich + Chair of Computational Modeling and Simulation. + + TUM Open Infra Platform is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License Version 3 + as published by the Free Software Foundation. + + TUM Open Infra Platform is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include +#include + +#include + +#include +#include +#include + +using namespace testing; + +class Clothoid : public IfcVisualTest { +protected: + + // Test standard values + buw::Image4b _background = buw::Image4b(0, 0); + + virtual void SetUp() override { + IfcVisualTest::SetUp(); + + express_model = OpenInfraPlatform::IFC4X3_RC4::IFC4X3_RC4Reader::FromFile(filename.string()); + + importer = buw::makeReferenceCounted>(); + auto model = importer->collectData(express_model); + + _background = rendererIfc->captureImage(); + rendererIfc->setModel(model[0]); + } + + virtual void TearDown() override { + express_model.reset(); + IfcVisualTest::TearDown(); + } + + virtual std::string TestName() const { return "clothoid_100.0_300_-inf_1_Meter"; } + virtual std::string Schema() const { return "IFC4X3_RC4"; } + + const boost::filesystem::path filename = dataPath("clothoid_100.0_300_-inf_1_Meter.ifc"); + + std::shared_ptr express_model = nullptr; + buw::ReferenceCounted> importer = nullptr; +}; + +TEST_F(Clothoid, AllEntitiesAreRead) { + EXPECT_THAT(express_model->entities.size(), Eq(72)); +} + +TEST_F(Clothoid, IFCHasAnEssentialEntity) { + auto result1 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto &pair) -> bool { return pair.second->classname() == "IFCCURVESEGMENT"; }); + auto result2 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto &pair) -> bool { return pair.second->classname() == "IFCCLOTHOID"; }); + EXPECT_NE(result1, express_model->entities.end()); + EXPECT_NE(result2, express_model->entities.end()); +} + +TEST_F(Clothoid, ImageIsSaved) +{ + // Arrange + buw::Image4b image = rendererIfc->captureImage(); + + // Act + buw::storeImage(testPath("clothoid_100.0_300_-inf_1_Meter.png").string(), image); + + // Assert + EXPECT_NO_THROW(buw::loadImage4b(testPath("clothoid_100.0_300_-inf_1_Meter.png").string())); +} + +TEST_F(Clothoid, PlaneSurfaceViews) +{ + // Arrange + const auto expected_top = buw::loadImage4b(dataPath("clothoid_100.0_300_-inf_1_Meter_top.png").string()); + + // Act (Top) + rendererIfc->setViewDirection(buw::eViewDirection::Top); + buw::Image4b image_top = CaptureImage(); + + // uncomment following lines to also save the screen shot + //buw::storeImage(testPath("clothoid_100.0_300_-inf_1_Meter_top.png").string(), image_top); + + // Assert + EXPECT_EQ(image_top, expected_top); +} \ No newline at end of file diff --git a/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_300_1000_1_Meter/CMakeLists.txt b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_300_1000_1_Meter/CMakeLists.txt new file mode 100644 index 000000000..dd541f0a8 --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_300_1000_1_Meter/CMakeLists.txt @@ -0,0 +1,20 @@ +# +# Copyright (c) 2021 Technical University of Munich +# Chair of Computational Modeling and Simulation. +# +# TUM Open Infra Platform is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License Version 3 +# as published by the Free Software Foundation. +# +# TUM Open Infra Platform is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +include(CreateUnitTests) + +CreateIfcFileVisualUnitTestForSchema(clothoid_100.0_300_1000_1_Meter IFC4X3_RC4) diff --git a/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_300_1000_1_Meter/Data/clothoid_100.0_300_1000_1_Meter.ifc b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_300_1000_1_Meter/Data/clothoid_100.0_300_1000_1_Meter.ifc new file mode 100644 index 000000000..ab2b2ac7b --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_300_1000_1_Meter/Data/clothoid_100.0_300_1000_1_Meter.ifc @@ -0,0 +1,81 @@ +ISO-10303-21; +HEADER; +FILE_DESCRIPTION (('ViewDefinition [CoordinationView]'), '2;1'); +FILE_NAME ('Single-LANDXML.ifc', '2021-05-24T11:00:00', ('IFC Rail Technical Services'), ('buildingSMART International RailwayRoom'), 'RailCOMPLETE\X2\FFAE\X0\', '2019.1.1995.0', ''); +FILE_SCHEMA (('IFC4X3_RC4')); +ENDSEC; +DATA; +#1 = IFCPROJECT('1FNFy8AJeHwwz7wDZHIYIu', #3, 'IFC Rail Referencedata', 'Rail alignment sample', $, 'Longname', 'Design', $, #9); +#2 = IFCAPPLICATION(#5, '2019.1.1995.0', 'RailCOMPLETE\X2\00AE\X0\', $); +#3 = IFCOWNERHISTORY(#6, #2, $, .ADDED., 1320688800, $, $, 1320688800); +#4 = IFCPERSON('TS', 'IFC Rail Technical Services', $, $, $, $, $, $); +#5 = IFCORGANIZATION('bsI RWR', 'buildingSmart International Railway Room', $, $, $); +#6 = IFCPERSONANDORGANIZATION(#4, #5, $); +#7 = IFCSIUNIT(*, .LENGTHUNIT., $, .METRE.); +#8 = IFCSIUNIT(*, .PLANEANGLEUNIT., $, .RADIAN.); +#9 = IFCUNITASSIGNMENT((#7, #8)); +#10 = IFCCARTESIANPOINT((0., 0., 0.)); +#11 = IFCDIRECTION((0., 0., 1.)); +#12 = IFCDIRECTION((1., 0., 0.)); +#13 = IFCAXIS2PLACEMENT3D(#10, #11, #12); +#14 = IFCLOCALPLACEMENT($, #13); +#15 = IFCRAILWAY('1FNFy9AJeHwuVmwDZHIYIu', #3, 'optional Railway Name', 'optional Railway Description', $, #14, $, 'Longname for Railway track geometry (alignment)', $, $); +#16 = IFCDIRECTION((0., 1., 0.)); +#17 = IFCGEOMETRICREPRESENTATIONCONTEXT($, 'MODEL', 3, 1.E-5, #13, #16); +#18 = IFCRELAGGREGATES('1FNFyAAJeHwu6TwDZHIYIu', #3, 'Documentation Container', 'Container for IfcProject, collects relevant products', #1, (#15)); +#19 = IFCRELCONTAINEDINSPATIALSTRUCTURE('1FNFyBAJeHwvmywDZHIYIu', #3, 'IfcProducts contained in myIfcRailway', 'Association between IfcProducts and IfcRailway', (#20), #15); +#20 = IFCALIGNMENT('1FNFyCAJeHwxedwDZHIYIu', #3, 'Spor', 'optional Railway Description', $, #48, #51, $, $); +#21 = IFCALIGNMENTHORIZONTAL('1FNFyDAJeHwv87wDZHIYIu', $, $, $, $, #53, #56); +#23 = IFCRELNESTS('3BJTAQrjCHwvVKbERtTLTf', $, $, $, #20, (#21)); +#28 = IFCCARTESIANPOINT((0., 0.)); +#29 = IFCALIGNMENTHORIZONTALSEGMENT($, $, #28, 0., 300., 1000., 100., $, .CLOTHOID.); +#30 = IFCALIGNMENTSEGMENT('1FNFyHAJeHwuDtwDZHIYIu', #3, $, $, $, #37, #40, #29); +#34 = IFCRELNESTS('1FNFyHAJeHwuDtwDZHIYIj', $, $, $, #21, (#30)); +#35 = IFCCOMPOSITECURVE((#36), .F.); +#36 = IFCCURVESEGMENT(.DISCONTINUOUS., #42, IFCPARAMETERVALUE(-142.857142857143), IFCNONNEGATIVELENGTHMEASURE(100.), #45); +#37 = IFCLOCALPLACEMENT($, #38); +#38 = IFCAXIS2PLACEMENT3D(#39, $, $); +#39 = IFCCARTESIANPOINT((0., 0., 0.)); +#40 = IFCPRODUCTDEFINITIONSHAPE($, $, (#41, #71)); +#41 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve2D', (#36)); +#42 = IFCAXIS2PLACEMENT2D(#43, #44); +#43 = IFCCARTESIANPOINT((0., 0.)); +#44 = IFCDIRECTION((1., 0.)); +#45 = IFCCLOTHOID(#46, -207.019667802706); +#46 = IFCAXIS2PLACEMENT2D(#47, $); +#47 = IFCCARTESIANPOINT((0., 0.)); +#48 = IFCLOCALPLACEMENT($, #49); +#49 = IFCAXIS2PLACEMENT3D(#50, $, $); +#50 = IFCCARTESIANPOINT((0., 0., 0.)); +#51 = IFCPRODUCTDEFINITIONSHAPE($, $, (#52, #77)); +#52 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve3D', (#35)); +#53 = IFCLOCALPLACEMENT($, #54); +#54 = IFCAXIS2PLACEMENT3D(#55, $, $); +#55 = IFCCARTESIANPOINT((0., 0., 0.)); +#56 = IFCPRODUCTDEFINITIONSHAPE($, $, (#57, #60)); +#57 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve2D', (#35)); +#58 = IFCCARTESIANPOINTLIST2D(((0., 0.), (9.99998157857806E-1, 1.66277624750033E-3), (1.99998534033737, 6.63553127663857E-3), (2.99995078443388, 1.48948781229202E-2), (3.99988395743782, 2.64173958380884E-2), (4.99977455540432, 4.11796309791161E-2), (5.99961250161492, 5.91580990709502E-2), (6.99938794503112, 8.03292860428488E-2), (7.99909125874164, 1.04669649638967E-1), (8.99871303840128, 1.32155620802717E-1), (9.9982441006641, 1.6276360503566E-1), (10.9976754816092, 1.96469983730713E-1), (11.9969984351606, 2.33251115479938E-1), (12.9962044315006, 2.73083337357162E-1), (13.9952851554776, 3.1594296617545E-1), (14.9942325050079, 3.61806299719721E-1), (15.9930385894722, 4.10649617954612E-1), (16.9916957281071, 4.62449184207774E-1), (17.9901964483906, 5.17181246328761E-1), (18.9885334844241, 5.74822037823718E-1), (19.9866997753087, 6.35347778966033E-1), (20.9846884635177, 6.98734677883092E-1), (21.9824928932642, 7.64958931619352E-1), (22.9801066088656, 8.33996727175935E-1), (23.9775233531034, 9.0582424252681E-1), (24.9747370655795, 9.80417647611913E-1), (25.9717418810694, 1.05775310530723), (26.9685321278716, 1.13780677237212), (27.9651023261544, 1.22055480037403), (28.9614471862989, 1.30597333659078), (29.9575616072401, 1.39403852489064), (30.9534406748047, 1.4847265065903), (31.9490796600466, 1.57801342129105), (32.9444740175805, 1.67387540769326), (33.9396193839125, 1.77228860438931), (34.934511575769, 1.87322915063532), (35.9291465884245, 1.97667318710178), (36.9235205940261, 2.08259685660311), (37.917629939918, 2.1909763048067), (38.9114711469631, 2.30178768092126), (39.9050409078644, 2.41500713836493), (40.8983360854845, 2.53061083541318), (41.8913537111644, 2.64857493582677), (42.8840909830407, 2.76887560946), (43.876545264363, 2.89148903284928), (44.8687140818095, 3.01639138978243), (45.8605951238025, 3.14355887184881), (46.8521862388234, 3.27296767897034), (47.8434854337273, 3.40459401991391), (48.8344908720567, 3.53841411278502), (49.8252008723562, 3.67440418550319), (50.8156139064857, 3.81254047625904), (51.8057285979343, 3.95279923395344), (52.7955437201347, 4.09515671861885), (53.7850581947767, 4.23958920182303), (54.7742710901217, 4.38607296705532), (55.7631816193174, 4.53458431009579), (56.7517891387125, 4.68509953936723), (57.7400931461725, 4.83759497627053), (58.7280932793957, 4.99204695550316), (59.7157893142296, 5.14843182536154), (60.7031811629884, 5.3067259480269), (61.6902688727712, 5.4669056998353), (62.6770526237805, 5.62894747153173), (63.6635327276425, 5.79282766850864), (64.6497096257275, 5.95852271102894), (65.6355838874716, 6.12600903443386), (66.6211562086995, 6.29526308933571), (67.6064274099483, 6.46626134179583), (68.5913984347923, 6.63898027348788), (69.5760703481696, 6.81339638184668), (70.5604443347088, 6.98948618020279), (71.5445216970581, 7.1672261979031), (72.5283038542152, 7.34659298041743), (73.5117923398582, 7.52756308943167), (74.4949888006787, 7.71011310292725), (75.4778949947155, 7.89421961524752), (76.4605127896901, 8.07985923715091), (77.4428441613439, 8.26700859585135), (78.4248911917762, 8.45564433504593), (79.4066560677843, 8.64574311493011), (80.3881410792052, 8.83728161220068), (81.369348617258, 9.03023652004655), (82.350281172889, 9.22458454812771), (83.3309413351173, 9.42030242254251), (84.3113317893831, 9.61736688578338), (85.2914553158965, 9.8157546966813), (86.2713147879886, 10.0154426303391), (87.2509131704641, 10.2164074780539), (88.2302535179554, 10.4186260472287), (89.2093389732783, 10.6220751612739), (90.1881727657893, 10.8267316594977), (91.1667582097451, 11.0325723969869), (92.1450987026629, 11.2395742444779), (93.1231977236824, 11.4477140882174), (94.1010588319304, 11.6569688298139), (95.0786856648857, 11.8673153860798), (96.0560819367465, 12.0787306888646), (97.0332514367991, 12.291191684878), (98.0101980277882, 12.5046753355059), (98.9869256442884, 12.7191586166163)), $); +#59 = IFCINDEXEDPOLYCURVE(#58, $, $); +#60 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#59)); +#61 = IFCOWNERHISTORY(#63, #65, $, .ADDED., 1630842293, $, $, 1630842293); +#62 = IFCORGANIZATION($, '\X2\0410\X0\\X2\0420\X0\ \X2\0414\X0\\X2\0418\X0\ \X2\0415\X0\\X2\0424\X0\ \X2\041E\X0\\X2\041E\X0\\X2\0414\X0\', 'RDF Ltd.', $, $); +#63 = IFCPERSONANDORGANIZATION(#64, #62, $); +#64 = IFCPERSON($, 'Bonsma', 'Peter', $, $, $, $, $); +#65 = IFCAPPLICATION(#62, '0.99', 'Add Check Library Application', 'TA 1001'); +#66 = IFCRELDEFINESBYPROPERTIES('33Wq2J6Ib12hP1Z$xUxTz9', #61, $, $, (#21), #67); +#67 = IFCPROPERTYSET('30i22TRNv78BSCtPKJJxrP', #61, 'ValidationPset', $, (#68)); +#68 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(99.9999785495359), $); +#69 = IFCCARTESIANPOINTLIST2D(((0., 0.), (9.99998157857806E-1, 1.66277624750033E-3), (1.99998534033737, 6.63553127663857E-3), (2.99995078443388, 1.48948781229202E-2), (3.99988395743782, 2.64173958380884E-2), (4.99977455540432, 4.11796309791161E-2), (5.99961250161492, 5.91580990709502E-2), (6.99938794503112, 8.03292860428488E-2), (7.99909125874164, 1.04669649638967E-1), (8.99871303840128, 1.32155620802717E-1), (9.9982441006641, 1.6276360503566E-1), (10.9976754816092, 1.96469983730713E-1), (11.9969984351606, 2.33251115479938E-1), (12.9962044315006, 2.73083337357162E-1), (13.9952851554776, 3.1594296617545E-1), (14.9942325050079, 3.61806299719721E-1), (15.9930385894722, 4.10649617954612E-1), (16.9916957281071, 4.62449184207774E-1), (17.9901964483906, 5.17181246328761E-1), (18.9885334844241, 5.74822037823718E-1), (19.9866997753087, 6.35347778966033E-1), (20.9846884635177, 6.98734677883092E-1), (21.9824928932642, 7.64958931619352E-1), (22.9801066088656, 8.33996727175935E-1), (23.9775233531034, 9.0582424252681E-1), (24.9747370655795, 9.80417647611913E-1), (25.9717418810694, 1.05775310530723), (26.9685321278716, 1.13780677237212), (27.9651023261544, 1.22055480037403), (28.9614471862989, 1.30597333659078), (29.9575616072401, 1.39403852489064), (30.9534406748047, 1.4847265065903), (31.9490796600466, 1.57801342129105), (32.9444740175805, 1.67387540769326), (33.9396193839125, 1.77228860438931), (34.934511575769, 1.87322915063532), (35.9291465884245, 1.97667318710178), (36.9235205940261, 2.08259685660311), (37.917629939918, 2.1909763048067), (38.9114711469631, 2.30178768092126), (39.9050409078644, 2.41500713836493), (40.8983360854845, 2.53061083541318), (41.8913537111644, 2.64857493582677), (42.8840909830407, 2.76887560946), (43.876545264363, 2.89148903284928), (44.8687140818095, 3.01639138978243), (45.8605951238025, 3.14355887184881), (46.8521862388234, 3.27296767897034), (47.8434854337273, 3.40459401991391), (48.8344908720567, 3.53841411278502), (49.8252008723562, 3.67440418550319), (50.8156139064857, 3.81254047625904), (51.8057285979343, 3.95279923395344), (52.7955437201347, 4.09515671861885), (53.7850581947767, 4.23958920182303), (54.7742710901217, 4.38607296705532), (55.7631816193174, 4.53458431009579), (56.7517891387125, 4.68509953936723), (57.7400931461725, 4.83759497627053), (58.7280932793957, 4.99204695550316), (59.7157893142296, 5.14843182536154), (60.7031811629884, 5.3067259480269), (61.6902688727712, 5.4669056998353), (62.6770526237805, 5.62894747153173), (63.6635327276425, 5.79282766850864), (64.6497096257275, 5.95852271102894), (65.6355838874716, 6.12600903443386), (66.6211562086995, 6.29526308933571), (67.6064274099483, 6.46626134179583), (68.5913984347923, 6.63898027348788), (69.5760703481696, 6.81339638184668), (70.5604443347088, 6.98948618020279), (71.5445216970581, 7.1672261979031), (72.5283038542152, 7.34659298041743), (73.5117923398582, 7.52756308943167), (74.4949888006787, 7.71011310292725), (75.4778949947155, 7.89421961524752), (76.4605127896901, 8.07985923715091), (77.4428441613439, 8.26700859585135), (78.4248911917762, 8.45564433504593), (79.4066560677843, 8.64574311493011), (80.3881410792052, 8.83728161220068), (81.369348617258, 9.03023652004655), (82.350281172889, 9.22458454812771), (83.3309413351173, 9.42030242254251), (84.3113317893831, 9.61736688578338), (85.2914553158965, 9.8157546966813), (86.2713147879886, 10.0154426303391), (87.2509131704641, 10.2164074780539), (88.2302535179554, 10.4186260472287), (89.2093389732783, 10.6220751612739), (90.1881727657893, 10.8267316594977), (91.1667582097451, 11.0325723969869), (92.1450987026629, 11.2395742444779), (93.1231977236824, 11.4477140882174), (94.1010588319304, 11.6569688298139), (95.0786856648857, 11.8673153860798), (96.0560819367465, 12.0787306888646), (97.0332514367991, 12.291191684878), (98.0101980277882, 12.5046753355059), (98.9869256442884, 12.7191586166163)), $); +#70 = IFCINDEXEDPOLYCURVE(#69, $, $); +#71 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#70)); +#72 = IFCRELDEFINESBYPROPERTIES('2YqDqKI0v9ce$OC1IWSzRY', #61, $, $, (#30), #73); +#73 = IFCPROPERTYSET('3GMuUnKGTDNRJ0JLCw1Ys6', #61, 'ValidationPset', $, (#74)); +#74 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(99.9999785495359), $); +#75 = IFCCARTESIANPOINTLIST2D(((0., 0.), (9.99998157857806E-1, 1.66277624750033E-3), (1.99998534033737, 6.63553127663857E-3), (2.99995078443388, 1.48948781229202E-2), (3.99988395743782, 2.64173958380884E-2), (4.99977455540432, 4.11796309791161E-2), (5.99961250161492, 5.91580990709502E-2), (6.99938794503112, 8.03292860428488E-2), (7.99909125874164, 1.04669649638967E-1), (8.99871303840128, 1.32155620802717E-1), (9.9982441006641, 1.6276360503566E-1), (10.9976754816092, 1.96469983730713E-1), (11.9969984351606, 2.33251115479938E-1), (12.9962044315006, 2.73083337357162E-1), (13.9952851554776, 3.1594296617545E-1), (14.9942325050079, 3.61806299719721E-1), (15.9930385894722, 4.10649617954612E-1), (16.9916957281071, 4.62449184207774E-1), (17.9901964483906, 5.17181246328761E-1), (18.9885334844241, 5.74822037823718E-1), (19.9866997753087, 6.35347778966033E-1), (20.9846884635177, 6.98734677883092E-1), (21.9824928932642, 7.64958931619352E-1), (22.9801066088656, 8.33996727175935E-1), (23.9775233531034, 9.0582424252681E-1), (24.9747370655795, 9.80417647611913E-1), (25.9717418810694, 1.05775310530723), (26.9685321278716, 1.13780677237212), (27.9651023261544, 1.22055480037403), (28.9614471862989, 1.30597333659078), (29.9575616072401, 1.39403852489064), (30.9534406748047, 1.4847265065903), (31.9490796600466, 1.57801342129105), (32.9444740175805, 1.67387540769326), (33.9396193839125, 1.77228860438931), (34.934511575769, 1.87322915063532), (35.9291465884245, 1.97667318710178), (36.9235205940261, 2.08259685660311), (37.917629939918, 2.1909763048067), (38.9114711469631, 2.30178768092126), (39.9050409078644, 2.41500713836493), (40.8983360854845, 2.53061083541318), (41.8913537111644, 2.64857493582677), (42.8840909830407, 2.76887560946), (43.876545264363, 2.89148903284928), (44.8687140818095, 3.01639138978243), (45.8605951238025, 3.14355887184881), (46.8521862388234, 3.27296767897034), (47.8434854337273, 3.40459401991391), (48.8344908720567, 3.53841411278502), (49.8252008723562, 3.67440418550319), (50.8156139064857, 3.81254047625904), (51.8057285979343, 3.95279923395344), (52.7955437201347, 4.09515671861885), (53.7850581947767, 4.23958920182303), (54.7742710901217, 4.38607296705532), (55.7631816193174, 4.53458431009579), (56.7517891387125, 4.68509953936723), (57.7400931461725, 4.83759497627053), (58.7280932793957, 4.99204695550316), (59.7157893142296, 5.14843182536154), (60.7031811629884, 5.3067259480269), (61.6902688727712, 5.4669056998353), (62.6770526237805, 5.62894747153173), (63.6635327276425, 5.79282766850864), (64.6497096257275, 5.95852271102894), (65.6355838874716, 6.12600903443386), (66.6211562086995, 6.29526308933571), (67.6064274099483, 6.46626134179583), (68.5913984347923, 6.63898027348788), (69.5760703481696, 6.81339638184668), (70.5604443347088, 6.98948618020279), (71.5445216970581, 7.1672261979031), (72.5283038542152, 7.34659298041743), (73.5117923398582, 7.52756308943167), (74.4949888006787, 7.71011310292725), (75.4778949947155, 7.89421961524752), (76.4605127896901, 8.07985923715091), (77.4428441613439, 8.26700859585135), (78.4248911917762, 8.45564433504593), (79.4066560677843, 8.64574311493011), (80.3881410792052, 8.83728161220068), (81.369348617258, 9.03023652004655), (82.350281172889, 9.22458454812771), (83.3309413351173, 9.42030242254251), (84.3113317893831, 9.61736688578338), (85.2914553158965, 9.8157546966813), (86.2713147879886, 10.0154426303391), (87.2509131704641, 10.2164074780539), (88.2302535179554, 10.4186260472287), (89.2093389732783, 10.6220751612739), (90.1881727657893, 10.8267316594977), (91.1667582097451, 11.0325723969869), (92.1450987026629, 11.2395742444779), (93.1231977236824, 11.4477140882174), (94.1010588319304, 11.6569688298139), (95.0786856648857, 11.8673153860798), (96.0560819367465, 12.0787306888646), (97.0332514367991, 12.291191684878), (98.0101980277882, 12.5046753355059), (98.9869256442884, 12.7191586166163)), $); +#76 = IFCINDEXEDPOLYCURVE(#75, $, $); +#77 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#76)); +#78 = IFCRELDEFINESBYPROPERTIES('1rCPaw$5DBsBJwTvcUien5', #61, $, $, (#20), #79); +#79 = IFCPROPERTYSET('38SH0e$4H6s8BIAuwulJsf', #61, 'ValidationPset', $, (#80)); +#80 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(99.9999785495359), $); +ENDSEC; +END-ISO-10303-21; diff --git a/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_300_1000_1_Meter/Data/clothoid_100.0_300_1000_1_Meter.png b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_300_1000_1_Meter/Data/clothoid_100.0_300_1000_1_Meter.png new file mode 100644 index 000000000..748504751 Binary files /dev/null and b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_300_1000_1_Meter/Data/clothoid_100.0_300_1000_1_Meter.png differ diff --git a/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_300_1000_1_Meter/Data/clothoid_100.0_300_1000_1_Meter_top.png b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_300_1000_1_Meter/Data/clothoid_100.0_300_1000_1_Meter_top.png new file mode 100644 index 000000000..1fed3770c Binary files /dev/null and b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_300_1000_1_Meter/Data/clothoid_100.0_300_1000_1_Meter_top.png differ diff --git a/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_300_1000_1_Meter/src/clothoid_100.0_300_1000_1_Meter.cpp b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_300_1000_1_Meter/src/clothoid_100.0_300_1000_1_Meter.cpp new file mode 100644 index 000000000..a59628596 --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_300_1000_1_Meter/src/clothoid_100.0_300_1000_1_Meter.cpp @@ -0,0 +1,98 @@ +/* + Copyright (c) 2021 Technical University of Munich + Chair of Computational Modeling and Simulation. + + TUM Open Infra Platform is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License Version 3 + as published by the Free Software Foundation. + + TUM Open Infra Platform is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include +#include + +#include + +#include +#include +#include + +using namespace testing; + +class Clothoid : public IfcVisualTest { +protected: + + // Test standard values + buw::Image4b _background = buw::Image4b(0, 0); + + virtual void SetUp() override { + IfcVisualTest::SetUp(); + + express_model = OpenInfraPlatform::IFC4X3_RC4::IFC4X3_RC4Reader::FromFile(filename.string()); + + importer = buw::makeReferenceCounted>(); + auto model = importer->collectData(express_model); + + _background = rendererIfc->captureImage(); + rendererIfc->setModel(model[0]); + } + + virtual void TearDown() override { + express_model.reset(); + IfcVisualTest::TearDown(); + } + + virtual std::string TestName() const { return "clothoid_100.0_300_1000_1_Meter"; } + virtual std::string Schema() const { return "IFC4X3_RC4"; } + + const boost::filesystem::path filename = dataPath("clothoid_100.0_300_1000_1_Meter.ifc"); + + std::shared_ptr express_model = nullptr; + buw::ReferenceCounted> importer = nullptr; +}; + +TEST_F(Clothoid, AllEntitiesAreRead) { + EXPECT_THAT(express_model->entities.size(), Eq(72)); +} + +TEST_F(Clothoid, IFCHasAnEssentialEntity) { + auto result1 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto &pair) -> bool { return pair.second->classname() == "IFCCURVESEGMENT"; }); + auto result2 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto &pair) -> bool { return pair.second->classname() == "IFCCLOTHOID"; }); + EXPECT_NE(result1, express_model->entities.end()); + EXPECT_NE(result2, express_model->entities.end()); +} + +TEST_F(Clothoid, ImageIsSaved) +{ + // Arrange + buw::Image4b image = rendererIfc->captureImage(); + + // Act + buw::storeImage(testPath("clothoid_100.0_300_1000_1_Meter.png").string(), image); + + // Assert + EXPECT_NO_THROW(buw::loadImage4b(testPath("clothoid_100.0_300_1000_1_Meter.png").string())); +} + +TEST_F(Clothoid, PlaneSurfaceViews) +{ + // Arrange + const auto expected_top = buw::loadImage4b(dataPath("clothoid_100.0_300_1000_1_Meter_top.png").string()); + + // Act (Top) + rendererIfc->setViewDirection(buw::eViewDirection::Top); + buw::Image4b image_top = CaptureImage(); + + // uncomment following lines to also save the screen shot + //buw::storeImage(testPath("clothoid_100.0_300_1000_1_Meter_top.png").string(), image_top); + + // Assert + EXPECT_EQ(image_top, expected_top); +} diff --git a/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_300_inf_1_Meter/CMakeLists.txt b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_300_inf_1_Meter/CMakeLists.txt new file mode 100644 index 000000000..3d3190766 --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_300_inf_1_Meter/CMakeLists.txt @@ -0,0 +1,20 @@ +# +# Copyright (c) 2021 Technical University of Munich +# Chair of Computational Modeling and Simulation. +# +# TUM Open Infra Platform is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License Version 3 +# as published by the Free Software Foundation. +# +# TUM Open Infra Platform is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +include(CreateUnitTests) + +CreateIfcFileVisualUnitTestForSchema(clothoid_100.0_300_inf_1_Meter IFC4X3_RC4) diff --git a/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_300_inf_1_Meter/Data/clothoid_100.0_300_inf_1_Meter.ifc b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_300_inf_1_Meter/Data/clothoid_100.0_300_inf_1_Meter.ifc new file mode 100644 index 000000000..3677c66ce --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_300_inf_1_Meter/Data/clothoid_100.0_300_inf_1_Meter.ifc @@ -0,0 +1,81 @@ +ISO-10303-21; +HEADER; +FILE_DESCRIPTION (('ViewDefinition [CoordinationView]'), '2;1'); +FILE_NAME ('Single-LANDXML.ifc', '2021-05-24T11:00:00', ('IFC Rail Technical Services'), ('buildingSMART International RailwayRoom'), 'RailCOMPLETE\X2\FFAE\X0\', '2019.1.1995.0', ''); +FILE_SCHEMA (('IFC4X3_RC4')); +ENDSEC; +DATA; +#1 = IFCPROJECT('1FNFy8AJeHwwz7wDZHIYIu', #3, 'IFC Rail Referencedata', 'Rail alignment sample', $, 'Longname', 'Design', $, #9); +#2 = IFCAPPLICATION(#5, '2019.1.1995.0', 'RailCOMPLETE\X2\00AE\X0\', $); +#3 = IFCOWNERHISTORY(#6, #2, $, .ADDED., 1320688800, $, $, 1320688800); +#4 = IFCPERSON('TS', 'IFC Rail Technical Services', $, $, $, $, $, $); +#5 = IFCORGANIZATION('bsI RWR', 'buildingSmart International Railway Room', $, $, $); +#6 = IFCPERSONANDORGANIZATION(#4, #5, $); +#7 = IFCSIUNIT(*, .LENGTHUNIT., $, .METRE.); +#8 = IFCSIUNIT(*, .PLANEANGLEUNIT., $, .RADIAN.); +#9 = IFCUNITASSIGNMENT((#7, #8)); +#10 = IFCCARTESIANPOINT((0., 0., 0.)); +#11 = IFCDIRECTION((0., 0., 1.)); +#12 = IFCDIRECTION((1., 0., 0.)); +#13 = IFCAXIS2PLACEMENT3D(#10, #11, #12); +#14 = IFCLOCALPLACEMENT($, #13); +#15 = IFCRAILWAY('1FNFy9AJeHwuVmwDZHIYIu', #3, 'optional Railway Name', 'optional Railway Description', $, #14, $, 'Longname for Railway track geometry (alignment)', $, $); +#16 = IFCDIRECTION((0., 1., 0.)); +#17 = IFCGEOMETRICREPRESENTATIONCONTEXT($, 'MODEL', 3, 1.E-5, #13, #16); +#18 = IFCRELAGGREGATES('1FNFyAAJeHwu6TwDZHIYIu', #3, 'Documentation Container', 'Container for IfcProject, collects relevant products', #1, (#15)); +#19 = IFCRELCONTAINEDINSPATIALSTRUCTURE('1FNFyBAJeHwvmywDZHIYIu', #3, 'IfcProducts contained in myIfcRailway', 'Association between IfcProducts and IfcRailway', (#20), #15); +#20 = IFCALIGNMENT('1FNFyCAJeHwxedwDZHIYIu', #3, 'Spor', 'optional Railway Description', $, #48, #51, $, $); +#21 = IFCALIGNMENTHORIZONTAL('1FNFyDAJeHwv87wDZHIYIu', $, $, $, $, #53, #56); +#23 = IFCRELNESTS('3BJTAQrjCHwvVKbERtTLTf', $, $, $, #20, (#21)); +#28 = IFCCARTESIANPOINT((0., 0.)); +#29 = IFCALIGNMENTHORIZONTALSEGMENT($, $, #28, 0., 300., 0., 100., $, .CLOTHOID.); +#30 = IFCALIGNMENTSEGMENT('1FNFyHAJeHwuDtwDZHIYIu', #3, $, $, $, #37, #40, #29); +#34 = IFCRELNESTS('1FNFyHAJeHwuDtwDZHIYIj', $, $, $, #21, (#30)); +#35 = IFCCOMPOSITECURVE((#36), .F.); +#36 = IFCCURVESEGMENT(.DISCONTINUOUS., #42, IFCPARAMETERVALUE(-100.), IFCNONNEGATIVELENGTHMEASURE(100.), #45); +#37 = IFCLOCALPLACEMENT($, #38); +#38 = IFCAXIS2PLACEMENT3D(#39, $, $); +#39 = IFCCARTESIANPOINT((0., 0., 0.)); +#40 = IFCPRODUCTDEFINITIONSHAPE($, $, (#41, #71)); +#41 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve2D', (#36)); +#42 = IFCAXIS2PLACEMENT2D(#43, #44); +#43 = IFCCARTESIANPOINT((0., 0.)); +#44 = IFCDIRECTION((1., 0.)); +#45 = IFCCLOTHOID(#46, -173.205080756888); +#46 = IFCAXIS2PLACEMENT2D(#47, $); +#47 = IFCCARTESIANPOINT((0., 0.)); +#48 = IFCLOCALPLACEMENT($, #49); +#49 = IFCAXIS2PLACEMENT3D(#50, $, $); +#50 = IFCCARTESIANPOINT((0., 0., 0.)); +#51 = IFCPRODUCTDEFINITIONSHAPE($, $, (#52, #77)); +#52 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve3D', (#35)); +#53 = IFCLOCALPLACEMENT($, #54); +#54 = IFCAXIS2PLACEMENT3D(#55, $, $); +#55 = IFCCARTESIANPOINT((0., 0., 0.)); +#56 = IFCPRODUCTDEFINITIONSHAPE($, $, (#57, #60)); +#57 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve2D', (#35)); +#58 = IFCCARTESIANPOINTLIST2D(((0., 0.), (9.99998162010282E-1, 1.66110958634486E-3), (1.99998540655037, 6.62219811856807E-3), (2.99995111848775, 1.48498794443812E-2), (3.99988500957765, 2.63107347002508E-2), (4.9997771152241, 4.09713143974142E-2), (5.99961779123027, 5.87981404542712E-2), (6.99939771053855, 7.97577081756171E-2), (7.99910785996089, 1.03816488179266E-1), (8.99873953690001, 1.3094092827057E-1), (9.99828434606158, 1.61097455265321E-1), (10.9977341961583, 1.94252476761617E-1), (11.9970812966063, 2.3037238286118E-1), (12.9963181542133, 2.69423547840615E-1), (13.995437569861, 3.11372331773263E-1), (14.99443263518, 3.56185082102013E-1), (15.9932967292185, 4.03828135163766E-1), (16.9920235151059, 4.54267817665969E-1), (17.9906069367105, 5.07470448115852E-1), (18.9890412152921, 5.63402338202835E-1), (19.9873208461503, 6.22029794134716E-1), (20.9854405952682, 6.83319117928095E-1), (21.9833954959522, 7.47236608653708E-1), (22.9811808454681, 8.13748563637118E-1), (23.978792201674, 8.82821279615344E-1), (24.97622537965, 9.5442105384999E-1), (25.9734764483251, 1.02851418519745), (26.9705417271021, 1.10506697513666), (27.9674177824799, 1.1840457287551), (28.9641014246739, 1.2654167556934), (29.960589704235, 1.34914637104936), (30.956879908667, 1.43520089624168), (31.952969559043, 1.5235466598342), (32.9488564066208, 1.61414999832099), (33.9445384294578, 1.70697725687308), (34.9400138290245, 1.80199479004719), (35.9352810268195, 1.89916896245714), (36.9303386609822, 1.99846614940848), (37.9251855829077, 2.09985273749689), (38.91982085386, 2.20329512517092), (39.9142437415876, 2.30875972325963), (40.9084537169379, 2.41621295546572), (41.9024504504736, 2.52562125882472), (42.8962338090893, 2.6369510841307), (43.8898038526297, 2.75016889632925), (44.8831608305081, 2.86524117487813), (45.8763051783272, 2.98213441407625), (46.8692375145007, 3.10081512336151), (47.8619586368762, 3.22124982757807), (48.8544695193603, 3.34340506721362), (49.846771308545, 3.46724739860722), (50.838865320336, 3.59274339412826), (51.8307530365829, 3.71985964232712), (52.8224361017109, 3.8485627480581), (53.8139163193552, 3.97881933257512), (54.8051956489972, 4.11059603360093), (55.7962762026022, 4.24385950537011), (56.7871602412603, 4.3785764186467), (57.7778501718286, 4.5147134607169), (58.7683485435763, 4.65223733535734), (59.7586580448313, 4.79111476277967), (60.7487814996301, 4.93131247955176), (61.7387218643691, 5.07279723849641), (62.7284822244584, 5.21553580856776), (63.7180657909785, 5.35949497470635), (64.7074758973387, 5.504641537673), (65.6967159959379, 5.65094231386237), (66.685789654828, 5.79836413509665), (67.6747005543797, 5.94687384839988), (68.6634524839499, 6.09643831575357), (69.6520493385519, 6.2470244138341), (70.6404951155283, 6.39859903373245), (71.6287939112249, 6.55112908065694), (72.6169499176679, 6.70458147361937), (73.6049674192428, 6.85892314510517), (74.5928507893753, 7.01412104072823), (75.5806044872145, 7.17014211887078), (76.568233054318, 7.32695335030904), (77.5557411113392, 7.48452171782506), (78.543133354716, 7.64281421580538), (79.5304145533619, 7.80179784982709), (80.5175895453586, 7.96143963623175), (81.5046632346504, 8.12170660168778), (82.4916405877404, 8.28256578274189), (83.4785266303881, 8.44398422536007), (84.4653264443087, 8.60592898445867), (85.4520451638735, 8.76836712342618), (86.4386879728125, 8.93126571363624), (87.4252601009173, 9.09459183395234), (88.4117668207462, 9.25831257022499), (89.3982134443292, 9.42239501478159), (90.3846053198759, 9.58680626590982), (91.3709478284822, 9.75151342733504), (92.3572463808401, 9.91648360769204), (93.3435064139461, 10.0816839199921), (94.3297333878127, 10.2470814810853), (95.3159327821781, 10.4126434111195), (96.3021100932187, 10.5783368329956), (97.2882708302601, 10.7441288718202), (98.2744205124901, 10.9099866543562), (99.2605646656709, 11.0758773084715)), $); +#59 = IFCINDEXEDPOLYCURVE(#58, $, $); +#60 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#59)); +#61 = IFCOWNERHISTORY(#63, #65, $, .ADDED., 1630842293, $, $, 1630842293); +#62 = IFCORGANIZATION($, '\X2\0410\X0\\X2\0420\X0\ \X2\0414\X0\\X2\0418\X0\ \X2\0415\X0\\X2\0424\X0\ \X2\041E\X0\\X2\041E\X0\\X2\0414\X0\', 'RDF Ltd.', $, $); +#63 = IFCPERSONANDORGANIZATION(#64, #62, $); +#64 = IFCPERSON($, 'Bonsma', 'Peter', $, $, $, $, $); +#65 = IFCAPPLICATION(#62, '0.99', 'Add Check Library Application', 'TA 1001'); +#66 = IFCRELDEFINESBYPROPERTIES('2qRCF2fSD3xvrYlQEFAAhb', #61, $, $, (#21), #67); +#67 = IFCPROPERTYSET('3Jtsp9cSPEqwg31d_n_dki', #61, 'ValidationPset', $, (#68)); +#68 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(99.9999845682112), $); +#69 = IFCCARTESIANPOINTLIST2D(((0., 0.), (9.99998162010282E-1, 1.66110958634486E-3), (1.99998540655037, 6.62219811856807E-3), (2.99995111848775, 1.48498794443812E-2), (3.99988500957765, 2.63107347002508E-2), (4.9997771152241, 4.09713143974142E-2), (5.99961779123027, 5.87981404542712E-2), (6.99939771053855, 7.97577081756171E-2), (7.99910785996089, 1.03816488179266E-1), (8.99873953690001, 1.3094092827057E-1), (9.99828434606158, 1.61097455265321E-1), (10.9977341961583, 1.94252476761617E-1), (11.9970812966063, 2.3037238286118E-1), (12.9963181542133, 2.69423547840615E-1), (13.995437569861, 3.11372331773263E-1), (14.99443263518, 3.56185082102013E-1), (15.9932967292185, 4.03828135163766E-1), (16.9920235151059, 4.54267817665969E-1), (17.9906069367105, 5.07470448115852E-1), (18.9890412152921, 5.63402338202835E-1), (19.9873208461503, 6.22029794134716E-1), (20.9854405952682, 6.83319117928095E-1), (21.9833954959522, 7.47236608653708E-1), (22.9811808454681, 8.13748563637118E-1), (23.978792201674, 8.82821279615344E-1), (24.97622537965, 9.5442105384999E-1), (25.9734764483251, 1.02851418519745), (26.9705417271021, 1.10506697513666), (27.9674177824799, 1.1840457287551), (28.9641014246739, 1.2654167556934), (29.960589704235, 1.34914637104936), (30.956879908667, 1.43520089624168), (31.952969559043, 1.5235466598342), (32.9488564066208, 1.61414999832099), (33.9445384294578, 1.70697725687308), (34.9400138290245, 1.80199479004719), (35.9352810268195, 1.89916896245714), (36.9303386609822, 1.99846614940848), (37.9251855829077, 2.09985273749689), (38.91982085386, 2.20329512517092), (39.9142437415876, 2.30875972325963), (40.9084537169379, 2.41621295546572), (41.9024504504736, 2.52562125882472), (42.8962338090893, 2.6369510841307), (43.8898038526297, 2.75016889632925), (44.8831608305081, 2.86524117487813), (45.8763051783272, 2.98213441407625), (46.8692375145007, 3.10081512336151), (47.8619586368762, 3.22124982757807), (48.8544695193603, 3.34340506721362), (49.846771308545, 3.46724739860722), (50.838865320336, 3.59274339412826), (51.8307530365829, 3.71985964232712), (52.8224361017109, 3.8485627480581), (53.8139163193552, 3.97881933257512), (54.8051956489972, 4.11059603360093), (55.7962762026022, 4.24385950537011), (56.7871602412603, 4.3785764186467), (57.7778501718286, 4.5147134607169), (58.7683485435763, 4.65223733535734), (59.7586580448313, 4.79111476277967), (60.7487814996301, 4.93131247955176), (61.7387218643691, 5.07279723849641), (62.7284822244584, 5.21553580856776), (63.7180657909785, 5.35949497470635), (64.7074758973387, 5.504641537673), (65.6967159959379, 5.65094231386237), (66.685789654828, 5.79836413509665), (67.6747005543797, 5.94687384839988), (68.6634524839499, 6.09643831575357), (69.6520493385519, 6.2470244138341), (70.6404951155283, 6.39859903373245), (71.6287939112249, 6.55112908065694), (72.6169499176679, 6.70458147361937), (73.6049674192428, 6.85892314510517), (74.5928507893753, 7.01412104072823), (75.5806044872145, 7.17014211887078), (76.568233054318, 7.32695335030904), (77.5557411113392, 7.48452171782506), (78.543133354716, 7.64281421580538), (79.5304145533619, 7.80179784982709), (80.5175895453586, 7.96143963623175), (81.5046632346504, 8.12170660168778), (82.4916405877404, 8.28256578274189), (83.4785266303881, 8.44398422536007), (84.4653264443087, 8.60592898445867), (85.4520451638735, 8.76836712342618), (86.4386879728125, 8.93126571363624), (87.4252601009173, 9.09459183395234), (88.4117668207462, 9.25831257022499), (89.3982134443292, 9.42239501478159), (90.3846053198759, 9.58680626590982), (91.3709478284822, 9.75151342733504), (92.3572463808401, 9.91648360769204), (93.3435064139461, 10.0816839199921), (94.3297333878127, 10.2470814810853), (95.3159327821781, 10.4126434111195), (96.3021100932187, 10.5783368329956), (97.2882708302601, 10.7441288718202), (98.2744205124901, 10.9099866543562), (99.2605646656709, 11.0758773084715)), $); +#70 = IFCINDEXEDPOLYCURVE(#69, $, $); +#71 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#70)); +#72 = IFCRELDEFINESBYPROPERTIES('0JjK408Jr4kgRlVTiQak03', #61, $, $, (#30), #73); +#73 = IFCPROPERTYSET('0jYQjEJjH5AA4SbVuUtrVD', #61, 'ValidationPset', $, (#74)); +#74 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(99.9999845682112), $); +#75 = IFCCARTESIANPOINTLIST2D(((0., 0.), (9.99998162010282E-1, 1.66110958634486E-3), (1.99998540655037, 6.62219811856807E-3), (2.99995111848775, 1.48498794443812E-2), (3.99988500957765, 2.63107347002508E-2), (4.9997771152241, 4.09713143974142E-2), (5.99961779123027, 5.87981404542712E-2), (6.99939771053855, 7.97577081756171E-2), (7.99910785996089, 1.03816488179266E-1), (8.99873953690001, 1.3094092827057E-1), (9.99828434606158, 1.61097455265321E-1), (10.9977341961583, 1.94252476761617E-1), (11.9970812966063, 2.3037238286118E-1), (12.9963181542133, 2.69423547840615E-1), (13.995437569861, 3.11372331773263E-1), (14.99443263518, 3.56185082102013E-1), (15.9932967292185, 4.03828135163766E-1), (16.9920235151059, 4.54267817665969E-1), (17.9906069367105, 5.07470448115852E-1), (18.9890412152921, 5.63402338202835E-1), (19.9873208461503, 6.22029794134716E-1), (20.9854405952682, 6.83319117928095E-1), (21.9833954959522, 7.47236608653708E-1), (22.9811808454681, 8.13748563637118E-1), (23.978792201674, 8.82821279615344E-1), (24.97622537965, 9.5442105384999E-1), (25.9734764483251, 1.02851418519745), (26.9705417271021, 1.10506697513666), (27.9674177824799, 1.1840457287551), (28.9641014246739, 1.2654167556934), (29.960589704235, 1.34914637104936), (30.956879908667, 1.43520089624168), (31.952969559043, 1.5235466598342), (32.9488564066208, 1.61414999832099), (33.9445384294578, 1.70697725687308), (34.9400138290245, 1.80199479004719), (35.9352810268195, 1.89916896245714), (36.9303386609822, 1.99846614940848), (37.9251855829077, 2.09985273749689), (38.91982085386, 2.20329512517092), (39.9142437415876, 2.30875972325963), (40.9084537169379, 2.41621295546572), (41.9024504504736, 2.52562125882472), (42.8962338090893, 2.6369510841307), (43.8898038526297, 2.75016889632925), (44.8831608305081, 2.86524117487813), (45.8763051783272, 2.98213441407625), (46.8692375145007, 3.10081512336151), (47.8619586368762, 3.22124982757807), (48.8544695193603, 3.34340506721362), (49.846771308545, 3.46724739860722), (50.838865320336, 3.59274339412826), (51.8307530365829, 3.71985964232712), (52.8224361017109, 3.8485627480581), (53.8139163193552, 3.97881933257512), (54.8051956489972, 4.11059603360093), (55.7962762026022, 4.24385950537011), (56.7871602412603, 4.3785764186467), (57.7778501718286, 4.5147134607169), (58.7683485435763, 4.65223733535734), (59.7586580448313, 4.79111476277967), (60.7487814996301, 4.93131247955176), (61.7387218643691, 5.07279723849641), (62.7284822244584, 5.21553580856776), (63.7180657909785, 5.35949497470635), (64.7074758973387, 5.504641537673), (65.6967159959379, 5.65094231386237), (66.685789654828, 5.79836413509665), (67.6747005543797, 5.94687384839988), (68.6634524839499, 6.09643831575357), (69.6520493385519, 6.2470244138341), (70.6404951155283, 6.39859903373245), (71.6287939112249, 6.55112908065694), (72.6169499176679, 6.70458147361937), (73.6049674192428, 6.85892314510517), (74.5928507893753, 7.01412104072823), (75.5806044872145, 7.17014211887078), (76.568233054318, 7.32695335030904), (77.5557411113392, 7.48452171782506), (78.543133354716, 7.64281421580538), (79.5304145533619, 7.80179784982709), (80.5175895453586, 7.96143963623175), (81.5046632346504, 8.12170660168778), (82.4916405877404, 8.28256578274189), (83.4785266303881, 8.44398422536007), (84.4653264443087, 8.60592898445867), (85.4520451638735, 8.76836712342618), (86.4386879728125, 8.93126571363624), (87.4252601009173, 9.09459183395234), (88.4117668207462, 9.25831257022499), (89.3982134443292, 9.42239501478159), (90.3846053198759, 9.58680626590982), (91.3709478284822, 9.75151342733504), (92.3572463808401, 9.91648360769204), (93.3435064139461, 10.0816839199921), (94.3297333878127, 10.2470814810853), (95.3159327821781, 10.4126434111195), (96.3021100932187, 10.5783368329956), (97.2882708302601, 10.7441288718202), (98.2744205124901, 10.9099866543562), (99.2605646656709, 11.0758773084715)), $); +#76 = IFCINDEXEDPOLYCURVE(#75, $, $); +#77 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#76)); +#78 = IFCRELDEFINESBYPROPERTIES('1R_96rWuj3F95oP6bLbRLx', #61, $, $, (#20), #79); +#79 = IFCPROPERTYSET('0HHDW8NE51sv0I$Nxhmm0H', #61, 'ValidationPset', $, (#80)); +#80 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(99.9999845682112), $); +ENDSEC; +END-ISO-10303-21; diff --git a/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_300_inf_1_Meter/Data/clothoid_100.0_300_inf_1_Meter.png b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_300_inf_1_Meter/Data/clothoid_100.0_300_inf_1_Meter.png new file mode 100644 index 000000000..59fec4263 Binary files /dev/null and b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_300_inf_1_Meter/Data/clothoid_100.0_300_inf_1_Meter.png differ diff --git a/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_300_inf_1_Meter/Data/clothoid_100.0_300_inf_1_Meter_top.png b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_300_inf_1_Meter/Data/clothoid_100.0_300_inf_1_Meter_top.png new file mode 100644 index 000000000..8364b4176 Binary files /dev/null and b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_300_inf_1_Meter/Data/clothoid_100.0_300_inf_1_Meter_top.png differ diff --git a/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_300_inf_1_Meter/src/clothoid_100.0_300_inf_1_Meter.cpp b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_300_inf_1_Meter/src/clothoid_100.0_300_inf_1_Meter.cpp new file mode 100644 index 000000000..853e8e015 --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_300_inf_1_Meter/src/clothoid_100.0_300_inf_1_Meter.cpp @@ -0,0 +1,98 @@ +/* + Copyright (c) 2021 Technical University of Munich + Chair of Computational Modeling and Simulation. + + TUM Open Infra Platform is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License Version 3 + as published by the Free Software Foundation. + + TUM Open Infra Platform is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include +#include + +#include + +#include +#include +#include + +using namespace testing; + +class Clothoid : public IfcVisualTest { +protected: + + // Test standard values + buw::Image4b _background = buw::Image4b(0, 0); + + virtual void SetUp() override { + IfcVisualTest::SetUp(); + + express_model = OpenInfraPlatform::IFC4X3_RC4::IFC4X3_RC4Reader::FromFile(filename.string()); + + importer = buw::makeReferenceCounted>(); + auto model = importer->collectData(express_model); + + _background = rendererIfc->captureImage(); + rendererIfc->setModel(model[0]); + } + + virtual void TearDown() override { + express_model.reset(); + IfcVisualTest::TearDown(); + } + + virtual std::string TestName() const { return "clothoid_100.0_300_inf_1_Meter"; } + virtual std::string Schema() const { return "IFC4X3_RC4"; } + + const boost::filesystem::path filename = dataPath("clothoid_100.0_300_inf_1_Meter.ifc"); + + std::shared_ptr express_model = nullptr; + buw::ReferenceCounted> importer = nullptr; +}; + +TEST_F(Clothoid, AllEntitiesAreRead) { + EXPECT_THAT(express_model->entities.size(), Eq(72)); +} + +TEST_F(Clothoid, IFCHasAnEssentialEntity) { + auto result1 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto &pair) -> bool { return pair.second->classname() == "IFCCURVESEGMENT"; }); + auto result2 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto &pair) -> bool { return pair.second->classname() == "IFCCLOTHOID"; }); + EXPECT_NE(result1, express_model->entities.end()); + EXPECT_NE(result2, express_model->entities.end()); +} + +TEST_F(Clothoid, ImageIsSaved) +{ + // Arrange + buw::Image4b image = rendererIfc->captureImage(); + + // Act + buw::storeImage(testPath("clothoid_100.0_300_inf_1_Meter.png").string(), image); + + // Assert + EXPECT_NO_THROW(buw::loadImage4b(testPath("clothoid_100.0_300_inf_1_Meter.png").string())); +} + +TEST_F(Clothoid, PlaneSurfaceViews) +{ + // Arrange + const auto expected_top = buw::loadImage4b(dataPath("clothoid_100.0_300_inf_1_Meter_top.png").string()); + + // Act (Top) + rendererIfc->setViewDirection(buw::eViewDirection::Top); + buw::Image4b image_top = CaptureImage(); + + // uncomment following lines to also save the screen shot + //buw::storeImage(testPath("clothoid_100.0_300_inf_1_Meter_top1.png").string(), image_top); + + // Assert + EXPECT_EQ(image_top, expected_top); +} \ No newline at end of file diff --git a/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_inf_300_1_Meter/CMakeLists.txt b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_inf_300_1_Meter/CMakeLists.txt new file mode 100644 index 000000000..bea39b365 --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_inf_300_1_Meter/CMakeLists.txt @@ -0,0 +1,20 @@ +# +# Copyright (c) 2021 Technical University of Munich +# Chair of Computational Modeling and Simulation. +# +# TUM Open Infra Platform is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License Version 3 +# as published by the Free Software Foundation. +# +# TUM Open Infra Platform is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +include(CreateUnitTests) + +CreateIfcFileVisualUnitTestForSchema(clothoid_100.0_inf_300_1_Meter IFC4X3_RC4) diff --git a/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_inf_300_1_Meter/Data/clothoid_100.0_inf_300_1_Meter.ifc b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_inf_300_1_Meter/Data/clothoid_100.0_inf_300_1_Meter.ifc new file mode 100644 index 000000000..ca8beb58b --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_inf_300_1_Meter/Data/clothoid_100.0_inf_300_1_Meter.ifc @@ -0,0 +1,81 @@ +ISO-10303-21; +HEADER; +FILE_DESCRIPTION (('ViewDefinition [CoordinationView]'), '2;1'); +FILE_NAME ('Single-LANDXML.ifc', '2021-05-24T11:00:00', ('IFC Rail Technical Services'), ('buildingSMART International RailwayRoom'), 'RailCOMPLETE\X2\FFAE\X0\', '2019.1.1995.0', ''); +FILE_SCHEMA (('IFC4X3_RC4')); +ENDSEC; +DATA; +#1 = IFCPROJECT('1FNFy8AJeHwwz7wDZHIYIu', #3, 'IFC Rail Referencedata', 'Rail alignment sample', $, 'Longname', 'Design', $, #9); +#2 = IFCAPPLICATION(#5, '2019.1.1995.0', 'RailCOMPLETE\X2\00AE\X0\', $); +#3 = IFCOWNERHISTORY(#6, #2, $, .ADDED., 1320688800, $, $, 1320688800); +#4 = IFCPERSON('TS', 'IFC Rail Technical Services', $, $, $, $, $, $); +#5 = IFCORGANIZATION('bsI RWR', 'buildingSmart International Railway Room', $, $, $); +#6 = IFCPERSONANDORGANIZATION(#4, #5, $); +#7 = IFCSIUNIT(*, .LENGTHUNIT., $, .METRE.); +#8 = IFCSIUNIT(*, .PLANEANGLEUNIT., $, .RADIAN.); +#9 = IFCUNITASSIGNMENT((#7, #8)); +#10 = IFCCARTESIANPOINT((0., 0., 0.)); +#11 = IFCDIRECTION((0., 0., 1.)); +#12 = IFCDIRECTION((1., 0., 0.)); +#13 = IFCAXIS2PLACEMENT3D(#10, #11, #12); +#14 = IFCLOCALPLACEMENT($, #13); +#15 = IFCRAILWAY('1FNFy9AJeHwuVmwDZHIYIu', #3, 'optional Railway Name', 'optional Railway Description', $, #14, $, 'Longname for Railway track geometry (alignment)', $, $); +#16 = IFCDIRECTION((0., 1., 0.)); +#17 = IFCGEOMETRICREPRESENTATIONCONTEXT($, 'MODEL', 3, 1.E-5, #13, #16); +#18 = IFCRELAGGREGATES('1FNFyAAJeHwu6TwDZHIYIu', #3, 'Documentation Container', 'Container for IfcProject, collects relevant products', #1, (#15)); +#19 = IFCRELCONTAINEDINSPATIALSTRUCTURE('1FNFyBAJeHwvmywDZHIYIu', #3, 'IfcProducts contained in myIfcRailway', 'Association between IfcProducts and IfcRailway', (#20), #15); +#20 = IFCALIGNMENT('1FNFyCAJeHwxedwDZHIYIu', #3, 'Spor', 'optional Railway Description', $, #48, #51, $, $); +#21 = IFCALIGNMENTHORIZONTAL('1FNFyDAJeHwv87wDZHIYIu', $, $, $, $, #53, #56); +#23 = IFCRELNESTS('3BJTAQrjCHwvVKbERtTLTf', $, $, $, #20, (#21)); +#28 = IFCCARTESIANPOINT((0., 0.)); +#29 = IFCALIGNMENTHORIZONTALSEGMENT($, $, #28, 0., 0., 300., 100., $, .CLOTHOID.); +#30 = IFCALIGNMENTSEGMENT('1FNFyHAJeHwuDtwDZHIYIu', #3, $, $, $, #37, #40, #29); +#34 = IFCRELNESTS('1FNFyHAJeHwuDtwDZHIYIj', $, $, $, #21, (#30)); +#35 = IFCCOMPOSITECURVE((#36), .F.); +#36 = IFCCURVESEGMENT(.DISCONTINUOUS., #42, IFCPARAMETERVALUE(0.), IFCNONNEGATIVELENGTHMEASURE(100.), #45); +#37 = IFCLOCALPLACEMENT($, #38); +#38 = IFCAXIS2PLACEMENT3D(#39, $, $); +#39 = IFCCARTESIANPOINT((0., 0., 0.)); +#40 = IFCPRODUCTDEFINITIONSHAPE($, $, (#41, #71)); +#41 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve2D', (#36)); +#42 = IFCAXIS2PLACEMENT2D(#43, #44); +#43 = IFCCARTESIANPOINT((0., 0.)); +#44 = IFCDIRECTION((1., 0.)); +#45 = IFCCLOTHOID(#46, 173.205080756888); +#46 = IFCAXIS2PLACEMENT2D(#47, $); +#47 = IFCCARTESIANPOINT((0., 0.)); +#48 = IFCLOCALPLACEMENT($, #49); +#49 = IFCAXIS2PLACEMENT3D(#50, $, $); +#50 = IFCCARTESIANPOINT((0., 0., 0.)); +#51 = IFCPRODUCTDEFINITIONSHAPE($, $, (#52, #77)); +#52 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve3D', (#35)); +#53 = IFCLOCALPLACEMENT($, #54); +#54 = IFCAXIS2PLACEMENT3D(#55, $, $); +#55 = IFCCARTESIANPOINT((0., 0., 0.)); +#56 = IFCPRODUCTDEFINITIONSHAPE($, $, (#57, #60)); +#57 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve2D', (#35)); +#58 = IFCCARTESIANPOINTLIST2D(((0., 0.), (9.99999999972222E-1, 5.55555555544531E-6), (1.99999999911111, 4.4444444430335E-5), (2.99999999325, 1.49999999758928E-4), (3.99999997155556, 3.55555553749558E-4), (4.99999991319445, 6.9444443583278E-4), (5.999999784, 1.19999996914285E-3), (6.9999995331389, 1.905555464777E-3), (7.99999908977783, 2.8444442132769E-3), (8.99999835975014, 4.0499994727768E-3), (9.99999722222258, 5.55555445326286E-3), (10.999995526362, 7.39444229638793E-3), (11.9999930880018, 9.5999960502864E-3), (12.9999896863093, 1.22055486388336E-2), (13.9999850604518, 1.5244432824794E-2), (14.9999789062637, 1.8749981166303E-2), (15.9999708729134, 2.27555259661264E-2), (16.9999605595701, 2.72943992131425E-2), (17.9999475120709, 3.23999325154911E-2), (18.9999312195875, 3.81054570248335E-2), (19.999911111294, 4.44443033511694E-2), (20.9998865530337, 5.14498014676536E-2), (21.9998568439868, 5.91552806048584E-2), (22.9998212133379, 6.75940691339256E-2), (23.9997788169437, 7.67994944380537E-2), (24.9997287340016, 8.68048827717643E-2), (25.9996699637173, 9.76435591073921E-2), (26.999601421974, 1.09348846968246E-1), (27.9995219380011, 1.21954068247882E-1), (28.9994302510434, 1.35492543014938E-1), (29.9993250070312, 1.49997589302972E-1), (30.9992047552504, 1.6550252288475E-1), (31.9990679450131, 1.8204065703043E-1), (32.9989129223292, 1.99645302249088E-1), (33.9987379265783, 2.18349766013029E-1), (34.9985410871824, 2.38187352464336E-1), (35.9983204202793, 2.59191362103088E-1), (36.9980738253972, 2.81395091456719E-1), (37.9977990821296, 3.04831832729935E-1), (38.9974938468118, 3.29534873434662E-1), (39.9971556491983, 3.55537495999453E-1), (40.9967818891412, 3.82872977357812E-1), (41.9963698332701, 4.11574588514884E-1), (42.9959166116734, 4.41675594091954E-1), (43.9954192145808, 4.73209251848202E-1), (44.9948744890478, 5.06208812179173E-1), (45.9942791356417, 5.40707517591404E-1), (46.9936297051295, 5.76738602152657E-1), (47.9929225951674, 6.14335290917215E-1), (48.9921540469933, 6.53530799325692E-1), (49.9913201421206, 6.94358332578797E-1), (50.9904167990349, 7.36851084984529E-1), (51.9894397698929, 7.81042239278224E-1), (52.9883846372246, 8.26964965914937E-1), (53.9872468106378, 8.74652422333605E-1), (54.9860215235256, 9.24137752192431E-1), (55.9847038297777, 9.75454084574977E-1), (56.9832886004944, 1.02863453316639), (57.9817705207049, 1.08371219539924), (58.9801440860885, 1.14072015156843), (59.978403599701, 1.19969146391466), (60.9765431687038, 1.2606591756758), (61.9745567010989, 1.32365631010581), (62.9724379024677, 1.38871586946054), (63.9701802727149, 1.45587083394989), (64.9677771028175, 1.52515416065589), (65.9652214715793, 1.596598782416), (66.9625062423912, 1.67023760667131), (67.9596240599967, 1.74610351427896), (68.9565673472647, 1.82422935828826), (69.9533283019679, 1.90464796268009), (70.9498988935683, 1.98739212106893), (71.9462708600097, 2.07249459536717), (72.9424357045179, 2.15998811441092), (73.9383846924081, 2.2499053725471), (74.9341088479007, 2.34227902818108), (75.9295989509452, 2.43714170228446), (76.9248455340534, 2.53452597686245), (77.9198388791408, 2.63446439338038), (78.9145690143782, 2.73698945114875), (79.9090257110528, 2.84213360566643), (80.9031984804396, 2.94992926692144), (81.8970765706829, 3.06040879764886), (82.8906489636899, 3.17360451154532), (83.8839043720348, 3.28954867143964), (84.8768312358747, 3.40827348741909), (85.8694177198787, 3.5298111149109), (86.8616517101684, 3.65419365271829), (87.853520811273, 3.78145314101089), (88.845012343097, 3.91162155926881), (89.8361133379021, 4.04473082417998), (90.8268105373045, 4.18081278749035), (91.8170903892865, 4.3198992338064), (92.8069390452241, 4.46202187834967), (93.7963423569304, 4.60721236466255), (94.7852858737162, 4.75550226226533), (95.7737548394674, 4.9069230642636), (96.7617341897404, 5.061506184906), (97.7492085488755, 5.21928295709152), (98.7361622271294, 5.38028462982623), (99.7225792178275, 5.5445423656288)), $); +#59 = IFCINDEXEDPOLYCURVE(#58, $, $); +#60 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#59)); +#61 = IFCOWNERHISTORY(#63, #65, $, .ADDED., 1630842293, $, $, 1630842293); +#62 = IFCORGANIZATION($, '\X2\0410\X0\\X2\0420\X0\ \X2\0414\X0\\X2\0418\X0\ \X2\0415\X0\\X2\0424\X0\ \X2\041E\X0\\X2\041E\X0\\X2\0414\X0\', 'RDF Ltd.', $, $); +#63 = IFCPERSONANDORGANIZATION(#64, #62, $); +#64 = IFCPERSON($, 'Bonsma', 'Peter', $, $, $, $, $); +#65 = IFCAPPLICATION(#62, '0.99', 'Add Check Library Application', 'TA 1001'); +#66 = IFCRELDEFINESBYPROPERTIES('1551hfo_LE8guV4q9f5nBt', #61, $, $, (#21), #67); +#67 = IFCPROPERTYSET('21HRepTFD2pwvHT5xJTi9o', #61, 'ValidationPset', $, (#68)); +#68 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(99.9999845682112), $); +#69 = IFCCARTESIANPOINTLIST2D(((0., 0.), (9.99999999972222E-1, 5.55555555544531E-6), (1.99999999911111, 4.4444444430335E-5), (2.99999999325, 1.49999999758928E-4), (3.99999997155556, 3.55555553749558E-4), (4.99999991319445, 6.9444443583278E-4), (5.999999784, 1.19999996914285E-3), (6.9999995331389, 1.905555464777E-3), (7.99999908977783, 2.8444442132769E-3), (8.99999835975014, 4.0499994727768E-3), (9.99999722222258, 5.55555445326286E-3), (10.999995526362, 7.39444229638793E-3), (11.9999930880018, 9.5999960502864E-3), (12.9999896863093, 1.22055486388336E-2), (13.9999850604518, 1.5244432824794E-2), (14.9999789062637, 1.8749981166303E-2), (15.9999708729134, 2.27555259661264E-2), (16.9999605595701, 2.72943992131425E-2), (17.9999475120709, 3.23999325154911E-2), (18.9999312195875, 3.81054570248335E-2), (19.999911111294, 4.44443033511694E-2), (20.9998865530337, 5.14498014676536E-2), (21.9998568439868, 5.91552806048584E-2), (22.9998212133379, 6.75940691339256E-2), (23.9997788169437, 7.67994944380537E-2), (24.9997287340016, 8.68048827717643E-2), (25.9996699637173, 9.76435591073921E-2), (26.999601421974, 1.09348846968246E-1), (27.9995219380011, 1.21954068247882E-1), (28.9994302510434, 1.35492543014938E-1), (29.9993250070312, 1.49997589302972E-1), (30.9992047552504, 1.6550252288475E-1), (31.9990679450131, 1.8204065703043E-1), (32.9989129223292, 1.99645302249088E-1), (33.9987379265783, 2.18349766013029E-1), (34.9985410871824, 2.38187352464336E-1), (35.9983204202793, 2.59191362103088E-1), (36.9980738253972, 2.81395091456719E-1), (37.9977990821296, 3.04831832729935E-1), (38.9974938468118, 3.29534873434662E-1), (39.9971556491983, 3.55537495999453E-1), (40.9967818891412, 3.82872977357812E-1), (41.9963698332701, 4.11574588514884E-1), (42.9959166116734, 4.41675594091954E-1), (43.9954192145808, 4.73209251848202E-1), (44.9948744890478, 5.06208812179173E-1), (45.9942791356417, 5.40707517591404E-1), (46.9936297051295, 5.76738602152657E-1), (47.9929225951674, 6.14335290917215E-1), (48.9921540469933, 6.53530799325692E-1), (49.9913201421206, 6.94358332578797E-1), (50.9904167990349, 7.36851084984529E-1), (51.9894397698929, 7.81042239278224E-1), (52.9883846372246, 8.26964965914937E-1), (53.9872468106378, 8.74652422333605E-1), (54.9860215235256, 9.24137752192431E-1), (55.9847038297777, 9.75454084574977E-1), (56.9832886004944, 1.02863453316639), (57.9817705207049, 1.08371219539924), (58.9801440860885, 1.14072015156843), (59.978403599701, 1.19969146391466), (60.9765431687038, 1.2606591756758), (61.9745567010989, 1.32365631010581), (62.9724379024677, 1.38871586946054), (63.9701802727149, 1.45587083394989), (64.9677771028175, 1.52515416065589), (65.9652214715793, 1.596598782416), (66.9625062423912, 1.67023760667131), (67.9596240599967, 1.74610351427896), (68.9565673472647, 1.82422935828826), (69.9533283019679, 1.90464796268009), (70.9498988935683, 1.98739212106893), (71.9462708600097, 2.07249459536717), (72.9424357045179, 2.15998811441092), (73.9383846924081, 2.2499053725471), (74.9341088479007, 2.34227902818108), (75.9295989509452, 2.43714170228446), (76.9248455340534, 2.53452597686245), (77.9198388791408, 2.63446439338038), (78.9145690143782, 2.73698945114875), (79.9090257110528, 2.84213360566643), (80.9031984804396, 2.94992926692144), (81.8970765706829, 3.06040879764886), (82.8906489636899, 3.17360451154532), (83.8839043720348, 3.28954867143964), (84.8768312358747, 3.40827348741909), (85.8694177198787, 3.5298111149109), (86.8616517101684, 3.65419365271829), (87.853520811273, 3.78145314101089), (88.845012343097, 3.91162155926881), (89.8361133379021, 4.04473082417998), (90.8268105373045, 4.18081278749035), (91.8170903892865, 4.3198992338064), (92.8069390452241, 4.46202187834967), (93.7963423569304, 4.60721236466255), (94.7852858737162, 4.75550226226533), (95.7737548394674, 4.9069230642636), (96.7617341897404, 5.061506184906), (97.7492085488755, 5.21928295709152), (98.7361622271294, 5.38028462982623), (99.7225792178275, 5.5445423656288)), $); +#70 = IFCINDEXEDPOLYCURVE(#69, $, $); +#71 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#70)); +#72 = IFCRELDEFINESBYPROPERTIES('3cc9sz8rPDcgC5JKbnRFTb', #61, $, $, (#30), #73); +#73 = IFCPROPERTYSET('19YW1D9X19PRicYlpQ6iha', #61, 'ValidationPset', $, (#74)); +#74 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(99.9999845682112), $); +#75 = IFCCARTESIANPOINTLIST2D(((0., 0.), (9.99999999972222E-1, 5.55555555544531E-6), (1.99999999911111, 4.4444444430335E-5), (2.99999999325, 1.49999999758928E-4), (3.99999997155556, 3.55555553749558E-4), (4.99999991319445, 6.9444443583278E-4), (5.999999784, 1.19999996914285E-3), (6.9999995331389, 1.905555464777E-3), (7.99999908977783, 2.8444442132769E-3), (8.99999835975014, 4.0499994727768E-3), (9.99999722222258, 5.55555445326286E-3), (10.999995526362, 7.39444229638793E-3), (11.9999930880018, 9.5999960502864E-3), (12.9999896863093, 1.22055486388336E-2), (13.9999850604518, 1.5244432824794E-2), (14.9999789062637, 1.8749981166303E-2), (15.9999708729134, 2.27555259661264E-2), (16.9999605595701, 2.72943992131425E-2), (17.9999475120709, 3.23999325154911E-2), (18.9999312195875, 3.81054570248335E-2), (19.999911111294, 4.44443033511694E-2), (20.9998865530337, 5.14498014676536E-2), (21.9998568439868, 5.91552806048584E-2), (22.9998212133379, 6.75940691339256E-2), (23.9997788169437, 7.67994944380537E-2), (24.9997287340016, 8.68048827717643E-2), (25.9996699637173, 9.76435591073921E-2), (26.999601421974, 1.09348846968246E-1), (27.9995219380011, 1.21954068247882E-1), (28.9994302510434, 1.35492543014938E-1), (29.9993250070312, 1.49997589302972E-1), (30.9992047552504, 1.6550252288475E-1), (31.9990679450131, 1.8204065703043E-1), (32.9989129223292, 1.99645302249088E-1), (33.9987379265783, 2.18349766013029E-1), (34.9985410871824, 2.38187352464336E-1), (35.9983204202793, 2.59191362103088E-1), (36.9980738253972, 2.81395091456719E-1), (37.9977990821296, 3.04831832729935E-1), (38.9974938468118, 3.29534873434662E-1), (39.9971556491983, 3.55537495999453E-1), (40.9967818891412, 3.82872977357812E-1), (41.9963698332701, 4.11574588514884E-1), (42.9959166116734, 4.41675594091954E-1), (43.9954192145808, 4.73209251848202E-1), (44.9948744890478, 5.06208812179173E-1), (45.9942791356417, 5.40707517591404E-1), (46.9936297051295, 5.76738602152657E-1), (47.9929225951674, 6.14335290917215E-1), (48.9921540469933, 6.53530799325692E-1), (49.9913201421206, 6.94358332578797E-1), (50.9904167990349, 7.36851084984529E-1), (51.9894397698929, 7.81042239278224E-1), (52.9883846372246, 8.26964965914937E-1), (53.9872468106378, 8.74652422333605E-1), (54.9860215235256, 9.24137752192431E-1), (55.9847038297777, 9.75454084574977E-1), (56.9832886004944, 1.02863453316639), (57.9817705207049, 1.08371219539924), (58.9801440860885, 1.14072015156843), (59.978403599701, 1.19969146391466), (60.9765431687038, 1.2606591756758), (61.9745567010989, 1.32365631010581), (62.9724379024677, 1.38871586946054), (63.9701802727149, 1.45587083394989), (64.9677771028175, 1.52515416065589), (65.9652214715793, 1.596598782416), (66.9625062423912, 1.67023760667131), (67.9596240599967, 1.74610351427896), (68.9565673472647, 1.82422935828826), (69.9533283019679, 1.90464796268009), (70.9498988935683, 1.98739212106893), (71.9462708600097, 2.07249459536717), (72.9424357045179, 2.15998811441092), (73.9383846924081, 2.2499053725471), (74.9341088479007, 2.34227902818108), (75.9295989509452, 2.43714170228446), (76.9248455340534, 2.53452597686245), (77.9198388791408, 2.63446439338038), (78.9145690143782, 2.73698945114875), (79.9090257110528, 2.84213360566643), (80.9031984804396, 2.94992926692144), (81.8970765706829, 3.06040879764886), (82.8906489636899, 3.17360451154532), (83.8839043720348, 3.28954867143964), (84.8768312358747, 3.40827348741909), (85.8694177198787, 3.5298111149109), (86.8616517101684, 3.65419365271829), (87.853520811273, 3.78145314101089), (88.845012343097, 3.91162155926881), (89.8361133379021, 4.04473082417998), (90.8268105373045, 4.18081278749035), (91.8170903892865, 4.3198992338064), (92.8069390452241, 4.46202187834967), (93.7963423569304, 4.60721236466255), (94.7852858737162, 4.75550226226533), (95.7737548394674, 4.9069230642636), (96.7617341897404, 5.061506184906), (97.7492085488755, 5.21928295709152), (98.7361622271294, 5.38028462982623), (99.7225792178275, 5.5445423656288)), $); +#76 = IFCINDEXEDPOLYCURVE(#75, $, $); +#77 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#76)); +#78 = IFCRELDEFINESBYPROPERTIES('0w$kEgZrPCp9p8G6Mnj6az', #61, $, $, (#20), #79); +#79 = IFCPROPERTYSET('3Stq1t98j9h95z8O9XuY_E', #61, 'ValidationPset', $, (#80)); +#80 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(99.9999845682112), $); +ENDSEC; +END-ISO-10303-21; diff --git a/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_inf_300_1_Meter/Data/clothoid_100.0_inf_300_1_Meter.png b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_inf_300_1_Meter/Data/clothoid_100.0_inf_300_1_Meter.png new file mode 100644 index 000000000..07a82be21 Binary files /dev/null and b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_inf_300_1_Meter/Data/clothoid_100.0_inf_300_1_Meter.png differ diff --git a/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_inf_300_1_Meter/Data/clothoid_100.0_inf_300_1_Meter_top.png b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_inf_300_1_Meter/Data/clothoid_100.0_inf_300_1_Meter_top.png new file mode 100644 index 000000000..a9d7a169a Binary files /dev/null and b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_inf_300_1_Meter/Data/clothoid_100.0_inf_300_1_Meter_top.png differ diff --git a/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_inf_300_1_Meter/src/clothoid_100.0_inf_300_1_Meter.cpp b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_inf_300_1_Meter/src/clothoid_100.0_inf_300_1_Meter.cpp new file mode 100644 index 000000000..bbe851624 --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_inf_300_1_Meter/src/clothoid_100.0_inf_300_1_Meter.cpp @@ -0,0 +1,98 @@ +/* + Copyright (c) 2021 Technical University of Munich + Chair of Computational Modeling and Simulation. + + TUM Open Infra Platform is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License Version 3 + as published by the Free Software Foundation. + + TUM Open Infra Platform is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include +#include + +#include + +#include +#include +#include + +using namespace testing; + +class Clothoid : public IfcVisualTest { +protected: + + // Test standard values + buw::Image4b _background = buw::Image4b(0, 0); + + virtual void SetUp() override { + IfcVisualTest::SetUp(); + + express_model = OpenInfraPlatform::IFC4X3_RC4::IFC4X3_RC4Reader::FromFile(filename.string()); + + importer = buw::makeReferenceCounted>(); + auto model = importer->collectData(express_model); + + _background = rendererIfc->captureImage(); + rendererIfc->setModel(model[0]); + } + + virtual void TearDown() override { + express_model.reset(); + IfcVisualTest::TearDown(); + } + + virtual std::string TestName() const { return "clothoid_100.0_inf_300_1_Meter"; } + virtual std::string Schema() const { return "IFC4X3_RC4"; } + + const boost::filesystem::path filename = dataPath("clothoid_100.0_inf_300_1_Meter.ifc"); + + std::shared_ptr express_model = nullptr; + buw::ReferenceCounted> importer = nullptr; +}; + +TEST_F(Clothoid, AllEntitiesAreRead) { + EXPECT_THAT(express_model->entities.size(), Eq(72)); +} + +TEST_F(Clothoid, IFCHasAnEssentialEntity) { + auto result1 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto &pair) -> bool { return pair.second->classname() == "IFCCURVESEGMENT"; }); + auto result2 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto &pair) -> bool { return pair.second->classname() == "IFCCLOTHOID"; }); + EXPECT_NE(result1, express_model->entities.end()); + EXPECT_NE(result2, express_model->entities.end()); +} + +TEST_F(Clothoid, ImageIsSaved) +{ + // Arrange + buw::Image4b image = rendererIfc->captureImage(); + + // Act + buw::storeImage(testPath("clothoid_100.0_inf_300_1_Meter.png").string(), image); + + // Assert + EXPECT_NO_THROW(buw::loadImage4b(testPath("clothoid_100.0_inf_300_1_Meter.png").string())); +} + +TEST_F(Clothoid, PlaneSurfaceViews) +{ + // Arrange + const auto expected_top = buw::loadImage4b(dataPath("clothoid_100.0_inf_300_1_Meter_top.png").string()); + + // Act (Top) + rendererIfc->setViewDirection(buw::eViewDirection::Top); + buw::Image4b image_top = CaptureImage(); + + // uncomment following lines to also save the screen shot + //buw::storeImage(testPath("clothoid_100.0_inf_300_1_Meter_top.png").string(), image_top); + + // Assert + EXPECT_EQ(image_top, expected_top); +} \ No newline at end of file diff --git a/UnitTests/Schemas/IFC4X3_RC4/cosine-curve_100.0_300_1000_1_Meter/CMakeLists.txt b/UnitTests/Schemas/IFC4X3_RC4/cosine-curve_100.0_300_1000_1_Meter/CMakeLists.txt new file mode 100644 index 000000000..310c0d5d4 --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/cosine-curve_100.0_300_1000_1_Meter/CMakeLists.txt @@ -0,0 +1,20 @@ +# +# Copyright (c) 2021 Technical University of Munich +# Chair of Computational Modeling and Simulation. +# +# TUM Open Infra Platform is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License Version 3 +# as published by the Free Software Foundation. +# +# TUM Open Infra Platform is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +include(CreateUnitTests) + +CreateIfcFileVisualUnitTestForSchema(cosine-curve_100.0_300_1000_1_Meter IFC4X3_RC4) diff --git a/UnitTests/Schemas/IFC4X3_RC4/cosine-curve_100.0_300_1000_1_Meter/Data/cosine-curve_100.0_300_1000_1_Meter.ifc b/UnitTests/Schemas/IFC4X3_RC4/cosine-curve_100.0_300_1000_1_Meter/Data/cosine-curve_100.0_300_1000_1_Meter.ifc new file mode 100644 index 000000000..91eb67638 --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/cosine-curve_100.0_300_1000_1_Meter/Data/cosine-curve_100.0_300_1000_1_Meter.ifc @@ -0,0 +1,79 @@ +ISO-10303-21; +HEADER; +FILE_DESCRIPTION (('ViewDefinition [CoordinationView]'), '2;1'); +FILE_NAME ('Single-LANDXML.ifc', '2021-05-24T11:00:00', ('IFC Rail Technical Services'), ('buildingSMART International RailwayRoom'), 'RailCOMPLETE\X2\FFAE\X0\', '2019.1.1995.0', ''); +FILE_SCHEMA (('IFC4X3_RC4')); +ENDSEC; +DATA; +#1 = IFCPROJECT('1FNFy8AJeHwwz7wDZHIYIu', #3, 'IFC Rail Referencedata', 'Rail alignment sample', $, 'Longname', 'Design', $, #9); +#2 = IFCAPPLICATION(#5, '2019.1.1995.0', 'RailCOMPLETE\X2\00AE\X0\', $); +#3 = IFCOWNERHISTORY(#6, #2, $, .ADDED., 1320688800, $, $, 1320688800); +#4 = IFCPERSON('TS', 'IFC Rail Technical Services', $, $, $, $, $, $); +#5 = IFCORGANIZATION('bsI RWR', 'buildingSmart International Railway Room', $, $, $); +#6 = IFCPERSONANDORGANIZATION(#4, #5, $); +#7 = IFCSIUNIT(*, .LENGTHUNIT., $, .METRE.); +#8 = IFCSIUNIT(*, .PLANEANGLEUNIT., $, .RADIAN.); +#9 = IFCUNITASSIGNMENT((#7, #8)); +#10 = IFCCARTESIANPOINT((0., 0., 0.)); +#11 = IFCDIRECTION((0., 0., 1.)); +#12 = IFCDIRECTION((1., 0., 0.)); +#13 = IFCAXIS2PLACEMENT3D(#10, #11, #12); +#14 = IFCLOCALPLACEMENT($, #13); +#15 = IFCRAILWAY('1FNFy9AJeHwuVmwDZHIYIu', #3, 'optional Railway Name', 'optional Railway Description', $, #14, $, 'Longname for Railway track geometry (alignment)', $, $); +#16 = IFCDIRECTION((0., 1., 0.)); +#17 = IFCGEOMETRICREPRESENTATIONCONTEXT($, 'MODEL', 3, 1.E-5, #13, #16); +#18 = IFCRELAGGREGATES('1FNFyAAJeHwu6TwDZHIYIu', #3, 'Documentation Container', 'Container for IfcProject, collects relevant products', #1, (#15)); +#19 = IFCRELCONTAINEDINSPATIALSTRUCTURE('1FNFyBAJeHwvmywDZHIYIu', #3, 'IfcProducts contained in myIfcRailway', 'Association between IfcProducts and IfcRailway', (#20), #15); +#20 = IFCALIGNMENT('1FNFyCAJeHwxedwDZHIYIu', #3, 'Spor', 'optional Railway Description', $, #46, #49, $, $); +#21 = IFCALIGNMENTHORIZONTAL('1FNFyDAJeHwv87wDZHIYIu', $, $, $, $, #51, #54); +#23 = IFCRELNESTS('3BJTAQrjCHwvVKbERtTLTf', $, $, $, #20, (#21)); +#28 = IFCCARTESIANPOINT((0., 0.)); +#29 = IFCALIGNMENTHORIZONTALSEGMENT($, $, #28, 0., 300., 1000., 100., $, .COSINECURVE.); +#30 = IFCALIGNMENTSEGMENT('1FNFyHAJeHwuDtwDZHIYIu', #3, $, $, $, #37, #40, #29); +#34 = IFCRELNESTS('1FNFyHAJeHwuDtwDZHIYIj', $, $, $, #21, (#30)); +#35 = IFCCOMPOSITECURVE((#36), .F.); +#36 = IFCCURVESEGMENT(.DISCONTINUOUS., #42, IFCPARAMETERVALUE(0.), IFCNONNEGATIVELENGTHMEASURE(100.), #45); +#37 = IFCLOCALPLACEMENT($, #38); +#38 = IFCAXIS2PLACEMENT3D(#39, $, $); +#39 = IFCCARTESIANPOINT((0., 0., 0.)); +#40 = IFCPRODUCTDEFINITIONSHAPE($, $, (#41, #69)); +#41 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve2D', (#36)); +#42 = IFCAXIS2PLACEMENT2D(#43, #44); +#43 = IFCCARTESIANPOINT((0., 0.)); +#44 = IFCDIRECTION((1., 0.)); +#45 = IFCCOSINE($, 857.142857142857, 461.538461538462); +#46 = IFCLOCALPLACEMENT($, #47); +#47 = IFCAXIS2PLACEMENT3D(#48, $, $); +#48 = IFCCARTESIANPOINT((0., 0., 0.)); +#49 = IFCPRODUCTDEFINITIONSHAPE($, $, (#50, #75)); +#50 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve3D', (#35)); +#51 = IFCLOCALPLACEMENT($, #52); +#52 = IFCAXIS2PLACEMENT3D(#53, $, $); +#53 = IFCCARTESIANPOINT((0., 0., 0.)); +#54 = IFCPRODUCTDEFINITIONSHAPE($, $, (#55, #58)); +#55 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve2D', (#35)); +#56 = IFCCARTESIANPOINTLIST2D(((0., 0.), (9.99998148277109E-1, 1.66661714796978E-3), (1.99998518931123, 6.66587445182578E-3), (2.99995003132327, 1.49959901235904E-2), (3.99988161342515, 2.66539966230598E-2), (4.99976892097341, 4.16357438144689E-2), (5.99960100081288, 5.99359033798865E-2), (6.99936697637428, 8.15479744834188E-2), (7.99905606258996, 1.06464290678638E-1), (8.99865758059279, 1.3467602805E-1), (9.9981609721634, 1.661732145774E-1), (10.9975558138923, 2.00944740711399E-1), (11.9968318310237, 2.38978371145113E-1), (12.995978910949, 2.8026075776719E-1), (13.9949871163197, 3.24777453778841E-1), (14.993846697748, 3.72512928956395E-1), (15.9925481060694, 4.23450586039467E-1), (16.9910820041365, 4.77572778223448E-1), (17.9894392781212, 5.34860827733715E-1), (18.9876110482979, 5.95295045457678E-1), (19.9855886792871, 6.5885475160959E-1), (20.9833637897356, 7.25518297401883E-1), (21.9809282614151, 7.95263087695675E-1), (22.9782742477197, 8.68065604602088E-1), (23.9753941815464, 9.43901432004989E-1), (24.9722807825433, 1.02274528097491), (25.9689270637128, 1.10457101604294), (26.9653263373576, 1.18935168230277), (27.9614722203614, 1.27705953330801), (28.9573586387944, 1.3676660597317), (29.9529798318406, 1.46114201875377), (30.9483303550397, 1.55745746414219), (31.9434050828432, 1.65658177699257), (32.9381992104843, 1.758483697091), (33.9327082551615, 1.86313135486406), (34.9269280565404, 1.97049230388013), (35.9208547765773, 2.0805335538654), (36.9144848986718, 2.19322160419809), (37.9078152261564, 2.308522477844), (38.9008428801322, 2.42640175569668), (39.8935652966627, 2.54682461128514), (40.8859802233382, 2.66975584581217), (41.8780857152245, 2.79515992348645), (42.869880130212, 2.92300100711147), (43.861362123782, 3.05324299389455), (44.8525306432084, 3.18584955143942), (45.8433849212131, 3.32078415388589), (46.8339244690969, 3.45801011816034), (47.8241490693663, 3.59749064030121), (48.8140587678785, 3.73918883182363), (49.8036538655283, 3.88306775608794), (50.7929349094998, 4.02909046463683), (51.7819026841086, 4.17722003346657), (52.7705582012586, 4.3274195991978), (53.7589026905394, 4.47965239511183), (54.7469375889909, 4.63388178701909), (55.7346645305601, 4.79007130892616), (56.7220853352778, 4.94818469846894), (57.7092019981815, 5.10818593207938), (58.6960166780113, 5.27003925985404), (59.6825316857054, 5.43370924009285), (60.6687494727222, 5.59916077347723), (61.6546726192146, 5.76635913685707), (62.6403038220836, 5.93527001661639), (63.6256458829367, 6.10585954158829), (64.6107016959759, 6.27809431549006), (65.5954742358412, 6.45194144884993), (66.5799665454328, 6.62736859039734), (67.5641817237367, 6.80434395788937), (68.5481229136762, 6.98283636834604), (69.5317932900111, 7.16281526766831), (70.5151960473074, 7.34425075961253), (71.4983343879967, 7.52711363409612), (72.4812115105459, 7.71137539480948), (73.4638305977551, 7.89700828610995), (74.446194805203, 8.08398531917389), (75.428307249855, 8.27228029738388), (76.4101709988506, 8.46186784092831), (77.391789058485, 8.65272341059145), (78.3731643633979, 8.8448233307126), (79.3542997659829, 9.03814481129346), (80.3351980260276, 9.23266596923372), (81.3158618005971, 9.42836584867532), (82.2962936341678, 9.62522444043651), (83.2764959490209, 9.82322270051762), (84.2564710359029, 10.0223425676611), (85.2362210449588, 10.222566979949), (86.2157479769427, 10.423879890422), (87.1950536747111, 10.6262662817045), (88.1741398149999, 10.8297121796218), (89.1530079004892, 11.0342046657946), (90.1316592521562, 11.2397318891991), (91.1100950019153, 11.4462830766801), (92.0883160855477, 11.653848542405), (93.0663232359159, 11.8624196962502), (94.0441169764631, 12.0719890511082), (95.0216976149938, 12.2825502291083), (95.9990652377323, 12.4940979667429), (96.9762197036555, 12.7066281188914), (97.953160639094, 12.9201376617382), (98.9298874325985, 13.1346246945772)), $); +#57 = IFCINDEXEDPOLYCURVE(#56, $, $); +#58 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#57)); +#59 = IFCOWNERHISTORY(#61, #63, $, .ADDED., 1630842406, $, $, 1630842406); +#60 = IFCORGANIZATION($, '\X2\0410\X0\\X2\0420\X0\ \X2\0414\X0\\X2\0418\X0\ \X2\0415\X0\\X2\0424\X0\ \X2\041E\X0\\X2\041E\X0\\X2\0414\X0\', 'RDF Ltd.', $, $); +#61 = IFCPERSONANDORGANIZATION(#62, #60, $); +#62 = IFCPERSON($, 'Bonsma', 'Peter', $, $, $, $, $); +#63 = IFCAPPLICATION(#60, '0.99', 'Add Check Library Application', 'TA 1001'); +#64 = IFCRELDEFINESBYPROPERTIES('3W9Bg_L0nCoP2T2OJOCCXG', #59, $, $, (#21), #65); +#65 = IFCPROPERTYSET('0dn8iQT7XEYgrYYh0$razk', #59, 'ValidationPset', $, (#66)); +#66 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(99.999977601897), $); +#67 = IFCCARTESIANPOINTLIST2D(((0., 0.), (9.99998148277109E-1, 1.66661714796978E-3), (1.99998518931123, 6.66587445182578E-3), (2.99995003132327, 1.49959901235904E-2), (3.99988161342515, 2.66539966230598E-2), (4.99976892097341, 4.16357438144689E-2), (5.99960100081288, 5.99359033798865E-2), (6.99936697637428, 8.15479744834188E-2), (7.99905606258996, 1.06464290678638E-1), (8.99865758059279, 1.3467602805E-1), (9.9981609721634, 1.661732145774E-1), (10.9975558138923, 2.00944740711399E-1), (11.9968318310237, 2.38978371145113E-1), (12.995978910949, 2.8026075776719E-1), (13.9949871163197, 3.24777453778841E-1), (14.993846697748, 3.72512928956395E-1), (15.9925481060694, 4.23450586039467E-1), (16.9910820041365, 4.77572778223448E-1), (17.9894392781212, 5.34860827733715E-1), (18.9876110482979, 5.95295045457678E-1), (19.9855886792871, 6.5885475160959E-1), (20.9833637897356, 7.25518297401883E-1), (21.9809282614151, 7.95263087695675E-1), (22.9782742477197, 8.68065604602088E-1), (23.9753941815464, 9.43901432004989E-1), (24.9722807825433, 1.02274528097491), (25.9689270637128, 1.10457101604294), (26.9653263373576, 1.18935168230277), (27.9614722203614, 1.27705953330801), (28.9573586387944, 1.3676660597317), (29.9529798318406, 1.46114201875377), (30.9483303550397, 1.55745746414219), (31.9434050828432, 1.65658177699257), (32.9381992104843, 1.758483697091), (33.9327082551615, 1.86313135486406), (34.9269280565404, 1.97049230388013), (35.9208547765773, 2.0805335538654), (36.9144848986718, 2.19322160419809), (37.9078152261564, 2.308522477844), (38.9008428801322, 2.42640175569668), (39.8935652966627, 2.54682461128514), (40.8859802233382, 2.66975584581217), (41.8780857152245, 2.79515992348645), (42.869880130212, 2.92300100711147), (43.861362123782, 3.05324299389455), (44.8525306432084, 3.18584955143942), (45.8433849212131, 3.32078415388589), (46.8339244690969, 3.45801011816034), (47.8241490693663, 3.59749064030121), (48.8140587678785, 3.73918883182363), (49.8036538655283, 3.88306775608794), (50.7929349094998, 4.02909046463683), (51.7819026841086, 4.17722003346657), (52.7705582012586, 4.3274195991978), (53.7589026905394, 4.47965239511183), (54.7469375889909, 4.63388178701909), (55.7346645305601, 4.79007130892616), (56.7220853352778, 4.94818469846894), (57.7092019981815, 5.10818593207938), (58.6960166780113, 5.27003925985404), (59.6825316857054, 5.43370924009285), (60.6687494727222, 5.59916077347723), (61.6546726192146, 5.76635913685707), (62.6403038220836, 5.93527001661639), (63.6256458829367, 6.10585954158829), (64.6107016959759, 6.27809431549006), (65.5954742358412, 6.45194144884993), (66.5799665454328, 6.62736859039734), (67.5641817237367, 6.80434395788937), (68.5481229136762, 6.98283636834604), (69.5317932900111, 7.16281526766831), (70.5151960473074, 7.34425075961253), (71.4983343879967, 7.52711363409612), (72.4812115105459, 7.71137539480948), (73.4638305977551, 7.89700828610995), (74.446194805203, 8.08398531917389), (75.428307249855, 8.27228029738388), (76.4101709988506, 8.46186784092831), (77.391789058485, 8.65272341059145), (78.3731643633979, 8.8448233307126), (79.3542997659829, 9.03814481129346), (80.3351980260276, 9.23266596923372), (81.3158618005971, 9.42836584867532), (82.2962936341678, 9.62522444043651), (83.2764959490209, 9.82322270051762), (84.2564710359029, 10.0223425676611), (85.2362210449588, 10.222566979949), (86.2157479769427, 10.423879890422), (87.1950536747111, 10.6262662817045), (88.1741398149999, 10.8297121796218), (89.1530079004892, 11.0342046657946), (90.1316592521562, 11.2397318891991), (91.1100950019153, 11.4462830766801), (92.0883160855477, 11.653848542405), (93.0663232359159, 11.8624196962502), (94.0441169764631, 12.0719890511082), (95.0216976149938, 12.2825502291083), (95.9990652377323, 12.4940979667429), (96.9762197036555, 12.7066281188914), (97.953160639094, 12.9201376617382), (98.9298874325985, 13.1346246945772)), $); +#68 = IFCINDEXEDPOLYCURVE(#67, $, $); +#69 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#68)); +#70 = IFCRELDEFINESBYPROPERTIES('1XDAeCiRD3f9JgFsuztEsr', #59, $, $, (#30), #71); +#71 = IFCPROPERTYSET('3anQw0HfzFJhB$zFdLBJ17', #59, 'ValidationPset', $, (#72)); +#72 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(99.999977601897), $); +#73 = IFCCARTESIANPOINTLIST2D(((0., 0.), (9.99998148277109E-1, 1.66661714796978E-3), (1.99998518931123, 6.66587445182578E-3), (2.99995003132327, 1.49959901235904E-2), (3.99988161342515, 2.66539966230598E-2), (4.99976892097341, 4.16357438144689E-2), (5.99960100081288, 5.99359033798865E-2), (6.99936697637428, 8.15479744834188E-2), (7.99905606258996, 1.06464290678638E-1), (8.99865758059279, 1.3467602805E-1), (9.9981609721634, 1.661732145774E-1), (10.9975558138923, 2.00944740711399E-1), (11.9968318310237, 2.38978371145113E-1), (12.995978910949, 2.8026075776719E-1), (13.9949871163197, 3.24777453778841E-1), (14.993846697748, 3.72512928956395E-1), (15.9925481060694, 4.23450586039467E-1), (16.9910820041365, 4.77572778223448E-1), (17.9894392781212, 5.34860827733715E-1), (18.9876110482979, 5.95295045457678E-1), (19.9855886792871, 6.5885475160959E-1), (20.9833637897356, 7.25518297401883E-1), (21.9809282614151, 7.95263087695675E-1), (22.9782742477197, 8.68065604602088E-1), (23.9753941815464, 9.43901432004989E-1), (24.9722807825433, 1.02274528097491), (25.9689270637128, 1.10457101604294), (26.9653263373576, 1.18935168230277), (27.9614722203614, 1.27705953330801), (28.9573586387944, 1.3676660597317), (29.9529798318406, 1.46114201875377), (30.9483303550397, 1.55745746414219), (31.9434050828432, 1.65658177699257), (32.9381992104843, 1.758483697091), (33.9327082551615, 1.86313135486406), (34.9269280565404, 1.97049230388013), (35.9208547765773, 2.0805335538654), (36.9144848986718, 2.19322160419809), (37.9078152261564, 2.308522477844), (38.9008428801322, 2.42640175569668), (39.8935652966627, 2.54682461128514), (40.8859802233382, 2.66975584581217), (41.8780857152245, 2.79515992348645), (42.869880130212, 2.92300100711147), (43.861362123782, 3.05324299389455), (44.8525306432084, 3.18584955143942), (45.8433849212131, 3.32078415388589), (46.8339244690969, 3.45801011816034), (47.8241490693663, 3.59749064030121), (48.8140587678785, 3.73918883182363), (49.8036538655283, 3.88306775608794), (50.7929349094998, 4.02909046463683), (51.7819026841086, 4.17722003346657), (52.7705582012586, 4.3274195991978), (53.7589026905394, 4.47965239511183), (54.7469375889909, 4.63388178701909), (55.7346645305601, 4.79007130892616), (56.7220853352778, 4.94818469846894), (57.7092019981815, 5.10818593207938), (58.6960166780113, 5.27003925985404), (59.6825316857054, 5.43370924009285), (60.6687494727222, 5.59916077347723), (61.6546726192146, 5.76635913685707), (62.6403038220836, 5.93527001661639), (63.6256458829367, 6.10585954158829), (64.6107016959759, 6.27809431549006), (65.5954742358412, 6.45194144884993), (66.5799665454328, 6.62736859039734), (67.5641817237367, 6.80434395788937), (68.5481229136762, 6.98283636834604), (69.5317932900111, 7.16281526766831), (70.5151960473074, 7.34425075961253), (71.4983343879967, 7.52711363409612), (72.4812115105459, 7.71137539480948), (73.4638305977551, 7.89700828610995), (74.446194805203, 8.08398531917389), (75.428307249855, 8.27228029738388), (76.4101709988506, 8.46186784092831), (77.391789058485, 8.65272341059145), (78.3731643633979, 8.8448233307126), (79.3542997659829, 9.03814481129346), (80.3351980260276, 9.23266596923372), (81.3158618005971, 9.42836584867532), (82.2962936341678, 9.62522444043651), (83.2764959490209, 9.82322270051762), (84.2564710359029, 10.0223425676611), (85.2362210449588, 10.222566979949), (86.2157479769427, 10.423879890422), (87.1950536747111, 10.6262662817045), (88.1741398149999, 10.8297121796218), (89.1530079004892, 11.0342046657946), (90.1316592521562, 11.2397318891991), (91.1100950019153, 11.4462830766801), (92.0883160855477, 11.653848542405), (93.0663232359159, 11.8624196962502), (94.0441169764631, 12.0719890511082), (95.0216976149938, 12.2825502291083), (95.9990652377323, 12.4940979667429), (96.9762197036555, 12.7066281188914), (97.953160639094, 12.9201376617382), (98.9298874325985, 13.1346246945772)), $); +#74 = IFCINDEXEDPOLYCURVE(#73, $, $); +#75 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#74)); +#76 = IFCRELDEFINESBYPROPERTIES('23bpi8MUz7NQ8pZRG6Nfd4', #59, $, $, (#20), #77); +#77 = IFCPROPERTYSET('1cZX$CTAP7Pg5RZynl1vGg', #59, 'ValidationPset', $, (#78)); +#78 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(99.999977601897), $); +ENDSEC; +END-ISO-10303-21; diff --git a/UnitTests/Schemas/IFC4X3_RC4/cosine-curve_100.0_300_1000_1_Meter/src/cosine-curve_100.0_300_1000_1_Meter.cpp b/UnitTests/Schemas/IFC4X3_RC4/cosine-curve_100.0_300_1000_1_Meter/src/cosine-curve_100.0_300_1000_1_Meter.cpp new file mode 100644 index 000000000..de2e59ed2 --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/cosine-curve_100.0_300_1000_1_Meter/src/cosine-curve_100.0_300_1000_1_Meter.cpp @@ -0,0 +1,102 @@ +/* + Copyright (c) 2021 Technical University of Munich + Chair of Computational Modeling and Simulation. + + TUM Open Infra Platform is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License Version 3 + as published by the Free Software Foundation. + + TUM Open Infra Platform is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include +#include + +#include + +#include +#include +#include + +using namespace testing; + +class CosineCurve : public IfcVisualTest { +protected: + + // Test standard values + buw::Image4b _background = buw::Image4b(0, 0); + + virtual void SetUp() override { + IfcVisualTest::SetUp(); + + express_model = OpenInfraPlatform::IFC4X3_RC4::IFC4X3_RC4Reader::FromFile(filename.string()); + + importer = buw::makeReferenceCounted>(); + auto model = importer->collectData(express_model); + + _background = rendererIfc->captureImage(); + rendererIfc->setModel(model[0]); + } + + virtual void TearDown() override { + express_model.reset(); + IfcVisualTest::TearDown(); + } + + virtual std::string TestName() const { return "cosine-curve_100.0_300_1000_1_Meter"; } + virtual std::string Schema() const { return "IFC4X3_RC4"; } + + const boost::filesystem::path filename = dataPath("cosine-curve_100.0_300_1000_1_Meter.ifc"); + + std::shared_ptr express_model = nullptr; + buw::ReferenceCounted> importer = nullptr; +}; + +TEST_F(CosineCurve, AllEntitiesAreRead) { + EXPECT_THAT(express_model->entities.size(), Eq(70)); +} + +TEST_F(CosineCurve, IFCHasAnEssentialEntity) { + auto result1 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto &pair) -> bool { return pair.second->classname() == "IFCCOSINE"; }); + auto result2 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto& pair) -> bool { return pair.second->classname() == "IFCCURVESEGMENT"; }); + auto result3 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto& pair) -> bool { return pair.second->classname() == "IFCALIGNMENTHORIZONTAL"; }); + auto result4 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto& pair) -> bool { return pair.second->classname() == "IFCALIGNMENTHORIZONTALSEGMENT"; }); + EXPECT_NE(result1, express_model->entities.end()); + EXPECT_NE(result2, express_model->entities.end()); + EXPECT_NE(result3, express_model->entities.end()); + EXPECT_NE(result4, express_model->entities.end()); +} + +TEST_F(CosineCurve, ImageIsSaved) +{ + // Arrange + buw::Image4b image = rendererIfc->captureImage(); + + // Act + buw::storeImage(testPath("cosine-curve_100.0_300_1000_1_Meter.png").string(), image); + + // Assert + EXPECT_NO_THROW(buw::loadImage4b(testPath("cosine-curve_100.0_300_1000_1_Meter.png").string())); +} + +TEST_F(CosineCurve, PlaneSurfaceViews) +{ + // Arrange + const auto expected_top = buw::loadImage4b(dataPath("cosine-curve_100.0_300_1000_1_Meter_top.png").string()); + + // Act (Top) + rendererIfc->setViewDirection(buw::eViewDirection::Top); + buw::Image4b image_top = CaptureImage(); + + // uncomment following lines to also save the screen shot + //buw::storeImage(testPath("cosine-curve_100.0_300_1000_1_Meter_top.png").string(), image_top); + + // Assert + EXPECT_EQ(image_top, expected_top); +} \ No newline at end of file diff --git a/UnitTests/Schemas/IFC4X3_RC4/cubic_100.0_300_1000_1_Meter/CMakeLists.txt b/UnitTests/Schemas/IFC4X3_RC4/cubic_100.0_300_1000_1_Meter/CMakeLists.txt new file mode 100644 index 000000000..09bc1e61d --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/cubic_100.0_300_1000_1_Meter/CMakeLists.txt @@ -0,0 +1,20 @@ +# +# Copyright (c) 2021 Technical University of Munich +# Chair of Computational Modeling and Simulation. +# +# TUM Open Infra Platform is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License Version 3 +# as published by the Free Software Foundation. +# +# TUM Open Infra Platform is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +include(CreateUnitTests) + +CreateIfcFileVisualUnitTestForSchema(cubic_100.0_300_1000_1_Meter IFC4X3_RC4) diff --git a/UnitTests/Schemas/IFC4X3_RC4/cubic_100.0_300_1000_1_Meter/Data/cubic_100.0_300_1000_1_Meter.ifc b/UnitTests/Schemas/IFC4X3_RC4/cubic_100.0_300_1000_1_Meter/Data/cubic_100.0_300_1000_1_Meter.ifc new file mode 100644 index 000000000..64ddf80d5 --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/cubic_100.0_300_1000_1_Meter/Data/cubic_100.0_300_1000_1_Meter.ifc @@ -0,0 +1,79 @@ +ISO-10303-21; +HEADER; +FILE_DESCRIPTION (('ViewDefinition [CoordinationView]'), '2;1'); +FILE_NAME ('Single-LANDXML.ifc', '2021-05-24T11:00:00', ('IFC Rail Technical Services'), ('buildingSMART International RailwayRoom'), 'RailCOMPLETE\X2\FFAE\X0\', '2019.1.1995.0', ''); +FILE_SCHEMA (('IFC4X3_RC4')); +ENDSEC; +DATA; +#1 = IFCPROJECT('1FNFy8AJeHwwz7wDZHIYIu', #3, 'IFC Rail Referencedata', 'Rail alignment sample', $, 'Longname', 'Design', $, #9); +#2 = IFCAPPLICATION(#5, '2019.1.1995.0', 'RailCOMPLETE\X2\00AE\X0\', $); +#3 = IFCOWNERHISTORY(#6, #2, $, .ADDED., 1320688800, $, $, 1320688800); +#4 = IFCPERSON('TS', 'IFC Rail Technical Services', $, $, $, $, $, $); +#5 = IFCORGANIZATION('bsI RWR', 'buildingSmart International Railway Room', $, $, $); +#6 = IFCPERSONANDORGANIZATION(#4, #5, $); +#7 = IFCSIUNIT(*, .LENGTHUNIT., $, .METRE.); +#8 = IFCSIUNIT(*, .PLANEANGLEUNIT., $, .RADIAN.); +#9 = IFCUNITASSIGNMENT((#7, #8)); +#10 = IFCCARTESIANPOINT((0., 0., 0.)); +#11 = IFCDIRECTION((0., 0., 1.)); +#12 = IFCDIRECTION((1., 0., 0.)); +#13 = IFCAXIS2PLACEMENT3D(#10, #11, #12); +#14 = IFCLOCALPLACEMENT($, #13); +#15 = IFCRAILWAY('1FNFy9AJeHwuVmwDZHIYIu', #3, 'optional Railway Name', 'optional Railway Description', $, #14, $, 'Longname for Railway track geometry (alignment)', $, $); +#16 = IFCDIRECTION((0., 1., 0.)); +#17 = IFCGEOMETRICREPRESENTATIONCONTEXT($, 'MODEL', 3, 1.E-5, #13, #16); +#18 = IFCRELAGGREGATES('1FNFyAAJeHwu6TwDZHIYIu', #3, 'Documentation Container', 'Container for IfcProject, collects relevant products', #1, (#15)); +#19 = IFCRELCONTAINEDINSPATIALSTRUCTURE('1FNFyBAJeHwvmywDZHIYIu', #3, 'IfcProducts contained in myIfcRailway', 'Association between IfcProducts and IfcRailway', (#20), #15); +#20 = IFCALIGNMENT('1FNFyCAJeHwxedwDZHIYIu', #3, 'Spor', 'optional Railway Description', $, #46, #49, $, $); +#21 = IFCALIGNMENTHORIZONTAL('1FNFyDAJeHwv87wDZHIYIu', $, $, $, $, #51, #54); +#23 = IFCRELNESTS('3BJTAQrjCHwvVKbERtTLTf', $, $, $, #20, (#21)); +#28 = IFCCARTESIANPOINT((0., 0.)); +#29 = IFCALIGNMENTHORIZONTALSEGMENT($, $, #28, 0., 300., 1000., 100., $, .CUBIC.); +#30 = IFCALIGNMENTSEGMENT('1FNFyHAJeHwuDtwDZHIYIu', #3, $, $, $, #37, #40, #29); +#34 = IFCRELNESTS('1FNFyHAJeHwuDtwDZHIYIj', $, $, $, #21, (#30)); +#35 = IFCCOMPOSITECURVE((#36), .F.); +#36 = IFCCURVESEGMENT(.DISCONTINUOUS., #42, IFCPARAMETERVALUE(0.), IFCNONNEGATIVELENGTHMEASURE(100.), #45); +#37 = IFCLOCALPLACEMENT($, #38); +#38 = IFCAXIS2PLACEMENT3D(#39, $, $); +#39 = IFCCARTESIANPOINT((0., 0., 0.)); +#40 = IFCPRODUCTDEFINITIONSHAPE($, $, (#41, #69)); +#41 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve2D', (#36)); +#42 = IFCAXIS2PLACEMENT2D(#43, #44); +#43 = IFCCARTESIANPOINT((0., 0.)); +#44 = IFCDIRECTION((1., 0.)); +#45 = IFCPOLYNOMIALCURVE(#42, (0., 1., 0.), (0., 0., 1., 0.), $); +#46 = IFCLOCALPLACEMENT($, #47); +#47 = IFCAXIS2PLACEMENT3D(#48, $, $); +#48 = IFCCARTESIANPOINT((0., 0., 0.)); +#49 = IFCPRODUCTDEFINITIONSHAPE($, $, (#50, #75)); +#50 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve3D', (#35)); +#51 = IFCLOCALPLACEMENT($, #52); +#52 = IFCAXIS2PLACEMENT3D(#53, $, $); +#53 = IFCCARTESIANPOINT((0., 0., 0.)); +#54 = IFCPRODUCTDEFINITIONSHAPE($, $, (#55, #58)); +#55 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve2D', (#35)); +#56 = IFCCARTESIANPOINTLIST2D(((0., 0.), (1., 0.), (2., 0.), (3., 0.), (4., 0.), (5., 0.), (6., 0.), (7., 0.), (8., 0.), (9., 0.), (10., 0.), (11., 0.), (12., 0.), (13., 0.), (14., 0.), (15., 0.), (16., 0.), (17., 0.), (18., 0.), (19., 0.), (20., 0.), (21., 0.), (22., 0.), (23., 0.), (24., 0.), (25., 0.), (26., 0.), (27., 0.), (28., 0.), (29., 0.), (30., 0.), (31., 0.), (32., 0.), (33., 0.), (34., 0.), (35., 0.), (36., 0.), (37., 0.), (38., 0.), (39., 0.), (40., 0.), (41., 0.), (42., 0.), (43., 0.), (44., 0.), (45., 0.), (46., 0.), (47., 0.), (48., 0.), (49., 0.), (50., 0.), (51., 0.), (52., 0.), (53., 0.), (54., 0.), (55., 0.), (56., 0.), (57., 0.), (58., 0.), (59., 0.), (60., 0.), (61., 0.), (62., 0.), (63., 0.), (64., 0.), (65., 0.), (66., 0.), (67., 0.), (68., 0.), (69., 0.), (70., 0.), (71., 0.), (72., 0.), (73., 0.), (74., 0.), (75., 0.), (76., 0.), (77., 0.), (78., 0.), (79., 0.), (80., 0.), (81., 0.), (82., 0.), (83., 0.), (84., 0.), (85., 0.), (86., 0.), (87., 0.), (88., 0.), (89., 0.), (90., 0.), (91., 0.), (92., 0.), (93., 0.), (94., 0.), (95., 0.), (96., 0.), (97., 0.), (98., 0.), (99., 0.), (100., 0.)), $); +#57 = IFCINDEXEDPOLYCURVE(#56, $, $); +#58 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#57)); +#59 = IFCOWNERHISTORY(#61, #63, $, .ADDED., 1630842508, $, $, 1630842508); +#60 = IFCORGANIZATION($, '\X2\0410\X0\\X2\0420\X0\ \X2\0414\X0\\X2\0418\X0\ \X2\0415\X0\\X2\0424\X0\ \X2\041E\X0\\X2\041E\X0\\X2\0414\X0\', 'RDF Ltd.', $, $); +#61 = IFCPERSONANDORGANIZATION(#62, #60, $); +#62 = IFCPERSON($, 'Bonsma', 'Peter', $, $, $, $, $); +#63 = IFCAPPLICATION(#60, '0.99', 'Add Check Library Application', 'TA 1001'); +#64 = IFCRELDEFINESBYPROPERTIES('2bBuFv_ijERgsLKlQwr5HM', #59, $, $, (#21), #65); +#65 = IFCPROPERTYSET('0SzIEXqa1CRgMbi4KLOhyq', #59, 'ValidationPset', $, (#66)); +#66 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(100.), $); +#67 = IFCCARTESIANPOINTLIST2D(((0., 0.), (1., 0.), (2., 0.), (3., 0.), (4., 0.), (5., 0.), (6., 0.), (7., 0.), (8., 0.), (9., 0.), (10., 0.), (11., 0.), (12., 0.), (13., 0.), (14., 0.), (15., 0.), (16., 0.), (17., 0.), (18., 0.), (19., 0.), (20., 0.), (21., 0.), (22., 0.), (23., 0.), (24., 0.), (25., 0.), (26., 0.), (27., 0.), (28., 0.), (29., 0.), (30., 0.), (31., 0.), (32., 0.), (33., 0.), (34., 0.), (35., 0.), (36., 0.), (37., 0.), (38., 0.), (39., 0.), (40., 0.), (41., 0.), (42., 0.), (43., 0.), (44., 0.), (45., 0.), (46., 0.), (47., 0.), (48., 0.), (49., 0.), (50., 0.), (51., 0.), (52., 0.), (53., 0.), (54., 0.), (55., 0.), (56., 0.), (57., 0.), (58., 0.), (59., 0.), (60., 0.), (61., 0.), (62., 0.), (63., 0.), (64., 0.), (65., 0.), (66., 0.), (67., 0.), (68., 0.), (69., 0.), (70., 0.), (71., 0.), (72., 0.), (73., 0.), (74., 0.), (75., 0.), (76., 0.), (77., 0.), (78., 0.), (79., 0.), (80., 0.), (81., 0.), (82., 0.), (83., 0.), (84., 0.), (85., 0.), (86., 0.), (87., 0.), (88., 0.), (89., 0.), (90., 0.), (91., 0.), (92., 0.), (93., 0.), (94., 0.), (95., 0.), (96., 0.), (97., 0.), (98., 0.), (99., 0.), (100., 0.)), $); +#68 = IFCINDEXEDPOLYCURVE(#67, $, $); +#69 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#68)); +#70 = IFCRELDEFINESBYPROPERTIES('3awH4O7UHE6Pl_mPdByl2b', #59, $, $, (#30), #71); +#71 = IFCPROPERTYSET('3a$OQOABL7GAoL$7ns3Me_', #59, 'ValidationPset', $, (#72)); +#72 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(100.), $); +#73 = IFCCARTESIANPOINTLIST2D(((0., 0.), (1., 0.), (2., 0.), (3., 0.), (4., 0.), (5., 0.), (6., 0.), (7., 0.), (8., 0.), (9., 0.), (10., 0.), (11., 0.), (12., 0.), (13., 0.), (14., 0.), (15., 0.), (16., 0.), (17., 0.), (18., 0.), (19., 0.), (20., 0.), (21., 0.), (22., 0.), (23., 0.), (24., 0.), (25., 0.), (26., 0.), (27., 0.), (28., 0.), (29., 0.), (30., 0.), (31., 0.), (32., 0.), (33., 0.), (34., 0.), (35., 0.), (36., 0.), (37., 0.), (38., 0.), (39., 0.), (40., 0.), (41., 0.), (42., 0.), (43., 0.), (44., 0.), (45., 0.), (46., 0.), (47., 0.), (48., 0.), (49., 0.), (50., 0.), (51., 0.), (52., 0.), (53., 0.), (54., 0.), (55., 0.), (56., 0.), (57., 0.), (58., 0.), (59., 0.), (60., 0.), (61., 0.), (62., 0.), (63., 0.), (64., 0.), (65., 0.), (66., 0.), (67., 0.), (68., 0.), (69., 0.), (70., 0.), (71., 0.), (72., 0.), (73., 0.), (74., 0.), (75., 0.), (76., 0.), (77., 0.), (78., 0.), (79., 0.), (80., 0.), (81., 0.), (82., 0.), (83., 0.), (84., 0.), (85., 0.), (86., 0.), (87., 0.), (88., 0.), (89., 0.), (90., 0.), (91., 0.), (92., 0.), (93., 0.), (94., 0.), (95., 0.), (96., 0.), (97., 0.), (98., 0.), (99., 0.), (100., 0.)), $); +#74 = IFCINDEXEDPOLYCURVE(#73, $, $); +#75 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#74)); +#76 = IFCRELDEFINESBYPROPERTIES('0v_Be$wqfDweEa$VWapD_u', #59, $, $, (#20), #77); +#77 = IFCPROPERTYSET('2cyPb7sqz9_8k9gZ7a$ney', #59, 'ValidationPset', $, (#78)); +#78 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(100.), $); +ENDSEC; +END-ISO-10303-21; diff --git a/UnitTests/Schemas/IFC4X3_RC4/cubic_100.0_300_1000_1_Meter/src/cubic_100.0_300_1000_1_Meter.cpp b/UnitTests/Schemas/IFC4X3_RC4/cubic_100.0_300_1000_1_Meter/src/cubic_100.0_300_1000_1_Meter.cpp new file mode 100644 index 000000000..485924d10 --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/cubic_100.0_300_1000_1_Meter/src/cubic_100.0_300_1000_1_Meter.cpp @@ -0,0 +1,100 @@ +/* + Copyright (c) 2021 Technical University of Munich + Chair of Computational Modeling and Simulation. + + TUM Open Infra Platform is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License Version 3 + as published by the Free Software Foundation. + + TUM Open Infra Platform is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include +#include + +#include + +#include +#include +#include + +using namespace testing; + +class Cubic : public IfcVisualTest { +protected: + + // Test standard values + buw::Image4b _background = buw::Image4b(0, 0); + + virtual void SetUp() override { + IfcVisualTest::SetUp(); + + express_model = OpenInfraPlatform::IFC4X3_RC4::IFC4X3_RC4Reader::FromFile(filename.string()); + + importer = buw::makeReferenceCounted>(); + auto model = importer->collectData(express_model); + + _background = rendererIfc->captureImage(); + rendererIfc->setModel(model[0]); + } + + virtual void TearDown() override { + express_model.reset(); + IfcVisualTest::TearDown(); + } + + virtual std::string TestName() const { return "cubic_100.0_300_1000_1_Meter"; } + virtual std::string Schema() const { return "IFC4X3_RC4"; } + + const boost::filesystem::path filename = dataPath("cubic_100.0_300_1000_1_Meter.ifc"); + + std::shared_ptr express_model = nullptr; + buw::ReferenceCounted> importer = nullptr; +}; + +TEST_F(Cubic, AllEntitiesAreRead) { + EXPECT_THAT(express_model->entities.size(), Eq(78)); +} + +TEST_F(Cubic, IFCHasAnEssentialEntity) { + auto result1 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto& pair) -> bool { return pair.second->classname() == "IFCCURVESEGMENT"; }); + auto result2 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto& pair) -> bool { return pair.second->classname() == "IFCALIGNMENTHORIZONTAL"; }); + auto result3 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto& pair) -> bool { return pair.second->classname() == "IFCALIGNMENTHORIZONTALSEGMENT"; }); + EXPECT_NE(result1, express_model->entities.end()); + EXPECT_NE(result2, express_model->entities.end()); + EXPECT_NE(result3, express_model->entities.end()); +} + +TEST_F(Cubic, ImageIsSaved) +{ + // Arrange + buw::Image4b image = rendererIfc->captureImage(); + + // Act + buw::storeImage(testPath("cubic_100.0_300_1000_1_Meter.png").string(), image); + + // Assert + EXPECT_NO_THROW(buw::loadImage4b(testPath("cubic_100.0_300_1000_1_Meter.png").string())); +} + +TEST_F(Cubic, PlaneSurfaceViews) +{ + // Arrange + const auto expected_top = buw::loadImage4b(dataPath("cubic_100.0_300_1000_1_Meter_top.png").string()); + + // Act (Top) + rendererIfc->setViewDirection(buw::eViewDirection::Top); + buw::Image4b image_top = CaptureImage(); + + // uncomment following lines to also save the screen shot + //buw::storeImage(testPath("cubic_100.0_300_1000_1_Meter_top.png").string(), image_top); + + // Assert + EXPECT_EQ(image_top, expected_top); +} diff --git a/UnitTests/Schemas/IFC4X3_RC4/helmert-curve_100.0_300_1000_1_Meter/CMakeLists.txt b/UnitTests/Schemas/IFC4X3_RC4/helmert-curve_100.0_300_1000_1_Meter/CMakeLists.txt new file mode 100644 index 000000000..09654ee0d --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/helmert-curve_100.0_300_1000_1_Meter/CMakeLists.txt @@ -0,0 +1,20 @@ +# +# Copyright (c) 2021 Technical University of Munich +# Chair of Computational Modeling and Simulation. +# +# TUM Open Infra Platform is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License Version 3 +# as published by the Free Software Foundation. +# +# TUM Open Infra Platform is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +include(CreateUnitTests) + +CreateIfcFileVisualUnitTestForSchema(helmert-curve_100.0_300_1000_1_Meter IFC4X3_RC4) diff --git a/UnitTests/Schemas/IFC4X3_RC4/helmert-curve_100.0_300_1000_1_Meter/Data/helmert-curve_100.0_300_1000_1_Meter.ifc b/UnitTests/Schemas/IFC4X3_RC4/helmert-curve_100.0_300_1000_1_Meter/Data/helmert-curve_100.0_300_1000_1_Meter.ifc new file mode 100644 index 000000000..92534dc19 --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/helmert-curve_100.0_300_1000_1_Meter/Data/helmert-curve_100.0_300_1000_1_Meter.ifc @@ -0,0 +1,95 @@ +ISO-10303-21; +HEADER; +FILE_DESCRIPTION (('ViewDefinition [CoordinationView]'), '2;1'); +FILE_NAME ('Single-LANDXML.ifc', '2021-05-24T11:00:00', ('IFC Rail Technical Services'), ('buildingSMART International RailwayRoom'), 'RailCOMPLETE\X2\FFAE\X0\', '2019.1.1995.0', ''); +FILE_SCHEMA (('IFC4X3_RC4')); +ENDSEC; +DATA; +#1 = IFCPROJECT('1FNFy8AJeHwwz7wDZHIYIu', #3, 'IFC Rail Referencedata', 'Rail alignment sample', $, 'Longname', 'Design', $, #9); +#2 = IFCAPPLICATION(#5, '2019.1.1995.0', 'RailCOMPLETE\X2\00AE\X0\', $); +#3 = IFCOWNERHISTORY(#6, #2, $, .ADDED., 1320688800, $, $, 1320688800); +#4 = IFCPERSON('TS', 'IFC Rail Technical Services', $, $, $, $, $, $); +#5 = IFCORGANIZATION('bsI RWR', 'buildingSmart International Railway Room', $, $, $); +#6 = IFCPERSONANDORGANIZATION(#4, #5, $); +#7 = IFCSIUNIT(*, .LENGTHUNIT., $, .METRE.); +#8 = IFCSIUNIT(*, .PLANEANGLEUNIT., $, .RADIAN.); +#9 = IFCUNITASSIGNMENT((#7, #8)); +#10 = IFCCARTESIANPOINT((0., 0., 0.)); +#11 = IFCDIRECTION((0., 0., 1.)); +#12 = IFCDIRECTION((1., 0., 0.)); +#13 = IFCAXIS2PLACEMENT3D(#10, #11, #12); +#14 = IFCLOCALPLACEMENT($, #13); +#15 = IFCRAILWAY('1FNFy9AJeHwuVmwDZHIYIu', #3, 'optional Railway Name', 'optional Railway Description', $, #14, $, 'Longname for Railway track geometry (alignment)', $, $); +#16 = IFCDIRECTION((0., 1., 0.)); +#17 = IFCGEOMETRICREPRESENTATIONCONTEXT($, 'MODEL', 3, 1.E-5, #13, #16); +#18 = IFCRELAGGREGATES('1FNFyAAJeHwu6TwDZHIYIu', #3, 'Documentation Container', 'Container for IfcProject, collects relevant products', #1, (#15)); +#19 = IFCRELCONTAINEDINSPATIALSTRUCTURE('1FNFyBAJeHwvmywDZHIYIu', #3, 'IfcProducts contained in myIfcRailway', 'Association between IfcProducts and IfcRailway', (#20), #15); +#20 = IFCALIGNMENT('1FNFyCAJeHwxedwDZHIYIu', #3, 'Spor', 'optional Railway Description', $, #62, #65, $, $); +#21 = IFCALIGNMENTHORIZONTAL('1FNFyDAJeHwv87wDZHIYIu', $, $, $, $, #67, #70); +#23 = IFCRELNESTS('3BJTAQrjCHwvVKbERtTLTf', $, $, $, #20, (#21)); +#28 = IFCCARTESIANPOINT((0., 0.)); +#29 = IFCALIGNMENTHORIZONTALSEGMENT($, $, #28, 0., 300., 1000., 100., $, .HELMERTCURVE.); +#30 = IFCALIGNMENTSEGMENT('1FNFyHAJeHwuDtwDZHIYIu', #3, $, $, $, #50, #53, #29); +#34 = IFCRELNESTS('1FNFyHAJeHwuDtwDZHIYIj', $, $, $, #21, (#30)); +#35 = IFCCOMPOSITECURVE((#36, #49), .F.); +#36 = IFCCURVESEGMENT(.DISCONTINUOUS., #42, IFCPARAMETERVALUE(0.), IFCNONNEGATIVELENGTHMEASURE(50.), #45); +#37 = IFCLOCALPLACEMENT($, #38); +#38 = IFCAXIS2PLACEMENT3D(#39, $, $); +#39 = IFCCARTESIANPOINT((0., 0., 0.)); +#40 = IFCPRODUCTDEFINITIONSHAPE($, $, (#41)); +#41 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve2D', (#36, #49)); +#42 = IFCAXIS2PLACEMENT2D(#43, #44); +#43 = IFCCARTESIANPOINT((0., 0.)); +#44 = IFCDIRECTION((1., 0.)); +#45 = IFCSECONDORDERPOLYNOMIALSPIRAL(#46, -128.92319893893, $, $); +#46 = IFCAXIS2PLACEMENT2D(#47, #48); +#47 = IFCCARTESIANPOINT((0., 0.)); +#48 = IFCDIRECTION((1., 0.)); +#49 = IFCCURVESEGMENT(.CONTSAMEGRADIENTSAMECURVATURE., #55, IFCPARAMETERVALUE(50.), IFCNONNEGATIVELENGTHMEASURE(50.), #58); +#50 = IFCLOCALPLACEMENT($, #51); +#51 = IFCAXIS2PLACEMENT3D(#52, $, $); +#52 = IFCCARTESIANPOINT((0., 0., 0.)); +#53 = IFCPRODUCTDEFINITIONSHAPE($, $, (#54, #85)); +#54 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve2D', (#49)); +#55 = IFCAXIS2PLACEMENT2D(#56, #57); +#56 = IFCCARTESIANPOINT((49.9986497142664, -2.4304942922762E-1)); +#57 = IFCDIRECTION((9.99810962746271E-1, -1.94432191875433E-2)); +#58 = IFCSECONDORDERPOLYNOMIALSPIRAL(#59, 128.92319893893, -103.509833901353, 428.571428571428); +#59 = IFCAXIS2PLACEMENT2D(#60, #61); +#60 = IFCCARTESIANPOINT((5.67092501201216E-3, 4.86060789440783E-1)); +#61 = IFCDIRECTION((9.9924392245525E-1, -3.88790873895689E-2)); +#62 = IFCLOCALPLACEMENT($, #63); +#63 = IFCAXIS2PLACEMENT3D(#64, $, $); +#64 = IFCCARTESIANPOINT((0., 0., 0.)); +#65 = IFCPRODUCTDEFINITIONSHAPE(#17, $, (#66, #91)); +#66 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve3D', (#35)); +#67 = IFCLOCALPLACEMENT($, #68); +#68 = IFCAXIS2PLACEMENT3D(#69, $, $); +#69 = IFCCARTESIANPOINT((0., 0., 0.)); +#70 = IFCPRODUCTDEFINITIONSHAPE($, $, (#71, #74)); +#71 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve2D', (#35)); +#72 = IFCCARTESIANPOINTLIST2D(((0., 0.), (5.E-1, -2.43055556415977E-9), (9.99999999999998E-1, -3.88888889060971E-8), (1.49999999999997, -1.96875000025808E-7), (1.99999999999978, -6.22222222256572E-7), (2.49999999999894, -1.51909722226464E-6), (2.99999999999622, -3.15000000004791E-6), (3.49999999998888, -5.83576388893179E-6), (3.99999999997168, -9.95555555555856E-6), (4.49999999993541, -1.59468749998637E-5), (4.99999999986497, -2.43055555550288E-5), (5.49999999973686, -3.55857638873943E-5), (5.99999999951616, -5.03999999963097E-5), (6.4999999991527, -6.94190972138879E-5), (6.99999999857659, -9.33722222046213E-5), (7.49999999769287, -1.23046874964801E-4), (7.99999999637529, -1.59288888821665E-4), (8.49999999445916, -2.03002430432193E-4), (8.99999999173314, -2.55149999781413E-4), (9.49999998792997, -3.16752430180104E-4), (9.99999998271605, -3.88888888261716E-4), (10.4999999756797, -4.72696873978303E-4), (10.9999999663185, -5.69372220595242E-4), (11.4999999540243, -6.80169094684464E-4), (11.9999999380685, -8.06399996115859E-4), (12.4999999175837, -9.4943575804651E-4), (12.9999998915458, -1.11070554690731E-3), (13.4999998587529, -1.29169686238651E-3), (13.9999998178038, -1.49395553740959E-3), (14.4999997670734, -1.71908573811492E-3), (14.9999997046875, -1.96874996382447E-3), (15.4999996284948, -2.24466904700877E-3), (15.9999995360375, -2.54862215324535E-3), (16.4999994245195, -2.88244678116962E-3), (16.9999992907727, -3.24803876241713E-3), (17.4999991312209, -3.64735226155619E-3), (17.999998941842, -4.0823997760094E-3), (18.4999987181267, -4.55525213596274E-3), (18.9999984550366, -5.06803850426082E-3), (19.499998146958, -5.62294637628648E-3), (19.9999977876545, -6.22222157982294E-3), (20.4999973702164, -6.86816827489676E-3), (20.9999968870078, -7.5631489535991E-3), (21.4999963296102, -8.30958443988341E-3), (21.9999956887647, -9.10995388933684E-3), (22.4999949543098, -9.96679478892273E-3), (22.9999941151175, -1.08827029566914E-2), (23.4999931590255, -1.18603325414563E-2), (23.9999920727671, -1.29023960224317E-2), (24.4999908418974, -1.40116642088297E-2), (24.9999894507165, -1.51909662394109E-2), (25.4999878821897, -1.64431895819865E-2), (25.9999861178636, -1.77712800328669E-2), (26.4999841377799, -1.91782417162522E-2), (26.9999819203848, -2.06671370835601E-2), (27.4999794424351, -2.22410869126854E-2), (27.9999766789012, -2.39032703071876E-2), (28.4999736028656, -2.56569246953982E-2), (28.9999701854182, -2.75053458294442E-2), (29.499966395548, -2.94518877841798E-2), (29.9999622000299, -3.14999629560208E-2), (30.499957563309, -3.36530420616735E-2), (30.9999524473795, -3.59146541367515E-2), (31.4999468116605, -3.82883865342725E-2), (31.9999406128671, -4.07778849230266E-2), (32.4999338048779, -4.33868532858077E-2), (32.9999263385969, -4.61190539174986E-2), (33.499918161813, -4.89783074230009E-2), (33.9999092190533, -5.19684927149995E-2), (34.4998994514326, -5.50935470115508E-2), (34.999888796499, -5.83574658334843E-2), (35.4998771880734, -6.17643030016065E-2), (35.9998645560859, -6.5318170633694E-2), (36.4998508264061, -6.90232391412642E-2), (36.9998359206695, -7.28837372261111E-2), (37.4998197560985, -7.69039518765914E-2), (37.9998022453186, -8.10882283636473E-2), (38.4997832961697, -8.54409702365521E-2), (38.999762811512, -8.99666393183621E-2), (39.4997406890268, -9.46697557010591E-2), (39.9997168210125, -9.9554897740368E-2), (40.4996910941746, -1.0462670205023E-1), (40.9996633894109, -1.09889863496917E-1), (41.4996335815908, -1.15349135192764E-1), (41.9996015393297, -1.21009328489504E-1), (42.499567124757, -1.26875312971183E-1), (42.9995301932795, -1.3295201644664E-1), (43.4994905933378, -1.39244424941514E-1), (43.9994481661583, -1.45757582689783E-1), (44.4994027454982, -1.52496592124784E-1), (44.9993541573855, -1.59466613869706E-1), (45.4993022198523, -1.66672866727532E-1), (45.9992467426623, -1.7412062767039E-1), (46.4991875270327, -1.81815231828305E-1), (46.9991243653489, -1.89762072477311E-1), (47.4990570408739, -1.97966601026905E-1), (47.9989853274511, -2.06434327006795E-1), (48.4989089892001, -2.15170818052944E-1), (48.9988277802072, -2.24181699892842E-1), (49.4987414442084, -2.33472656329999E-1), (49.9986497142664, -2.4304942922762E-1), (50.4985523125373, -2.52917813631276E-1), (50.9984489510365, -2.6308360428996E-1), (51.4983393325533, -2.73552542179484E-1), (51.9982231506862, -2.84330309628625E-1), (52.4981000897914, -2.95422530305276E-1), (52.9979698249389, -3.06834769202366E-1), (53.4978320218745, -3.18572532623547E-1), (53.997686336989, -3.30641268168703E-1), (54.4975324172925, -3.43046364719243E-1), (54.9973699003968, -3.55793152423232E-1), (55.4971984145028, -3.68886902680349E-1), (55.9970175783943, -3.82332828126705E-1), (56.4968270014386, -3.96136082619517E-1), (56.9966262835925, -4.10301761221677E-1), (57.4964150154146, -4.24834900186197E-1), (57.9961927780833, -4.3974047694059E-1), (58.4959591434213, -4.55023410071171E-1), (58.9957136739251, -4.7068855930729E-1), (59.4954559228008, -4.8674072550555E-1), (59.9951854340053, -5.03184650633992E-1), (60.4949017422933, -5.20025017756272E-1), (60.9946043732697, -5.37266451015862E-1), (61.4942928434475, -5.54913515620278E-1), (61.9939666603112, -5.72970717825349E-1), (62.4936253223852, -5.91442504919572E-1), (62.9932683193081, -6.10333265208525E-1), (63.4928951319113, -6.29647327999404E-1), (63.9925052323038, -6.49388963585674E-1), (64.4920980839612, -6.69562383231858E-1), (64.9916731418199, -6.90171739158475E-1), (65.4912298523765, -7.11221124527171E-1), (65.9907676537918, -7.3271457342603E-1), (66.4902859759995, -7.54656060855098E-1), (66.9897842408203, -7.77049502712147E-1), (67.4892618620795, -7.99898755778667E-1), (67.9887182457301, -8.23207617706154E-1), (68.48815278998, -8.46979827002654E-1), (68.9875648854242, -8.71219063019626E-1), (69.4869539151803, -8.95928945939126E-1), (69.9863192550293, -9.21113036761321E-1), (70.4856602735603, -9.46774837292364E-1), (70.9849763323191, -9.72917790132647E-1), (71.4842667859615, -9.99545278665437E-1), (71.9835309824102, -1.02666062704593), (72.4827682630153, -1.05426710019073), (72.9819779627199, -1.08236790376776), (73.481159410228, -1.11096618418665), (73.9803119281774, -1.14006502858956), (74.4794348333157, -1.1696674648426), (74.9785274366798, -1.1997764615276), (75.4775890437796, -1.23039492793457), (75.976618954784, -1.26152571405455), (76.4756164647118, -1.29317161057316), (76.974580863625, -1.32533534886458), (77.4735114368248, -1.35801960098624), (77.9724074650528, -1.39122697967403), (78.4712682246929, -1.42496003833812), (78.9700929879782, -1.45922127105951), (79.4688810231998, -1.49401311258708), (79.9676315949187, -1.52933793833539), (80.466343964181, -1.56519806438311), (80.9650173887354, -1.60159574747216), (81.4636511232534, -1.63853318500751), (81.9622444195527, -1.67601251505767), (82.4607965268224, -1.71403581635597), (82.9593066918513, -1.75260510830248), (83.4577741592581, -1.79172235096671), (83.9561981717248, -1.83138944509106), (84.4545779702315, -1.87160823209498), (84.9529127942933, -1.91238049408), (85.451201882201, -1.95370795383536), (85.9494444712615, -1.99559227484463), (86.4476397980421, -2.03803506129295), (86.9457870986159, -2.08103785807514), (87.443885608809, -2.12460215080464), (87.9419345644498, -2.16872936582319), (88.4399332016202, -2.21342087021138), (88.9378807569077, -2.25867797180002), (89.4357764676601, -2.30450191918231), (89.9336195722406, -2.35089390172684), (90.4314093102856, -2.39785504959148), (90.9291449229626, -2.44538643373805), (91.4268256532305, -2.49348906594784), (91.9244507461001, -2.542163898838), (92.422019448897, -2.5914118258788), (92.9195310115245, -2.64123368141163), (93.4169846867277, -2.69163024066798), (93.9143797303595, -2.7426022197892), (94.4117154016461, -2.7941502758471), (94.9089909634543, -2.84627500686544), (95.4062056825593, -2.89897695184223), (95.9033588299129, -2.95225659077291), (96.4004496809126, -3.00611434467434), (96.8974775156713, -3.06055057560966), (97.394441619287, -3.11556558671396), (97.8913412821136, -3.17115962222077), (98.3881758000311, -3.22733286748948), (98.8849444747173, -3.28408544903341), (99.3816466139184, -3.34141743454888), (99.8782815317203, -3.39932883294494)), $); +#73 = IFCINDEXEDPOLYCURVE(#72, $, $); +#74 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#73)); +#75 = IFCOWNERHISTORY(#77, #79, $, .ADDED., 1630842535, $, $, 1630842535); +#76 = IFCORGANIZATION($, '\X2\0410\X0\\X2\0420\X0\ \X2\0414\X0\\X2\0418\X0\ \X2\0415\X0\\X2\0424\X0\ \X2\041E\X0\\X2\041E\X0\\X2\0414\X0\', 'RDF Ltd.', $, $); +#77 = IFCPERSONANDORGANIZATION(#78, #76, $); +#78 = IFCPERSON($, 'Bonsma', 'Peter', $, $, $, $, $); +#79 = IFCAPPLICATION(#76, '0.99', 'Add Check Library Application', 'TA 1001'); +#80 = IFCRELDEFINESBYPROPERTIES('3VMBYiyND7zhFSJ2mKGiyo', #75, $, $, (#21), #81); +#81 = IFCPROPERTYSET('3YoDiZw4fF2Okh1bgrnrSR', #75, 'ValidationPset', $, (#82)); +#82 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(99.9999978260094), $); +#83 = IFCCARTESIANPOINTLIST2D(((49.9986497142664, -2.4304942922762E-1), (50.4985523125373, -2.52917813631276E-1), (50.9984489510365, -2.6308360428996E-1), (51.4983393325533, -2.73552542179484E-1), (51.9982231506862, -2.84330309628625E-1), (52.4981000897914, -2.95422530305276E-1), (52.9979698249389, -3.06834769202366E-1), (53.4978320218745, -3.18572532623547E-1), (53.997686336989, -3.30641268168703E-1), (54.4975324172925, -3.43046364719243E-1), (54.9973699003968, -3.55793152423232E-1), (55.4971984145028, -3.68886902680349E-1), (55.9970175783943, -3.82332828126705E-1), (56.4968270014386, -3.96136082619517E-1), (56.9966262835925, -4.10301761221677E-1), (57.4964150154146, -4.24834900186197E-1), (57.9961927780833, -4.3974047694059E-1), (58.4959591434213, -4.55023410071171E-1), (58.9957136739251, -4.7068855930729E-1), (59.4954559228008, -4.8674072550555E-1), (59.9951854340053, -5.03184650633992E-1), (60.4949017422933, -5.20025017756272E-1), (60.9946043732697, -5.37266451015862E-1), (61.4942928434475, -5.54913515620278E-1), (61.9939666603112, -5.72970717825349E-1), (62.4936253223852, -5.91442504919572E-1), (62.9932683193081, -6.10333265208525E-1), (63.4928951319113, -6.29647327999404E-1), (63.9925052323038, -6.49388963585674E-1), (64.4920980839612, -6.69562383231858E-1), (64.9916731418199, -6.90171739158475E-1), (65.4912298523765, -7.11221124527171E-1), (65.9907676537918, -7.3271457342603E-1), (66.4902859759995, -7.54656060855098E-1), (66.9897842408203, -7.77049502712147E-1), (67.4892618620795, -7.99898755778667E-1), (67.9887182457301, -8.23207617706154E-1), (68.48815278998, -8.46979827002654E-1), (68.9875648854242, -8.71219063019626E-1), (69.4869539151803, -8.95928945939126E-1), (69.9863192550293, -9.21113036761321E-1), (70.4856602735603, -9.46774837292364E-1), (70.9849763323191, -9.72917790132647E-1), (71.4842667859615, -9.99545278665437E-1), (71.9835309824102, -1.02666062704593), (72.4827682630153, -1.05426710019073), (72.9819779627199, -1.08236790376776), (73.481159410228, -1.11096618418665), (73.9803119281774, -1.14006502858956), (74.4794348333157, -1.1696674648426), (74.9785274366798, -1.1997764615276), (75.4775890437796, -1.23039492793457), (75.976618954784, -1.26152571405455), (76.4756164647118, -1.29317161057316), (76.974580863625, -1.32533534886458), (77.4735114368248, -1.35801960098624), (77.9724074650528, -1.39122697967403), (78.4712682246929, -1.42496003833812), (78.9700929879782, -1.45922127105951), (79.4688810231998, -1.49401311258708), (79.9676315949187, -1.52933793833539), (80.466343964181, -1.56519806438311), (80.9650173887354, -1.60159574747216), (81.4636511232534, -1.63853318500751), (81.9622444195527, -1.67601251505767), (82.4607965268224, -1.71403581635597), (82.9593066918513, -1.75260510830248), (83.4577741592581, -1.79172235096671), (83.9561981717248, -1.83138944509106), (84.4545779702315, -1.87160823209498), (84.9529127942933, -1.91238049408), (85.451201882201, -1.95370795383536), (85.9494444712615, -1.99559227484463), (86.4476397980421, -2.03803506129295), (86.9457870986159, -2.08103785807514), (87.443885608809, -2.12460215080464), (87.9419345644498, -2.16872936582319), (88.4399332016202, -2.21342087021138), (88.9378807569077, -2.25867797180002), (89.4357764676601, -2.30450191918231), (89.9336195722406, -2.35089390172684), (90.4314093102856, -2.39785504959148), (90.9291449229626, -2.44538643373805), (91.4268256532305, -2.49348906594784), (91.9244507461001, -2.542163898838), (92.422019448897, -2.5914118258788), (92.9195310115245, -2.64123368141163), (93.4169846867277, -2.69163024066798), (93.9143797303595, -2.7426022197892), (94.4117154016461, -2.7941502758471), (94.9089909634543, -2.84627500686544), (95.4062056825593, -2.89897695184223), (95.9033588299129, -2.95225659077291), (96.4004496809126, -3.00611434467434), (96.8974775156713, -3.06055057560966), (97.394441619287, -3.11556558671396), (97.8913412821136, -3.17115962222077), (98.3881758000311, -3.22733286748948), (98.8849444747173, -3.28408544903341), (99.3816466139184, -3.34141743454888), (99.8782815317203, -3.39932883294494)), $); +#84 = IFCINDEXEDPOLYCURVE(#83, $, $); +#85 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#84)); +#86 = IFCRELDEFINESBYPROPERTIES('2BkBD2pmD8cueLbU0eqhcJ', #75, $, $, (#30), #87); +#87 = IFCPROPERTYSET('3Zs6ffu8X8Ae9KKgDGnZtW', #75, 'ValidationPset', $, (#88)); +#88 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(49.999997967784), $); +#89 = IFCCARTESIANPOINTLIST2D(((0., 0.), (5.E-1, -2.43055556415977E-9), (9.99999999999998E-1, -3.88888889060971E-8), (1.49999999999997, -1.96875000025808E-7), (1.99999999999978, -6.22222222256572E-7), (2.49999999999894, -1.51909722226464E-6), (2.99999999999622, -3.15000000004791E-6), (3.49999999998888, -5.83576388893179E-6), (3.99999999997168, -9.95555555555856E-6), (4.49999999993541, -1.59468749998637E-5), (4.99999999986497, -2.43055555550288E-5), (5.49999999973686, -3.55857638873943E-5), (5.99999999951616, -5.03999999963097E-5), (6.4999999991527, -6.94190972138879E-5), (6.99999999857659, -9.33722222046213E-5), (7.49999999769287, -1.23046874964801E-4), (7.99999999637529, -1.59288888821665E-4), (8.49999999445916, -2.03002430432193E-4), (8.99999999173314, -2.55149999781413E-4), (9.49999998792997, -3.16752430180104E-4), (9.99999998271605, -3.88888888261716E-4), (10.4999999756797, -4.72696873978303E-4), (10.9999999663185, -5.69372220595242E-4), (11.4999999540243, -6.80169094684464E-4), (11.9999999380685, -8.06399996115859E-4), (12.4999999175837, -9.4943575804651E-4), (12.9999998915458, -1.11070554690731E-3), (13.4999998587529, -1.29169686238651E-3), (13.9999998178038, -1.49395553740959E-3), (14.4999997670734, -1.71908573811492E-3), (14.9999997046875, -1.96874996382447E-3), (15.4999996284948, -2.24466904700877E-3), (15.9999995360375, -2.54862215324535E-3), (16.4999994245195, -2.88244678116962E-3), (16.9999992907727, -3.24803876241713E-3), (17.4999991312209, -3.64735226155619E-3), (17.999998941842, -4.0823997760094E-3), (18.4999987181267, -4.55525213596274E-3), (18.9999984550366, -5.06803850426082E-3), (19.499998146958, -5.62294637628648E-3), (19.9999977876545, -6.22222157982294E-3), (20.4999973702164, -6.86816827489676E-3), (20.9999968870078, -7.5631489535991E-3), (21.4999963296102, -8.30958443988341E-3), (21.9999956887647, -9.10995388933684E-3), (22.4999949543098, -9.96679478892273E-3), (22.9999941151175, -1.08827029566914E-2), (23.4999931590255, -1.18603325414563E-2), (23.9999920727671, -1.29023960224317E-2), (24.4999908418974, -1.40116642088297E-2), (24.9999894507165, -1.51909662394109E-2), (25.4999878821897, -1.64431895819865E-2), (25.9999861178636, -1.77712800328669E-2), (26.4999841377799, -1.91782417162522E-2), (26.9999819203848, -2.06671370835601E-2), (27.4999794424351, -2.22410869126854E-2), (27.9999766789012, -2.39032703071876E-2), (28.4999736028656, -2.56569246953982E-2), (28.9999701854182, -2.75053458294442E-2), (29.499966395548, -2.94518877841798E-2), (29.9999622000299, -3.14999629560208E-2), (30.499957563309, -3.36530420616735E-2), (30.9999524473795, -3.59146541367515E-2), (31.4999468116605, -3.82883865342725E-2), (31.9999406128671, -4.07778849230266E-2), (32.4999338048779, -4.33868532858077E-2), (32.9999263385969, -4.61190539174986E-2), (33.499918161813, -4.89783074230009E-2), (33.9999092190533, -5.19684927149995E-2), (34.4998994514326, -5.50935470115508E-2), (34.999888796499, -5.83574658334843E-2), (35.4998771880734, -6.17643030016065E-2), (35.9998645560859, -6.5318170633694E-2), (36.4998508264061, -6.90232391412642E-2), (36.9998359206695, -7.28837372261111E-2), (37.4998197560985, -7.69039518765914E-2), (37.9998022453186, -8.10882283636473E-2), (38.4997832961697, -8.54409702365521E-2), (38.999762811512, -8.99666393183621E-2), (39.4997406890268, -9.46697557010591E-2), (39.9997168210125, -9.9554897740368E-2), (40.4996910941746, -1.0462670205023E-1), (40.9996633894109, -1.09889863496917E-1), (41.4996335815908, -1.15349135192764E-1), (41.9996015393297, -1.21009328489504E-1), (42.499567124757, -1.26875312971183E-1), (42.9995301932795, -1.3295201644664E-1), (43.4994905933378, -1.39244424941514E-1), (43.9994481661583, -1.45757582689783E-1), (44.4994027454982, -1.52496592124784E-1), (44.9993541573855, -1.59466613869706E-1), (45.4993022198523, -1.66672866727532E-1), (45.9992467426623, -1.7412062767039E-1), (46.4991875270327, -1.81815231828305E-1), (46.9991243653489, -1.89762072477311E-1), (47.4990570408739, -1.97966601026905E-1), (47.9989853274511, -2.06434327006795E-1), (48.4989089892001, -2.15170818052944E-1), (48.9988277802072, -2.24181699892842E-1), (49.4987414442084, -2.33472656329999E-1), (49.9986497142664, -2.4304942922762E-1), (50.4985523125373, -2.52917813631276E-1), (50.9984489510365, -2.6308360428996E-1), (51.4983393325533, -2.73552542179484E-1), (51.9982231506862, -2.84330309628625E-1), (52.4981000897914, -2.95422530305276E-1), (52.9979698249389, -3.06834769202366E-1), (53.4978320218745, -3.18572532623547E-1), (53.997686336989, -3.30641268168703E-1), (54.4975324172925, -3.43046364719243E-1), (54.9973699003968, -3.55793152423232E-1), (55.4971984145028, -3.68886902680349E-1), (55.9970175783943, -3.82332828126705E-1), (56.4968270014386, -3.96136082619517E-1), (56.9966262835925, -4.10301761221677E-1), (57.4964150154146, -4.24834900186197E-1), (57.9961927780833, -4.3974047694059E-1), (58.4959591434213, -4.55023410071171E-1), (58.9957136739251, -4.7068855930729E-1), (59.4954559228008, -4.8674072550555E-1), (59.9951854340053, -5.03184650633992E-1), (60.4949017422933, -5.20025017756272E-1), (60.9946043732697, -5.37266451015862E-1), (61.4942928434475, -5.54913515620278E-1), (61.9939666603112, -5.72970717825349E-1), (62.4936253223852, -5.91442504919572E-1), (62.9932683193081, -6.10333265208525E-1), (63.4928951319113, -6.29647327999404E-1), (63.9925052323038, -6.49388963585674E-1), (64.4920980839612, -6.69562383231858E-1), (64.9916731418199, -6.90171739158475E-1), (65.4912298523765, -7.11221124527171E-1), (65.9907676537918, -7.3271457342603E-1), (66.4902859759995, -7.54656060855098E-1), (66.9897842408203, -7.77049502712147E-1), (67.4892618620795, -7.99898755778667E-1), (67.9887182457301, -8.23207617706154E-1), (68.48815278998, -8.46979827002654E-1), (68.9875648854242, -8.71219063019626E-1), (69.4869539151803, -8.95928945939126E-1), (69.9863192550293, -9.21113036761321E-1), (70.4856602735603, -9.46774837292364E-1), (70.9849763323191, -9.72917790132647E-1), (71.4842667859615, -9.99545278665437E-1), (71.9835309824102, -1.02666062704593), (72.4827682630153, -1.05426710019073), (72.9819779627199, -1.08236790376776), (73.481159410228, -1.11096618418665), (73.9803119281774, -1.14006502858956), (74.4794348333157, -1.1696674648426), (74.9785274366798, -1.1997764615276), (75.4775890437796, -1.23039492793457), (75.976618954784, -1.26152571405455), (76.4756164647118, -1.29317161057316), (76.974580863625, -1.32533534886458), (77.4735114368248, -1.35801960098624), (77.9724074650528, -1.39122697967403), (78.4712682246929, -1.42496003833812), (78.9700929879782, -1.45922127105951), (79.4688810231998, -1.49401311258708), (79.9676315949187, -1.52933793833539), (80.466343964181, -1.56519806438311), (80.9650173887354, -1.60159574747216), (81.4636511232534, -1.63853318500751), (81.9622444195527, -1.67601251505767), (82.4607965268224, -1.71403581635597), (82.9593066918513, -1.75260510830248), (83.4577741592581, -1.79172235096671), (83.9561981717248, -1.83138944509106), (84.4545779702315, -1.87160823209498), (84.9529127942933, -1.91238049408), (85.451201882201, -1.95370795383536), (85.9494444712615, -1.99559227484463), (86.4476397980421, -2.03803506129295), (86.9457870986159, -2.08103785807514), (87.443885608809, -2.12460215080464), (87.9419345644498, -2.16872936582319), (88.4399332016202, -2.21342087021138), (88.9378807569077, -2.25867797180002), (89.4357764676601, -2.30450191918231), (89.9336195722406, -2.35089390172684), (90.4314093102856, -2.39785504959148), (90.9291449229626, -2.44538643373805), (91.4268256532305, -2.49348906594784), (91.9244507461001, -2.542163898838), (92.422019448897, -2.5914118258788), (92.9195310115245, -2.64123368141163), (93.4169846867277, -2.69163024066798), (93.9143797303595, -2.7426022197892), (94.4117154016461, -2.7941502758471), (94.9089909634543, -2.84627500686544), (95.4062056825593, -2.89897695184223), (95.9033588299129, -2.95225659077291), (96.4004496809126, -3.00611434467434), (96.8974775156713, -3.06055057560966), (97.394441619287, -3.11556558671396), (97.8913412821136, -3.17115962222077), (98.3881758000311, -3.22733286748948), (98.8849444747173, -3.28408544903341), (99.3816466139184, -3.34141743454888), (99.8782815317203, -3.39932883294494)), $); +#90 = IFCINDEXEDPOLYCURVE(#89, $, $); +#91 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#90)); +#92 = IFCRELDEFINESBYPROPERTIES('1R0BdPXWH0UOWShIBjKGB$', #75, $, $, (#20), #93); +#93 = IFCPROPERTYSET('1gf0grWtL4iRwwZ09MGlXp', #75, 'ValidationPset', $, (#94)); +#94 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(99.9999978260094), $); +ENDSEC; +END-ISO-10303-21; diff --git a/UnitTests/Schemas/IFC4X3_RC4/helmert-curve_100.0_300_1000_1_Meter/src/helmert-curve_100.0_300_1000_1_Meter.cpp b/UnitTests/Schemas/IFC4X3_RC4/helmert-curve_100.0_300_1000_1_Meter/src/helmert-curve_100.0_300_1000_1_Meter.cpp new file mode 100644 index 000000000..73698af8b --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/helmert-curve_100.0_300_1000_1_Meter/src/helmert-curve_100.0_300_1000_1_Meter.cpp @@ -0,0 +1,100 @@ +/* + Copyright (c) 2021 Technical University of Munich + Chair of Computational Modeling and Simulation. + + TUM Open Infra Platform is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License Version 3 + as published by the Free Software Foundation. + + TUM Open Infra Platform is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include +#include + +#include + +#include +#include +#include + +using namespace testing; + +class HelmertCurve : public IfcVisualTest { +protected: + + // Test standard values + buw::Image4b _background = buw::Image4b(0, 0); + + virtual void SetUp() override { + IfcVisualTest::SetUp(); + + express_model = OpenInfraPlatform::IFC4X3_RC4::IFC4X3_RC4Reader::FromFile(filename.string()); + + importer = buw::makeReferenceCounted>(); + auto model = importer->collectData(express_model); + + _background = rendererIfc->captureImage(); + rendererIfc->setModel(model[0]); + } + + virtual void TearDown() override { + express_model.reset(); + IfcVisualTest::TearDown(); + } + + virtual std::string TestName() const { return "helmert-curve_100.0_300_1000_1_Meter"; } + virtual std::string Schema() const { return "IFC4X3_RC4"; } + + const boost::filesystem::path filename = dataPath("helmert-curve_100.0_300_1000_1_Meter.ifc"); + + std::shared_ptr express_model = nullptr; + buw::ReferenceCounted> importer = nullptr; +}; + +TEST_F(HelmertCurve, AllEntitiesAreRead) { + EXPECT_THAT(express_model->entities.size(), Eq(86)); +} + +TEST_F(HelmertCurve, IFCHasAnEssentialEntity) { + auto result1 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto& pair) -> bool { return pair.second->classname() == "IFCCURVESEGMENT"; }); + auto result2 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto& pair) -> bool { return pair.second->classname() == "IFCALIGNMENTHORIZONTAL"; }); + auto result3 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto& pair) -> bool { return pair.second->classname() == "IFCALIGNMENTHORIZONTALSEGMENT"; }); + EXPECT_NE(result1, express_model->entities.end()); + EXPECT_NE(result2, express_model->entities.end()); + EXPECT_NE(result3, express_model->entities.end()); +} + +TEST_F(HelmertCurve, ImageIsSaved) +{ + // Arrange + buw::Image4b image = rendererIfc->captureImage(); + + // Act + buw::storeImage(testPath("helmert-curve_100.0_300_1000_1_Meter.png").string(), image); + + // Assert + EXPECT_NO_THROW(buw::loadImage4b(testPath("helmert-curve_100.0_300_1000_1_Meter.png").string())); +} + +TEST_F(HelmertCurve, PlaneSurfaceViews) +{ + // Arrange + const auto expected_top = buw::loadImage4b(dataPath("helmert-curve_100.0_300_1000_1_Meter_top.png").string()); + + // Act (Top) + rendererIfc->setViewDirection(buw::eViewDirection::Top); + buw::Image4b image_top = CaptureImage(); + + // uncomment following lines to also save the screen shot + //buw::storeImage(testPath("helmert-curve_100.0_300_1000_1_Meter_top.png").string(), image_top); + + // Assert + EXPECT_EQ(image_top, expected_top); +} \ No newline at end of file diff --git a/UnitTests/Schemas/IFC4X3_RC4/line_100.0_-1000_-300_1_Meter/CMakeLists.txt b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_-1000_-300_1_Meter/CMakeLists.txt new file mode 100644 index 000000000..76fef4281 --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_-1000_-300_1_Meter/CMakeLists.txt @@ -0,0 +1,20 @@ +# +# Copyright (c) 2021 Technical University of Munich +# Chair of Computational Modeling and Simulation. +# +# TUM Open Infra Platform is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License Version 3 +# as published by the Free Software Foundation. +# +# TUM Open Infra Platform is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +include(CreateUnitTests) + +CreateIfcFileVisualUnitTestForSchema(line_100.0_-1000_-300_1_Meter IFC4X3_RC4) diff --git a/UnitTests/Schemas/IFC4X3_RC4/line_100.0_-1000_-300_1_Meter/Data/line_100.0_-1000_-300_1_Meter.ifc b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_-1000_-300_1_Meter/Data/line_100.0_-1000_-300_1_Meter.ifc new file mode 100644 index 000000000..5d1f522bd --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_-1000_-300_1_Meter/Data/line_100.0_-1000_-300_1_Meter.ifc @@ -0,0 +1,82 @@ +ISO-10303-21; +HEADER; +FILE_DESCRIPTION (('ViewDefinition [CoordinationView]'), '2;1'); +FILE_NAME ('Single-LANDXML.ifc', '2021-05-24T11:00:00', ('IFC Rail Technical Services'), ('buildingSMART International RailwayRoom'), 'RailCOMPLETE\X2\FFAE\X0\', '2019.1.1995.0', ''); +FILE_SCHEMA (('IFC4X3_RC4')); +ENDSEC; +DATA; +#1 = IFCPROJECT('1FNFy8AJeHwwz7wDZHIYIu', #3, 'IFC Rail Referencedata', 'Rail alignment sample', $, 'Longname', 'Design', $, #9); +#2 = IFCAPPLICATION(#5, '2019.1.1995.0', 'RailCOMPLETE\X2\00AE\X0\', $); +#3 = IFCOWNERHISTORY(#6, #2, $, .ADDED., 1320688800, $, $, 1320688800); +#4 = IFCPERSON('TS', 'IFC Rail Technical Services', $, $, $, $, $, $); +#5 = IFCORGANIZATION('bsI RWR', 'buildingSmart International Railway Room', $, $, $); +#6 = IFCPERSONANDORGANIZATION(#4, #5, $); +#7 = IFCSIUNIT(*, .LENGTHUNIT., $, .METRE.); +#8 = IFCSIUNIT(*, .PLANEANGLEUNIT., $, .RADIAN.); +#9 = IFCUNITASSIGNMENT((#7, #8)); +#10 = IFCCARTESIANPOINT((0., 0., 0.)); +#11 = IFCDIRECTION((0., 0., 1.)); +#12 = IFCDIRECTION((1., 0., 0.)); +#13 = IFCAXIS2PLACEMENT3D(#10, #11, #12); +#14 = IFCLOCALPLACEMENT($, #13); +#15 = IFCRAILWAY('1FNFy9AJeHwuVmwDZHIYIu', #3, 'optional Railway Name', 'optional Railway Description', $, #14, $, 'Longname for Railway track geometry (alignment)', $, $); +#16 = IFCDIRECTION((0., 1., 0.)); +#17 = IFCGEOMETRICREPRESENTATIONCONTEXT($, 'MODEL', 3, 1.E-5, #13, #16); +#18 = IFCRELAGGREGATES('1FNFyAAJeHwu6TwDZHIYIu', #3, 'Documentation Container', 'Container for IfcProject, collects relevant products', #1, (#15)); +#19 = IFCRELCONTAINEDINSPATIALSTRUCTURE('1FNFyBAJeHwvmywDZHIYIu', #3, 'IfcProducts contained in myIfcRailway', 'Association between IfcProducts and IfcRailway', (#20), #15); +#20 = IFCALIGNMENT('1FNFyCAJeHwxedwDZHIYIu', #3, 'Spor', 'optional Railway Description', $, #49, #52, $, $); +#21 = IFCALIGNMENTHORIZONTAL('1FNFyDAJeHwv87wDZHIYIu', $, $, $, $, #54, #57); +#23 = IFCRELNESTS('3BJTAQrjCHwvVKbERtTLTf', $, $, $, #20, (#21)); +#28 = IFCCARTESIANPOINT((0., 0.)); +#29 = IFCALIGNMENTHORIZONTALSEGMENT($, $, #28, 0., -1000., -300., 100., $, .LINE.); +#30 = IFCALIGNMENTSEGMENT('1FNFyHAJeHwuDtwDZHIYIu', #3, $, $, $, #37, #40, #29); +#34 = IFCRELNESTS('1FNFyHAJeHwuDtwDZHIYIj', $, $, $, #21, (#30)); +#35 = IFCCOMPOSITECURVE((#36), .F.); +#36 = IFCCURVESEGMENT(.DISCONTINUOUS., #42, IFCNONNEGATIVELENGTHMEASURE(0.), IFCNONNEGATIVELENGTHMEASURE(100.), #45); +#37 = IFCLOCALPLACEMENT($, #38); +#38 = IFCAXIS2PLACEMENT3D(#39, $, $); +#39 = IFCCARTESIANPOINT((0., 0., 0.)); +#40 = IFCPRODUCTDEFINITIONSHAPE($, $, (#41, #72)); +#41 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve2D', (#36)); +#42 = IFCAXIS2PLACEMENT2D(#43, #44); +#43 = IFCCARTESIANPOINT((0., 0.)); +#44 = IFCDIRECTION((1., 0.)); +#45 = IFCLINE(#46, #47); +#46 = IFCCARTESIANPOINT((0., 0.)); +#47 = IFCVECTOR(#48, 1.); +#48 = IFCDIRECTION((1., 0.)); +#49 = IFCLOCALPLACEMENT($, #50); +#50 = IFCAXIS2PLACEMENT3D(#51, $, $); +#51 = IFCCARTESIANPOINT((0., 0., 0.)); +#52 = IFCPRODUCTDEFINITIONSHAPE($, $, (#53, #78)); +#53 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve3D', (#35)); +#54 = IFCLOCALPLACEMENT($, #55); +#55 = IFCAXIS2PLACEMENT3D(#56, $, $); +#56 = IFCCARTESIANPOINT((0., 0., 0.)); +#57 = IFCPRODUCTDEFINITIONSHAPE($, $, (#58, #61)); +#58 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve2D', (#35)); +#59 = IFCCARTESIANPOINTLIST2D(((0., 0.), (100., 0.)), $); +#60 = IFCINDEXEDPOLYCURVE(#59, $, $); +#61 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#60)); +#62 = IFCOWNERHISTORY(#64, #66, $, .ADDED., 1630842561, $, $, 1630842561); +#63 = IFCORGANIZATION($, '\X2\0410\X0\\X2\0420\X0\ \X2\0414\X0\\X2\0418\X0\ \X2\0415\X0\\X2\0424\X0\ \X2\041E\X0\\X2\041E\X0\\X2\0414\X0\', 'RDF Ltd.', $, $); +#64 = IFCPERSONANDORGANIZATION(#65, #63, $); +#65 = IFCPERSON($, 'Bonsma', 'Peter', $, $, $, $, $); +#66 = IFCAPPLICATION(#63, '0.99', 'Add Check Library Application', 'TA 1001'); +#67 = IFCRELDEFINESBYPROPERTIES('22h3gBLGb2UuNDJaGHgHfE', #62, $, $, (#21), #68); +#68 = IFCPROPERTYSET('2d9uZunEvFwf$32rPUBigb', #62, 'ValidationPset', $, (#69)); +#69 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(100.), $); +#70 = IFCCARTESIANPOINTLIST2D(((0., 0.), (100., 0.)), $); +#71 = IFCINDEXEDPOLYCURVE(#70, $, $); +#72 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#71)); +#73 = IFCRELDEFINESBYPROPERTIES('1kaSJgeCT60wVDmbcMPh3i', #62, $, $, (#30), #74); +#74 = IFCPROPERTYSET('2YcvwO$HL2CPzq7Fiy0gcR', #62, 'ValidationPset', $, (#75)); +#75 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(100.), $); +#76 = IFCCARTESIANPOINTLIST2D(((0., 0.), (100., 0.)), $); +#77 = IFCINDEXEDPOLYCURVE(#76, $, $); +#78 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#77)); +#79 = IFCRELDEFINESBYPROPERTIES('2Zz26AJv55Quf$ZzjDzLAy', #62, $, $, (#20), #80); +#80 = IFCPROPERTYSET('3KS73nMuLBjgXiIlhSFlFW', #62, 'ValidationPset', $, (#81)); +#81 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(100.), $); +ENDSEC; +END-ISO-10303-21; diff --git a/UnitTests/Schemas/IFC4X3_RC4/line_100.0_-1000_-300_1_Meter/Data/line_100.0_-1000_-300_1_Meter.png b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_-1000_-300_1_Meter/Data/line_100.0_-1000_-300_1_Meter.png new file mode 100644 index 000000000..3c862d4fe Binary files /dev/null and b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_-1000_-300_1_Meter/Data/line_100.0_-1000_-300_1_Meter.png differ diff --git a/UnitTests/Schemas/IFC4X3_RC4/line_100.0_-1000_-300_1_Meter/Data/line_100.0_-1000_-300_1_Meter_top.png b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_-1000_-300_1_Meter/Data/line_100.0_-1000_-300_1_Meter_top.png new file mode 100644 index 000000000..73ac6daa4 Binary files /dev/null and b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_-1000_-300_1_Meter/Data/line_100.0_-1000_-300_1_Meter_top.png differ diff --git a/UnitTests/Schemas/IFC4X3_RC4/line_100.0_-1000_-300_1_Meter/src/line_100.0_-1000_-300_1_Meter.cpp b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_-1000_-300_1_Meter/src/line_100.0_-1000_-300_1_Meter.cpp new file mode 100644 index 000000000..c3441bb96 --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_-1000_-300_1_Meter/src/line_100.0_-1000_-300_1_Meter.cpp @@ -0,0 +1,102 @@ +/* + Copyright (c) 2021 Technical University of Munich + Chair of Computational Modeling and Simulation. + + TUM Open Infra Platform is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License Version 3 + as published by the Free Software Foundation. + + TUM Open Infra Platform is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include +#include + +#include + +#include +#include +#include + +using namespace testing; + +class Line : public IfcVisualTest { +protected: + + // Test standard values + buw::Image4b _background = buw::Image4b(0, 0); + + virtual void SetUp() override { + IfcVisualTest::SetUp(); + + express_model = OpenInfraPlatform::IFC4X3_RC4::IFC4X3_RC4Reader::FromFile(filename.string()); + + importer = buw::makeReferenceCounted>(); + auto model = importer->collectData(express_model); + + _background = rendererIfc->captureImage(); + rendererIfc->setModel(model[0]); + } + + virtual void TearDown() override { + express_model.reset(); + IfcVisualTest::TearDown(); + } + + virtual std::string TestName() const { return "line_100.0_-1000_-300_1_Meter"; } + virtual std::string Schema() const { return "IFC4X3_RC4"; } + + const boost::filesystem::path filename = dataPath("line_100.0_-1000_-300_1_Meter.ifc"); + + std::shared_ptr express_model = nullptr; + buw::ReferenceCounted> importer = nullptr; +}; + +TEST_F(Line, AllEntitiesAreRead) { + EXPECT_THAT(express_model->entities.size(), Eq(73)); +} + +TEST_F(Line, IFCHasAnEssentialEntity) { + auto result1 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto& pair) -> bool { return pair.second->classname() == "IFCCURVESEGMENT"; }); + auto result2 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto& pair) -> bool { return pair.second->classname() == "IFCALIGNMENTHORIZONTAL"; }); + auto result3 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto& pair) -> bool { return pair.second->classname() == "IFCALIGNMENTHORIZONTALSEGMENT"; }); + auto result4 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto& pair) -> bool { return pair.second->classname() == "IFCLINE"; }); + EXPECT_NE(result1, express_model->entities.end()); + EXPECT_NE(result2, express_model->entities.end()); + EXPECT_NE(result3, express_model->entities.end()); + EXPECT_NE(result4, express_model->entities.end()); +} + +TEST_F(Line, ImageIsSaved) +{ + // Arrange + buw::Image4b image = rendererIfc->captureImage(); + + // Act + buw::storeImage(testPath("line_100.0_-1000_-300_1_Meter.png").string(), image); + + // Assert + EXPECT_NO_THROW(buw::loadImage4b(testPath("line_100.0_-1000_-300_1_Meter.png").string())); +} + +TEST_F(Line, PlaneSurfaceViews) +{ + // Arrange + const auto expected_top = buw::loadImage4b(dataPath("line_100.0_-1000_-300_1_Meter_top.png").string()); + + // Act (Top) + rendererIfc->setViewDirection(buw::eViewDirection::Top); + buw::Image4b image_top = CaptureImage(); + + // uncomment following lines to also save the screen shot + //buw::storeImage(testPath("line_100.0_-1000_-300_1_Meter_top.png").string(), image_top); + + // Assert + EXPECT_EQ(image_top, expected_top); +} \ No newline at end of file diff --git a/UnitTests/Schemas/IFC4X3_RC4/line_100.0_-300_-1000_1_Meter/CMakeLists.txt b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_-300_-1000_1_Meter/CMakeLists.txt new file mode 100644 index 000000000..9637845ab --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_-300_-1000_1_Meter/CMakeLists.txt @@ -0,0 +1,20 @@ +# +# Copyright (c) 2021 Technical University of Munich +# Chair of Computational Modeling and Simulation. +# +# TUM Open Infra Platform is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License Version 3 +# as published by the Free Software Foundation. +# +# TUM Open Infra Platform is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +include(CreateUnitTests) + +CreateIfcFileVisualUnitTestForSchema(line_100.0_-300_-1000_1_Meter IFC4X3_RC4) diff --git a/UnitTests/Schemas/IFC4X3_RC4/line_100.0_-300_-1000_1_Meter/Data/line_100.0_-300_-1000_1_Meter.ifc b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_-300_-1000_1_Meter/Data/line_100.0_-300_-1000_1_Meter.ifc new file mode 100644 index 000000000..15c684547 --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_-300_-1000_1_Meter/Data/line_100.0_-300_-1000_1_Meter.ifc @@ -0,0 +1,82 @@ +ISO-10303-21; +HEADER; +FILE_DESCRIPTION (('ViewDefinition [CoordinationView]'), '2;1'); +FILE_NAME ('Single-LANDXML.ifc', '2021-05-24T11:00:00', ('IFC Rail Technical Services'), ('buildingSMART International RailwayRoom'), 'RailCOMPLETE\X2\FFAE\X0\', '2019.1.1995.0', ''); +FILE_SCHEMA (('IFC4X3_RC4')); +ENDSEC; +DATA; +#1 = IFCPROJECT('1FNFy8AJeHwwz7wDZHIYIu', #3, 'IFC Rail Referencedata', 'Rail alignment sample', $, 'Longname', 'Design', $, #9); +#2 = IFCAPPLICATION(#5, '2019.1.1995.0', 'RailCOMPLETE\X2\00AE\X0\', $); +#3 = IFCOWNERHISTORY(#6, #2, $, .ADDED., 1320688800, $, $, 1320688800); +#4 = IFCPERSON('TS', 'IFC Rail Technical Services', $, $, $, $, $, $); +#5 = IFCORGANIZATION('bsI RWR', 'buildingSmart International Railway Room', $, $, $); +#6 = IFCPERSONANDORGANIZATION(#4, #5, $); +#7 = IFCSIUNIT(*, .LENGTHUNIT., $, .METRE.); +#8 = IFCSIUNIT(*, .PLANEANGLEUNIT., $, .RADIAN.); +#9 = IFCUNITASSIGNMENT((#7, #8)); +#10 = IFCCARTESIANPOINT((0., 0., 0.)); +#11 = IFCDIRECTION((0., 0., 1.)); +#12 = IFCDIRECTION((1., 0., 0.)); +#13 = IFCAXIS2PLACEMENT3D(#10, #11, #12); +#14 = IFCLOCALPLACEMENT($, #13); +#15 = IFCRAILWAY('1FNFy9AJeHwuVmwDZHIYIu', #3, 'optional Railway Name', 'optional Railway Description', $, #14, $, 'Longname for Railway track geometry (alignment)', $, $); +#16 = IFCDIRECTION((0., 1., 0.)); +#17 = IFCGEOMETRICREPRESENTATIONCONTEXT($, 'MODEL', 3, 1.E-5, #13, #16); +#18 = IFCRELAGGREGATES('1FNFyAAJeHwu6TwDZHIYIu', #3, 'Documentation Container', 'Container for IfcProject, collects relevant products', #1, (#15)); +#19 = IFCRELCONTAINEDINSPATIALSTRUCTURE('1FNFyBAJeHwvmywDZHIYIu', #3, 'IfcProducts contained in myIfcRailway', 'Association between IfcProducts and IfcRailway', (#20), #15); +#20 = IFCALIGNMENT('1FNFyCAJeHwxedwDZHIYIu', #3, 'Spor', 'optional Railway Description', $, #49, #52, $, $); +#21 = IFCALIGNMENTHORIZONTAL('1FNFyDAJeHwv87wDZHIYIu', $, $, $, $, #54, #57); +#23 = IFCRELNESTS('3BJTAQrjCHwvVKbERtTLTf', $, $, $, #20, (#21)); +#28 = IFCCARTESIANPOINT((0., 0.)); +#29 = IFCALIGNMENTHORIZONTALSEGMENT($, $, #28, 0., -300., -1000., 100., $, .LINE.); +#30 = IFCALIGNMENTSEGMENT('1FNFyHAJeHwuDtwDZHIYIu', #3, $, $, $, #37, #40, #29); +#34 = IFCRELNESTS('1FNFyHAJeHwuDtwDZHIYIj', $, $, $, #21, (#30)); +#35 = IFCCOMPOSITECURVE((#36), .F.); +#36 = IFCCURVESEGMENT(.DISCONTINUOUS., #42, IFCNONNEGATIVELENGTHMEASURE(0.), IFCNONNEGATIVELENGTHMEASURE(100.), #45); +#37 = IFCLOCALPLACEMENT($, #38); +#38 = IFCAXIS2PLACEMENT3D(#39, $, $); +#39 = IFCCARTESIANPOINT((0., 0., 0.)); +#40 = IFCPRODUCTDEFINITIONSHAPE($, $, (#41, #72)); +#41 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve2D', (#36)); +#42 = IFCAXIS2PLACEMENT2D(#43, #44); +#43 = IFCCARTESIANPOINT((0., 0.)); +#44 = IFCDIRECTION((1., 0.)); +#45 = IFCLINE(#46, #47); +#46 = IFCCARTESIANPOINT((0., 0.)); +#47 = IFCVECTOR(#48, 1.); +#48 = IFCDIRECTION((1., 0.)); +#49 = IFCLOCALPLACEMENT($, #50); +#50 = IFCAXIS2PLACEMENT3D(#51, $, $); +#51 = IFCCARTESIANPOINT((0., 0., 0.)); +#52 = IFCPRODUCTDEFINITIONSHAPE($, $, (#53, #78)); +#53 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve3D', (#35)); +#54 = IFCLOCALPLACEMENT($, #55); +#55 = IFCAXIS2PLACEMENT3D(#56, $, $); +#56 = IFCCARTESIANPOINT((0., 0., 0.)); +#57 = IFCPRODUCTDEFINITIONSHAPE($, $, (#58, #61)); +#58 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve2D', (#35)); +#59 = IFCCARTESIANPOINTLIST2D(((0., 0.), (100., 0.)), $); +#60 = IFCINDEXEDPOLYCURVE(#59, $, $); +#61 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#60)); +#62 = IFCOWNERHISTORY(#64, #66, $, .ADDED., 1630842560, $, $, 1630842560); +#63 = IFCORGANIZATION($, '\X2\0410\X0\\X2\0420\X0\ \X2\0414\X0\\X2\0418\X0\ \X2\0415\X0\\X2\0424\X0\ \X2\041E\X0\\X2\041E\X0\\X2\0414\X0\', 'RDF Ltd.', $, $); +#64 = IFCPERSONANDORGANIZATION(#65, #63, $); +#65 = IFCPERSON($, 'Bonsma', 'Peter', $, $, $, $, $); +#66 = IFCAPPLICATION(#63, '0.99', 'Add Check Library Application', 'TA 1001'); +#67 = IFCRELDEFINESBYPROPERTIES('20mUhgagb8DwVaNdO0imdO', #62, $, $, (#21), #68); +#68 = IFCPROPERTYSET('3XU1RSS61D7hrOFhy_N9WT', #62, 'ValidationPset', $, (#69)); +#69 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(100.), $); +#70 = IFCCARTESIANPOINTLIST2D(((0., 0.), (100., 0.)), $); +#71 = IFCINDEXEDPOLYCURVE(#70, $, $); +#72 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#71)); +#73 = IFCRELDEFINESBYPROPERTIES('02K2bgyOL629KXqBtTE$u9', #62, $, $, (#30), #74); +#74 = IFCPROPERTYSET('2hZEELarHCUwZf0CRchQj1', #62, 'ValidationPset', $, (#75)); +#75 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(100.), $); +#76 = IFCCARTESIANPOINTLIST2D(((0., 0.), (100., 0.)), $); +#77 = IFCINDEXEDPOLYCURVE(#76, $, $); +#78 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#77)); +#79 = IFCRELDEFINESBYPROPERTIES('0xRgfyZL9DSPAtt9alXp9T', #62, $, $, (#20), #80); +#80 = IFCPROPERTYSET('3Buujhe3DAJ9cX$OLY$gTJ', #62, 'ValidationPset', $, (#81)); +#81 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(100.), $); +ENDSEC; +END-ISO-10303-21; diff --git a/UnitTests/Schemas/IFC4X3_RC4/line_100.0_-300_-1000_1_Meter/Data/line_100.0_-300_-1000_1_Meter.png b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_-300_-1000_1_Meter/Data/line_100.0_-300_-1000_1_Meter.png new file mode 100644 index 000000000..3c862d4fe Binary files /dev/null and b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_-300_-1000_1_Meter/Data/line_100.0_-300_-1000_1_Meter.png differ diff --git a/UnitTests/Schemas/IFC4X3_RC4/line_100.0_-300_-1000_1_Meter/Data/line_100.0_-300_-1000_1_Meter_top.png b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_-300_-1000_1_Meter/Data/line_100.0_-300_-1000_1_Meter_top.png new file mode 100644 index 000000000..73ac6daa4 Binary files /dev/null and b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_-300_-1000_1_Meter/Data/line_100.0_-300_-1000_1_Meter_top.png differ diff --git a/UnitTests/Schemas/IFC4X3_RC4/line_100.0_-300_-1000_1_Meter/src/line_100.0_-300_-1000_1_Meter.cpp b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_-300_-1000_1_Meter/src/line_100.0_-300_-1000_1_Meter.cpp new file mode 100644 index 000000000..d8b569581 --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_-300_-1000_1_Meter/src/line_100.0_-300_-1000_1_Meter.cpp @@ -0,0 +1,102 @@ +/* + Copyright (c) 2021 Technical University of Munich + Chair of Computational Modeling and Simulation. + + TUM Open Infra Platform is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License Version 3 + as published by the Free Software Foundation. + + TUM Open Infra Platform is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include +#include + +#include + +#include +#include +#include + +using namespace testing; + +class Line : public IfcVisualTest { +protected: + + // Test standard values + buw::Image4b _background = buw::Image4b(0, 0); + + virtual void SetUp() override { + IfcVisualTest::SetUp(); + + express_model = OpenInfraPlatform::IFC4X3_RC4::IFC4X3_RC4Reader::FromFile(filename.string()); + + importer = buw::makeReferenceCounted>(); + auto model = importer->collectData(express_model); + + _background = rendererIfc->captureImage(); + rendererIfc->setModel(model[0]); + } + + virtual void TearDown() override { + express_model.reset(); + IfcVisualTest::TearDown(); + } + + virtual std::string TestName() const { return "line_100.0_-300_-1000_1_Meter"; } + virtual std::string Schema() const { return "IFC4X3_RC4"; } + + const boost::filesystem::path filename = dataPath("line_100.0_-300_-1000_1_Meter.ifc"); + + std::shared_ptr express_model = nullptr; + buw::ReferenceCounted> importer = nullptr; +}; + +TEST_F(Line, AllEntitiesAreRead) { + EXPECT_THAT(express_model->entities.size(), Eq(73)); +} + +TEST_F(Line, IFCHasAnEssentialEntity) { + auto result1 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto& pair) -> bool { return pair.second->classname() == "IFCCURVESEGMENT"; }); + auto result2 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto& pair) -> bool { return pair.second->classname() == "IFCALIGNMENTHORIZONTAL"; }); + auto result3 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto& pair) -> bool { return pair.second->classname() == "IFCALIGNMENTHORIZONTALSEGMENT"; }); + auto result4 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto& pair) -> bool { return pair.second->classname() == "IFCLINE"; }); + EXPECT_NE(result1, express_model->entities.end()); + EXPECT_NE(result2, express_model->entities.end()); + EXPECT_NE(result3, express_model->entities.end()); + EXPECT_NE(result4, express_model->entities.end()); +} + +TEST_F(Line, ImageIsSaved) +{ + // Arrange + buw::Image4b image = rendererIfc->captureImage(); + + // Act + buw::storeImage(testPath("line_100.0_-300_-1000_1_Meter.png").string(), image); + + // Assert + EXPECT_NO_THROW(buw::loadImage4b(testPath("line_100.0_-300_-1000_1_Meter.png").string())); +} + +TEST_F(Line, PlaneSurfaceViews) +{ + // Arrange + const auto expected_top = buw::loadImage4b(dataPath("line_100.0_-300_-1000_1_Meter_top.png").string()); + + // Act (Top) + rendererIfc->setViewDirection(buw::eViewDirection::Top); + buw::Image4b image_top = CaptureImage(); + + // uncomment following lines to also save the screen shot + //buw::storeImage(testPath("line_100.0_-300_-1000_1_Meter_top.png").string(), image_top); + + // Assert + EXPECT_EQ(image_top, expected_top); +} \ No newline at end of file diff --git a/UnitTests/Schemas/IFC4X3_RC4/line_100.0_-300_-inf_1_Meter/CMakeLists.txt b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_-300_-inf_1_Meter/CMakeLists.txt new file mode 100644 index 000000000..ac92dd86e --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_-300_-inf_1_Meter/CMakeLists.txt @@ -0,0 +1,20 @@ +# +# Copyright (c) 2021 Technical University of Munich +# Chair of Computational Modeling and Simulation. +# +# TUM Open Infra Platform is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License Version 3 +# as published by the Free Software Foundation. +# +# TUM Open Infra Platform is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +include(CreateUnitTests) + +CreateIfcFileVisualUnitTestForSchema(line_100.0_-300_-inf_1_Meter IFC4X3_RC4) diff --git a/UnitTests/Schemas/IFC4X3_RC4/line_100.0_-300_-inf_1_Meter/Data/line_100.0_-300_-inf_1_Meter.ifc b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_-300_-inf_1_Meter/Data/line_100.0_-300_-inf_1_Meter.ifc new file mode 100644 index 000000000..21517e903 --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_-300_-inf_1_Meter/Data/line_100.0_-300_-inf_1_Meter.ifc @@ -0,0 +1,82 @@ +ISO-10303-21; +HEADER; +FILE_DESCRIPTION (('ViewDefinition [CoordinationView]'), '2;1'); +FILE_NAME ('Single-LANDXML.ifc', '2021-05-24T11:00:00', ('IFC Rail Technical Services'), ('buildingSMART International RailwayRoom'), 'RailCOMPLETE\X2\FFAE\X0\', '2019.1.1995.0', ''); +FILE_SCHEMA (('IFC4X3_RC4')); +ENDSEC; +DATA; +#1 = IFCPROJECT('1FNFy8AJeHwwz7wDZHIYIu', #3, 'IFC Rail Referencedata', 'Rail alignment sample', $, 'Longname', 'Design', $, #9); +#2 = IFCAPPLICATION(#5, '2019.1.1995.0', 'RailCOMPLETE\X2\00AE\X0\', $); +#3 = IFCOWNERHISTORY(#6, #2, $, .ADDED., 1320688800, $, $, 1320688800); +#4 = IFCPERSON('TS', 'IFC Rail Technical Services', $, $, $, $, $, $); +#5 = IFCORGANIZATION('bsI RWR', 'buildingSmart International Railway Room', $, $, $); +#6 = IFCPERSONANDORGANIZATION(#4, #5, $); +#7 = IFCSIUNIT(*, .LENGTHUNIT., $, .METRE.); +#8 = IFCSIUNIT(*, .PLANEANGLEUNIT., $, .RADIAN.); +#9 = IFCUNITASSIGNMENT((#7, #8)); +#10 = IFCCARTESIANPOINT((0., 0., 0.)); +#11 = IFCDIRECTION((0., 0., 1.)); +#12 = IFCDIRECTION((1., 0., 0.)); +#13 = IFCAXIS2PLACEMENT3D(#10, #11, #12); +#14 = IFCLOCALPLACEMENT($, #13); +#15 = IFCRAILWAY('1FNFy9AJeHwuVmwDZHIYIu', #3, 'optional Railway Name', 'optional Railway Description', $, #14, $, 'Longname for Railway track geometry (alignment)', $, $); +#16 = IFCDIRECTION((0., 1., 0.)); +#17 = IFCGEOMETRICREPRESENTATIONCONTEXT($, 'MODEL', 3, 1.E-5, #13, #16); +#18 = IFCRELAGGREGATES('1FNFyAAJeHwu6TwDZHIYIu', #3, 'Documentation Container', 'Container for IfcProject, collects relevant products', #1, (#15)); +#19 = IFCRELCONTAINEDINSPATIALSTRUCTURE('1FNFyBAJeHwvmywDZHIYIu', #3, 'IfcProducts contained in myIfcRailway', 'Association between IfcProducts and IfcRailway', (#20), #15); +#20 = IFCALIGNMENT('1FNFyCAJeHwxedwDZHIYIu', #3, 'Spor', 'optional Railway Description', $, #49, #52, $, $); +#21 = IFCALIGNMENTHORIZONTAL('1FNFyDAJeHwv87wDZHIYIu', $, $, $, $, #54, #57); +#23 = IFCRELNESTS('3BJTAQrjCHwvVKbERtTLTf', $, $, $, #20, (#21)); +#28 = IFCCARTESIANPOINT((0., 0.)); +#29 = IFCALIGNMENTHORIZONTALSEGMENT($, $, #28, 0., -300., 0., 100., $, .LINE.); +#30 = IFCALIGNMENTSEGMENT('1FNFyHAJeHwuDtwDZHIYIu', #3, $, $, $, #37, #40, #29); +#34 = IFCRELNESTS('1FNFyHAJeHwuDtwDZHIYIj', $, $, $, #21, (#30)); +#35 = IFCCOMPOSITECURVE((#36), .F.); +#36 = IFCCURVESEGMENT(.DISCONTINUOUS., #42, IFCNONNEGATIVELENGTHMEASURE(0.), IFCNONNEGATIVELENGTHMEASURE(100.), #45); +#37 = IFCLOCALPLACEMENT($, #38); +#38 = IFCAXIS2PLACEMENT3D(#39, $, $); +#39 = IFCCARTESIANPOINT((0., 0., 0.)); +#40 = IFCPRODUCTDEFINITIONSHAPE($, $, (#41, #72)); +#41 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve2D', (#36)); +#42 = IFCAXIS2PLACEMENT2D(#43, #44); +#43 = IFCCARTESIANPOINT((0., 0.)); +#44 = IFCDIRECTION((1., 0.)); +#45 = IFCLINE(#46, #47); +#46 = IFCCARTESIANPOINT((0., 0.)); +#47 = IFCVECTOR(#48, 1.); +#48 = IFCDIRECTION((1., 0.)); +#49 = IFCLOCALPLACEMENT($, #50); +#50 = IFCAXIS2PLACEMENT3D(#51, $, $); +#51 = IFCCARTESIANPOINT((0., 0., 0.)); +#52 = IFCPRODUCTDEFINITIONSHAPE($, $, (#53, #78)); +#53 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve3D', (#35)); +#54 = IFCLOCALPLACEMENT($, #55); +#55 = IFCAXIS2PLACEMENT3D(#56, $, $); +#56 = IFCCARTESIANPOINT((0., 0., 0.)); +#57 = IFCPRODUCTDEFINITIONSHAPE($, $, (#58, #61)); +#58 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve2D', (#35)); +#59 = IFCCARTESIANPOINTLIST2D(((0., 0.), (100., 0.)), $); +#60 = IFCINDEXEDPOLYCURVE(#59, $, $); +#61 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#60)); +#62 = IFCOWNERHISTORY(#64, #66, $, .ADDED., 1630842561, $, $, 1630842561); +#63 = IFCORGANIZATION($, '\X2\0410\X0\\X2\0420\X0\ \X2\0414\X0\\X2\0418\X0\ \X2\0415\X0\\X2\0424\X0\ \X2\041E\X0\\X2\041E\X0\\X2\0414\X0\', 'RDF Ltd.', $, $); +#64 = IFCPERSONANDORGANIZATION(#65, #63, $); +#65 = IFCPERSON($, 'Bonsma', 'Peter', $, $, $, $, $); +#66 = IFCAPPLICATION(#63, '0.99', 'Add Check Library Application', 'TA 1001'); +#67 = IFCRELDEFINESBYPROPERTIES('3YJiySoHH7XQSIRddZLs28', #62, $, $, (#21), #68); +#68 = IFCPROPERTYSET('02juCA4dj7PxGLr0RcRyc8', #62, 'ValidationPset', $, (#69)); +#69 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(100.), $); +#70 = IFCCARTESIANPOINTLIST2D(((0., 0.), (100., 0.)), $); +#71 = IFCINDEXEDPOLYCURVE(#70, $, $); +#72 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#71)); +#73 = IFCRELDEFINESBYPROPERTIES('0UQi5lNMn7SgUTHa4JciDb', #62, $, $, (#30), #74); +#74 = IFCPROPERTYSET('3O74ZLH1D5px3dn6KFkhLV', #62, 'ValidationPset', $, (#75)); +#75 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(100.), $); +#76 = IFCCARTESIANPOINTLIST2D(((0., 0.), (100., 0.)), $); +#77 = IFCINDEXEDPOLYCURVE(#76, $, $); +#78 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#77)); +#79 = IFCRELDEFINESBYPROPERTIES('0TazUz7Yj83gZ2EvZr3ses', #62, $, $, (#20), #80); +#80 = IFCPROPERTYSET('3lyZDnq4DFhw1EzCJRY4dq', #62, 'ValidationPset', $, (#81)); +#81 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(100.), $); +ENDSEC; +END-ISO-10303-21; diff --git a/UnitTests/Schemas/IFC4X3_RC4/line_100.0_-300_-inf_1_Meter/Data/line_100.0_-300_-inf_1_Meter.png b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_-300_-inf_1_Meter/Data/line_100.0_-300_-inf_1_Meter.png new file mode 100644 index 000000000..3c862d4fe Binary files /dev/null and b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_-300_-inf_1_Meter/Data/line_100.0_-300_-inf_1_Meter.png differ diff --git a/UnitTests/Schemas/IFC4X3_RC4/line_100.0_-300_-inf_1_Meter/Data/line_100.0_-300_-inf_1_Meter_top.png b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_-300_-inf_1_Meter/Data/line_100.0_-300_-inf_1_Meter_top.png new file mode 100644 index 000000000..73ac6daa4 Binary files /dev/null and b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_-300_-inf_1_Meter/Data/line_100.0_-300_-inf_1_Meter_top.png differ diff --git a/UnitTests/Schemas/IFC4X3_RC4/line_100.0_-300_-inf_1_Meter/src/line_100.0_-300_-inf_1_Meter.cpp b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_-300_-inf_1_Meter/src/line_100.0_-300_-inf_1_Meter.cpp new file mode 100644 index 000000000..273ab56f3 --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_-300_-inf_1_Meter/src/line_100.0_-300_-inf_1_Meter.cpp @@ -0,0 +1,102 @@ +/* + Copyright (c) 2021 Technical University of Munich + Chair of Computational Modeling and Simulation. + + TUM Open Infra Platform is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License Version 3 + as published by the Free Software Foundation. + + TUM Open Infra Platform is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include +#include + +#include + +#include +#include +#include + +using namespace testing; + +class Line : public IfcVisualTest { +protected: + + // Test standard values + buw::Image4b _background = buw::Image4b(0, 0); + + virtual void SetUp() override { + IfcVisualTest::SetUp(); + + express_model = OpenInfraPlatform::IFC4X3_RC4::IFC4X3_RC4Reader::FromFile(filename.string()); + + importer = buw::makeReferenceCounted>(); + auto model = importer->collectData(express_model); + + _background = rendererIfc->captureImage(); + rendererIfc->setModel(model[0]); + } + + virtual void TearDown() override { + express_model.reset(); + IfcVisualTest::TearDown(); + } + + virtual std::string TestName() const { return "line_100.0_-300_-inf_1_Meter"; } + virtual std::string Schema() const { return "IFC4X3_RC4"; } + + const boost::filesystem::path filename = dataPath("line_100.0_-300_-inf_1_Meter.ifc"); + + std::shared_ptr express_model = nullptr; + buw::ReferenceCounted> importer = nullptr; +}; + +TEST_F(Line, AllEntitiesAreRead) { + EXPECT_THAT(express_model->entities.size(), Eq(73)); +} + +TEST_F(Line, IFCHasAnEssentialEntity) { + auto result1 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto& pair) -> bool { return pair.second->classname() == "IFCCURVESEGMENT"; }); + auto result2 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto& pair) -> bool { return pair.second->classname() == "IFCALIGNMENTHORIZONTAL"; }); + auto result3 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto& pair) -> bool { return pair.second->classname() == "IFCALIGNMENTHORIZONTALSEGMENT"; }); + auto result4 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto& pair) -> bool { return pair.second->classname() == "IFCLINE"; }); + EXPECT_NE(result1, express_model->entities.end()); + EXPECT_NE(result2, express_model->entities.end()); + EXPECT_NE(result3, express_model->entities.end()); + EXPECT_NE(result4, express_model->entities.end()); +} + +TEST_F(Line, ImageIsSaved) +{ + // Arrange + buw::Image4b image = rendererIfc->captureImage(); + + // Act + buw::storeImage(testPath("line_100.0_-300_-inf_1_Meter.png").string(), image); + + // Assert + EXPECT_NO_THROW(buw::loadImage4b(testPath("line_100.0_-300_-inf_1_Meter.png").string())); +} + +TEST_F(Line, PlaneSurfaceViews) +{ + // Arrange + const auto expected_top = buw::loadImage4b(dataPath("line_100.0_-300_-inf_1_Meter_top.png").string()); + + // Act (Top) + rendererIfc->setViewDirection(buw::eViewDirection::Top); + buw::Image4b image_top = CaptureImage(); + + // uncomment following lines to also save the screen shot + buw::storeImage(testPath("line_100.0_-300_-inf_1_Meter_top1.png").string(), image_top); + + // Assert + EXPECT_EQ(image_top, expected_top); +} diff --git a/UnitTests/Schemas/IFC4X3_RC4/line_100.0_-inf_-300_1_Meter/CMakeLists.txt b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_-inf_-300_1_Meter/CMakeLists.txt new file mode 100644 index 000000000..8e4ac0b23 --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_-inf_-300_1_Meter/CMakeLists.txt @@ -0,0 +1,20 @@ +# +# Copyright (c) 2021 Technical University of Munich +# Chair of Computational Modeling and Simulation. +# +# TUM Open Infra Platform is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License Version 3 +# as published by the Free Software Foundation. +# +# TUM Open Infra Platform is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +include(CreateUnitTests) + +CreateIfcFileVisualUnitTestForSchema(line_100.0_-inf_-300_1_Meter IFC4X3_RC4) diff --git a/UnitTests/Schemas/IFC4X3_RC4/line_100.0_-inf_-300_1_Meter/Data/line_100.0_-inf_-300_1_Meter.ifc b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_-inf_-300_1_Meter/Data/line_100.0_-inf_-300_1_Meter.ifc new file mode 100644 index 000000000..cf4bfb229 --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_-inf_-300_1_Meter/Data/line_100.0_-inf_-300_1_Meter.ifc @@ -0,0 +1,82 @@ +ISO-10303-21; +HEADER; +FILE_DESCRIPTION (('ViewDefinition [CoordinationView]'), '2;1'); +FILE_NAME ('Single-LANDXML.ifc', '2021-05-24T11:00:00', ('IFC Rail Technical Services'), ('buildingSMART International RailwayRoom'), 'RailCOMPLETE\X2\FFAE\X0\', '2019.1.1995.0', ''); +FILE_SCHEMA (('IFC4X3_RC4')); +ENDSEC; +DATA; +#1 = IFCPROJECT('1FNFy8AJeHwwz7wDZHIYIu', #3, 'IFC Rail Referencedata', 'Rail alignment sample', $, 'Longname', 'Design', $, #9); +#2 = IFCAPPLICATION(#5, '2019.1.1995.0', 'RailCOMPLETE\X2\00AE\X0\', $); +#3 = IFCOWNERHISTORY(#6, #2, $, .ADDED., 1320688800, $, $, 1320688800); +#4 = IFCPERSON('TS', 'IFC Rail Technical Services', $, $, $, $, $, $); +#5 = IFCORGANIZATION('bsI RWR', 'buildingSmart International Railway Room', $, $, $); +#6 = IFCPERSONANDORGANIZATION(#4, #5, $); +#7 = IFCSIUNIT(*, .LENGTHUNIT., $, .METRE.); +#8 = IFCSIUNIT(*, .PLANEANGLEUNIT., $, .RADIAN.); +#9 = IFCUNITASSIGNMENT((#7, #8)); +#10 = IFCCARTESIANPOINT((0., 0., 0.)); +#11 = IFCDIRECTION((0., 0., 1.)); +#12 = IFCDIRECTION((1., 0., 0.)); +#13 = IFCAXIS2PLACEMENT3D(#10, #11, #12); +#14 = IFCLOCALPLACEMENT($, #13); +#15 = IFCRAILWAY('1FNFy9AJeHwuVmwDZHIYIu', #3, 'optional Railway Name', 'optional Railway Description', $, #14, $, 'Longname for Railway track geometry (alignment)', $, $); +#16 = IFCDIRECTION((0., 1., 0.)); +#17 = IFCGEOMETRICREPRESENTATIONCONTEXT($, 'MODEL', 3, 1.E-5, #13, #16); +#18 = IFCRELAGGREGATES('1FNFyAAJeHwu6TwDZHIYIu', #3, 'Documentation Container', 'Container for IfcProject, collects relevant products', #1, (#15)); +#19 = IFCRELCONTAINEDINSPATIALSTRUCTURE('1FNFyBAJeHwvmywDZHIYIu', #3, 'IfcProducts contained in myIfcRailway', 'Association between IfcProducts and IfcRailway', (#20), #15); +#20 = IFCALIGNMENT('1FNFyCAJeHwxedwDZHIYIu', #3, 'Spor', 'optional Railway Description', $, #49, #52, $, $); +#21 = IFCALIGNMENTHORIZONTAL('1FNFyDAJeHwv87wDZHIYIu', $, $, $, $, #54, #57); +#23 = IFCRELNESTS('3BJTAQrjCHwvVKbERtTLTf', $, $, $, #20, (#21)); +#28 = IFCCARTESIANPOINT((0., 0.)); +#29 = IFCALIGNMENTHORIZONTALSEGMENT($, $, #28, 0., 0., -300., 100., $, .LINE.); +#30 = IFCALIGNMENTSEGMENT('1FNFyHAJeHwuDtwDZHIYIu', #3, $, $, $, #37, #40, #29); +#34 = IFCRELNESTS('1FNFyHAJeHwuDtwDZHIYIj', $, $, $, #21, (#30)); +#35 = IFCCOMPOSITECURVE((#36), .F.); +#36 = IFCCURVESEGMENT(.DISCONTINUOUS., #42, IFCNONNEGATIVELENGTHMEASURE(0.), IFCNONNEGATIVELENGTHMEASURE(100.), #45); +#37 = IFCLOCALPLACEMENT($, #38); +#38 = IFCAXIS2PLACEMENT3D(#39, $, $); +#39 = IFCCARTESIANPOINT((0., 0., 0.)); +#40 = IFCPRODUCTDEFINITIONSHAPE($, $, (#41, #72)); +#41 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve2D', (#36)); +#42 = IFCAXIS2PLACEMENT2D(#43, #44); +#43 = IFCCARTESIANPOINT((0., 0.)); +#44 = IFCDIRECTION((1., 0.)); +#45 = IFCLINE(#46, #47); +#46 = IFCCARTESIANPOINT((0., 0.)); +#47 = IFCVECTOR(#48, 1.); +#48 = IFCDIRECTION((1., 0.)); +#49 = IFCLOCALPLACEMENT($, #50); +#50 = IFCAXIS2PLACEMENT3D(#51, $, $); +#51 = IFCCARTESIANPOINT((0., 0., 0.)); +#52 = IFCPRODUCTDEFINITIONSHAPE($, $, (#53, #78)); +#53 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve3D', (#35)); +#54 = IFCLOCALPLACEMENT($, #55); +#55 = IFCAXIS2PLACEMENT3D(#56, $, $); +#56 = IFCCARTESIANPOINT((0., 0., 0.)); +#57 = IFCPRODUCTDEFINITIONSHAPE($, $, (#58, #61)); +#58 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve2D', (#35)); +#59 = IFCCARTESIANPOINTLIST2D(((0., 0.), (100., 0.)), $); +#60 = IFCINDEXEDPOLYCURVE(#59, $, $); +#61 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#60)); +#62 = IFCOWNERHISTORY(#64, #66, $, .ADDED., 1630842561, $, $, 1630842561); +#63 = IFCORGANIZATION($, '\X2\0410\X0\\X2\0420\X0\ \X2\0414\X0\\X2\0418\X0\ \X2\0415\X0\\X2\0424\X0\ \X2\041E\X0\\X2\041E\X0\\X2\0414\X0\', 'RDF Ltd.', $, $); +#64 = IFCPERSONANDORGANIZATION(#65, #63, $); +#65 = IFCPERSON($, 'Bonsma', 'Peter', $, $, $, $, $); +#66 = IFCAPPLICATION(#63, '0.99', 'Add Check Library Application', 'TA 1001'); +#67 = IFCRELDEFINESBYPROPERTIES('224Rkbf71C1gZk5uSCR55R', #62, $, $, (#21), #68); +#68 = IFCPROPERTYSET('2cGISrOpjEEgBcj_y0liEV', #62, 'ValidationPset', $, (#69)); +#69 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(100.), $); +#70 = IFCCARTESIANPOINTLIST2D(((0., 0.), (100., 0.)), $); +#71 = IFCINDEXEDPOLYCURVE(#70, $, $); +#72 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#71)); +#73 = IFCRELDEFINESBYPROPERTIES('2eTSailqL8qe9mWvtPbUT2', #62, $, $, (#30), #74); +#74 = IFCPROPERTYSET('1MzRYXwFT869pSuF876c$X', #62, 'ValidationPset', $, (#75)); +#75 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(100.), $); +#76 = IFCCARTESIANPOINTLIST2D(((0., 0.), (100., 0.)), $); +#77 = IFCINDEXEDPOLYCURVE(#76, $, $); +#78 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#77)); +#79 = IFCRELDEFINESBYPROPERTIES('0PTOxrhSH4sAq7EUafWelW', #62, $, $, (#20), #80); +#80 = IFCPROPERTYSET('3TZv8S$NPC_gtzta1j$QU6', #62, 'ValidationPset', $, (#81)); +#81 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(100.), $); +ENDSEC; +END-ISO-10303-21; diff --git a/UnitTests/Schemas/IFC4X3_RC4/line_100.0_-inf_-300_1_Meter/Data/line_100.0_-inf_-300_1_Meter.png b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_-inf_-300_1_Meter/Data/line_100.0_-inf_-300_1_Meter.png new file mode 100644 index 000000000..3c862d4fe Binary files /dev/null and b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_-inf_-300_1_Meter/Data/line_100.0_-inf_-300_1_Meter.png differ diff --git a/UnitTests/Schemas/IFC4X3_RC4/line_100.0_-inf_-300_1_Meter/Data/line_100.0_-inf_-300_1_Meter_top.png b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_-inf_-300_1_Meter/Data/line_100.0_-inf_-300_1_Meter_top.png new file mode 100644 index 000000000..73ac6daa4 Binary files /dev/null and b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_-inf_-300_1_Meter/Data/line_100.0_-inf_-300_1_Meter_top.png differ diff --git a/UnitTests/Schemas/IFC4X3_RC4/line_100.0_-inf_-300_1_Meter/src/line_100.0_-inf_-300_1_Meter.cpp b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_-inf_-300_1_Meter/src/line_100.0_-inf_-300_1_Meter.cpp new file mode 100644 index 000000000..5519fd750 --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_-inf_-300_1_Meter/src/line_100.0_-inf_-300_1_Meter.cpp @@ -0,0 +1,102 @@ +/* + Copyright (c) 2021 Technical University of Munich + Chair of Computational Modeling and Simulation. + + TUM Open Infra Platform is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License Version 3 + as published by the Free Software Foundation. + + TUM Open Infra Platform is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include +#include + +#include + +#include +#include +#include + +using namespace testing; + +class Line : public IfcVisualTest { +protected: + + // Test standard values + buw::Image4b _background = buw::Image4b(0, 0); + + virtual void SetUp() override { + IfcVisualTest::SetUp(); + + express_model = OpenInfraPlatform::IFC4X3_RC4::IFC4X3_RC4Reader::FromFile(filename.string()); + + importer = buw::makeReferenceCounted>(); + auto model = importer->collectData(express_model); + + _background = rendererIfc->captureImage(); + rendererIfc->setModel(model[0]); + } + + virtual void TearDown() override { + express_model.reset(); + IfcVisualTest::TearDown(); + } + + virtual std::string TestName() const { return "line_100.0_-inf_-300_1_Meter"; } + virtual std::string Schema() const { return "IFC4X3_RC4"; } + + const boost::filesystem::path filename = dataPath("line_100.0_-inf_-300_1_Meter.ifc"); + + std::shared_ptr express_model = nullptr; + buw::ReferenceCounted> importer = nullptr; +}; + +TEST_F(Line, AllEntitiesAreRead) { + EXPECT_THAT(express_model->entities.size(), Eq(73)); +} + +TEST_F(Line, IFCHasAnEssentialEntity) { + auto result1 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto& pair) -> bool { return pair.second->classname() == "IFCCURVESEGMENT"; }); + auto result2 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto& pair) -> bool { return pair.second->classname() == "IFCALIGNMENTHORIZONTAL"; }); + auto result3 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto& pair) -> bool { return pair.second->classname() == "IFCALIGNMENTHORIZONTALSEGMENT"; }); + auto result4 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto& pair) -> bool { return pair.second->classname() == "IFCLINE"; }); + EXPECT_NE(result1, express_model->entities.end()); + EXPECT_NE(result2, express_model->entities.end()); + EXPECT_NE(result3, express_model->entities.end()); + EXPECT_NE(result4, express_model->entities.end()); +} + +TEST_F(Line, ImageIsSaved) +{ + // Arrange + buw::Image4b image = rendererIfc->captureImage(); + + // Act + buw::storeImage(testPath("line_100.0_-inf_-300_1_Meter.png").string(), image); + + // Assert + EXPECT_NO_THROW(buw::loadImage4b(testPath("line_100.0_-inf_-300_1_Meter.png").string())); +} + +TEST_F(Line, PlaneSurfaceViews) +{ + // Arrange + const auto expected_top = buw::loadImage4b(dataPath("line_100.0_-inf_-300_1_Meter_top.png").string()); + + // Act (Top) + rendererIfc->setViewDirection(buw::eViewDirection::Top); + buw::Image4b image_top = CaptureImage(); + + // uncomment following lines to also save the screen shot + //buw::storeImage(testPath("line_100.0_-inf_-300_1_Meter_top.png").string(), image_top); + + // Assert + EXPECT_EQ(image_top, expected_top); +} \ No newline at end of file diff --git a/UnitTests/Schemas/IFC4X3_RC4/line_100.0_1000_300_1_Meter/CMakeLists.txt b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_1000_300_1_Meter/CMakeLists.txt new file mode 100644 index 000000000..f52f869dd --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_1000_300_1_Meter/CMakeLists.txt @@ -0,0 +1,20 @@ +# +# Copyright (c) 2021 Technical University of Munich +# Chair of Computational Modeling and Simulation. +# +# TUM Open Infra Platform is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License Version 3 +# as published by the Free Software Foundation. +# +# TUM Open Infra Platform is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +include(CreateUnitTests) + +CreateIfcFileVisualUnitTestForSchema(line_100.0_1000_300_1_Meter IFC4X3_RC4) diff --git a/UnitTests/Schemas/IFC4X3_RC4/line_100.0_1000_300_1_Meter/Data/line_100.0_1000_300_1_Meter.ifc b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_1000_300_1_Meter/Data/line_100.0_1000_300_1_Meter.ifc new file mode 100644 index 000000000..1d9a24280 --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_1000_300_1_Meter/Data/line_100.0_1000_300_1_Meter.ifc @@ -0,0 +1,82 @@ +ISO-10303-21; +HEADER; +FILE_DESCRIPTION (('ViewDefinition [CoordinationView]'), '2;1'); +FILE_NAME ('Single-LANDXML.ifc', '2021-05-24T11:00:00', ('IFC Rail Technical Services'), ('buildingSMART International RailwayRoom'), 'RailCOMPLETE\X2\FFAE\X0\', '2019.1.1995.0', ''); +FILE_SCHEMA (('IFC4X3_RC4')); +ENDSEC; +DATA; +#1 = IFCPROJECT('1FNFy8AJeHwwz7wDZHIYIu', #3, 'IFC Rail Referencedata', 'Rail alignment sample', $, 'Longname', 'Design', $, #9); +#2 = IFCAPPLICATION(#5, '2019.1.1995.0', 'RailCOMPLETE\X2\00AE\X0\', $); +#3 = IFCOWNERHISTORY(#6, #2, $, .ADDED., 1320688800, $, $, 1320688800); +#4 = IFCPERSON('TS', 'IFC Rail Technical Services', $, $, $, $, $, $); +#5 = IFCORGANIZATION('bsI RWR', 'buildingSmart International Railway Room', $, $, $); +#6 = IFCPERSONANDORGANIZATION(#4, #5, $); +#7 = IFCSIUNIT(*, .LENGTHUNIT., $, .METRE.); +#8 = IFCSIUNIT(*, .PLANEANGLEUNIT., $, .RADIAN.); +#9 = IFCUNITASSIGNMENT((#7, #8)); +#10 = IFCCARTESIANPOINT((0., 0., 0.)); +#11 = IFCDIRECTION((0., 0., 1.)); +#12 = IFCDIRECTION((1., 0., 0.)); +#13 = IFCAXIS2PLACEMENT3D(#10, #11, #12); +#14 = IFCLOCALPLACEMENT($, #13); +#15 = IFCRAILWAY('1FNFy9AJeHwuVmwDZHIYIu', #3, 'optional Railway Name', 'optional Railway Description', $, #14, $, 'Longname for Railway track geometry (alignment)', $, $); +#16 = IFCDIRECTION((0., 1., 0.)); +#17 = IFCGEOMETRICREPRESENTATIONCONTEXT($, 'MODEL', 3, 1.E-5, #13, #16); +#18 = IFCRELAGGREGATES('1FNFyAAJeHwu6TwDZHIYIu', #3, 'Documentation Container', 'Container for IfcProject, collects relevant products', #1, (#15)); +#19 = IFCRELCONTAINEDINSPATIALSTRUCTURE('1FNFyBAJeHwvmywDZHIYIu', #3, 'IfcProducts contained in myIfcRailway', 'Association between IfcProducts and IfcRailway', (#20), #15); +#20 = IFCALIGNMENT('1FNFyCAJeHwxedwDZHIYIu', #3, 'Spor', 'optional Railway Description', $, #49, #52, $, $); +#21 = IFCALIGNMENTHORIZONTAL('1FNFyDAJeHwv87wDZHIYIu', $, $, $, $, #54, #57); +#23 = IFCRELNESTS('3BJTAQrjCHwvVKbERtTLTf', $, $, $, #20, (#21)); +#28 = IFCCARTESIANPOINT((0., 0.)); +#29 = IFCALIGNMENTHORIZONTALSEGMENT($, $, #28, 0., 1000., 300., 100., $, .LINE.); +#30 = IFCALIGNMENTSEGMENT('1FNFyHAJeHwuDtwDZHIYIu', #3, $, $, $, #37, #40, #29); +#34 = IFCRELNESTS('1FNFyHAJeHwuDtwDZHIYIj', $, $, $, #21, (#30)); +#35 = IFCCOMPOSITECURVE((#36), .F.); +#36 = IFCCURVESEGMENT(.DISCONTINUOUS., #42, IFCNONNEGATIVELENGTHMEASURE(0.), IFCNONNEGATIVELENGTHMEASURE(100.), #45); +#37 = IFCLOCALPLACEMENT($, #38); +#38 = IFCAXIS2PLACEMENT3D(#39, $, $); +#39 = IFCCARTESIANPOINT((0., 0., 0.)); +#40 = IFCPRODUCTDEFINITIONSHAPE($, $, (#41, #72)); +#41 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve2D', (#36)); +#42 = IFCAXIS2PLACEMENT2D(#43, #44); +#43 = IFCCARTESIANPOINT((0., 0.)); +#44 = IFCDIRECTION((1., 0.)); +#45 = IFCLINE(#46, #47); +#46 = IFCCARTESIANPOINT((0., 0.)); +#47 = IFCVECTOR(#48, 1.); +#48 = IFCDIRECTION((1., 0.)); +#49 = IFCLOCALPLACEMENT($, #50); +#50 = IFCAXIS2PLACEMENT3D(#51, $, $); +#51 = IFCCARTESIANPOINT((0., 0., 0.)); +#52 = IFCPRODUCTDEFINITIONSHAPE($, $, (#53, #78)); +#53 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve3D', (#35)); +#54 = IFCLOCALPLACEMENT($, #55); +#55 = IFCAXIS2PLACEMENT3D(#56, $, $); +#56 = IFCCARTESIANPOINT((0., 0., 0.)); +#57 = IFCPRODUCTDEFINITIONSHAPE($, $, (#58, #61)); +#58 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve2D', (#35)); +#59 = IFCCARTESIANPOINTLIST2D(((0., 0.), (100., 0.)), $); +#60 = IFCINDEXEDPOLYCURVE(#59, $, $); +#61 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#60)); +#62 = IFCOWNERHISTORY(#64, #66, $, .ADDED., 1630842561, $, $, 1630842561); +#63 = IFCORGANIZATION($, '\X2\0410\X0\\X2\0420\X0\ \X2\0414\X0\\X2\0418\X0\ \X2\0415\X0\\X2\0424\X0\ \X2\041E\X0\\X2\041E\X0\\X2\0414\X0\', 'RDF Ltd.', $, $); +#64 = IFCPERSONANDORGANIZATION(#65, #63, $); +#65 = IFCPERSON($, 'Bonsma', 'Peter', $, $, $, $, $); +#66 = IFCAPPLICATION(#63, '0.99', 'Add Check Library Application', 'TA 1001'); +#67 = IFCRELDEFINESBYPROPERTIES('2eNLZbL290vh2pqJpWM4H2', #62, $, $, (#21), #68); +#68 = IFCPROPERTYSET('3ruC2KZKnEUAsENqgpIgX7', #62, 'ValidationPset', $, (#69)); +#69 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(100.), $); +#70 = IFCCARTESIANPOINTLIST2D(((0., 0.), (100., 0.)), $); +#71 = IFCINDEXEDPOLYCURVE(#70, $, $); +#72 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#71)); +#73 = IFCRELDEFINESBYPROPERTIES('0H0_IVtwf0k8ckAGFPEA5_', #62, $, $, (#30), #74); +#74 = IFCPROPERTYSET('0DBu83O1fCReOalZUHiTJK', #62, 'ValidationPset', $, (#75)); +#75 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(100.), $); +#76 = IFCCARTESIANPOINTLIST2D(((0., 0.), (100., 0.)), $); +#77 = IFCINDEXEDPOLYCURVE(#76, $, $); +#78 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#77)); +#79 = IFCRELDEFINESBYPROPERTIES('1F2mrMchXCa9nBo7uapz01', #62, $, $, (#20), #80); +#80 = IFCPROPERTYSET('1NUva49Ur6uuBXoGpMxKuX', #62, 'ValidationPset', $, (#81)); +#81 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(100.), $); +ENDSEC; +END-ISO-10303-21; diff --git a/UnitTests/Schemas/IFC4X3_RC4/line_100.0_1000_300_1_Meter/Data/line_100.0_1000_300_1_Meter.png b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_1000_300_1_Meter/Data/line_100.0_1000_300_1_Meter.png new file mode 100644 index 000000000..3c862d4fe Binary files /dev/null and b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_1000_300_1_Meter/Data/line_100.0_1000_300_1_Meter.png differ diff --git a/UnitTests/Schemas/IFC4X3_RC4/line_100.0_1000_300_1_Meter/Data/line_100.0_1000_300_1_Meter_top.png b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_1000_300_1_Meter/Data/line_100.0_1000_300_1_Meter_top.png new file mode 100644 index 000000000..73ac6daa4 Binary files /dev/null and b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_1000_300_1_Meter/Data/line_100.0_1000_300_1_Meter_top.png differ diff --git a/UnitTests/Schemas/IFC4X3_RC4/line_100.0_1000_300_1_Meter/src/line_100.0_1000_300_1_Meter.cpp b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_1000_300_1_Meter/src/line_100.0_1000_300_1_Meter.cpp new file mode 100644 index 000000000..c3a0d085d --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_1000_300_1_Meter/src/line_100.0_1000_300_1_Meter.cpp @@ -0,0 +1,102 @@ +/* + Copyright (c) 2021 Technical University of Munich + Chair of Computational Modeling and Simulation. + + TUM Open Infra Platform is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License Version 3 + as published by the Free Software Foundation. + + TUM Open Infra Platform is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include +#include + +#include + +#include +#include +#include + +using namespace testing; + +class Line : public IfcVisualTest { +protected: + + // Test standard values + buw::Image4b _background = buw::Image4b(0, 0); + + virtual void SetUp() override { + IfcVisualTest::SetUp(); + + express_model = OpenInfraPlatform::IFC4X3_RC4::IFC4X3_RC4Reader::FromFile(filename.string()); + + importer = buw::makeReferenceCounted>(); + auto model = importer->collectData(express_model); + + _background = rendererIfc->captureImage(); + rendererIfc->setModel(model[0]); + } + + virtual void TearDown() override { + express_model.reset(); + IfcVisualTest::TearDown(); + } + + virtual std::string TestName() const { return "line_100.0_1000_300_1_Meter"; } + virtual std::string Schema() const { return "IFC4X3_RC4"; } + + const boost::filesystem::path filename = dataPath("line_100.0_1000_300_1_Meter.ifc"); + + std::shared_ptr express_model = nullptr; + buw::ReferenceCounted> importer = nullptr; +}; + +TEST_F(Line, AllEntitiesAreRead) { + EXPECT_THAT(express_model->entities.size(), Eq(73)); +} + +TEST_F(Line, IFCHasAnEssentialEntity) { + auto result1 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto& pair) -> bool { return pair.second->classname() == "IFCCURVESEGMENT"; }); + auto result2 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto& pair) -> bool { return pair.second->classname() == "IFCALIGNMENTHORIZONTAL"; }); + auto result3 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto& pair) -> bool { return pair.second->classname() == "IFCALIGNMENTHORIZONTALSEGMENT"; }); + auto result4 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto& pair) -> bool { return pair.second->classname() == "IFCLINE"; }); + EXPECT_NE(result1, express_model->entities.end()); + EXPECT_NE(result2, express_model->entities.end()); + EXPECT_NE(result3, express_model->entities.end()); + EXPECT_NE(result4, express_model->entities.end()); +} + +TEST_F(Line, ImageIsSaved) +{ + // Arrange + buw::Image4b image = rendererIfc->captureImage(); + + // Act + buw::storeImage(testPath("line_100.0_1000_300_1_Meter.png").string(), image); + + // Assert + EXPECT_NO_THROW(buw::loadImage4b(testPath("line_100.0_1000_300_1_Meter.png").string())); +} + +TEST_F(Line, PlaneSurfaceViews) +{ + // Arrange + const auto expected_top = buw::loadImage4b(dataPath("line_100.0_1000_300_1_Meter_top.png").string()); + + // Act (Top) + rendererIfc->setViewDirection(buw::eViewDirection::Top); + buw::Image4b image_top = CaptureImage(); + + // uncomment following lines to also save the screen shot + //buw::storeImage(testPath("line_100.0_1000_300_1_Meter_top.png").string(), image_top); + + // Assert + EXPECT_EQ(image_top, expected_top); +} \ No newline at end of file diff --git a/UnitTests/Schemas/IFC4X3_RC4/line_100.0_300_1000_1_Meter/CMakeLists.txt b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_300_1000_1_Meter/CMakeLists.txt new file mode 100644 index 000000000..227083b1d --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_300_1000_1_Meter/CMakeLists.txt @@ -0,0 +1,20 @@ +# +# Copyright (c) 2021 Technical University of Munich +# Chair of Computational Modeling and Simulation. +# +# TUM Open Infra Platform is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License Version 3 +# as published by the Free Software Foundation. +# +# TUM Open Infra Platform is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +include(CreateUnitTests) + +CreateIfcFileVisualUnitTestForSchema(line_100.0_300_1000_1_Meter IFC4X3_RC4) diff --git a/UnitTests/Schemas/IFC4X3_RC4/line_100.0_300_1000_1_Meter/Data/line_100.0_300_1000_1_Meter.ifc b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_300_1000_1_Meter/Data/line_100.0_300_1000_1_Meter.ifc new file mode 100644 index 000000000..85f6e14f2 --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_300_1000_1_Meter/Data/line_100.0_300_1000_1_Meter.ifc @@ -0,0 +1,82 @@ +ISO-10303-21; +HEADER; +FILE_DESCRIPTION (('ViewDefinition [CoordinationView]'), '2;1'); +FILE_NAME ('Single-LANDXML.ifc', '2021-05-24T11:00:00', ('IFC Rail Technical Services'), ('buildingSMART International RailwayRoom'), 'RailCOMPLETE\X2\FFAE\X0\', '2019.1.1995.0', ''); +FILE_SCHEMA (('IFC4X3_RC4')); +ENDSEC; +DATA; +#1 = IFCPROJECT('1FNFy8AJeHwwz7wDZHIYIu', #3, 'IFC Rail Referencedata', 'Rail alignment sample', $, 'Longname', 'Design', $, #9); +#2 = IFCAPPLICATION(#5, '2019.1.1995.0', 'RailCOMPLETE\X2\00AE\X0\', $); +#3 = IFCOWNERHISTORY(#6, #2, $, .ADDED., 1320688800, $, $, 1320688800); +#4 = IFCPERSON('TS', 'IFC Rail Technical Services', $, $, $, $, $, $); +#5 = IFCORGANIZATION('bsI RWR', 'buildingSmart International Railway Room', $, $, $); +#6 = IFCPERSONANDORGANIZATION(#4, #5, $); +#7 = IFCSIUNIT(*, .LENGTHUNIT., $, .METRE.); +#8 = IFCSIUNIT(*, .PLANEANGLEUNIT., $, .RADIAN.); +#9 = IFCUNITASSIGNMENT((#7, #8)); +#10 = IFCCARTESIANPOINT((0., 0., 0.)); +#11 = IFCDIRECTION((0., 0., 1.)); +#12 = IFCDIRECTION((1., 0., 0.)); +#13 = IFCAXIS2PLACEMENT3D(#10, #11, #12); +#14 = IFCLOCALPLACEMENT($, #13); +#15 = IFCRAILWAY('1FNFy9AJeHwuVmwDZHIYIu', #3, 'optional Railway Name', 'optional Railway Description', $, #14, $, 'Longname for Railway track geometry (alignment)', $, $); +#16 = IFCDIRECTION((0., 1., 0.)); +#17 = IFCGEOMETRICREPRESENTATIONCONTEXT($, 'MODEL', 3, 1.E-5, #13, #16); +#18 = IFCRELAGGREGATES('1FNFyAAJeHwu6TwDZHIYIu', #3, 'Documentation Container', 'Container for IfcProject, collects relevant products', #1, (#15)); +#19 = IFCRELCONTAINEDINSPATIALSTRUCTURE('1FNFyBAJeHwvmywDZHIYIu', #3, 'IfcProducts contained in myIfcRailway', 'Association between IfcProducts and IfcRailway', (#20), #15); +#20 = IFCALIGNMENT('1FNFyCAJeHwxedwDZHIYIu', #3, 'Spor', 'optional Railway Description', $, #49, #52, $, $); +#21 = IFCALIGNMENTHORIZONTAL('1FNFyDAJeHwv87wDZHIYIu', $, $, $, $, #54, #57); +#23 = IFCRELNESTS('3BJTAQrjCHwvVKbERtTLTf', $, $, $, #20, (#21)); +#28 = IFCCARTESIANPOINT((0., 0.)); +#29 = IFCALIGNMENTHORIZONTALSEGMENT($, $, #28, 0., 300., 1000., 100., $, .LINE.); +#30 = IFCALIGNMENTSEGMENT('1FNFyHAJeHwuDtwDZHIYIu', #3, $, $, $, #37, #40, #29); +#34 = IFCRELNESTS('1FNFyHAJeHwuDtwDZHIYIj', $, $, $, #21, (#30)); +#35 = IFCCOMPOSITECURVE((#36), .F.); +#36 = IFCCURVESEGMENT(.DISCONTINUOUS., #42, IFCNONNEGATIVELENGTHMEASURE(0.), IFCNONNEGATIVELENGTHMEASURE(100.), #45); +#37 = IFCLOCALPLACEMENT($, #38); +#38 = IFCAXIS2PLACEMENT3D(#39, $, $); +#39 = IFCCARTESIANPOINT((0., 0., 0.)); +#40 = IFCPRODUCTDEFINITIONSHAPE($, $, (#41, #72)); +#41 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve2D', (#36)); +#42 = IFCAXIS2PLACEMENT2D(#43, #44); +#43 = IFCCARTESIANPOINT((0., 0.)); +#44 = IFCDIRECTION((1., 0.)); +#45 = IFCLINE(#46, #47); +#46 = IFCCARTESIANPOINT((0., 0.)); +#47 = IFCVECTOR(#48, 1.); +#48 = IFCDIRECTION((1., 0.)); +#49 = IFCLOCALPLACEMENT($, #50); +#50 = IFCAXIS2PLACEMENT3D(#51, $, $); +#51 = IFCCARTESIANPOINT((0., 0., 0.)); +#52 = IFCPRODUCTDEFINITIONSHAPE($, $, (#53, #78)); +#53 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve3D', (#35)); +#54 = IFCLOCALPLACEMENT($, #55); +#55 = IFCAXIS2PLACEMENT3D(#56, $, $); +#56 = IFCCARTESIANPOINT((0., 0., 0.)); +#57 = IFCPRODUCTDEFINITIONSHAPE($, $, (#58, #61)); +#58 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve2D', (#35)); +#59 = IFCCARTESIANPOINTLIST2D(((0., 0.), (100., 0.)), $); +#60 = IFCINDEXEDPOLYCURVE(#59, $, $); +#61 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#60)); +#62 = IFCOWNERHISTORY(#64, #66, $, .ADDED., 1630842560, $, $, 1630842560); +#63 = IFCORGANIZATION($, '\X2\0410\X0\\X2\0420\X0\ \X2\0414\X0\\X2\0418\X0\ \X2\0415\X0\\X2\0424\X0\ \X2\041E\X0\\X2\041E\X0\\X2\0414\X0\', 'RDF Ltd.', $, $); +#64 = IFCPERSONANDORGANIZATION(#65, #63, $); +#65 = IFCPERSON($, 'Bonsma', 'Peter', $, $, $, $, $); +#66 = IFCAPPLICATION(#63, '0.99', 'Add Check Library Application', 'TA 1001'); +#67 = IFCRELDEFINESBYPROPERTIES('20N207nf18EvV40tX1ByB3', #62, $, $, (#21), #68); +#68 = IFCPROPERTYSET('0gozNkw6f2DwQQmlQvu87N', #62, 'ValidationPset', $, (#69)); +#69 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(100.), $); +#70 = IFCCARTESIANPOINTLIST2D(((0., 0.), (100., 0.)), $); +#71 = IFCINDEXEDPOLYCURVE(#70, $, $); +#72 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#71)); +#73 = IFCRELDEFINESBYPROPERTIES('1o50vN1W9DNfZOSlv1nZwX', #62, $, $, (#30), #74); +#74 = IFCPROPERTYSET('0PT8feDuf0Ff4PUbiKyrwO', #62, 'ValidationPset', $, (#75)); +#75 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(100.), $); +#76 = IFCCARTESIANPOINTLIST2D(((0., 0.), (100., 0.)), $); +#77 = IFCINDEXEDPOLYCURVE(#76, $, $); +#78 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#77)); +#79 = IFCRELDEFINESBYPROPERTIES('0LrOk4DMn6gQPKz0Qjm7wX', #62, $, $, (#20), #80); +#80 = IFCPROPERTYSET('1N4wqmVpr1A9F1UssOD3T_', #62, 'ValidationPset', $, (#81)); +#81 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(100.), $); +ENDSEC; +END-ISO-10303-21; diff --git a/UnitTests/Schemas/IFC4X3_RC4/line_100.0_300_1000_1_Meter/Data/line_100.0_300_1000_1_Meter.png b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_300_1000_1_Meter/Data/line_100.0_300_1000_1_Meter.png new file mode 100644 index 000000000..3c862d4fe Binary files /dev/null and b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_300_1000_1_Meter/Data/line_100.0_300_1000_1_Meter.png differ diff --git a/UnitTests/Schemas/IFC4X3_RC4/line_100.0_300_1000_1_Meter/Data/line_100.0_300_1000_1_Meter_top.png b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_300_1000_1_Meter/Data/line_100.0_300_1000_1_Meter_top.png new file mode 100644 index 000000000..73ac6daa4 Binary files /dev/null and b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_300_1000_1_Meter/Data/line_100.0_300_1000_1_Meter_top.png differ diff --git a/UnitTests/Schemas/IFC4X3_RC4/line_100.0_300_1000_1_Meter/src/line_100.0_300_1000_1_Meter.cpp b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_300_1000_1_Meter/src/line_100.0_300_1000_1_Meter.cpp new file mode 100644 index 000000000..a0ae804de --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_300_1000_1_Meter/src/line_100.0_300_1000_1_Meter.cpp @@ -0,0 +1,102 @@ +/* + Copyright (c) 2021 Technical University of Munich + Chair of Computational Modeling and Simulation. + + TUM Open Infra Platform is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License Version 3 + as published by the Free Software Foundation. + + TUM Open Infra Platform is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include +#include + +#include + +#include +#include +#include + +using namespace testing; + +class Line : public IfcVisualTest { +protected: + + // Test standard values + buw::Image4b _background = buw::Image4b(0, 0); + + virtual void SetUp() override { + IfcVisualTest::SetUp(); + + express_model = OpenInfraPlatform::IFC4X3_RC4::IFC4X3_RC4Reader::FromFile(filename.string()); + + importer = buw::makeReferenceCounted>(); + auto model = importer->collectData(express_model); + + _background = rendererIfc->captureImage(); + rendererIfc->setModel(model[0]); + } + + virtual void TearDown() override { + express_model.reset(); + IfcVisualTest::TearDown(); + } + + virtual std::string TestName() const { return "line_100.0_300_1000_1_Meter"; } + virtual std::string Schema() const { return "IFC4X3_RC4"; } + + const boost::filesystem::path filename = dataPath("line_100.0_300_1000_1_Meter.ifc"); + + std::shared_ptr express_model = nullptr; + buw::ReferenceCounted> importer = nullptr; +}; + +TEST_F(Line, AllEntitiesAreRead) { + EXPECT_THAT(express_model->entities.size(), Eq(73)); +} + +TEST_F(Line, IFCHasAnEssentialEntity) { + auto result1 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto& pair) -> bool { return pair.second->classname() == "IFCCURVESEGMENT"; }); + auto result2 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto& pair) -> bool { return pair.second->classname() == "IFCALIGNMENTHORIZONTAL"; }); + auto result3 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto& pair) -> bool { return pair.second->classname() == "IFCALIGNMENTHORIZONTALSEGMENT"; }); + auto result4 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto& pair) -> bool { return pair.second->classname() == "IFCLINE"; }); + EXPECT_NE(result1, express_model->entities.end()); + EXPECT_NE(result2, express_model->entities.end()); + EXPECT_NE(result3, express_model->entities.end()); + EXPECT_NE(result4, express_model->entities.end()); +} + +TEST_F(Line, ImageIsSaved) +{ + // Arrange + buw::Image4b image = rendererIfc->captureImage(); + + // Act + buw::storeImage(testPath("line_100.0_300_1000_1_Meter.png").string(), image); + + // Assert + EXPECT_NO_THROW(buw::loadImage4b(testPath("line_100.0_300_1000_1_Meter.png").string())); +} + +TEST_F(Line, PlaneSurfaceViews) +{ + // Arrange + const auto expected_top = buw::loadImage4b(dataPath("line_100.0_300_1000_1_Meter_top.png").string()); + + // Act (Top) + rendererIfc->setViewDirection(buw::eViewDirection::Top); + buw::Image4b image_top = CaptureImage(); + + // uncomment following lines to also save the screen shot + //buw::storeImage(testPath("line_100.0_300_1000_1_Meter_top.png").string(), image_top); + + // Assert + EXPECT_EQ(image_top, expected_top); +} \ No newline at end of file diff --git a/UnitTests/Schemas/IFC4X3_RC4/line_100.0_300_inf_1_Meter/CMakeLists.txt b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_300_inf_1_Meter/CMakeLists.txt new file mode 100644 index 000000000..20fabf49e --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_300_inf_1_Meter/CMakeLists.txt @@ -0,0 +1,20 @@ +# +# Copyright (c) 2021 Technical University of Munich +# Chair of Computational Modeling and Simulation. +# +# TUM Open Infra Platform is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License Version 3 +# as published by the Free Software Foundation. +# +# TUM Open Infra Platform is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +include(CreateUnitTests) + +CreateIfcFileVisualUnitTestForSchema(line_100.0_300_inf_1_Meter IFC4X3_RC4) diff --git a/UnitTests/Schemas/IFC4X3_RC4/line_100.0_300_inf_1_Meter/Data/line_100.0_300_inf_1_Meter.ifc b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_300_inf_1_Meter/Data/line_100.0_300_inf_1_Meter.ifc new file mode 100644 index 000000000..64d863173 --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_300_inf_1_Meter/Data/line_100.0_300_inf_1_Meter.ifc @@ -0,0 +1,82 @@ +ISO-10303-21; +HEADER; +FILE_DESCRIPTION (('ViewDefinition [CoordinationView]'), '2;1'); +FILE_NAME ('Single-LANDXML.ifc', '2021-05-24T11:00:00', ('IFC Rail Technical Services'), ('buildingSMART International RailwayRoom'), 'RailCOMPLETE\X2\FFAE\X0\', '2019.1.1995.0', ''); +FILE_SCHEMA (('IFC4X3_RC4')); +ENDSEC; +DATA; +#1 = IFCPROJECT('1FNFy8AJeHwwz7wDZHIYIu', #3, 'IFC Rail Referencedata', 'Rail alignment sample', $, 'Longname', 'Design', $, #9); +#2 = IFCAPPLICATION(#5, '2019.1.1995.0', 'RailCOMPLETE\X2\00AE\X0\', $); +#3 = IFCOWNERHISTORY(#6, #2, $, .ADDED., 1320688800, $, $, 1320688800); +#4 = IFCPERSON('TS', 'IFC Rail Technical Services', $, $, $, $, $, $); +#5 = IFCORGANIZATION('bsI RWR', 'buildingSmart International Railway Room', $, $, $); +#6 = IFCPERSONANDORGANIZATION(#4, #5, $); +#7 = IFCSIUNIT(*, .LENGTHUNIT., $, .METRE.); +#8 = IFCSIUNIT(*, .PLANEANGLEUNIT., $, .RADIAN.); +#9 = IFCUNITASSIGNMENT((#7, #8)); +#10 = IFCCARTESIANPOINT((0., 0., 0.)); +#11 = IFCDIRECTION((0., 0., 1.)); +#12 = IFCDIRECTION((1., 0., 0.)); +#13 = IFCAXIS2PLACEMENT3D(#10, #11, #12); +#14 = IFCLOCALPLACEMENT($, #13); +#15 = IFCRAILWAY('1FNFy9AJeHwuVmwDZHIYIu', #3, 'optional Railway Name', 'optional Railway Description', $, #14, $, 'Longname for Railway track geometry (alignment)', $, $); +#16 = IFCDIRECTION((0., 1., 0.)); +#17 = IFCGEOMETRICREPRESENTATIONCONTEXT($, 'MODEL', 3, 1.E-5, #13, #16); +#18 = IFCRELAGGREGATES('1FNFyAAJeHwu6TwDZHIYIu', #3, 'Documentation Container', 'Container for IfcProject, collects relevant products', #1, (#15)); +#19 = IFCRELCONTAINEDINSPATIALSTRUCTURE('1FNFyBAJeHwvmywDZHIYIu', #3, 'IfcProducts contained in myIfcRailway', 'Association between IfcProducts and IfcRailway', (#20), #15); +#20 = IFCALIGNMENT('1FNFyCAJeHwxedwDZHIYIu', #3, 'Spor', 'optional Railway Description', $, #49, #52, $, $); +#21 = IFCALIGNMENTHORIZONTAL('1FNFyDAJeHwv87wDZHIYIu', $, $, $, $, #54, #57); +#23 = IFCRELNESTS('3BJTAQrjCHwvVKbERtTLTf', $, $, $, #20, (#21)); +#28 = IFCCARTESIANPOINT((0., 0.)); +#29 = IFCALIGNMENTHORIZONTALSEGMENT($, $, #28, 0., 300., 0., 100., $, .LINE.); +#30 = IFCALIGNMENTSEGMENT('1FNFyHAJeHwuDtwDZHIYIu', #3, $, $, $, #37, #40, #29); +#34 = IFCRELNESTS('1FNFyHAJeHwuDtwDZHIYIj', $, $, $, #21, (#30)); +#35 = IFCCOMPOSITECURVE((#36), .F.); +#36 = IFCCURVESEGMENT(.DISCONTINUOUS., #42, IFCNONNEGATIVELENGTHMEASURE(0.), IFCNONNEGATIVELENGTHMEASURE(100.), #45); +#37 = IFCLOCALPLACEMENT($, #38); +#38 = IFCAXIS2PLACEMENT3D(#39, $, $); +#39 = IFCCARTESIANPOINT((0., 0., 0.)); +#40 = IFCPRODUCTDEFINITIONSHAPE($, $, (#41, #72)); +#41 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve2D', (#36)); +#42 = IFCAXIS2PLACEMENT2D(#43, #44); +#43 = IFCCARTESIANPOINT((0., 0.)); +#44 = IFCDIRECTION((1., 0.)); +#45 = IFCLINE(#46, #47); +#46 = IFCCARTESIANPOINT((0., 0.)); +#47 = IFCVECTOR(#48, 1.); +#48 = IFCDIRECTION((1., 0.)); +#49 = IFCLOCALPLACEMENT($, #50); +#50 = IFCAXIS2PLACEMENT3D(#51, $, $); +#51 = IFCCARTESIANPOINT((0., 0., 0.)); +#52 = IFCPRODUCTDEFINITIONSHAPE($, $, (#53, #78)); +#53 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve3D', (#35)); +#54 = IFCLOCALPLACEMENT($, #55); +#55 = IFCAXIS2PLACEMENT3D(#56, $, $); +#56 = IFCCARTESIANPOINT((0., 0., 0.)); +#57 = IFCPRODUCTDEFINITIONSHAPE($, $, (#58, #61)); +#58 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve2D', (#35)); +#59 = IFCCARTESIANPOINTLIST2D(((0., 0.), (100., 0.)), $); +#60 = IFCINDEXEDPOLYCURVE(#59, $, $); +#61 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#60)); +#62 = IFCOWNERHISTORY(#64, #66, $, .ADDED., 1630842560, $, $, 1630842560); +#63 = IFCORGANIZATION($, '\X2\0410\X0\\X2\0420\X0\ \X2\0414\X0\\X2\0418\X0\ \X2\0415\X0\\X2\0424\X0\ \X2\041E\X0\\X2\041E\X0\\X2\0414\X0\', 'RDF Ltd.', $, $); +#64 = IFCPERSONANDORGANIZATION(#65, #63, $); +#65 = IFCPERSON($, 'Bonsma', 'Peter', $, $, $, $, $); +#66 = IFCAPPLICATION(#63, '0.99', 'Add Check Library Application', 'TA 1001'); +#67 = IFCRELDEFINESBYPROPERTIES('354cUdtSnAweyhAXUcJpTD', #62, $, $, (#21), #68); +#68 = IFCPROPERTYSET('2ic$p3enn7BREVq3aTTRI0', #62, 'ValidationPset', $, (#69)); +#69 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(100.), $); +#70 = IFCCARTESIANPOINTLIST2D(((0., 0.), (100., 0.)), $); +#71 = IFCINDEXEDPOLYCURVE(#70, $, $); +#72 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#71)); +#73 = IFCRELDEFINESBYPROPERTIES('3RP3WfI5zEnATZw$xKlC7F', #62, $, $, (#30), #74); +#74 = IFCPROPERTYSET('1D3L6Rzof7_PdNaiEAOs$a', #62, 'ValidationPset', $, (#75)); +#75 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(100.), $); +#76 = IFCCARTESIANPOINTLIST2D(((0., 0.), (100., 0.)), $); +#77 = IFCINDEXEDPOLYCURVE(#76, $, $); +#78 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#77)); +#79 = IFCRELDEFINESBYPROPERTIES('0blrc6BJ1DUfgUXLoziZHI', #62, $, $, (#20), #80); +#80 = IFCPROPERTYSET('2jwa8qD3P18unzvhS7lB29', #62, 'ValidationPset', $, (#81)); +#81 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(100.), $); +ENDSEC; +END-ISO-10303-21; diff --git a/UnitTests/Schemas/IFC4X3_RC4/line_100.0_300_inf_1_Meter/Data/line_100.0_300_inf_1_Meter.png b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_300_inf_1_Meter/Data/line_100.0_300_inf_1_Meter.png new file mode 100644 index 000000000..3c862d4fe Binary files /dev/null and b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_300_inf_1_Meter/Data/line_100.0_300_inf_1_Meter.png differ diff --git a/UnitTests/Schemas/IFC4X3_RC4/line_100.0_300_inf_1_Meter/Data/line_100.0_300_inf_1_Meter_top.png b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_300_inf_1_Meter/Data/line_100.0_300_inf_1_Meter_top.png new file mode 100644 index 000000000..73ac6daa4 Binary files /dev/null and b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_300_inf_1_Meter/Data/line_100.0_300_inf_1_Meter_top.png differ diff --git a/UnitTests/Schemas/IFC4X3_RC4/line_100.0_300_inf_1_Meter/src/line_100.0_300_inf_1_Meter.cpp b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_300_inf_1_Meter/src/line_100.0_300_inf_1_Meter.cpp new file mode 100644 index 000000000..8bc77b09f --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_300_inf_1_Meter/src/line_100.0_300_inf_1_Meter.cpp @@ -0,0 +1,102 @@ +/* + Copyright (c) 2021 Technical University of Munich + Chair of Computational Modeling and Simulation. + + TUM Open Infra Platform is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License Version 3 + as published by the Free Software Foundation. + + TUM Open Infra Platform is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include +#include + +#include + +#include +#include +#include + +using namespace testing; + +class Line : public IfcVisualTest { +protected: + + // Test standard values + buw::Image4b _background = buw::Image4b(0, 0); + + virtual void SetUp() override { + IfcVisualTest::SetUp(); + + express_model = OpenInfraPlatform::IFC4X3_RC4::IFC4X3_RC4Reader::FromFile(filename.string()); + + importer = buw::makeReferenceCounted>(); + auto model = importer->collectData(express_model); + + _background = rendererIfc->captureImage(); + rendererIfc->setModel(model[0]); + } + + virtual void TearDown() override { + express_model.reset(); + IfcVisualTest::TearDown(); + } + + virtual std::string TestName() const { return "line_100.0_300_inf_1_Meter"; } + virtual std::string Schema() const { return "IFC4X3_RC4"; } + + const boost::filesystem::path filename = dataPath("line_100.0_300_inf_1_Meter.ifc"); + + std::shared_ptr express_model = nullptr; + buw::ReferenceCounted> importer = nullptr; +}; + +TEST_F(Line, AllEntitiesAreRead) { + EXPECT_THAT(express_model->entities.size(), Eq(73)); +} + +TEST_F(Line, IFCHasAnEssentialEntity) { + auto result1 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto& pair) -> bool { return pair.second->classname() == "IFCCURVESEGMENT"; }); + auto result2 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto& pair) -> bool { return pair.second->classname() == "IFCALIGNMENTHORIZONTAL"; }); + auto result3 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto& pair) -> bool { return pair.second->classname() == "IFCALIGNMENTHORIZONTALSEGMENT"; }); + auto result4 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto& pair) -> bool { return pair.second->classname() == "IFCLINE"; }); + EXPECT_NE(result1, express_model->entities.end()); + EXPECT_NE(result2, express_model->entities.end()); + EXPECT_NE(result3, express_model->entities.end()); + EXPECT_NE(result4, express_model->entities.end()); +} + +TEST_F(Line, ImageIsSaved) +{ + // Arrange + buw::Image4b image = rendererIfc->captureImage(); + + // Act + buw::storeImage(testPath("line_100.0_300_inf_1_Meter.png").string(), image); + + // Assert + EXPECT_NO_THROW(buw::loadImage4b(testPath("line_100.0_300_inf_1_Meter.png").string())); +} + +TEST_F(Line, PlaneSurfaceViews) +{ + // Arrange + const auto expected_top = buw::loadImage4b(dataPath("line_100.0_300_inf_1_Meter_top.png").string()); + + // Act (Top) + rendererIfc->setViewDirection(buw::eViewDirection::Top); + buw::Image4b image_top = CaptureImage(); + + // uncomment following lines to also save the screen shot + //buw::storeImage(testPath("line_100.0_300_inf_1_Meter_top.png").string(), image_top); + + // Assert + EXPECT_EQ(image_top, expected_top); +} \ No newline at end of file diff --git a/UnitTests/Schemas/IFC4X3_RC4/line_100.0_inf_300_1_Meter/CMakeLists.txt b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_inf_300_1_Meter/CMakeLists.txt new file mode 100644 index 000000000..e50cf7c06 --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_inf_300_1_Meter/CMakeLists.txt @@ -0,0 +1,20 @@ +# +# Copyright (c) 2021 Technical University of Munich +# Chair of Computational Modeling and Simulation. +# +# TUM Open Infra Platform is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License Version 3 +# as published by the Free Software Foundation. +# +# TUM Open Infra Platform is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +include(CreateUnitTests) + +CreateIfcFileVisualUnitTestForSchema(line_100.0_inf_300_1_Meter IFC4X3_RC4) diff --git a/UnitTests/Schemas/IFC4X3_RC4/line_100.0_inf_300_1_Meter/Data/line_100.0_inf_300_1_Meter.ifc b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_inf_300_1_Meter/Data/line_100.0_inf_300_1_Meter.ifc new file mode 100644 index 000000000..8d337e70d --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_inf_300_1_Meter/Data/line_100.0_inf_300_1_Meter.ifc @@ -0,0 +1,82 @@ +ISO-10303-21; +HEADER; +FILE_DESCRIPTION (('ViewDefinition [CoordinationView]'), '2;1'); +FILE_NAME ('Single-LANDXML.ifc', '2021-05-24T11:00:00', ('IFC Rail Technical Services'), ('buildingSMART International RailwayRoom'), 'RailCOMPLETE\X2\FFAE\X0\', '2019.1.1995.0', ''); +FILE_SCHEMA (('IFC4X3_RC4')); +ENDSEC; +DATA; +#1 = IFCPROJECT('1FNFy8AJeHwwz7wDZHIYIu', #3, 'IFC Rail Referencedata', 'Rail alignment sample', $, 'Longname', 'Design', $, #9); +#2 = IFCAPPLICATION(#5, '2019.1.1995.0', 'RailCOMPLETE\X2\00AE\X0\', $); +#3 = IFCOWNERHISTORY(#6, #2, $, .ADDED., 1320688800, $, $, 1320688800); +#4 = IFCPERSON('TS', 'IFC Rail Technical Services', $, $, $, $, $, $); +#5 = IFCORGANIZATION('bsI RWR', 'buildingSmart International Railway Room', $, $, $); +#6 = IFCPERSONANDORGANIZATION(#4, #5, $); +#7 = IFCSIUNIT(*, .LENGTHUNIT., $, .METRE.); +#8 = IFCSIUNIT(*, .PLANEANGLEUNIT., $, .RADIAN.); +#9 = IFCUNITASSIGNMENT((#7, #8)); +#10 = IFCCARTESIANPOINT((0., 0., 0.)); +#11 = IFCDIRECTION((0., 0., 1.)); +#12 = IFCDIRECTION((1., 0., 0.)); +#13 = IFCAXIS2PLACEMENT3D(#10, #11, #12); +#14 = IFCLOCALPLACEMENT($, #13); +#15 = IFCRAILWAY('1FNFy9AJeHwuVmwDZHIYIu', #3, 'optional Railway Name', 'optional Railway Description', $, #14, $, 'Longname for Railway track geometry (alignment)', $, $); +#16 = IFCDIRECTION((0., 1., 0.)); +#17 = IFCGEOMETRICREPRESENTATIONCONTEXT($, 'MODEL', 3, 1.E-5, #13, #16); +#18 = IFCRELAGGREGATES('1FNFyAAJeHwu6TwDZHIYIu', #3, 'Documentation Container', 'Container for IfcProject, collects relevant products', #1, (#15)); +#19 = IFCRELCONTAINEDINSPATIALSTRUCTURE('1FNFyBAJeHwvmywDZHIYIu', #3, 'IfcProducts contained in myIfcRailway', 'Association between IfcProducts and IfcRailway', (#20), #15); +#20 = IFCALIGNMENT('1FNFyCAJeHwxedwDZHIYIu', #3, 'Spor', 'optional Railway Description', $, #49, #52, $, $); +#21 = IFCALIGNMENTHORIZONTAL('1FNFyDAJeHwv87wDZHIYIu', $, $, $, $, #54, #57); +#23 = IFCRELNESTS('3BJTAQrjCHwvVKbERtTLTf', $, $, $, #20, (#21)); +#28 = IFCCARTESIANPOINT((0., 0.)); +#29 = IFCALIGNMENTHORIZONTALSEGMENT($, $, #28, 0., 0., 300., 100., $, .LINE.); +#30 = IFCALIGNMENTSEGMENT('1FNFyHAJeHwuDtwDZHIYIu', #3, $, $, $, #37, #40, #29); +#34 = IFCRELNESTS('1FNFyHAJeHwuDtwDZHIYIj', $, $, $, #21, (#30)); +#35 = IFCCOMPOSITECURVE((#36), .F.); +#36 = IFCCURVESEGMENT(.DISCONTINUOUS., #42, IFCNONNEGATIVELENGTHMEASURE(0.), IFCNONNEGATIVELENGTHMEASURE(100.), #45); +#37 = IFCLOCALPLACEMENT($, #38); +#38 = IFCAXIS2PLACEMENT3D(#39, $, $); +#39 = IFCCARTESIANPOINT((0., 0., 0.)); +#40 = IFCPRODUCTDEFINITIONSHAPE($, $, (#41, #72)); +#41 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve2D', (#36)); +#42 = IFCAXIS2PLACEMENT2D(#43, #44); +#43 = IFCCARTESIANPOINT((0., 0.)); +#44 = IFCDIRECTION((1., 0.)); +#45 = IFCLINE(#46, #47); +#46 = IFCCARTESIANPOINT((0., 0.)); +#47 = IFCVECTOR(#48, 1.); +#48 = IFCDIRECTION((1., 0.)); +#49 = IFCLOCALPLACEMENT($, #50); +#50 = IFCAXIS2PLACEMENT3D(#51, $, $); +#51 = IFCCARTESIANPOINT((0., 0., 0.)); +#52 = IFCPRODUCTDEFINITIONSHAPE($, $, (#53, #78)); +#53 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve3D', (#35)); +#54 = IFCLOCALPLACEMENT($, #55); +#55 = IFCAXIS2PLACEMENT3D(#56, $, $); +#56 = IFCCARTESIANPOINT((0., 0., 0.)); +#57 = IFCPRODUCTDEFINITIONSHAPE($, $, (#58, #61)); +#58 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve2D', (#35)); +#59 = IFCCARTESIANPOINTLIST2D(((0., 0.), (100., 0.)), $); +#60 = IFCINDEXEDPOLYCURVE(#59, $, $); +#61 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#60)); +#62 = IFCOWNERHISTORY(#64, #66, $, .ADDED., 1630842561, $, $, 1630842561); +#63 = IFCORGANIZATION($, '\X2\0410\X0\\X2\0420\X0\ \X2\0414\X0\\X2\0418\X0\ \X2\0415\X0\\X2\0424\X0\ \X2\041E\X0\\X2\041E\X0\\X2\0414\X0\', 'RDF Ltd.', $, $); +#64 = IFCPERSONANDORGANIZATION(#65, #63, $); +#65 = IFCPERSON($, 'Bonsma', 'Peter', $, $, $, $, $); +#66 = IFCAPPLICATION(#63, '0.99', 'Add Check Library Application', 'TA 1001'); +#67 = IFCRELDEFINESBYPROPERTIES('0zq4D4unT3fe5cOJ$EE862', #62, $, $, (#21), #68); +#68 = IFCPROPERTYSET('3TmYQnRJD7WAxZ5JXGE4qQ', #62, 'ValidationPset', $, (#69)); +#69 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(100.), $); +#70 = IFCCARTESIANPOINTLIST2D(((0., 0.), (100., 0.)), $); +#71 = IFCINDEXEDPOLYCURVE(#70, $, $); +#72 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#71)); +#73 = IFCRELDEFINESBYPROPERTIES('2v2KqNVC97bQcVelqQwjkf', #62, $, $, (#30), #74); +#74 = IFCPROPERTYSET('2TlG3IeZr4bhvaJR7hM1ZI', #62, 'ValidationPset', $, (#75)); +#75 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(100.), $); +#76 = IFCCARTESIANPOINTLIST2D(((0., 0.), (100., 0.)), $); +#77 = IFCINDEXEDPOLYCURVE(#76, $, $); +#78 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#77)); +#79 = IFCRELDEFINESBYPROPERTIES('3cH_QbUfvCyQsTrvhhvbMH', #62, $, $, (#20), #80); +#80 = IFCPROPERTYSET('3tGnEliXT5GubGDIAgoudm', #62, 'ValidationPset', $, (#81)); +#81 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(100.), $); +ENDSEC; +END-ISO-10303-21; diff --git a/UnitTests/Schemas/IFC4X3_RC4/line_100.0_inf_300_1_Meter/Data/line_100.0_inf_300_1_Meter.png b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_inf_300_1_Meter/Data/line_100.0_inf_300_1_Meter.png new file mode 100644 index 000000000..3c862d4fe Binary files /dev/null and b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_inf_300_1_Meter/Data/line_100.0_inf_300_1_Meter.png differ diff --git a/UnitTests/Schemas/IFC4X3_RC4/line_100.0_inf_300_1_Meter/Data/line_100.0_inf_300_1_Meter_top.png b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_inf_300_1_Meter/Data/line_100.0_inf_300_1_Meter_top.png new file mode 100644 index 000000000..73ac6daa4 Binary files /dev/null and b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_inf_300_1_Meter/Data/line_100.0_inf_300_1_Meter_top.png differ diff --git a/UnitTests/Schemas/IFC4X3_RC4/line_100.0_inf_300_1_Meter/src/line_100.0_inf_300_1_Meter.cpp b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_inf_300_1_Meter/src/line_100.0_inf_300_1_Meter.cpp new file mode 100644 index 000000000..a584bb4c5 --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/line_100.0_inf_300_1_Meter/src/line_100.0_inf_300_1_Meter.cpp @@ -0,0 +1,103 @@ +/* + Copyright (c) 2021 Technical University of Munich + Chair of Computational Modeling and Simulation. + + TUM Open Infra Platform is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License Version 3 + as published by the Free Software Foundation. + + TUM Open Infra Platform is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include +#include + +#include + +#include +#include +#include + +using namespace testing; + +class Line : public IfcVisualTest { +protected: + + // Test standard values + buw::Image4b _background = buw::Image4b(0, 0); + + virtual void SetUp() override { + IfcVisualTest::SetUp(); + + express_model = OpenInfraPlatform::IFC4X3_RC4::IFC4X3_RC4Reader::FromFile(filename.string()); + + importer = buw::makeReferenceCounted>(); + auto model = importer->collectData(express_model); + + _background = rendererIfc->captureImage(); + rendererIfc->setModel(model[0]); + } + + virtual void TearDown() override { + express_model.reset(); + IfcVisualTest::TearDown(); + } + + virtual std::string TestName() const { return "line_100.0_inf_300_1_Meter"; } + virtual std::string Schema() const { return "IFC4X3_RC4"; } + + const boost::filesystem::path filename = dataPath("line_100.0_inf_300_1_Meter.ifc"); + + std::shared_ptr express_model = nullptr; + buw::ReferenceCounted> importer = nullptr; +}; + +TEST_F(Line, AllEntitiesAreRead) { + EXPECT_THAT(express_model->entities.size(), Eq(73)); +} + +TEST_F(Line, IFCHasAnEssentialEntity) { + auto result1 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto& pair) -> bool { return pair.second->classname() == "IFCCURVESEGMENT"; }); + auto result2 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto& pair) -> bool { return pair.second->classname() == "IFCALIGNMENTHORIZONTAL"; }); + auto result3 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto& pair) -> bool { return pair.second->classname() == "IFCALIGNMENTHORIZONTALSEGMENT"; }); + auto result4 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto& pair) -> bool { return pair.second->classname() == "IFCLINE"; }); + EXPECT_NE(result1, express_model->entities.end()); + EXPECT_NE(result2, express_model->entities.end()); + EXPECT_NE(result3, express_model->entities.end()); + EXPECT_NE(result4, express_model->entities.end()); +} + +TEST_F(Line, ImageIsSaved) +{ + // Arrange + buw::Image4b image = rendererIfc->captureImage(); + + // Act + buw::storeImage(testPath("line_100.0_inf_300_1_Meter.png").string(), image); + + // Assert + EXPECT_NO_THROW(buw::loadImage4b(testPath("line_100.0_inf_300_1_Meter.png").string())); +} + +TEST_F(Line, PlaneSurfaceViews) +{ + // Arrange + const auto expected_top = buw::loadImage4b(dataPath("line_100.0_inf_300_1_Meter_top.png").string()); + + // Act (Top) + rendererIfc->setViewDirection(buw::eViewDirection::Top); + buw::Image4b image_top = CaptureImage(); + + + // uncomment following lines to also save the screen shot + //buw::storeImage(testPath("line_100.0_inf_300_1_Meter_top.png").string(), image_top); + + // Assert + EXPECT_EQ(image_top, expected_top); +} \ No newline at end of file diff --git a/UnitTests/Schemas/IFC4X3_RC4/namespace.h b/UnitTests/Schemas/IFC4X3_RC4/namespace.h new file mode 100644 index 000000000..90220f69c --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/namespace.h @@ -0,0 +1,38 @@ +/* + Copyright (c) 2021 Technical University of Munich + Chair of Computational Modeling and Simulation. + + TUM Open Infra Platform is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License Version 3 + as published by the Free Software Foundation. + + TUM Open Infra Platform is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#pragma once +#ifndef F7302D7B_948F_445E_8DB9_C722295B8E2E +#define F7302D7B_948F_445E_8DB9_C722295B8E2E + +#if !defined OIP_NAMESPACE_UNITTESTS_SCHEMA_IFC4X3_RC4_BEGIN +#define OIP_NAMESPACE_UNITTESTS_SCHEMA_IFC4X3_RC4_BEGIN \ +namespace OpenInfraPlatform {\ +namespace UnitTests {\ +namespace Schema {\ +namespace IFC4X3_RC4 { +#endif + +#if !defined OIP_NAMESPACE_UNITTESTS_SCHEMA_IFC4X3_RC4_END +#define OIP_NAMESPACE_UNITTESTS_SCHEMA_IFC4X3_RC4_END \ +}\ +}\ +}\ +} + +#endif +#endif /* F7302D7B_948F_445E_8DB9_C722295B8E2E */ diff --git a/UnitTests/Schemas/IFC4X3_RC4/sine-curve_100.0_300_1000_1_Meter/CMakeLists.txt b/UnitTests/Schemas/IFC4X3_RC4/sine-curve_100.0_300_1000_1_Meter/CMakeLists.txt new file mode 100644 index 000000000..16825fce6 --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/sine-curve_100.0_300_1000_1_Meter/CMakeLists.txt @@ -0,0 +1,20 @@ +# +# Copyright (c) 2021 Technical University of Munich +# Chair of Computational Modeling and Simulation. +# +# TUM Open Infra Platform is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License Version 3 +# as published by the Free Software Foundation. +# +# TUM Open Infra Platform is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +include(CreateUnitTests) + +CreateIfcFileVisualUnitTestForSchema(sine-curve_100.0_300_1000_1_Meter IFC4X3_RC4) diff --git a/UnitTests/Schemas/IFC4X3_RC4/sine-curve_100.0_300_1000_1_Meter/Data/sine-curve_100.0_300_1000_1_Meter.ifc b/UnitTests/Schemas/IFC4X3_RC4/sine-curve_100.0_300_1000_1_Meter/Data/sine-curve_100.0_300_1000_1_Meter.ifc new file mode 100644 index 000000000..012cb4e1d --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/sine-curve_100.0_300_1000_1_Meter/Data/sine-curve_100.0_300_1000_1_Meter.ifc @@ -0,0 +1,79 @@ +ISO-10303-21; +HEADER; +FILE_DESCRIPTION (('ViewDefinition [CoordinationView]'), '2;1'); +FILE_NAME ('Single-LANDXML.ifc', '2021-05-24T11:00:00', ('IFC Rail Technical Services'), ('buildingSMART International RailwayRoom'), 'RailCOMPLETE\X2\FFAE\X0\', '2019.1.1995.0', ''); +FILE_SCHEMA (('IFC4X3_RC4')); +ENDSEC; +DATA; +#1 = IFCPROJECT('1FNFy8AJeHwwz7wDZHIYIu', #3, 'IFC Rail Referencedata', 'Rail alignment sample', $, 'Longname', 'Design', $, #9); +#2 = IFCAPPLICATION(#5, '2019.1.1995.0', 'RailCOMPLETE\X2\00AE\X0\', $); +#3 = IFCOWNERHISTORY(#6, #2, $, .ADDED., 1320688800, $, $, 1320688800); +#4 = IFCPERSON('TS', 'IFC Rail Technical Services', $, $, $, $, $, $); +#5 = IFCORGANIZATION('bsI RWR', 'buildingSmart International Railway Room', $, $, $); +#6 = IFCPERSONANDORGANIZATION(#4, #5, $); +#7 = IFCSIUNIT(*, .LENGTHUNIT., $, .METRE.); +#8 = IFCSIUNIT(*, .PLANEANGLEUNIT., $, .RADIAN.); +#9 = IFCUNITASSIGNMENT((#7, #8)); +#10 = IFCCARTESIANPOINT((0., 0., 0.)); +#11 = IFCDIRECTION((0., 0., 1.)); +#12 = IFCDIRECTION((1., 0., 0.)); +#13 = IFCAXIS2PLACEMENT3D(#10, #11, #12); +#14 = IFCLOCALPLACEMENT($, #13); +#15 = IFCRAILWAY('1FNFy9AJeHwuVmwDZHIYIu', #3, 'optional Railway Name', 'optional Railway Description', $, #14, $, 'Longname for Railway track geometry (alignment)', $, $); +#16 = IFCDIRECTION((0., 1., 0.)); +#17 = IFCGEOMETRICREPRESENTATIONCONTEXT($, 'MODEL', 3, 1.E-5, #13, #16); +#18 = IFCRELAGGREGATES('1FNFyAAJeHwu6TwDZHIYIu', #3, 'Documentation Container', 'Container for IfcProject, collects relevant products', #1, (#15)); +#19 = IFCRELCONTAINEDINSPATIALSTRUCTURE('1FNFyBAJeHwvmywDZHIYIu', #3, 'IfcProducts contained in myIfcRailway', 'Association between IfcProducts and IfcRailway', (#20), #15); +#20 = IFCALIGNMENT('1FNFyCAJeHwxedwDZHIYIu', #3, 'Spor', 'optional Railway Description', $, #46, #49, $, $); +#21 = IFCALIGNMENTHORIZONTAL('1FNFyDAJeHwv87wDZHIYIu', $, $, $, $, #51, #54); +#23 = IFCRELNESTS('3BJTAQrjCHwvVKbERtTLTf', $, $, $, #20, (#21)); +#28 = IFCCARTESIANPOINT((0., 0.)); +#29 = IFCALIGNMENTHORIZONTALSEGMENT($, $, #28, 0., 300., 1000., 100., $, .SINECURVE.); +#30 = IFCALIGNMENTSEGMENT('1FNFyHAJeHwuDtwDZHIYIu', #3, $, $, $, #37, #40, #29); +#34 = IFCRELNESTS('1FNFyHAJeHwuDtwDZHIYIj', $, $, $, #21, (#30)); +#35 = IFCCOMPOSITECURVE((#36), .F.); +#36 = IFCCURVESEGMENT(.DISCONTINUOUS., #42, IFCPARAMETERVALUE(0.), IFCNONNEGATIVELENGTHMEASURE(100.), #45); +#37 = IFCLOCALPLACEMENT($, #38); +#38 = IFCAXIS2PLACEMENT3D(#39, $, $); +#39 = IFCCARTESIANPOINT((0., 0., 0.)); +#40 = IFCPRODUCTDEFINITIONSHAPE($, $, (#41, #69)); +#41 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve2D', (#36)); +#42 = IFCAXIS2PLACEMENT2D(#43, #44); +#43 = IFCCARTESIANPOINT((0., 0.)); +#44 = IFCDIRECTION((1., 0.)); +#45 = IFCSINE($, 2692.79370307697, -207.019667802706, 300.); +#46 = IFCLOCALPLACEMENT($, #47); +#47 = IFCAXIS2PLACEMENT3D(#48, $, $); +#48 = IFCCARTESIANPOINT((0., 0., 0.)); +#49 = IFCPRODUCTDEFINITIONSHAPE($, $, (#50, #75)); +#50 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve3D', (#35)); +#51 = IFCLOCALPLACEMENT($, #52); +#52 = IFCAXIS2PLACEMENT3D(#53, $, $); +#53 = IFCCARTESIANPOINT((0., 0., 0.)); +#54 = IFCPRODUCTDEFINITIONSHAPE($, $, (#55, #58)); +#55 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve2D', (#35)); +#56 = IFCCARTESIANPOINTLIST2D(((0., 0.), (9.99998148151309E-1, 1.66666435589666E-3), (1.99998518535452, 6.66661742062004E-3), (2.99995000180305, 1.4999688629274E-2), (3.99988149125478, 2.66654867790927E-2), (4.99976855496621, 4.16633091739696E-2), (5.99960010711964, 5.99920518982836E-2), (6.99936508171177, 8.16501215890721E-2), (7.99905244086287, 1.0663534906941E-1), (8.99865118449613, 1.34944905198138E-1), (9.99815036132743, 1.66575219281888E-1), (10.9975390810969, 2.0152190038467E-1), (11.9968065279645, 2.3977966185823E-1), (12.9959419749822, 2.81342249402907E-1), (13.9949347995494, 3.26202372953943E-1), (14.9937744997477, 3.74351642672203E-1), (15.9924507114449, 4.25780509301011E-1), (16.9909532260517, 4.80478209132498E-1), (17.9892720088092, 5.38432713807505E-1), (18.9873972174773, 5.99630685152788E-1), (19.9853192212931, 6.64057435238108E-1), (20.9830286200626, 7.31696891813912E-1), (21.9805162632479, 8.02531569267744E-1), (22.9777732689096, 8.76542545214426E-1), (23.9747910423633, 9.53709442811535E-1), (24.9715612944123, 1.0340104188678), (25.9680760590161, 1.11742215778801), (26.9643277102608, 1.20391987137373), (27.9603089784987, 1.29347730447518), (28.9560129655323, 1.38606674646516), (29.9514331587185, 1.48165904848256), (30.9465634438835, 1.58022364636901), (31.9413981169378, 1.68172858919952), (32.9359318940977, 1.78614057328516), (33.9301599206234, 1.89342498150416), (34.924077777996, 2.00354592779635), (35.9176814894679, 2.11646630663571), (36.9109675239307, 2.23214784727628), (37.9039327980563, 2.35055117254791), (38.8965746766817, 2.47163586196128), (39.888890971417, 2.59536051886464), (40.8808799374713, 2.72168284138002), (41.8725402687026, 2.85055969683213), (42.8638710909102, 2.9819471993706), (43.8548719534014, 3.11580079047448), (44.8455428188734, 3.25207532201783), (45.8358840516681, 3.39072514156598), (46.8258964044617, 3.53170417956471), (47.8155810034675, 3.67496603807822), (48.8049393322357, 3.82046408072675), (49.7939732141464, 3.96815152347126), (50.7826847936958, 4.11798152589045), (51.7710765166877, 4.26990728259425), (52.7591511094455, 4.42388211441869), (53.7469115571649, 4.57985955904867), (54.7343610815344, 4.7377934607183), (55.7215031177525, 4.89763805864273), (56.7083412910713, 5.05934807384123), (57.6948793930009, 5.22287879401785), (58.6811213573059, 5.38818615617411), (59.6670712359276, 5.55522682663759), (60.652733174961, 5.7239582782001), (61.6381113908161, 5.89433886407103), (62.6232101466877, 6.06632788836357), (63.6080337294543, 6.23988567284512), (64.5925864271226, 6.41497361969757), (65.5768725069287, 6.59155427004842), (66.5608961941994, 6.76959135804988), (67.5446616520729, 6.94904986030039), (68.5281729621704, 7.1298960404201), (69.5114341063024, 7.31209748861114), (70.4944489492861, 7.49562315605191), (71.4772212229443, 7.68044338399476), (72.459754511346, 7.86652992745633), (73.4420522373435, 8.05385597341068), (74.4241176504508, 8.24239615341627), (75.4059538161024, 8.43212655062915), (76.3875636063233, 8.62302470117625), (77.3689496918323, 8.81506958988461), (78.350114535598, 9.00824164038379), (79.331060387853, 9.20252269962082), (80.3117892825728, 9.39789601684855), (81.292303035414, 9.59434621716978), (82.2726032431042, 9.79185926974097), (83.2526912842678, 9.99042245076007), (84.2325683216683, 10.1900243013835), (85.2122353058425, 10.3906545807377), (86.1916929800981, 10.5923042142091), (87.1709418868389, 10.7949652372162), (88.1499823751825, 10.9986307346855), (89.1288146098284, 11.2032947764672), (90.107438581132, 11.4089523489488), (91.0858541163356, 11.6155992831328), (92.0640608919078, 11.8232321794644), (93.042058446935, 12.0318483297055), (94.0198461975096, 12.2414456361639), (94.9974234520557, 12.452022528597), (95.9747894275296, 12.6635778791182), (96.9519432664315, 12.876110915444), (97.9288840545597, 13.0896211328231), (98.9056108394409, 13.304108204998)), $); +#57 = IFCINDEXEDPOLYCURVE(#56, $, $); +#58 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#57)); +#59 = IFCOWNERHISTORY(#61, #63, $, .ADDED., 1630842747, $, $, 1630842747); +#60 = IFCORGANIZATION($, '\X2\0410\X0\\X2\0420\X0\ \X2\0414\X0\\X2\0418\X0\ \X2\0415\X0\\X2\0424\X0\ \X2\041E\X0\\X2\041E\X0\\X2\0414\X0\', 'RDF Ltd.', $, $); +#61 = IFCPERSONANDORGANIZATION(#62, #60, $); +#62 = IFCPERSON($, 'Bonsma', 'Peter', $, $, $, $, $); +#63 = IFCAPPLICATION(#60, '0.99', 'Add Check Library Application', 'TA 1001'); +#64 = IFCRELDEFINESBYPROPERTIES('2wbMuaUJnA_gs7tNUXpUgY', #59, $, $, (#21), #65); +#65 = IFCPROPERTYSET('1Ch5lfsnX4uxAvdHLq8mVD', #59, 'ValidationPset', $, (#66)); +#66 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(99.9999771104856), $); +#67 = IFCCARTESIANPOINTLIST2D(((0., 0.), (9.99998148151309E-1, 1.66666435589666E-3), (1.99998518535452, 6.66661742062004E-3), (2.99995000180305, 1.4999688629274E-2), (3.99988149125478, 2.66654867790927E-2), (4.99976855496621, 4.16633091739696E-2), (5.99960010711964, 5.99920518982836E-2), (6.99936508171177, 8.16501215890721E-2), (7.99905244086287, 1.0663534906941E-1), (8.99865118449613, 1.34944905198138E-1), (9.99815036132743, 1.66575219281888E-1), (10.9975390810969, 2.0152190038467E-1), (11.9968065279645, 2.3977966185823E-1), (12.9959419749822, 2.81342249402907E-1), (13.9949347995494, 3.26202372953943E-1), (14.9937744997477, 3.74351642672203E-1), (15.9924507114449, 4.25780509301011E-1), (16.9909532260517, 4.80478209132498E-1), (17.9892720088092, 5.38432713807505E-1), (18.9873972174773, 5.99630685152788E-1), (19.9853192212931, 6.64057435238108E-1), (20.9830286200626, 7.31696891813912E-1), (21.9805162632479, 8.02531569267744E-1), (22.9777732689096, 8.76542545214426E-1), (23.9747910423633, 9.53709442811535E-1), (24.9715612944123, 1.0340104188678), (25.9680760590161, 1.11742215778801), (26.9643277102608, 1.20391987137373), (27.9603089784987, 1.29347730447518), (28.9560129655323, 1.38606674646516), (29.9514331587185, 1.48165904848256), (30.9465634438835, 1.58022364636901), (31.9413981169378, 1.68172858919952), (32.9359318940977, 1.78614057328516), (33.9301599206234, 1.89342498150416), (34.924077777996, 2.00354592779635), (35.9176814894679, 2.11646630663571), (36.9109675239307, 2.23214784727628), (37.9039327980563, 2.35055117254791), (38.8965746766817, 2.47163586196128), (39.888890971417, 2.59536051886464), (40.8808799374713, 2.72168284138002), (41.8725402687026, 2.85055969683213), (42.8638710909102, 2.9819471993706), (43.8548719534014, 3.11580079047448), (44.8455428188734, 3.25207532201783), (45.8358840516681, 3.39072514156598), (46.8258964044617, 3.53170417956471), (47.8155810034675, 3.67496603807822), (48.8049393322357, 3.82046408072675), (49.7939732141464, 3.96815152347126), (50.7826847936958, 4.11798152589045), (51.7710765166877, 4.26990728259425), (52.7591511094455, 4.42388211441869), (53.7469115571649, 4.57985955904867), (54.7343610815344, 4.7377934607183), (55.7215031177525, 4.89763805864273), (56.7083412910713, 5.05934807384123), (57.6948793930009, 5.22287879401785), (58.6811213573059, 5.38818615617411), (59.6670712359276, 5.55522682663759), (60.652733174961, 5.7239582782001), (61.6381113908161, 5.89433886407103), (62.6232101466877, 6.06632788836357), (63.6080337294543, 6.23988567284512), (64.5925864271226, 6.41497361969757), (65.5768725069287, 6.59155427004842), (66.5608961941994, 6.76959135804988), (67.5446616520729, 6.94904986030039), (68.5281729621704, 7.1298960404201), (69.5114341063024, 7.31209748861114), (70.4944489492861, 7.49562315605191), (71.4772212229443, 7.68044338399476), (72.459754511346, 7.86652992745633), (73.4420522373435, 8.05385597341068), (74.4241176504508, 8.24239615341627), (75.4059538161024, 8.43212655062915), (76.3875636063233, 8.62302470117625), (77.3689496918323, 8.81506958988461), (78.350114535598, 9.00824164038379), (79.331060387853, 9.20252269962082), (80.3117892825728, 9.39789601684855), (81.292303035414, 9.59434621716978), (82.2726032431042, 9.79185926974097), (83.2526912842678, 9.99042245076007), (84.2325683216683, 10.1900243013835), (85.2122353058425, 10.3906545807377), (86.1916929800981, 10.5923042142091), (87.1709418868389, 10.7949652372162), (88.1499823751825, 10.9986307346855), (89.1288146098284, 11.2032947764672), (90.107438581132, 11.4089523489488), (91.0858541163356, 11.6155992831328), (92.0640608919078, 11.8232321794644), (93.042058446935, 12.0318483297055), (94.0198461975096, 12.2414456361639), (94.9974234520557, 12.452022528597), (95.9747894275296, 12.6635778791182), (96.9519432664315, 12.876110915444), (97.9288840545597, 13.0896211328231), (98.9056108394409, 13.304108204998)), $); +#68 = IFCINDEXEDPOLYCURVE(#67, $, $); +#69 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#68)); +#70 = IFCRELDEFINESBYPROPERTIES('3F6zD0s6r8FvKR5Gj8OKSF', #59, $, $, (#30), #71); +#71 = IFCPROPERTYSET('113QR_7kHAmOqsNO31ww$I', #59, 'ValidationPset', $, (#72)); +#72 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(99.9999771104856), $); +#73 = IFCCARTESIANPOINTLIST2D(((0., 0.), (9.99998148151309E-1, 1.66666435589666E-3), (1.99998518535452, 6.66661742062004E-3), (2.99995000180305, 1.4999688629274E-2), (3.99988149125478, 2.66654867790927E-2), (4.99976855496621, 4.16633091739696E-2), (5.99960010711964, 5.99920518982836E-2), (6.99936508171177, 8.16501215890721E-2), (7.99905244086287, 1.0663534906941E-1), (8.99865118449613, 1.34944905198138E-1), (9.99815036132743, 1.66575219281888E-1), (10.9975390810969, 2.0152190038467E-1), (11.9968065279645, 2.3977966185823E-1), (12.9959419749822, 2.81342249402907E-1), (13.9949347995494, 3.26202372953943E-1), (14.9937744997477, 3.74351642672203E-1), (15.9924507114449, 4.25780509301011E-1), (16.9909532260517, 4.80478209132498E-1), (17.9892720088092, 5.38432713807505E-1), (18.9873972174773, 5.99630685152788E-1), (19.9853192212931, 6.64057435238108E-1), (20.9830286200626, 7.31696891813912E-1), (21.9805162632479, 8.02531569267744E-1), (22.9777732689096, 8.76542545214426E-1), (23.9747910423633, 9.53709442811535E-1), (24.9715612944123, 1.0340104188678), (25.9680760590161, 1.11742215778801), (26.9643277102608, 1.20391987137373), (27.9603089784987, 1.29347730447518), (28.9560129655323, 1.38606674646516), (29.9514331587185, 1.48165904848256), (30.9465634438835, 1.58022364636901), (31.9413981169378, 1.68172858919952), (32.9359318940977, 1.78614057328516), (33.9301599206234, 1.89342498150416), (34.924077777996, 2.00354592779635), (35.9176814894679, 2.11646630663571), (36.9109675239307, 2.23214784727628), (37.9039327980563, 2.35055117254791), (38.8965746766817, 2.47163586196128), (39.888890971417, 2.59536051886464), (40.8808799374713, 2.72168284138002), (41.8725402687026, 2.85055969683213), (42.8638710909102, 2.9819471993706), (43.8548719534014, 3.11580079047448), (44.8455428188734, 3.25207532201783), (45.8358840516681, 3.39072514156598), (46.8258964044617, 3.53170417956471), (47.8155810034675, 3.67496603807822), (48.8049393322357, 3.82046408072675), (49.7939732141464, 3.96815152347126), (50.7826847936958, 4.11798152589045), (51.7710765166877, 4.26990728259425), (52.7591511094455, 4.42388211441869), (53.7469115571649, 4.57985955904867), (54.7343610815344, 4.7377934607183), (55.7215031177525, 4.89763805864273), (56.7083412910713, 5.05934807384123), (57.6948793930009, 5.22287879401785), (58.6811213573059, 5.38818615617411), (59.6670712359276, 5.55522682663759), (60.652733174961, 5.7239582782001), (61.6381113908161, 5.89433886407103), (62.6232101466877, 6.06632788836357), (63.6080337294543, 6.23988567284512), (64.5925864271226, 6.41497361969757), (65.5768725069287, 6.59155427004842), (66.5608961941994, 6.76959135804988), (67.5446616520729, 6.94904986030039), (68.5281729621704, 7.1298960404201), (69.5114341063024, 7.31209748861114), (70.4944489492861, 7.49562315605191), (71.4772212229443, 7.68044338399476), (72.459754511346, 7.86652992745633), (73.4420522373435, 8.05385597341068), (74.4241176504508, 8.24239615341627), (75.4059538161024, 8.43212655062915), (76.3875636063233, 8.62302470117625), (77.3689496918323, 8.81506958988461), (78.350114535598, 9.00824164038379), (79.331060387853, 9.20252269962082), (80.3117892825728, 9.39789601684855), (81.292303035414, 9.59434621716978), (82.2726032431042, 9.79185926974097), (83.2526912842678, 9.99042245076007), (84.2325683216683, 10.1900243013835), (85.2122353058425, 10.3906545807377), (86.1916929800981, 10.5923042142091), (87.1709418868389, 10.7949652372162), (88.1499823751825, 10.9986307346855), (89.1288146098284, 11.2032947764672), (90.107438581132, 11.4089523489488), (91.0858541163356, 11.6155992831328), (92.0640608919078, 11.8232321794644), (93.042058446935, 12.0318483297055), (94.0198461975096, 12.2414456361639), (94.9974234520557, 12.452022528597), (95.9747894275296, 12.6635778791182), (96.9519432664315, 12.876110915444), (97.9288840545597, 13.0896211328231), (98.9056108394409, 13.304108204998)), $); +#74 = IFCINDEXEDPOLYCURVE(#73, $, $); +#75 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#74)); +#76 = IFCRELDEFINESBYPROPERTIES('2dcxLSAF93mQMIlCPraGdY', #59, $, $, (#20), #77); +#77 = IFCPROPERTYSET('0huYX5cKDEOw_9TzqjG9UX', #59, 'ValidationPset', $, (#78)); +#78 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(99.9999771104856), $); +ENDSEC; +END-ISO-10303-21; diff --git a/UnitTests/Schemas/IFC4X3_RC4/sine-curve_100.0_300_1000_1_Meter/src/sine-curve_100.0_300_1000_1_Meter.cpp b/UnitTests/Schemas/IFC4X3_RC4/sine-curve_100.0_300_1000_1_Meter/src/sine-curve_100.0_300_1000_1_Meter.cpp new file mode 100644 index 000000000..b14a7adda --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/sine-curve_100.0_300_1000_1_Meter/src/sine-curve_100.0_300_1000_1_Meter.cpp @@ -0,0 +1,102 @@ +/* + Copyright (c) 2021 Technical University of Munich + Chair of Computational Modeling and Simulation. + + TUM Open Infra Platform is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License Version 3 + as published by the Free Software Foundation. + + TUM Open Infra Platform is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include +#include + +#include + +#include +#include +#include + +using namespace testing; + +class SineCurve : public IfcVisualTest { +protected: + + // Test standard values + buw::Image4b _background = buw::Image4b(0, 0); + + virtual void SetUp() override { + IfcVisualTest::SetUp(); + + express_model = OpenInfraPlatform::IFC4X3_RC4::IFC4X3_RC4Reader::FromFile(filename.string()); + + importer = buw::makeReferenceCounted>(); + auto model = importer->collectData(express_model); + + _background = rendererIfc->captureImage(); + rendererIfc->setModel(model[0]); + } + + virtual void TearDown() override { + express_model.reset(); + IfcVisualTest::TearDown(); + } + + virtual std::string TestName() const { return "sine-curve_100.0_300_1000_1_Meter"; } + virtual std::string Schema() const { return "IFC4X3_RC4"; } + + const boost::filesystem::path filename = dataPath("sine-curve_100.0_300_1000_1_Meter.ifc"); + + std::shared_ptr express_model = nullptr; + buw::ReferenceCounted> importer = nullptr; +}; + +TEST_F(SineCurve, AllEntitiesAreRead) { + EXPECT_THAT(express_model->entities.size(), Eq(70)); +} + +TEST_F(SineCurve, IFCHasAnEssentialEntity) { + auto result1 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto& pair) -> bool { return pair.second->classname() == "IFCCURVESEGMENT"; }); + auto result2 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto& pair) -> bool { return pair.second->classname() == "IFCALIGNMENTHORIZONTAL"; }); + auto result3 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto& pair) -> bool { return pair.second->classname() == "IFCALIGNMENTHORIZONTALSEGMENT"; }); + auto result4 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto& pair) -> bool { return pair.second->classname() == "IFCSINE"; }); + EXPECT_NE(result1, express_model->entities.end()); + EXPECT_NE(result2, express_model->entities.end()); + EXPECT_NE(result3, express_model->entities.end()); + EXPECT_NE(result4, express_model->entities.end()); +} + +TEST_F(SineCurve, ImageIsSaved) +{ + // Arrange + buw::Image4b image = rendererIfc->captureImage(); + + // Act + buw::storeImage(testPath("sine-curve_100.0_300_1000_1_Meter.png").string(), image); + + // Assert + EXPECT_NO_THROW(buw::loadImage4b(testPath("sine-curve_100.0_300_1000_1_Meter.png").string())); +} + +TEST_F(SineCurve, PlaneSurfaceViews) +{ + // Arrange + const auto expected_top = buw::loadImage4b(dataPath("sine-curve_100.0_300_1000_1_Meter_top.png").string()); + + // Act (Top) + rendererIfc->setViewDirection(buw::eViewDirection::Top); + buw::Image4b image_top = CaptureImage(); + + // uncomment following lines to also save the screen shot + //buw::storeImage(testPath("sine-curve_100.0_300_1000_1_Meter_top.png").string(), image_top); + + // Assert + EXPECT_EQ(image_top, expected_top); +} \ No newline at end of file diff --git a/UnitTests/Schemas/IFC4X3_RC4/viennese-bend_100.0_300_1000_1_Meter/CMakeLists.txt b/UnitTests/Schemas/IFC4X3_RC4/viennese-bend_100.0_300_1000_1_Meter/CMakeLists.txt new file mode 100644 index 000000000..bcdfb2c76 --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/viennese-bend_100.0_300_1000_1_Meter/CMakeLists.txt @@ -0,0 +1,20 @@ +# +# Copyright (c) 2021 Technical University of Munich +# Chair of Computational Modeling and Simulation. +# +# TUM Open Infra Platform is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License Version 3 +# as published by the Free Software Foundation. +# +# TUM Open Infra Platform is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +include(CreateUnitTests) + +CreateIfcFileVisualUnitTestForSchema(viennese-bend_100.0_300_1000_1_Meter IFC4X3_RC4) diff --git a/UnitTests/Schemas/IFC4X3_RC4/viennese-bend_100.0_300_1000_1_Meter/Data/viennese-bend_100.0_300_1000_1_Meter.ifc b/UnitTests/Schemas/IFC4X3_RC4/viennese-bend_100.0_300_1000_1_Meter/Data/viennese-bend_100.0_300_1000_1_Meter.ifc new file mode 100644 index 000000000..f2c4416ee --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/viennese-bend_100.0_300_1000_1_Meter/Data/viennese-bend_100.0_300_1000_1_Meter.ifc @@ -0,0 +1,142 @@ +ISO-10303-21; +HEADER; +FILE_DESCRIPTION (('ViewDefinition [CoordinationView]'), '2;1'); +FILE_NAME ('Single-LANDXML.ifc', '2021-05-24T11:00:00', ('IFC Rail Technical Services'), ('buildingSMART International RailwayRoom'), 'RailCOMPLETE\X2\FFAE\X0\', '2019.1.1995.0', ''); +FILE_SCHEMA (('IFC4X3_RC4')); +ENDSEC; +DATA; +#1 = IFCPROJECT('1FNFy8AJeHwwz7wDZHIYIu', #3, 'IFC Rail Referencedata', 'Rail alignment sample', $, 'Longname', 'Design', $, #9); +#2 = IFCAPPLICATION(#5, '2019.1.1995.0', 'RailCOMPLETE\X2\00AE\X0\', $); +#3 = IFCOWNERHISTORY(#6, #2, $, .ADDED., 1320688800, $, $, 1320688800); +#4 = IFCPERSON('TS', 'IFC Rail Technical Services', $, $, $, $, $, $); +#5 = IFCORGANIZATION('bsI RWR', 'buildingSmart International Railway Room', $, $, $); +#6 = IFCPERSONANDORGANIZATION(#4, #5, $); +#7 = IFCSIUNIT(*, .LENGTHUNIT., $, .METRE.); +#8 = IFCSIUNIT(*, .PLANEANGLEUNIT., $, .RADIAN.); +#9 = IFCUNITASSIGNMENT((#7, #8)); +#10 = IFCCARTESIANPOINT((0., 0., 0.)); +#11 = IFCDIRECTION((0., 0., 1.)); +#12 = IFCDIRECTION((1., 0., 0.)); +#13 = IFCAXIS2PLACEMENT3D(#10, #11, #12); +#14 = IFCLOCALPLACEMENT($, #13); +#15 = IFCRAILWAY('1FNFy9AJeHwuVmwDZHIYIu', #3, 'optional Railway Name', 'optional Railway Description', $, #14, $, 'Longname for Railway track geometry (alignment)', $, $); +#16 = IFCDIRECTION((0., 1., 0.)); +#17 = IFCGEOMETRICREPRESENTATIONCONTEXT($, 'MODEL', 3, 1.E-5, #13, #16); +#18 = IFCRELAGGREGATES('1FNFyAAJeHwu6TwDZHIYIu', #3, 'Documentation Container', 'Container for IfcProject, collects relevant products', #1, (#15)); +#19 = IFCRELCONTAINEDINSPATIALSTRUCTURE('1FNFyBAJeHwvmywDZHIYIu', #3, 'IfcProducts contained in myIfcRailway', 'Association between IfcProducts and IfcRailway', (#20), #15); +#20 = IFCALIGNMENT('1FNFyCAJeHwxedwDZHIYIu', #3, 'Spor', 'optional Railway Description', $, #113, #116, $, $); +#21 = IFCALIGNMENTHORIZONTAL('1FNFyDAJeHwv87wDZHIYIu', $, $, $, $, #118, #121); +#23 = IFCRELNESTS('3BJTAQrjCHwvVKbERtTLTf', $, $, $, #20, (#21, #41, #61)); +#28 = IFCCARTESIANPOINT((0., 0.)); +#29 = IFCALIGNMENTHORIZONTALSEGMENT($, $, #28, 0., 300., 1000., 100., 1.8, .VIENNESEBEND.); +#30 = IFCALIGNMENTSEGMENT('1FNFyHAJeHwuDtwDZHIYIu', #3, $, $, $, #67, #70, #29); +#34 = IFCRELNESTS('1FNFyHAJeHwuDtwDZHIYIj', $, $, $, #21, (#30)); +#41 = IFCALIGNMENTVERTICAL('1FNFyDAJeHwv87wDZHIYI1', $, $, $, $, #92, #95); +#42 = IFCALIGNMENTSEGMENT('1FNFyHAJeHwuDtwDZHIYI2', #3, $, $, $, #80, #83, #44); +#43 = IFCRELNESTS('4CGecNrjCHwxOSbERtTLTf', $, $, $, #41, (#42)); +#44 = IFCALIGNMENTVERTICALSEGMENT($, $, 0., 100., 0., 0., 0., $, .CONSTANTGRADIENT.); +#61 = IFCALIGNMENTCANT('1FNFyDAJeHwv87wDZHIYI7', $, $, $, $, #108, #111, 1.5); +#62 = IFCALIGNMENTSEGMENT('1FNFyHAJeHwuDtwDZHIYI3', #3, $, $, $, #99, #102, #64); +#63 = IFCRELNESTS('5CGecOrjCHww8dbERtTLTf', $, $, $, #61, (#62)); +#64 = IFCALIGNMENTCANTSEGMENT($, $, 0., 100., 0., -5.E-2, 0., 5.E-2, .VIENNESEBEND.); +#65 = IFCCOMPOSITECURVE((#66), .F.); +#66 = IFCCURVESEGMENT(.DISCONTINUOUS., #72, IFCPARAMETERVALUE(0.), IFCNONNEGATIVELENGTHMEASURE(100.), #75); +#67 = IFCLOCALPLACEMENT($, #68); +#68 = IFCAXIS2PLACEMENT3D(#69, $, $); +#69 = IFCCARTESIANPOINT((0., 0., 0.)); +#70 = IFCPRODUCTDEFINITIONSHAPE($, $, (#71, #142)); +#71 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve2D', (#66)); +#72 = IFCAXIS2PLACEMENT2D(#73, #74); +#73 = IFCCARTESIANPOINT((0., 0.)); +#74 = IFCDIRECTION((1., 0.)); +#75 = IFCSEVENTHORDERPOLYNOMIALSPIRAL(#76, 82.48484305114, -67.097076273516, 61.4392135957917, -70.7361746327603, -83.922298125931, 125.657906854859, $, 300.); +#76 = IFCAXIS2PLACEMENT2D(#77, $); +#77 = IFCCARTESIANPOINT((0., 0.)); +#78 = IFCGRADIENTCURVE((#79), .F., #65, $); +#79 = IFCCURVESEGMENT(.DISCONTINUOUS., #85, IFCNONNEGATIVELENGTHMEASURE(0.), IFCPARAMETERVALUE(100.), #88); +#80 = IFCLOCALPLACEMENT($, #81); +#81 = IFCAXIS2PLACEMENT3D(#82, $, $); +#82 = IFCCARTESIANPOINT((0., 0., 0.)); +#83 = IFCPRODUCTDEFINITIONSHAPE($, $, (#84, #148)); +#84 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve2D', (#79)); +#85 = IFCAXIS2PLACEMENT2D(#86, #87); +#86 = IFCCARTESIANPOINT((0., 0.)); +#87 = IFCDIRECTION((1., 0.)); +#88 = IFCLINE(#89, #90); +#89 = IFCCARTESIANPOINT((0., 0.)); +#90 = IFCVECTOR(#91, 1.); +#91 = IFCDIRECTION((1., 0.)); +#92 = IFCLOCALPLACEMENT($, #93); +#93 = IFCAXIS2PLACEMENT3D(#94, $, $); +#94 = IFCCARTESIANPOINT((0., 0., 0.)); +#95 = IFCPRODUCTDEFINITIONSHAPE($, $, (#96, #154)); +#96 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve3D', (#78)); +#97 = IFCSEGMENTEDREFERENCECURVE((#98), .F., #78, $); +#98 = IFCCURVESEGMENT(.DISCONTINUOUS., #104, IFCNONNEGATIVELENGTHMEASURE(0.), IFCPARAMETERVALUE(0.), $); +#99 = IFCLOCALPLACEMENT($, #100); +#100 = IFCAXIS2PLACEMENT3D(#101, $, $); +#101 = IFCCARTESIANPOINT((0., 0., 0.)); +#102 = IFCPRODUCTDEFINITIONSHAPE($, $, (#103)); +#103 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve2D', (#98)); +#104 = IFCAXIS2PLACEMENT3D(#105, #106, #107); +#105 = IFCCARTESIANPOINT((0., 0., 0.)); +#106 = IFCDIRECTION((0., 0., 1.)); +#107 = IFCDIRECTION((1., 0., 0.)); +#108 = IFCLOCALPLACEMENT($, #109); +#109 = IFCAXIS2PLACEMENT3D(#110, $, $); +#110 = IFCCARTESIANPOINT((0., 0., 0.)); +#111 = IFCPRODUCTDEFINITIONSHAPE($, $, (#112, #125)); +#112 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve3D', (#97)); +#113 = IFCLOCALPLACEMENT($, #114); +#114 = IFCAXIS2PLACEMENT3D(#115, $, $); +#115 = IFCCARTESIANPOINT((0., 0., 0.)); +#116 = IFCPRODUCTDEFINITIONSHAPE($, $, (#117, #160)); +#117 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve3D', (#78)); +#118 = IFCLOCALPLACEMENT($, #119); +#119 = IFCAXIS2PLACEMENT3D(#120, $, $); +#120 = IFCCARTESIANPOINT((0., 0., 0.)); +#121 = IFCPRODUCTDEFINITIONSHAPE($, $, (#122, #136)); +#122 = IFCSHAPEREPRESENTATION(#17, 'Axis', 'Curve2D', (#65)); +#123 = IFCCARTESIANPOINTLIST2D(((0., 0.), (9.99998148040028E-1, 1.66670609692341E-3), (1.99998518181965, 6.66728056121522E-3), (2.9999499751811, 1.5003019179914E-2), (3.99988138009064, 2.66759208153964E-2), (4.99976821909139, 4.16885394361971E-2), (5.99959928034506, 6.00438287026538E-2), (6.99936331537449, 8.17449809689336E-2), (7.99904903958166, 1.06795262455717E-1), (8.99864513557943, 1.35197846242436E-1), (9.99814025934171, 1.6695564462449E-1), (10.9975230491439, 2.02071142279316E-1), (11.9967821372347, 2.40546231585548E-1), (12.9959061641503, 2.82382051341814E-1), (13.9948837955558, 3.27578830035932E-1), (14.9937037414689, 3.76135734721484E-1), (15.9923547777008, 4.28050726466878E-1), (16.9908257693222, 4.8332042325217E-1), (17.9891056959438, 5.41939971101078E-1), (18.9871836785819, 6.0390292414987E-1), (19.9850490078607, 6.69201134271082E-1), (20.9826911732917, 7.37824650788554E-1), (21.9800998933569, 8.09761630740891E-1), (22.9772651461125, 8.84998260073405E-1), (23.9741772000263, 9.63518686063849E-1), (24.9708266447538, 1.04530496121485), (25.9672044215611, 1.13033699877609), (26.9633018531014, 1.21859253999181), (27.9591106722584, 1.31004713310449), (28.9546230497753, 1.40467412408329), (29.9498316204004, 1.50244465898655), (30.9447295072914, 1.60332769781065), (31.9393103444342, 1.70729003962409), (32.9335682968544, 1.8142963587342), (33.9274980784116, 1.92430925158605), (34.9210949669955, 2.0372892940477), (35.9143548169609, 2.15319510869381), (36.9072740686648, 2.27198344166012), (37.8998497549959, 2.39360924860485), (38.8920795048097, 2.51802578927969), (39.8839615432148, 2.64518473018208), (40.8754946886784, 2.77503625473305), (41.8666783469508, 2.90752918039944), (42.857512501833, 3.04261108215742), (43.847997702841, 3.18022842167426), (44.8381350498441, 3.32032668156883), (45.8279261747822, 3.46285050409633), (46.8173732205883, 3.60774383359131), (47.8064788174675, 3.75495006199329), (48.7952460567017, 3.9044121767722), (49.7836784621714, 4.05607291056599), (50.7717799597996, 4.20987489184013), (51.7595548451395, 4.365760795878), (52.7470077493404, 4.52367349541315), (53.7341436037358, 4.68355621021744), (54.7209676033053, 4.84535265496523), (55.7074851692694, 5.00900718470091), (56.6937019110772, 5.17446493724679), (57.6796235880506, 5.34167197189973), (58.6652560709457, 5.51057540377795), (59.6506053036894, 5.68112353319503), (60.6356772655458, 5.85326596945475), (61.6204779339555, 6.02695374847981), (62.6050132482888, 6.20213944370809), (63.5892890747373, 6.37877726971318), (64.5733111725601, 6.5568231780307), (65.5570851618882, 6.73623494469883), (66.5406164932753, 6.91697224905058), (67.5239104191694, 7.09899674332618), (68.5069719674653, 7.28227211270754), (69.4898059172803, 7.46676412541185), (70.4724167770829, 7.65244067251947), (71.4548087652838, 7.83927179725087), (72.4369857933866, 8.02722971345009), (73.4189514517784, 8.21628881307664), (74.4007089982232, 8.40642566255496), (75.382261349109, 8.59761898788029), (76.3636110734818, 8.7898496484313), (77.3447603898871, 8.983100599495), (78.325711166025, 9.17735684356573), (79.306464921211, 9.37260537053992), (80.2870228316217, 9.56883508698997), (81.2673857382921, 9.76603673476512), (82.2475541578166, 9.96420279923386), (83.2275282956958, 10.1633274075517), (84.2073080622545, 10.3634062174098), (85.1868930910462, 10.5644362967944), (86.1662827596429, 10.7664159953616), (87.1454762126957, 10.9693448081138), (88.1244723871359, 11.1732232321407), (89.1032700393675, 11.3780526172749), (90.0818677742866, 11.5838350115951), (91.0602640759402, 11.7905730027956), (92.0384573396168, 11.9982695565345), (93.0164459051368, 12.2069278529594), (93.9942280910839, 12.4165511227056), (94.9718022296922, 12.627142483755), (95.9491667020703, 12.8387047806432), (96.9263199734134, 13.0512404275977), (97.903260627817, 13.264751257294), (98.8799874022699, 13.4792383770162)), $); +#124 = IFCINDEXEDPOLYCURVE(#123, $, $); +#125 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#124)); +#126 = IFCOWNERHISTORY(#128, #130, $, .ADDED., 1630842913, $, $, 1630842913); +#127 = IFCORGANIZATION($, '\X2\0410\X0\\X2\0420\X0\ \X2\0414\X0\\X2\0418\X0\ \X2\0415\X0\\X2\0424\X0\ \X2\041E\X0\\X2\041E\X0\\X2\0414\X0\', 'RDF Ltd.', $, $); +#128 = IFCPERSONANDORGANIZATION(#129, #127, $); +#129 = IFCPERSON($, 'Bonsma', 'Peter', $, $, $, $, $); +#130 = IFCAPPLICATION(#127, '0.99', 'Add Check Library Application', 'TA 1001'); +#131 = IFCRELDEFINESBYPROPERTIES('3VkJmdYDf789189ZQJ526K', #126, $, $, (#61), #132); +#132 = IFCPROPERTYSET('2RdCMi6ZrB78kAu0KSbOEw', #126, 'ValidationPset', $, (#133)); +#133 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(99.9999765293375), $); +#134 = IFCCARTESIANPOINTLIST2D(((0., 0.), (9.99998148040028E-1, 1.66670609692341E-3), (1.99998518181965, 6.66728056121522E-3), (2.9999499751811, 1.5003019179914E-2), (3.99988138009064, 2.66759208153964E-2), (4.99976821909139, 4.16885394361971E-2), (5.99959928034506, 6.00438287026538E-2), (6.99936331537449, 8.17449809689336E-2), (7.99904903958166, 1.06795262455717E-1), (8.99864513557943, 1.35197846242436E-1), (9.99814025934171, 1.6695564462449E-1), (10.9975230491439, 2.02071142279316E-1), (11.9967821372347, 2.40546231585548E-1), (12.9959061641503, 2.82382051341814E-1), (13.9948837955558, 3.27578830035932E-1), (14.9937037414689, 3.76135734721484E-1), (15.9923547777008, 4.28050726466878E-1), (16.9908257693222, 4.8332042325217E-1), (17.9891056959438, 5.41939971101078E-1), (18.9871836785819, 6.0390292414987E-1), (19.9850490078607, 6.69201134271082E-1), (20.9826911732917, 7.37824650788554E-1), (21.9800998933569, 8.09761630740891E-1), (22.9772651461125, 8.84998260073405E-1), (23.9741772000263, 9.63518686063849E-1), (24.9708266447538, 1.04530496121485), (25.9672044215611, 1.13033699877609), (26.9633018531014, 1.21859253999181), (27.9591106722584, 1.31004713310449), (28.9546230497753, 1.40467412408329), (29.9498316204004, 1.50244465898655), (30.9447295072914, 1.60332769781065), (31.9393103444342, 1.70729003962409), (32.9335682968544, 1.8142963587342), (33.9274980784116, 1.92430925158605), (34.9210949669955, 2.0372892940477), (35.9143548169609, 2.15319510869381), (36.9072740686648, 2.27198344166012), (37.8998497549959, 2.39360924860485), (38.8920795048097, 2.51802578927969), (39.8839615432148, 2.64518473018208), (40.8754946886784, 2.77503625473305), (41.8666783469508, 2.90752918039944), (42.857512501833, 3.04261108215742), (43.847997702841, 3.18022842167426), (44.8381350498441, 3.32032668156883), (45.8279261747822, 3.46285050409633), (46.8173732205883, 3.60774383359131), (47.8064788174675, 3.75495006199329), (48.7952460567017, 3.9044121767722), (49.7836784621714, 4.05607291056599), (50.7717799597996, 4.20987489184013), (51.7595548451395, 4.365760795878), (52.7470077493404, 4.52367349541315), (53.7341436037358, 4.68355621021744), (54.7209676033053, 4.84535265496523), (55.7074851692694, 5.00900718470091), (56.6937019110772, 5.17446493724679), (57.6796235880506, 5.34167197189973), (58.6652560709457, 5.51057540377795), (59.6506053036894, 5.68112353319503), (60.6356772655458, 5.85326596945475), (61.6204779339555, 6.02695374847981), (62.6050132482888, 6.20213944370809), (63.5892890747373, 6.37877726971318), (64.5733111725601, 6.5568231780307), (65.5570851618882, 6.73623494469883), (66.5406164932753, 6.91697224905058), (67.5239104191694, 7.09899674332618), (68.5069719674653, 7.28227211270754), (69.4898059172803, 7.46676412541185), (70.4724167770829, 7.65244067251947), (71.4548087652838, 7.83927179725087), (72.4369857933866, 8.02722971345009), (73.4189514517784, 8.21628881307664), (74.4007089982232, 8.40642566255496), (75.382261349109, 8.59761898788029), (76.3636110734818, 8.7898496484313), (77.3447603898871, 8.983100599495), (78.325711166025, 9.17735684356573), (79.306464921211, 9.37260537053992), (80.2870228316217, 9.56883508698997), (81.2673857382921, 9.76603673476512), (82.2475541578166, 9.96420279923386), (83.2275282956958, 10.1633274075517), (84.2073080622545, 10.3634062174098), (85.1868930910462, 10.5644362967944), (86.1662827596429, 10.7664159953616), (87.1454762126957, 10.9693448081138), (88.1244723871359, 11.1732232321407), (89.1032700393675, 11.3780526172749), (90.0818677742866, 11.5838350115951), (91.0602640759402, 11.7905730027956), (92.0384573396168, 11.9982695565345), (93.0164459051368, 12.2069278529594), (93.9942280910839, 12.4165511227056), (94.9718022296922, 12.627142483755), (95.9491667020703, 12.8387047806432), (96.9263199734134, 13.0512404275977), (97.903260627817, 13.264751257294), (98.8799874022699, 13.4792383770162)), $); +#135 = IFCINDEXEDPOLYCURVE(#134, $, $); +#136 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#135)); +#137 = IFCRELDEFINESBYPROPERTIES('0yPitdL2D6feoWJXYS4X$z', #126, $, $, (#21), #138); +#138 = IFCPROPERTYSET('0cqxqZlUXE9gZybuqsp7VK', #126, 'ValidationPset', $, (#139)); +#139 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(99.9999765293375), $); +#140 = IFCCARTESIANPOINTLIST2D(((0., 0.), (9.99998148040028E-1, 1.66670609692341E-3), (1.99998518181965, 6.66728056121522E-3), (2.9999499751811, 1.5003019179914E-2), (3.99988138009064, 2.66759208153964E-2), (4.99976821909139, 4.16885394361971E-2), (5.99959928034506, 6.00438287026538E-2), (6.99936331537449, 8.17449809689336E-2), (7.99904903958166, 1.06795262455717E-1), (8.99864513557943, 1.35197846242436E-1), (9.99814025934171, 1.6695564462449E-1), (10.9975230491439, 2.02071142279316E-1), (11.9967821372347, 2.40546231585548E-1), (12.9959061641503, 2.82382051341814E-1), (13.9948837955558, 3.27578830035932E-1), (14.9937037414689, 3.76135734721484E-1), (15.9923547777008, 4.28050726466878E-1), (16.9908257693222, 4.8332042325217E-1), (17.9891056959438, 5.41939971101078E-1), (18.9871836785819, 6.0390292414987E-1), (19.9850490078607, 6.69201134271082E-1), (20.9826911732917, 7.37824650788554E-1), (21.9800998933569, 8.09761630740891E-1), (22.9772651461125, 8.84998260073405E-1), (23.9741772000263, 9.63518686063849E-1), (24.9708266447538, 1.04530496121485), (25.9672044215611, 1.13033699877609), (26.9633018531014, 1.21859253999181), (27.9591106722584, 1.31004713310449), (28.9546230497753, 1.40467412408329), (29.9498316204004, 1.50244465898655), (30.9447295072914, 1.60332769781065), (31.9393103444342, 1.70729003962409), (32.9335682968544, 1.8142963587342), (33.9274980784116, 1.92430925158605), (34.9210949669955, 2.0372892940477), (35.9143548169609, 2.15319510869381), (36.9072740686648, 2.27198344166012), (37.8998497549959, 2.39360924860485), (38.8920795048097, 2.51802578927969), (39.8839615432148, 2.64518473018208), (40.8754946886784, 2.77503625473305), (41.8666783469508, 2.90752918039944), (42.857512501833, 3.04261108215742), (43.847997702841, 3.18022842167426), (44.8381350498441, 3.32032668156883), (45.8279261747822, 3.46285050409633), (46.8173732205883, 3.60774383359131), (47.8064788174675, 3.75495006199329), (48.7952460567017, 3.9044121767722), (49.7836784621714, 4.05607291056599), (50.7717799597996, 4.20987489184013), (51.7595548451395, 4.365760795878), (52.7470077493404, 4.52367349541315), (53.7341436037358, 4.68355621021744), (54.7209676033053, 4.84535265496523), (55.7074851692694, 5.00900718470091), (56.6937019110772, 5.17446493724679), (57.6796235880506, 5.34167197189973), (58.6652560709457, 5.51057540377795), (59.6506053036894, 5.68112353319503), (60.6356772655458, 5.85326596945475), (61.6204779339555, 6.02695374847981), (62.6050132482888, 6.20213944370809), (63.5892890747373, 6.37877726971318), (64.5733111725601, 6.5568231780307), (65.5570851618882, 6.73623494469883), (66.5406164932753, 6.91697224905058), (67.5239104191694, 7.09899674332618), (68.5069719674653, 7.28227211270754), (69.4898059172803, 7.46676412541185), (70.4724167770829, 7.65244067251947), (71.4548087652838, 7.83927179725087), (72.4369857933866, 8.02722971345009), (73.4189514517784, 8.21628881307664), (74.4007089982232, 8.40642566255496), (75.382261349109, 8.59761898788029), (76.3636110734818, 8.7898496484313), (77.3447603898871, 8.983100599495), (78.325711166025, 9.17735684356573), (79.306464921211, 9.37260537053992), (80.2870228316217, 9.56883508698997), (81.2673857382921, 9.76603673476512), (82.2475541578166, 9.96420279923386), (83.2275282956958, 10.1633274075517), (84.2073080622545, 10.3634062174098), (85.1868930910462, 10.5644362967944), (86.1662827596429, 10.7664159953616), (87.1454762126957, 10.9693448081138), (88.1244723871359, 11.1732232321407), (89.1032700393675, 11.3780526172749), (90.0818677742866, 11.5838350115951), (91.0602640759402, 11.7905730027956), (92.0384573396168, 11.9982695565345), (93.0164459051368, 12.2069278529594), (93.9942280910839, 12.4165511227056), (94.9718022296922, 12.627142483755), (95.9491667020703, 12.8387047806432), (96.9263199734134, 13.0512404275977), (97.903260627817, 13.264751257294), (98.8799874022699, 13.4792383770162)), $); +#141 = IFCINDEXEDPOLYCURVE(#140, $, $); +#142 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#141)); +#143 = IFCRELDEFINESBYPROPERTIES('1zC$5Bp51Dww4Vukd_Qm$Y', #126, $, $, (#30), #144); +#144 = IFCPROPERTYSET('26112$DoPEy82Ka20IDA4D', #126, 'ValidationPset', $, (#145)); +#145 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(99.9999765293375), $); +#146 = IFCCARTESIANPOINTLIST2D(((0., 0.), (100., 0.)), $); +#147 = IFCINDEXEDPOLYCURVE(#146, $, $); +#148 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#147)); +#149 = IFCRELDEFINESBYPROPERTIES('2Ow4UHzqbArgSFb_AM7N3Z', #126, $, $, (#42), #150); +#150 = IFCPROPERTYSET('0IDd4tcFjABPhpdB7JnjQz', #126, 'ValidationPset', $, (#151)); +#151 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(100.), $); +#152 = IFCCARTESIANPOINTLIST2D(((0., 0.), (9.99998148040028E-1, 1.66670609692341E-3), (1.99998518181965, 6.66728056121522E-3), (2.9999499751811, 1.5003019179914E-2), (3.99988138009064, 2.66759208153964E-2), (4.99976821909139, 4.16885394361971E-2), (5.99959928034506, 6.00438287026538E-2), (6.99936331537449, 8.17449809689336E-2), (7.99904903958166, 1.06795262455717E-1), (8.99864513557943, 1.35197846242436E-1), (9.99814025934171, 1.6695564462449E-1), (10.9975230491439, 2.02071142279316E-1), (11.9967821372347, 2.40546231585548E-1), (12.9959061641503, 2.82382051341814E-1), (13.9948837955558, 3.27578830035932E-1), (14.9937037414689, 3.76135734721484E-1), (15.9923547777008, 4.28050726466878E-1), (16.9908257693222, 4.8332042325217E-1), (17.9891056959438, 5.41939971101078E-1), (18.9871836785819, 6.0390292414987E-1), (19.9850490078607, 6.69201134271082E-1), (20.9826911732917, 7.37824650788554E-1), (21.9800998933569, 8.09761630740891E-1), (22.9772651461125, 8.84998260073405E-1), (23.9741772000263, 9.63518686063849E-1), (24.9708266447538, 1.04530496121485), (25.9672044215611, 1.13033699877609), (26.9633018531014, 1.21859253999181), (27.9591106722584, 1.31004713310449), (28.9546230497753, 1.40467412408329), (29.9498316204004, 1.50244465898655), (30.9447295072914, 1.60332769781065), (31.9393103444342, 1.70729003962409), (32.9335682968544, 1.8142963587342), (33.9274980784116, 1.92430925158605), (34.9210949669955, 2.0372892940477), (35.9143548169609, 2.15319510869381), (36.9072740686648, 2.27198344166012), (37.8998497549959, 2.39360924860485), (38.8920795048097, 2.51802578927969), (39.8839615432148, 2.64518473018208), (40.8754946886784, 2.77503625473305), (41.8666783469508, 2.90752918039944), (42.857512501833, 3.04261108215742), (43.847997702841, 3.18022842167426), (44.8381350498441, 3.32032668156883), (45.8279261747822, 3.46285050409633), (46.8173732205883, 3.60774383359131), (47.8064788174675, 3.75495006199329), (48.7952460567017, 3.9044121767722), (49.7836784621714, 4.05607291056599), (50.7717799597996, 4.20987489184013), (51.7595548451395, 4.365760795878), (52.7470077493404, 4.52367349541315), (53.7341436037358, 4.68355621021744), (54.7209676033053, 4.84535265496523), (55.7074851692694, 5.00900718470091), (56.6937019110772, 5.17446493724679), (57.6796235880506, 5.34167197189973), (58.6652560709457, 5.51057540377795), (59.6506053036894, 5.68112353319503), (60.6356772655458, 5.85326596945475), (61.6204779339555, 6.02695374847981), (62.6050132482888, 6.20213944370809), (63.5892890747373, 6.37877726971318), (64.5733111725601, 6.5568231780307), (65.5570851618882, 6.73623494469883), (66.5406164932753, 6.91697224905058), (67.5239104191694, 7.09899674332618), (68.5069719674653, 7.28227211270754), (69.4898059172803, 7.46676412541185), (70.4724167770829, 7.65244067251947), (71.4548087652838, 7.83927179725087), (72.4369857933866, 8.02722971345009), (73.4189514517784, 8.21628881307664), (74.4007089982232, 8.40642566255496), (75.382261349109, 8.59761898788029), (76.3636110734818, 8.7898496484313), (77.3447603898871, 8.983100599495), (78.325711166025, 9.17735684356573), (79.306464921211, 9.37260537053992), (80.2870228316217, 9.56883508698997), (81.2673857382921, 9.76603673476512), (82.2475541578166, 9.96420279923386), (83.2275282956958, 10.1633274075517), (84.2073080622545, 10.3634062174098), (85.1868930910462, 10.5644362967944), (86.1662827596429, 10.7664159953616), (87.1454762126957, 10.9693448081138), (88.1244723871359, 11.1732232321407), (89.1032700393675, 11.3780526172749), (90.0818677742866, 11.5838350115951), (91.0602640759402, 11.7905730027956), (92.0384573396168, 11.9982695565345), (93.0164459051368, 12.2069278529594), (93.9942280910839, 12.4165511227056), (94.9718022296922, 12.627142483755), (95.9491667020703, 12.8387047806432), (96.9263199734134, 13.0512404275977), (97.903260627817, 13.264751257294), (98.8799874022699, 13.4792383770162)), $); +#153 = IFCINDEXEDPOLYCURVE(#152, $, $); +#154 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#153)); +#155 = IFCRELDEFINESBYPROPERTIES('2NpTKqXFH4FR2$lpEmT_dz', #126, $, $, (#41), #156); +#156 = IFCPROPERTYSET('1sunq26NjBD8cVAICisgJT', #126, 'ValidationPset', $, (#157)); +#157 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(99.9999765293375), $); +#158 = IFCCARTESIANPOINTLIST2D(((0., 0.), (9.99998148040028E-1, 1.66670609692341E-3), (1.99998518181965, 6.66728056121522E-3), (2.9999499751811, 1.5003019179914E-2), (3.99988138009064, 2.66759208153964E-2), (4.99976821909139, 4.16885394361971E-2), (5.99959928034506, 6.00438287026538E-2), (6.99936331537449, 8.17449809689336E-2), (7.99904903958166, 1.06795262455717E-1), (8.99864513557943, 1.35197846242436E-1), (9.99814025934171, 1.6695564462449E-1), (10.9975230491439, 2.02071142279316E-1), (11.9967821372347, 2.40546231585548E-1), (12.9959061641503, 2.82382051341814E-1), (13.9948837955558, 3.27578830035932E-1), (14.9937037414689, 3.76135734721484E-1), (15.9923547777008, 4.28050726466878E-1), (16.9908257693222, 4.8332042325217E-1), (17.9891056959438, 5.41939971101078E-1), (18.9871836785819, 6.0390292414987E-1), (19.9850490078607, 6.69201134271082E-1), (20.9826911732917, 7.37824650788554E-1), (21.9800998933569, 8.09761630740891E-1), (22.9772651461125, 8.84998260073405E-1), (23.9741772000263, 9.63518686063849E-1), (24.9708266447538, 1.04530496121485), (25.9672044215611, 1.13033699877609), (26.9633018531014, 1.21859253999181), (27.9591106722584, 1.31004713310449), (28.9546230497753, 1.40467412408329), (29.9498316204004, 1.50244465898655), (30.9447295072914, 1.60332769781065), (31.9393103444342, 1.70729003962409), (32.9335682968544, 1.8142963587342), (33.9274980784116, 1.92430925158605), (34.9210949669955, 2.0372892940477), (35.9143548169609, 2.15319510869381), (36.9072740686648, 2.27198344166012), (37.8998497549959, 2.39360924860485), (38.8920795048097, 2.51802578927969), (39.8839615432148, 2.64518473018208), (40.8754946886784, 2.77503625473305), (41.8666783469508, 2.90752918039944), (42.857512501833, 3.04261108215742), (43.847997702841, 3.18022842167426), (44.8381350498441, 3.32032668156883), (45.8279261747822, 3.46285050409633), (46.8173732205883, 3.60774383359131), (47.8064788174675, 3.75495006199329), (48.7952460567017, 3.9044121767722), (49.7836784621714, 4.05607291056599), (50.7717799597996, 4.20987489184013), (51.7595548451395, 4.365760795878), (52.7470077493404, 4.52367349541315), (53.7341436037358, 4.68355621021744), (54.7209676033053, 4.84535265496523), (55.7074851692694, 5.00900718470091), (56.6937019110772, 5.17446493724679), (57.6796235880506, 5.34167197189973), (58.6652560709457, 5.51057540377795), (59.6506053036894, 5.68112353319503), (60.6356772655458, 5.85326596945475), (61.6204779339555, 6.02695374847981), (62.6050132482888, 6.20213944370809), (63.5892890747373, 6.37877726971318), (64.5733111725601, 6.5568231780307), (65.5570851618882, 6.73623494469883), (66.5406164932753, 6.91697224905058), (67.5239104191694, 7.09899674332618), (68.5069719674653, 7.28227211270754), (69.4898059172803, 7.46676412541185), (70.4724167770829, 7.65244067251947), (71.4548087652838, 7.83927179725087), (72.4369857933866, 8.02722971345009), (73.4189514517784, 8.21628881307664), (74.4007089982232, 8.40642566255496), (75.382261349109, 8.59761898788029), (76.3636110734818, 8.7898496484313), (77.3447603898871, 8.983100599495), (78.325711166025, 9.17735684356573), (79.306464921211, 9.37260537053992), (80.2870228316217, 9.56883508698997), (81.2673857382921, 9.76603673476512), (82.2475541578166, 9.96420279923386), (83.2275282956958, 10.1633274075517), (84.2073080622545, 10.3634062174098), (85.1868930910462, 10.5644362967944), (86.1662827596429, 10.7664159953616), (87.1454762126957, 10.9693448081138), (88.1244723871359, 11.1732232321407), (89.1032700393675, 11.3780526172749), (90.0818677742866, 11.5838350115951), (91.0602640759402, 11.7905730027956), (92.0384573396168, 11.9982695565345), (93.0164459051368, 12.2069278529594), (93.9942280910839, 12.4165511227056), (94.9718022296922, 12.627142483755), (95.9491667020703, 12.8387047806432), (96.9263199734134, 13.0512404275977), (97.903260627817, 13.264751257294), (98.8799874022699, 13.4792383770162)), $); +#159 = IFCINDEXEDPOLYCURVE(#158, $, $); +#160 = IFCSHAPEREPRESENTATION(#17, 'Body-Fallback', 'Curve', (#159)); +#161 = IFCRELDEFINESBYPROPERTIES('17SX0IMoz8mQu8bWeC9fy5', #126, $, $, (#20), #162); +#162 = IFCPROPERTYSET('3nJxgcaJnDCxAljeSihICI', #126, 'ValidationPset', $, (#163)); +#163 = IFCPROPERTYSINGLEVALUE('ValidationLength', $, IFCLENGTHMEASURE(99.9999765293375), $); +ENDSEC; +END-ISO-10303-21; diff --git a/UnitTests/Schemas/IFC4X3_RC4/viennese-bend_100.0_300_1000_1_Meter/src/viennese-bend_100.0_300_1000_1_Meter.cpp b/UnitTests/Schemas/IFC4X3_RC4/viennese-bend_100.0_300_1000_1_Meter/src/viennese-bend_100.0_300_1000_1_Meter.cpp new file mode 100644 index 000000000..38e2e403b --- /dev/null +++ b/UnitTests/Schemas/IFC4X3_RC4/viennese-bend_100.0_300_1000_1_Meter/src/viennese-bend_100.0_300_1000_1_Meter.cpp @@ -0,0 +1,100 @@ +/* + Copyright (c) 2021 Technical University of Munich + Chair of Computational Modeling and Simulation. + + TUM Open Infra Platform is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License Version 3 + as published by the Free Software Foundation. + + TUM Open Infra Platform is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include +#include + +#include + +#include +#include +#include + +using namespace testing; + +class VienneseBend : public IfcVisualTest { +protected: + + // Test standard values + buw::Image4b _background = buw::Image4b(0, 0); + + virtual void SetUp() override { + IfcVisualTest::SetUp(); + + express_model = OpenInfraPlatform::IFC4X3_RC4::IFC4X3_RC4Reader::FromFile(filename.string()); + + importer = buw::makeReferenceCounted>(); + auto model = importer->collectData(express_model); + + _background = rendererIfc->captureImage(); + rendererIfc->setModel(model[0]); + } + + virtual void TearDown() override { + express_model.reset(); + IfcVisualTest::TearDown(); + } + + virtual std::string TestName() const { return "viennese-bend_100.0_300_1000_1_Meter"; } + virtual std::string Schema() const { return "IFC4X3_RC4"; } + + const boost::filesystem::path filename = dataPath("viennese-bend_100.0_300_1000_1_Meter.ifc"); + + std::shared_ptr express_model = nullptr; + buw::ReferenceCounted> importer = nullptr; +}; + +TEST_F(VienneseBend, AllEntitiesAreRead) { + EXPECT_THAT(express_model->entities.size(), Eq(153)); +} + +TEST_F(VienneseBend, IFCHasAnEssentialEntity) { + auto result1 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto& pair) -> bool { return pair.second->classname() == "IFCCURVESEGMENT"; }); + auto result2 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto& pair) -> bool { return pair.second->classname() == "IFCALIGNMENTHORIZONTAL"; }); + auto result3 = std::find_if(express_model->entities.begin(), express_model->entities.end(), [](auto& pair) -> bool { return pair.second->classname() == "IFCALIGNMENTHORIZONTALSEGMENT"; }); + EXPECT_NE(result1, express_model->entities.end()); + EXPECT_NE(result2, express_model->entities.end()); + EXPECT_NE(result3, express_model->entities.end()); +} + +TEST_F(VienneseBend, ImageIsSaved) +{ + // Arrange + buw::Image4b image = rendererIfc->captureImage(); + + // Act + buw::storeImage(testPath("viennese-bend_100.0_300_1000_1_Meter.png").string(), image); + + // Assert + EXPECT_NO_THROW(buw::loadImage4b(testPath("viennese-bend_100.0_300_1000_1_Meter.png").string())); +} + +TEST_F(VienneseBend, PlaneSurfaceViews) +{ + // Arrange + const auto expected_top = buw::loadImage4b(dataPath("viennese-bend_100.0_300_1000_1_Meter_top.png").string()); + + // Act (Top) + rendererIfc->setViewDirection(buw::eViewDirection::Top); + buw::Image4b image_top = CaptureImage(); + + // uncomment following lines to also save the screen shot + //buw::storeImage(testPath("viennese-bend_100.0_300_1000_1_Meter_top.png").string(), image_top); + + // Assert + EXPECT_EQ(image_top, expected_top); +}