Skip to content

Commit 322f0d9

Browse files
committed
developpement of the degeneration classes in course
1 parent 47193e1 commit 322f0d9

File tree

18 files changed

+568
-61
lines changed

18 files changed

+568
-61
lines changed

CMakeLists.txt

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,33 +21,23 @@
2121
cmake_minimum_required(VERSION 3.11)
2222

2323
# Define the project
24-
project(MyModule CXX)
24+
project(OpenGeode-Inspector CXX)
2525

26-
option(MYMODULE_WITH_TESTS "Compile test projects" ON)
26+
option(OPENGEODE_INSPECTOR_WITH_TESTS "Compile test projects" ON)
2727

28-
# Get MyModule dependencies
28+
# Get OpenGeode-inspector dependencies
2929
find_package(OpenGeode REQUIRED)
3030

3131
#------------------------------------------------------------------------------------------------
32-
# Configure the MyModule libraries
33-
add_geode_library(
34-
NAME mylib
35-
FOLDER "mylib"
36-
SOURCES
37-
"common.cpp"
38-
"hello_world.cpp"
39-
PUBLIC_HEADERS
40-
"hello_world.h"
41-
PRIVATE_DEPENDENCIES
42-
OpenGeode::basic
43-
)
32+
# Configure the OpenGeode-inspector libraries
33+
add_subdirectory(src/geode)
4434

4535
#------------------------------------------------------------------------------------------------
4636
# Optional modules configuration
47-
if(MYMODULE_WITH_TESTS)
37+
if(OPENGEODE_INSPECTOR_WITH_TESTS)
4838
# Enable testing with CTest
4939
enable_testing()
50-
message(STATUS "Configuring MyModule with tests")
40+
message(STATUS "Configuring OpenGeode-inspector with tests")
5141
add_subdirectory(tests)
5242
endif()
5343

README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
<h1 align="center">OpenGeode-ModuleTemplate<sup><i>by Geode-solutions</i></sup></h1>
2-
<h3 align="center">Template for creating your own OpenGeode modules</h3>
1+
<h1 align="center">OpenGeode-Inspector<sup><i>by Geode-solutions</i></sup></h1>
2+
<h3 align="center">OpenGeode module for inspecting meshes and models</h3>
33

44

55
<p align="center">
@@ -31,18 +31,22 @@
3131

3232
## Introduction
3333

34-
OpenGeode-ModuleTemplate provides a template for creating an [OpenGeode] module.
34+
OpenGeode-Inspector is a module of [OpenGeode] providing ways of inspecting your meshes and models and verifying their validity.
3535

3636
[OpenGeode]: https://github.com/Geode-solutions/OpenGeode
3737

3838
## Documentation
3939

40-
To know how to use this template, please have a look at this page: https://help.github.com/en/articles/creating-a-repository-from-a-template
40+
Go check out the online documentation at [docs.geode-solutions.com].
4141

42-
Have also a look at this [OpenGeode] documentation: https://docs.geode-solutions.com/opengeode then click on "How to create your own OpenGeode module"
42+
[docs.geode-solutions.com] https://docs.geode-solutions.com
43+
44+
Installing OpenGeode-Inspector is done:
45+
46+
* by compiling the C++ source.
4347

