Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
70fb029
New unit tests was added
Elvira2227 Oct 14, 2021
259e1ae
Merge remote-tracking branch 'tumcms/development' into UTIFC4X3_RC4
Elvira2227 Dec 1, 2021
aed79c3
Merge branch 'development' into UTIFC4X3_RC4
Elvira2227 Dec 21, 2021
1ae9e23
Merge remote-tracking branch 'tumcms/development' into UTIFC4X3_RC4
Elvira2227 Jan 14, 2022
ea463d4
Added new UT for clothoid's and lines, images were updated
Elvira2227 Jan 27, 2022
71f684b
Updated screenshots and unit tests; Fixed problem with reading .ifc i…
Elvira2227 Feb 8, 2022
5adcd71
Updated some UTs; Circular arc screenshots updated and fixed mistake
Elvira2227 Feb 9, 2022
4089f6d
Cubic ifc Datei updated
Elvira2227 Feb 11, 2022
a0e7d1d
Merge remote-tracking branch 'tumcms/development' into UTIFC4X3_RC4
Elvira2227 Feb 18, 2022
5ab97b8
Merge remote-tracking branch 'tumcms/development' into UTIFC4X3_RC4
Elvira2227 Apr 7, 2022
2b83b5b
new functions for IfcPolynomial Curve was added
Elvira2227 Apr 16, 2022
cf59b36
Functions to calculate integral value for parametric curve
Elvira2227 May 12, 2022
28f6421
corrections for integrateParameter function
Elvira2227 May 12, 2022
98adeb1
improve code; add functions for 3D; correct mistakes
Elvira2227 May 27, 2022
aac48ed
correct mistake (delete fstream)
Elvira2227 May 29, 2022
102578f
Improve calculatePolynomialDerivative function; fixing mistakes
Elvira2227 Jun 10, 2022
963fd76
Removing curly braces
Elvira2227 Jun 10, 2022
575861e
Merge remote-tracking branch 'tumcms/development' into IfcPolynomialC…
Elvira2227 Jun 10, 2022
abde8e1
Revert "Merge remote-tracking branch 'tumcms/development' into IfcPol…
Elvira2227 Jun 10, 2022
90056c7
Revert "Revert "Merge remote-tracking branch 'tumcms/development' int…
Elvira2227 Jun 10, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
380 changes: 380 additions & 0 deletions Core/src/IfcGeometryConverter/CurveConverter.h

Large diffs are not rendered by default.

26 changes: 26 additions & 0 deletions UnitTests/Schemas/IFC4X3_RC4/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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 <http://www.gnu.org/licenses/>.
#

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()
Original file line number Diff line number Diff line change
@@ -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 <http://www.gnu.org/licenses/>.
#

include(CreateUnitTests)

CreateIfcFileVisualUnitTestForSchema(bloss-curve_100.0_300_1000_1_Meter IFC4X3_RC4)

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -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 <http://www.gnu.org/licenses/>.
*/

#include <EarlyBinding/IFC4X3_RC4/src/reader/IFC4X3_RC4Reader.h>
#include <namespace.h>

#include <IfcVisualTest.h>

#include <IfcGeometryConverter/ConverterBuw.h>
#include <IfcGeometryConverter/IfcImporter.h>
#include <IfcGeometryConverter/IfcImporterImpl.h>

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<oip::IfcImporterT<emt::IFC4X3_RC4EntityTypes>>();
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<oip::EXPRESSModel> express_model = nullptr;
buw::ReferenceCounted<oip::IfcImporterT<emt::IFC4X3_RC4EntityTypes>> 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()));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't seem to see this file commited.

}

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);
}
Original file line number Diff line number Diff line change
@@ -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 <http://www.gnu.org/licenses/>.
#

include(CreateUnitTests)

CreateIfcFileVisualUnitTestForSchema(circular-arc_100.0_300_1000_1_Meter IFC4X3_RC4)

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -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 <http://www.gnu.org/licenses/>.
*/

#include <EarlyBinding/IFC4X3_RC4/src/reader/IFC4X3_RC4Reader.h>
#include <namespace.h>

#include <IfcVisualTest.h>

#include <IfcGeometryConverter/ConverterBuw.h>
#include <IfcGeometryConverter/IfcImporter.h>
#include <IfcGeometryConverter/IfcImporterImpl.h>

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<oip::IfcImporterT<emt::IFC4X3_RC4EntityTypes>>();
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<oip::EXPRESSModel> express_model = nullptr;
buw::ReferenceCounted<oip::IfcImporterT<emt::IFC4X3_RC4EntityTypes>> 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);
}
Original file line number Diff line number Diff line change
@@ -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 <http://www.gnu.org/licenses/>.
#

include(CreateUnitTests)

CreateIfcFileVisualUnitTestForSchema(clothoid_100.0_-300_-1000_1_Meter IFC4X3_RC4)
Loading