Skip to content

Commit 1fc764c

Browse files
feat(Inspector): Refactored and finished the topology inspector, allowing inspection of the topology of corners, lines, surfaces and surfaces
* feat(Inspector): new class to inspect the topology of a BRep unique vertices. * feat(Inspector): Refactored and finished the topology inspector, allowing inspection of the topology of corners, lines, surfaces and surfaces
1 parent 696fc1e commit 1fc764c

15 files changed

+1691
-339
lines changed

include/geode/inspector/topology/brep_vertices_topology.h renamed to include/geode/inspector/topology/brep_topology.h

Lines changed: 39 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,24 @@ namespace geode
3737
/*!
3838
* Class for inspecting the topology of a BRep model corners
3939
*/
40-
class opengeode_inspector_inspector_api BRepVerticesTopology
40+
class opengeode_inspector_inspector_api BRepTopologyInspector
4141
{
42-
OPENGEODE_DISABLE_COPY( BRepVerticesTopology );
42+
OPENGEODE_DISABLE_COPY( BRepTopologyInspector );
4343

4444
public:
45-
BRepVerticesTopology( const BRep& brep );
46-
~BRepVerticesTopology();
45+
BRepTopologyInspector( const BRep& brep );
46+
~BRepTopologyInspector();
4747

4848
/*!
49-
* Checks if the brep has topologically valid unique vertices, i.e. has
50-
* vertices which verify:
51-
* Each unique_vertex can only be associated to one corner.
52-
* Each corner can only be internal to one object (surface or block).
53-
* Each corner is a boundary of every line it is associated to.
49+
* Checks if the brep is topologically valid through the unique
50+
* vertices.
5451
*/
55-
bool brep_vertices_topology_is_valid() const;
52+
bool brep_topology_is_valid() const;
53+
54+
bool brep_components_are_linked_to_a_unique_vertex() const;
55+
56+
std::vector< index_t >
57+
invalid_components_topology_unique_vertices() const;
5658

5759
std::vector< index_t > multiple_corners_unique_vertices() const;
5860

@@ -63,6 +65,33 @@ namespace geode
6365

6466
std::vector< index_t > line_corners_without_boundary_status() const;
6567

68+
std::vector< index_t >
69+
part_of_not_boundary_nor_internal_line_unique_vertices() const;
70+
71+
std::vector< index_t >
72+
part_of_line_with_invalid_internal_topology_unique_vertices() const;
73+
74+
std::vector< index_t >
75+
part_of_invalid_unique_line_unique_vertices() const;
76+
77+
std::vector< index_t >
78+
part_of_lines_but_not_corner_unique_vertices() const;
79+
80+
std::vector< index_t >
81+
part_of_not_boundary_nor_internal_surface_unique_vertices() const;
82+
83+
std::vector< index_t >
84+
part_of_surface_with_invalid_internal_topology_unique_vertices()
85+
const;
86+
87+
std::vector< index_t >
88+
part_of_invalid_unique_surface_unique_vertices() const;
89+
90+
std::vector< index_t >
91+
part_of_invalid_multiple_surfaces_unique_vertices() const;
92+
93+
std::vector< index_t > part_of_invalid_blocks_unique_vertices() const;
94+
6695
private:
6796
IMPLEMENTATION_MEMBER( impl_ );
6897
};
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/*
2+
* Copyright (c) 2019 - 2022 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+
class BRep;
31+
} // namespace geode
32+
33+
namespace geode
34+
{
35+
namespace detail
36+
{
37+
/*!
38+
* Class for inspecting the topology of a BRep model blocks through
39+
* their unique vertices
40+
*/
41+
class BRepBlocksTopologyImpl
42+
{
43+
public:
44+
BRepBlocksTopologyImpl( const BRep& brep );
45+
46+
/*!
47+
* Checks if the brep unique vertices are parts of valid blocks,
48+
* i.e. verify:
49+
* If the vertex is part of multiple blocks, either it is part of
50+
* exactly 2 blocks (and at least one surface which is boundary to
51+
* the 2 blocks), or it is part of more than to blocks (and it is
52+
* either a corner, or not a corner but part of only one line).
53+
*/
54+
bool brep_vertex_blocks_topology_is_valid(
55+
index_t unique_vertex_index ) const;
56+
57+
private:
58+
const BRep& brep_;
59+
};
60+
} // namespace detail
61+
} // namespace geode
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
/*
2+
* Copyright (c) 2019 - 2022 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+
class BRep;
31+
} // namespace geode
32+
33+
namespace geode
34+
{
35+
namespace detail
36+
{
37+
class BRepCornersTopologyImpl
38+
{
39+
public:
40+
BRepCornersTopologyImpl( const BRep& brep );
41+
42+
/*!
43+
* Checks if the brep unique vertices are valid corners, i.e.
44+
* corners that verify:
45+
* Each unique_vertex can only be associated to one corner.
46+
* Each corner can only be internal to one object (surface or
47+
* block).
48+
* Each corner is a boundary of every line it is associated to.
49+
*/
50+
bool brep_corner_topology_is_valid(
51+
index_t unique_vertex_index ) const;
52+
53+
bool unique_vertex_has_multiple_corners(
54+
index_t unique_vertex_index ) const;
55+
56+
bool corner_has_multiple_embeddings(
57+
index_t unique_vertex_index ) const;
58+
59+
bool corner_is_not_internal_nor_boundary(
60+
index_t unique_vertex_index ) const;
61+
62+
bool corner_is_part_of_line_but_not_boundary(
63+
index_t unique_vertex_index ) const;
64+
65+
private:
66+
const BRep& brep_;
67+
};
68+
} // namespace detail
69+
} // namespace geode
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
/*
2+
* Copyright (c) 2019 - 2022 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+
class BRep;
31+
} // namespace geode
32+
33+
namespace geode
34+
{
35+
namespace detail
36+
{
37+
/*!
38+
* Class for inspecting the topology of a BRep model lines through their
39+
* unique vertices
40+
*/
41+
class BRepLinesTopologyImpl
42+
{
43+
public:
44+
BRepLinesTopologyImpl( const BRep& brep );
45+
46+
/*!
47+
* Checks if the brep unique vertices are parts of valid lines, i.e.
48+
* verify:
49+
* Each line is either internal or boundary.
50+
* Each internal line is internal to only one object and is not
51+
* boundary.
52+
* If the vertex is part of only one line, the line is either
53+
* internal to a surface, internal to a block, or a boundary of
54+
* multiple surfaces.
55+
* If the vertex is part of multiple lines, it is also a corner.
56+
*/
57+
bool brep_vertex_lines_topology_is_valid(
58+
index_t unique_vertex_index ) const;
59+
60+
bool vertex_is_part_of_not_boundary_nor_internal_line(
61+
const index_t unique_vertex_index ) const;
62+
63+
bool vertex_is_part_of_line_with_invalid_internal_topology(
64+
const index_t unique_vertex_index ) const;
65+
66+
bool vertex_is_part_of_invalid_unique_line(
67+
index_t unique_vertex_index ) const;
68+
69+
bool vertex_has_lines_but_is_not_corner(
70+
index_t unique_vertex_index ) const;
71+
72+
private:
73+
const BRep& brep_;
74+
};
75+
} // namespace detail
76+
} // namespace geode
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
/*
2+
* Copyright (c) 2019 - 2022 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+
class BRep;
31+
} // namespace geode
32+
33+
namespace geode
34+
{
35+
namespace detail
36+
{
37+
/*!
38+
* Class for inspecting the topology of a BRep model surfaces through
39+
* their unique vertices
40+
*/
41+
class BRepSurfacesTopologyImpl
42+
{
43+
public:
44+
BRepSurfacesTopologyImpl( const BRep& brep );
45+
46+
/*!
47+
* Checks if the brep unique vertices are parts of valid surfaces,
48+
* i.e. verify:
49+
* Each surface is either internal or boundary.
50+
* Each internal surface is internal to only one object and is not
51+
* boundary.
52+
* If the vertex is part of only one surface, the vertex is part of
53+
* no more than 2 blocks, and the surface is either internal to a
54+
* block (and the vertex is in one and only one block) or a boundary
55+
* of all the blocks the vertex is in.
56+
* If the vertex is part of multiple surfaces, it is either part of
57+
* only one line (and no corner, and the line is boundary to all the
58+
* surfaces) or multiple lines (and all the lines are either
59+
* internal or boundary to at least 2 of the surfaces the vertex is
60+
* in).
61+
*/
62+
bool brep_vertex_surfaces_topology_is_valid(
63+
index_t unique_vertex_index ) const;
64+
65+
bool vertex_is_part_of_not_boundary_nor_internal_surface(
66+
const index_t unique_vertex_index ) const;
67+
68+
bool vertex_is_part_of_surface_with_invalid_internal_topology(
69+
const index_t unique_vertex_index ) const;
70+
71+
bool vertex_is_part_of_invalid_unique_surface(
72+
index_t unique_vertex_index ) const;
73+
74+
bool vertex_is_part_of_invalid_multiple_surfaces(
75+
index_t unique_vertex_index ) const;
76+
77+
private:
78+
const BRep& brep_;
79+
};
80+
} // namespace detail
81+
} // namespace geode