4448
## Questions
45-
For questions and support please use the official [slack](https://slackin-opengeode.herokuapp.com) and go to the channel #module_template. The issue list of this repo is exclusively for bug reports and feature requests.
49+
For questions and support please use the official [slack](https://slackin-opengeode.herokuapp.com) and go to the channel #inspector. The issue list of this repo is exclusively for bug reports and feature requests.
4650

4751

4852
## License

include/mylib/hello_world.h renamed to include/geode/inspector/common.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@
2323

2424
#pragma once
2525

26-
#include <mylib/mymodule_mylib_export.h>
26+
#include <geode/basic/common.h>
2727

28-
namespace mymodule
29-
{
30-
bool mymodule_mylib_api hello_world();
31-
} // namespace mymodule
28+
#include <geode/inspector/opengeode_inspector_inspector_export.h>

src/mylib/hello_world.cpp renamed to include/geode/inspector/criterion/adjacency.h

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,11 @@
2121
*
2222
*/
2323

24-
#include <mylib/hello_world.h>
24+
#pragma once
2525

26-
#include <geode/basic/logger.h>
26+
#include <geode/inspector/common.h>
2727

28-
namespace mymodule
28+
namespace geode
2929
{
30-
bool hello_world()
31-
{
32-
geode::Logger::info( "Hello Geode World!" );
33-
return true;
34-
}
35-
} // namespace mymodule
30+
bool opengeode_inspector_inspector_api hello_world();
31+
} // namespace geode
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Copyright (c) 2019 - 2021 Geode-solutions
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy
5+
* of this software and associated documentation files (the "Software"), to deal
6+
* in the Software without restriction, including without limitation the rights
7+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
* copies of the Software, and to permit persons to whom the Software is
9+
* furnished to do so, subject to the following conditions:
10+
*
11+
* The above copyright notice and this permission notice shall be included in
12+
* all copies or substantial portions of the Software.
13+
*
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20+
* SOFTWARE.
21+
*
22+
*/
23+
24+
#pragma once
25+
26+
#include <geode/inspector/common.h>
27+
28+
namespace geode
29+
{
30+
bool opengeode_inspector_inspector_api hello_world();
31+
} // namespace geode
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Copyright (c) 2019 - 2021 Geode-solutions
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy
5+
* of this software and associated documentation files (the "Software"), to deal
6+
* in the Software without restriction, including without limitation the rights
7+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
* copies of the Software, and to permit persons to whom the Software is
9+
* furnished to do so, subject to the following conditions:
10+
*
11+
* The above copyright notice and this permission notice shall be included in
12+
* all copies or substantial portions of the Software.
13+
*
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20+
* SOFTWARE.
21+
*
22+
*/
23+
24+
#pragma once
25+
26+
#include <geode/inspector/common.h>
27+
28+
namespace geode
29+
{
30+
bool opengeode_inspector_inspector_api hello_world();
31+
} // namespace geode
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Copyright (c) 2019 - 2021 Geode-solutions
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy
5+
* of this software and associated documentation files (the "Software"), to deal
6+
* in the Software without restriction, including without limitation the rights
7+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
* copies of the Software, and to permit persons to whom the Software is
9+
* furnished to do so, subject to the following conditions:
10+
*
11+
* The above copyright notice and this permission notice shall be included in
12+
* all copies or substantial portions of the Software.
13+
*
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20+
* SOFTWARE.
21+
*
22+
*/
23+
24+
#pragma once
25+
26+
#include <geode/inspector/common.h>
27+
28+
namespace geode
29+
{
30+
bool opengeode_inspector_inspector_api hello_world();
31+
} // namespace geode
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
/*
2+
* Copyright (c) 2019 - 2021 Geode-solutions
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy
5+
* of this software and associated documentation files (the "Software"), to deal
6+
* in the Software without restriction, including without limitation the rights
7+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
* copies of the Software, and to permit persons to whom the Software is
9+
* furnished to do so, subject to the following conditions:
10+
*
11+
* The above copyright notice and this permission notice shall be included in
12+
* all copies or substantial portions of the Software.
13+
*
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20+
* SOFTWARE.
21+
*
22+
*/
23+
24+
#pragma once
25+
26+
#include <geode/basic/pimpl.h>
27+
28+
#include <geode/inspector/common.h>
29+
30+
namespace geode
31+
{
32+
FORWARD_DECLARATION_DIMENSION_CLASS( SurfaceMesh );
33+
FORWARD_DECLARATION_DIMENSION_CLASS( SolidMesh );
34+
} // namespace geode
35+
36+
namespace geode
37+
{
38+
namespace inspector
39+
{
40+
/*!
41+
* Class for inspecting the degeneration of a SurfaceMesh
42+
*/
43+
template < index_t dimension >
44+
class opengeode_inspector_inspector_api SurfaceMeshDegeneration
45+
{
46+
public:
47+
SurfaceMeshDegeneration() = default;
48+
SurfaceMeshDegeneration( SurfaceMeshDegeneration&& other );
49+
~SurfaceMeshDegeneration();
50+
51+
bool is_mesh_degenerated(
52+
const SurfaceMesh< dimension >& mesh ) const;
53+
54+
index_t nb_degenerated_edges(
55+
const SurfaceMesh< dimension >& mesh ) const;
56+
57+
const std::vector< index_t > degenerated_edges(
58+
const SurfaceMesh< dimension >& mesh ) const;
59+
60+
private:
61+
IMPLEMENTATION_MEMBER( impl_ );
62+
};
63+
ALIAS_2D_AND_3D( SurfaceMeshDegeneration );
64+
65+
// template < index_t dimension >
66+
// class SolidMeshDegeneration
67+
// {
68+
// public:
69+
// SolidMeshDegeneration();
70+
// SolidMeshDegeneration( SolidMeshDegeneration&& other );
71+
// ~SolidMeshDegeneration();
72+
73+
// bool is_mesh_degenerated(
74+
// const SolidMesh< dimension >& mesh ) const;
75+
76+
// index_t nb_degenerated_edges(
77+
// const SolidMesh< dimension >& mesh ) const;
78+
79+
// const std::vector< index_t > degenerated_edges(
80+
// const SolidMesh< dimension >& mesh ) const;
81+
82+
// private:
83+
// IMPLEMENTATION_MEMBER( impl_ );
84+
// };
85+
// ALIAS_2D_AND_3D( SolidMeshDegeneration );
86+
} // namespace inspector
87+
} // namespace geode
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Copyright (c) 2019 - 2021 Geode-solutions
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy
5+
* of this software and associated documentation files (the "Software"), to deal
6+
* in the Software without restriction, including without limitation the rights
7+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
* copies of the Software, and to permit persons to whom the Software is
9+
* furnished to do so, subject to the following conditions:
10+
*
11+
* The above copyright notice and this permission notice shall be included in
12+
* all copies or substantial portions of the Software.
13+
*
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20+
* SOFTWARE.
21+
*
22+
*/
23+
24+
#pragma once
25+
26+
#include <geode/inspector/common.h>
27+
28+
namespace geode
29+
{
30+
bool opengeode_inspector_inspector_api hello_world();
31+
} // namespace geode
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Copyright (c) 2019 - 2021 Geode-solutions
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy
5+
* of this software and associated documentation files (the "Software"), to deal
6+
* in the Software without restriction, including without limitation the rights
7+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
* copies of the Software, and to permit persons to whom the Software is
9+
* furnished to do so, subject to the following conditions:
10+
*
11+
* The above copyright notice and this permission notice shall be included in
12+
* all copies or substantial portions of the Software.
13+
*
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20+
* SOFTWARE.
21+
*
22+
*/
23+
24+
#pragma once
25+
26+
#include <geode/inspector/common.h>
27+
28+
namespace geode
29+
{
30+
bool opengeode_inspector_inspector_api hello_world();
31+
} // namespace geode

0 commit comments

Comments
 (0)