Skip to content

Commit ab89685

Browse files
committed
feat(Inspector): Added general inspectors for each mesh and model type. Refactored some API functions for clarity and homogeneity.
1 parent a446688 commit ab89685

File tree

58 files changed

+1223
-203
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+1223
-203
lines changed

bindings/python/src/inspector/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ add_geode_python_binding(
3434
"topology/brep_topology.h"
3535
"topology/section_topology.h"
3636
"inspector.cpp"
37+
"edgedcurve_inspector.h"
38+
"brep_inspector.h"
39+
"pointset_inspector.h"
40+
"section_inspector.h"
41+
"solid_inspector.h"
42+
"surface_inspector.h"
3743
DEPENDENCIES
3844
${PROJECT_NAME}::inspector
3945
)

bindings/python/src/inspector/adjacency/surface_adjacency.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
pybind11::class_< SurfaceMeshAdjacency##dimension##D >( \
3232
module, name##dimension.c_str() ) \
3333
.def( pybind11::init< const SurfaceMesh< dimension >& >() ) \
34+
.def( pybind11::init< const SurfaceMesh< dimension >&, bool >() ) \
3435
.def( "mesh_has_wrong_adjacencies", \
3536
&SurfaceMeshAdjacency##dimension##D::mesh_has_wrong_adjacencies ) \
3637
.def( "nb_edges_with_wrong_adjacency", \
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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+
#include <geode/model/representation/core/brep.h>
25+
26+
#include <geode/inspector/brep_inspector.h>
27+
28+
#define PYTHON_BREP_INSPECTOR() \
29+
pybind11::class_< BRepInspector, BRepTopologyInspector >( \
30+
module, "BRepInspector" ) \
31+
.def( pybind11::init< const BRep& >() ) \
32+
.def( pybind11::init< const BRep&, bool >() )
33+
34+
namespace geode
35+
{
36+
void define_brep_inspector( pybind11::module& module )
37+
{
38+
PYTHON_BREP_INSPECTOR();
39+
}
40+
} // namespace geode

bindings/python/src/inspector/colocation/edgedcurve_colocation.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
pybind11::class_< EdgedCurveColocation##dimension##D >( \
3232
module, name##dimension.c_str() ) \
3333
.def( pybind11::init< const EdgedCurve< dimension >& >() ) \
34+
.def( pybind11::init< const EdgedCurve< dimension >&, bool >() ) \
3435
.def( "mesh_has_colocated_points", \
3536
&EdgedCurveColocation##dimension##D::mesh_has_colocated_points ) \
3637
.def( "nb_colocated_points", \

bindings/python/src/inspector/colocation/pointset_colocation.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
pybind11::class_< PointSetColocation##dimension##D >( \
3232
module, name##dimension.c_str() ) \
3333
.def( pybind11::init< const PointSet< dimension >& >() ) \
34+
.def( pybind11::init< const PointSet< dimension >&, bool >() ) \
3435
.def( "mesh_has_colocated_points", \
3536
&PointSetColocation##dimension##D::mesh_has_colocated_points ) \
3637
.def( "nb_colocated_points", \

bindings/python/src/inspector/colocation/solid_colocation.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
pybind11::class_< SolidMeshColocation##dimension##D >( \
3232
module, name##dimension.c_str() ) \
3333
.def( pybind11::init< const SolidMesh< dimension >& >() ) \
34+
.def( pybind11::init< const SolidMesh< dimension >&, bool >() ) \
3435
.def( "mesh_has_colocated_points", \
3536
&SolidMeshColocation##dimension##D::mesh_has_colocated_points ) \
3637
.def( "nb_colocated_points", \

bindings/python/src/inspector/colocation/surface_colocation.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
pybind11::class_< SurfaceMeshColocation##dimension##D >( \
3232
module, name##dimension.c_str() ) \
3333
.def( pybind11::init< const SurfaceMesh< dimension >& >() ) \
34+
.def( pybind11::init< const SurfaceMesh< dimension >&, bool >() ) \
3435
.def( "mesh_has_colocated_points", \
3536
&SurfaceMeshColocation##dimension##D::mesh_has_colocated_points ) \
3637
.def( "nb_colocated_points", \

bindings/python/src/inspector/degeneration/edgedcurve_degeneration.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
pybind11::class_< EdgedCurveDegeneration##dimension##D >( \
3232
module, name##dimension.c_str() ) \
3333
.def( pybind11::init< const EdgedCurve< dimension >& >() ) \
34+
.def( pybind11::init< const EdgedCurve< dimension >&, bool >() ) \
3435
.def( "is_mesh_degenerated", \
3536
&EdgedCurveDegeneration##dimension##D::is_mesh_degenerated ) \
3637
.def( "nb_degenerated_edges", \

bindings/python/src/inspector/degeneration/solid_degeneration.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
pybind11::class_< SolidMeshDegeneration##dimension##D >( \
3232
module, name##dimension.c_str() ) \
3333
.def( pybind11::init< const SolidMesh< dimension >& >() ) \
34+
.def( pybind11::init< const SolidMesh< dimension >&, bool >() ) \
3435
.def( "is_mesh_degenerated", \
3536
&SolidMeshDegeneration##dimension##D::is_mesh_degenerated ) \
3637
.def( "nb_degenerated_edges", \

bindings/python/src/inspector/degeneration/surface_degeneration.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
pybind11::class_< SurfaceMeshDegeneration##dimension##D >( \
3232
module, name##dimension.c_str() ) \
3333
.def( pybind11::init< const SurfaceMesh< dimension >& >() ) \
34+
.def( pybind11::init< const SurfaceMesh< dimension >&, bool >() ) \
3435
.def( "is_mesh_degenerated", \
3536
&SurfaceMeshDegeneration##dimension##D::is_mesh_degenerated ) \
3637
.def( "nb_degenerated_edges", \

0 commit comments

Comments
 (0)