src/geode/inspector/CMakeLists.txt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,11 @@ add_geode_library(
3535
"criterion/manifold/surface_vertex_manifold.cpp"
3636
"criterion/manifold/surface_edge_manifold.cpp"
3737
"criterion/private/colocation_impl.cpp"
38-
"topology/brep_vertices_topology.cpp"
38+
"topology/brep_topology.cpp"
39+
"topology/private/brep_corners_topology_impl.cpp"
40+
"topology/private/brep_lines_topology_impl.cpp"
41+
"topology/private/brep_surfaces_topology_impl.cpp"
42+
"topology/private/brep_blocks_topology_impl.cpp"
3943
PUBLIC_HEADERS
4044
"common.h"
4145
"criterion/degeneration/edgedcurve_degeneration.h"
@@ -48,10 +52,14 @@ add_geode_library(
4852
"criterion/adjacency/surface_adjacency.h"
4953
"criterion/manifold/surface_vertex_manifold.h"
5054
"criterion/manifold/surface_edge_manifold.h"
51-
"topology/brep_vertices_topology.h"
55+
"topology/brep_topology.h"
5256
PRIVATE_HEADERS
5357
"criterion/private/degeneration_impl.h"
5458
"criterion/private/colocation_impl.h"
59+
"topology/private/brep_corners_topology_impl.h"
60+
"topology/private/brep_lines_topology_impl.h"
61+
"topology/private/brep_surfaces_topology_impl.h"
62+
"topology/private/brep_blocks_topology_impl.h"
5563
PUBLIC_DEPENDENCIES
5664
OpenGeode::basic
5765
PRIVATE_DEPENDENCIES

0 commit comments

Comments
 (0)