-
Notifications
You must be signed in to change notification settings - Fork 24
IfcPolynomialCurve #539
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Elvira2227
wants to merge
20
commits into
tumcms:development
Choose a base branch
from
Elvira2227:IfcPolynomialCurve
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
IfcPolynomialCurve #539
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 259e1ae
Merge remote-tracking branch 'tumcms/development' into UTIFC4X3_RC4
Elvira2227 aed79c3
Merge branch 'development' into UTIFC4X3_RC4
Elvira2227 1ae9e23
Merge remote-tracking branch 'tumcms/development' into UTIFC4X3_RC4
Elvira2227 ea463d4
Added new UT for clothoid's and lines, images were updated
Elvira2227 71f684b
Updated screenshots and unit tests; Fixed problem with reading .ifc i…
Elvira2227 5adcd71
Updated some UTs; Circular arc screenshots updated and fixed mistake
Elvira2227 4089f6d
Cubic ifc Datei updated
Elvira2227 a0e7d1d
Merge remote-tracking branch 'tumcms/development' into UTIFC4X3_RC4
Elvira2227 5ab97b8
Merge remote-tracking branch 'tumcms/development' into UTIFC4X3_RC4
Elvira2227 2b83b5b
new functions for IfcPolynomial Curve was added
Elvira2227 cf59b36
Functions to calculate integral value for parametric curve
Elvira2227 28f6421
corrections for integrateParameter function
Elvira2227 98adeb1
improve code; add functions for 3D; correct mistakes
Elvira2227 aac48ed
correct mistake (delete fstream)
Elvira2227 102578f
Improve calculatePolynomialDerivative function; fixing mistakes
Elvira2227 963fd76
Removing curly braces
Elvira2227 575861e
Merge remote-tracking branch 'tumcms/development' into IfcPolynomialC…
Elvira2227 abde8e1
Revert "Merge remote-tracking branch 'tumcms/development' into IfcPol…
Elvira2227 90056c7
Revert "Revert "Merge remote-tracking branch 'tumcms/development' int…
Elvira2227 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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() |
20 changes: 20 additions & 0 deletions
20
UnitTests/Schemas/IFC4X3_RC4/bloss-curve_100.0_300_1000_1_Meter/CMakeLists.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) |
81 changes: 81 additions & 0 deletions
81
...IFC4X3_RC4/bloss-curve_100.0_300_1000_1_Meter/Data/bloss-curve_100.0_300_1000_1_Meter.ifc
Large diffs are not rendered by default.
Oops, something went wrong.
100 changes: 100 additions & 0 deletions
100
.../IFC4X3_RC4/bloss-curve_100.0_300_1000_1_Meter/src/bloss-curve_100.0_300_1000_1_Meter.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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())); | ||
| } | ||
|
|
||
| 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); | ||
| } | ||
20 changes: 20 additions & 0 deletions
20
UnitTests/Schemas/IFC4X3_RC4/circular-arc_100.0_300_1000_1_Meter/CMakeLists.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) |
81 changes: 81 additions & 0 deletions
81
...C4X3_RC4/circular-arc_100.0_300_1000_1_Meter/Data/circular-arc_100.0_300_1000_1_Meter.ifc
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file added
BIN
+2.79 KB
...ircular-arc_100.0_300_1000_1_Meter/Data/circular-arc_100.0_300_1000_1_Meter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.69 KB
...lar-arc_100.0_300_1000_1_Meter/Data/circular-arc_100.0_300_1000_1_Meter_top.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
98 changes: 98 additions & 0 deletions
98
...FC4X3_RC4/circular-arc_100.0_300_1000_1_Meter/src/circular-arc_100.0_300_1000_1_Meter.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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); | ||
| } |
20 changes: 20 additions & 0 deletions
20
UnitTests/Schemas/IFC4X3_RC4/clothoid_100.0_-300_-1000_1_Meter/CMakeLists.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.