Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

namespace geode
{
void define_brep_builder( pybind11::module& module )

Check warning on line 40 in bindings/python/src/model/representation/builder/brep_builder.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

bindings/python/src/model/representation/builder/brep_builder.cpp:40:10 [misc-use-internal-linkage]

function 'define_brep_builder' can be made static or moved into an anonymous namespace to enforce internal linkage
{
pybind11::class_< BRepBuilder, TopologyBuilder, CornersBuilder3D,
LinesBuilder3D, SurfacesBuilder3D, BlocksBuilder3D,
Expand Down Expand Up @@ -89,6 +89,8 @@
&BRepBuilder::add_line_surface_boundary_relationship )
.def( "add_surface_block_boundary_relationship",
&BRepBuilder::add_surface_block_boundary_relationship )
.def( "add_corner_line_internal_relationship",
&BRepBuilder::add_corner_line_internal_relationship )
.def( "add_corner_surface_internal_relationship",
&BRepBuilder::add_corner_surface_internal_relationship )
.def( "add_line_surface_internal_relationship",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

namespace geode
{
void define_section_builder( pybind11::module& module )

Check warning on line 38 in bindings/python/src/model/representation/builder/section_builder.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

bindings/python/src/model/representation/builder/section_builder.cpp:38:10 [misc-use-internal-linkage]

function 'define_section_builder' can be made static or moved into an anonymous namespace to enforce internal linkage
{
pybind11::class_< SectionBuilder, TopologyBuilder, CornersBuilder2D,
LinesBuilder2D, SurfacesBuilder2D, ModelBoundariesBuilder2D,
Expand Down Expand Up @@ -79,6 +79,8 @@
&SectionBuilder::add_corner_line_boundary_relationship )
.def( "add_line_surface_boundary_relationship",
&SectionBuilder::add_line_surface_boundary_relationship )
.def( "add_corner_line_internal_relationship",
&SectionBuilder::add_corner_line_internal_relationship )
.def( "add_corner_surface_internal_relationship",
&SectionBuilder::add_corner_surface_internal_relationship )
.def( "add_line_surface_internal_relationship",
Expand Down
32 changes: 32 additions & 0 deletions bindings/python/src/model/representation/core/brep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

namespace geode
{
void define_brep( pybind11::module& module )

Check warning on line 41 in bindings/python/src/model/representation/core/brep.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

bindings/python/src/model/representation/core/brep.cpp:41:10 [misc-use-internal-linkage]

function 'define_brep' can be made static or moved into an anonymous namespace to enforce internal linkage
{
pybind11::class_< BRep, Topology, Corners3D, Lines3D, Surfaces3D,
Blocks3D, ModelBoundaries3D, CornerCollections3D, LineCollections3D,
Expand Down Expand Up @@ -111,6 +111,20 @@
return components;
},
pybind11::return_value_policy::reference )
.def( "nb_internal_corners_of_line",
static_cast< index_t ( BRep::* )( const Line3D& ) const >(
&BRep::nb_internal_corners ) )
.def(
"internal_corners_of_line",
[]( const BRep& brep, const Line3D& line ) {
std::vector< const Corner3D* > components;
for( const auto& component : brep.internal_corners( line ) )
{
components.push_back( &component );
}
return components;
},
pybind11::return_value_policy::reference )
.def( "nb_internal_corners_of_surface",
static_cast< index_t ( BRep::* )( const Surface3D& ) const >(
&BRep::nb_internal_corners ) )
Expand Down Expand Up @@ -183,6 +197,21 @@
return components;
},
pybind11::return_value_policy::reference )
.def( "nb_embedding_lines_of_corner",
static_cast< index_t ( BRep::* )( const Corner3D& ) const >(
&BRep::nb_embedding_lines ) )
.def(
"embedding_lines_of_corner",
[]( const BRep& brep, const Corner3D& corner ) {
std::vector< const Line3D* > components;
for( const auto& component :
brep.embedding_lines( corner ) )
{
components.push_back( &component );
}
return components;
},
pybind11::return_value_policy::reference )
.def( "nb_embedding_surfaces_of_corner",
static_cast< index_t ( BRep::* )( const Corner3D& ) const >(
&BRep::nb_embedding_surfaces ) )
Expand Down Expand Up @@ -332,6 +361,9 @@
.def( "is_block_boundary",
static_cast< bool ( BRep::* )( const Surface3D&,
const Block3D& ) const >( &BRep::is_boundary ) )
.def( "is_corner_in_line_internals",
static_cast< bool ( BRep::* )( const Corner3D&, const Line3D& )
const >( &BRep::is_internal ) )
.def( "is_corner_in_surface_internals",
static_cast< bool ( BRep::* )( const Corner3D&,
const Surface3D& ) const >( &BRep::is_internal ) )
Expand Down
36 changes: 35 additions & 1 deletion bindings/python/src/model/representation/core/section.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

namespace geode
{
void define_section( pybind11::module& module )

Check warning on line 39 in bindings/python/src/model/representation/core/section.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

bindings/python/src/model/representation/core/section.cpp:39:10 [misc-use-internal-linkage]

function 'define_section' can be made static or moved into an anonymous namespace to enforce internal linkage
{
pybind11::class_< Section, Topology, Corners2D, Lines2D, Surfaces2D,
ModelBoundaries2D, CornerCollections2D, LineCollections2D,
Expand Down Expand Up @@ -87,8 +87,24 @@
return components;
},
pybind11::return_value_policy::reference )
.def( "nb_internal_corners_of_line",
static_cast< index_t ( Section::* )( const Line2D& ) const >(
&Section::nb_internal_corners ) )
.def(
"internal_corners_of_line",
[]( const Section& section, const Line2D& line ) {
std::vector< const Corner2D* > components;
for( const auto& component :
section.internal_corners( line ) )
{
components.push_back( &component );
}
return components;
},
pybind11::return_value_policy::reference )
.def( "nb_internal_corners_of_surface",
&Section::nb_internal_corners )
static_cast< index_t ( Section::* )( const Surface2D& ) const >(
&Section::nb_internal_corners ) )
.def(
"internal_corners_of_surface",
[]( const Section& section, const Surface2D& surface ) {
Expand All @@ -114,6 +130,21 @@
return components;
},
pybind11::return_value_policy::reference )
.def( "nb_embedding_lines_of_corner",
static_cast< index_t ( Section::* )( const Corner2D& ) const >(
&Section::nb_embedding_lines ) )
.def(
"embedding_lines_of_corner",
[]( const Section& section, const Corner2D& corner ) {
std::vector< const Line2D* > components;
for( const auto& component :
section.embedding_lines( corner ) )
{
components.push_back( &component );
}
return components;
},
pybind11::return_value_policy::reference )
.def( "nb_embedding_surfaces_of_corner",
static_cast< index_t ( Section::* )( const Corner2D& ) const >(
&Section::nb_embedding_surfaces ) )
Expand Down Expand Up @@ -202,6 +233,9 @@
.def( "is_surface_boundary",
static_cast< bool ( Section::* )( const Line2D&,
const Surface2D& ) const >( &Section::is_boundary ) )
.def( "is_corner_in_line_internals",
static_cast< bool ( Section::* )( const Corner2D&,
const Line2D& ) const >( &Section::is_internal ) )
.def( "is_corner_in_surface_internals",
static_cast< bool ( Section::* )( const Corner2D&,
const Surface2D& ) const >( &Section::is_internal ) )
Expand Down
3 changes: 3 additions & 0 deletions include/geode/model/representation/builder/brep_builder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
* @extends SurfaceCollectionsBuilder3D
* @extends BlockCollectionsBuilder3D
*/
class opengeode_model_api BRepBuilder : public TopologyBuilder,

Check warning on line 91 in include/geode/model/representation/builder/brep_builder.hpp

View workflow job for this annotation

GitHub Actions / test / tidy

include/geode/model/representation/builder/brep_builder.hpp:91:31 [cppcoreguidelines-special-member-functions]

class 'BRepBuilder' defines a copy constructor, a copy assignment operator and a move constructor but does not define a destructor or a move assignment operator
public CornersBuilder3D,
public LinesBuilder3D,
public SurfacesBuilder3D,
Expand Down Expand Up @@ -211,6 +211,9 @@
void add_surface_block_boundary_relationship(
const Surface3D& surface, const Block3D& block );

void add_corner_line_internal_relationship(
const Corner3D& corner, const Line3D& line );

void add_corner_surface_internal_relationship(
const Corner3D& corner, const Surface3D& surface );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
* @extends LineCollectionsBuilder2D
* @extends SurfaceCollectionsBuilder2D
*/
class opengeode_model_api SectionBuilder

Check warning on line 81 in include/geode/model/representation/builder/section_builder.hpp

View workflow job for this annotation

GitHub Actions / test / tidy

include/geode/model/representation/builder/section_builder.hpp:81:31 [cppcoreguidelines-special-member-functions]

class 'SectionBuilder' defines a copy constructor, a copy assignment operator and a move constructor but does not define a destructor or a move assignment operator
: public TopologyBuilder,
public CornersBuilder2D,
public LinesBuilder2D,
Expand Down Expand Up @@ -179,6 +179,9 @@
void add_line_surface_boundary_relationship(
const Line2D& line, const Surface2D& surface );

void add_corner_line_internal_relationship(
const Corner2D& corner, const Line2D& line );

void add_corner_surface_internal_relationship(
const Corner2D& corner, const Surface2D& surface );

Expand Down
35 changes: 35 additions & 0 deletions include/geode/model/representation/core/brep.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
* @extends SurfaceCollections
* @extends BlockCollections
*/
class opengeode_model_api BRep : public Topology,

Check warning on line 75 in include/geode/model/representation/core/brep.hpp

View workflow job for this annotation

GitHub Actions / test / tidy

include/geode/model/representation/core/brep.hpp:75:31 [cppcoreguidelines-special-member-functions]

class 'BRep' defines a destructor, a move constructor and a move assignment operator but does not define a copy constructor or a copy assignment operator
public Corners3D,
public Lines3D,
public Surfaces3D,
Expand All @@ -96,7 +96,7 @@
BlockCollections3D >;
using Components = tuple_cat< MeshComponents, CollectionComponents >;

class opengeode_model_api BoundaryCornerRange

Check warning on line 99 in include/geode/model/representation/core/brep.hpp

View workflow job for this annotation

GitHub Actions / test / tidy

include/geode/model/representation/core/brep.hpp:99:35 [cppcoreguidelines-special-member-functions]

class 'BoundaryCornerRange' defines a destructor and a copy constructor but does not define a copy assignment operator, a move constructor or a move assignment operator
: public Relationships::BoundaryRangeIterator
{
public:
Expand All @@ -114,7 +114,7 @@
const BRep& brep_;
};

class opengeode_model_api BoundaryLineRange

Check warning on line 117 in include/geode/model/representation/core/brep.hpp

View workflow job for this annotation

GitHub Actions / test / tidy

include/geode/model/representation/core/brep.hpp:117:35 [cppcoreguidelines-special-member-functions]

class 'BoundaryLineRange' defines a destructor and a copy constructor but does not define a copy assignment operator, a move constructor or a move assignment operator
: public Relationships::BoundaryRangeIterator
{
public:
Expand All @@ -132,7 +132,7 @@
const BRep& brep_;
};

class opengeode_model_api BoundarySurfaceRange

Check warning on line 135 in include/geode/model/representation/core/brep.hpp

View workflow job for this annotation

GitHub Actions / test / tidy

include/geode/model/representation/core/brep.hpp:135:35 [cppcoreguidelines-special-member-functions]

class 'BoundarySurfaceRange' defines a destructor and a copy constructor but does not define a copy assignment operator, a move constructor or a move assignment operator
: public Relationships::BoundaryRangeIterator
{
public:
Expand Down Expand Up @@ -208,6 +208,7 @@
: public Relationships::InternalRangeIterator
{
public:
InternalCornerRange( const BRep& brep, const Line3D& line );
InternalCornerRange( const BRep& brep, const Surface3D& surface );
InternalCornerRange( const BRep& brep, const Block3D& block );
InternalCornerRange( const InternalCornerRange& range );
Expand Down Expand Up @@ -266,6 +267,26 @@
const BRep& brep_;
};

class opengeode_model_api EmbeddingLineRange
: public Relationships::EmbeddingRangeIterator
{
public:
EmbeddingLineRange( const BRep& brep, const Corner3D& corner );
EmbeddingLineRange( const EmbeddingLineRange& range );
~EmbeddingLineRange();

[[nodiscard]] const EmbeddingLineRange& begin() const;

[[nodiscard]] const EmbeddingLineRange& end() const;

void operator++();

[[nodiscard]] const Line3D& operator*() const;

private:
const BRep& brep_;
};

class opengeode_model_api EmbeddingSurfaceRange
: public Relationships::EmbeddingRangeIterator
{
Expand Down Expand Up @@ -415,6 +436,11 @@
[[nodiscard]] IncidentBlockRange incidences(
const Surface3D& surface ) const;

[[nodiscard]] index_t nb_internal_corners( const Line3D& line ) const;

[[nodiscard]] InternalCornerRange internal_corners(
const Line3D& line ) const;

[[nodiscard]] index_t nb_internal_corners(
const Surface3D& surface ) const;

Expand Down Expand Up @@ -443,6 +469,12 @@
[[nodiscard]] InternalSurfaceRange internal_surfaces(
const Block3D& block ) const;

[[nodiscard]] index_t nb_embedding_lines(
const Corner3D& corner ) const;

[[nodiscard]] EmbeddingLineRange embedding_lines(
const Corner3D& corner ) const;

[[nodiscard]] index_t nb_embedding_surfaces(
const Corner3D& corner ) const;

Expand Down Expand Up @@ -499,6 +531,9 @@
[[nodiscard]] bool is_boundary(
const Surface3D& surface, const Block3D& block ) const;

[[nodiscard]] bool is_internal(
const Corner3D& corner, const Line3D& surface ) const;

[[nodiscard]] bool is_internal(
const Corner3D& corner, const Surface3D& surface ) const;

Expand Down
36 changes: 36 additions & 0 deletions include/geode/model/representation/core/section.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ namespace geode
: public Relationships::InternalRangeIterator
{
public:
InternalCornerRange( const Section& section, const Line2D& line );
InternalCornerRange(
const Section& section, const Surface2D& surface );
InternalCornerRange( const InternalCornerRange& range );
Expand All @@ -203,6 +204,27 @@ namespace geode
const Section& section_;
};

class opengeode_model_api EmbeddingLineRange
: public Relationships::EmbeddingRangeIterator
{
public:
EmbeddingLineRange(
const Section& section, const Corner2D& corner );
EmbeddingLineRange( const EmbeddingLineRange& range );
~EmbeddingLineRange();

[[nodiscard]] const EmbeddingLineRange& begin() const;

[[nodiscard]] const EmbeddingLineRange& end() const;

void operator++();

[[nodiscard]] const Line2D& operator*() const;

private:
const Section& section_;
};

class opengeode_model_api EmbeddingSurfaceRange
: public Relationships::EmbeddingRangeIterator
{
Expand Down Expand Up @@ -306,6 +328,11 @@ namespace geode
[[nodiscard]] IncidentSurfaceRange incidences(
const Line2D& line ) const;

[[nodiscard]] index_t nb_internal_corners( const Line2D& line ) const;

[[nodiscard]] InternalCornerRange internal_corners(
const Line2D& line ) const;

[[nodiscard]] index_t nb_internal_corners(
const Surface2D& surface ) const;

Expand All @@ -318,6 +345,12 @@ namespace geode
[[nodiscard]] InternalLineRange internal_lines(
const Surface2D& surface ) const;

[[nodiscard]] index_t nb_embedding_lines(
const Corner2D& corner ) const;

[[nodiscard]] EmbeddingLineRange embedding_lines(
const Corner2D& corner ) const;

[[nodiscard]] index_t nb_embedding_surfaces(
const Corner2D& corner ) const;

Expand Down Expand Up @@ -349,6 +382,9 @@ namespace geode
[[nodiscard]] bool is_boundary(
const Line2D& line, const Surface2D& surface ) const;

[[nodiscard]] bool is_internal(
const Corner2D& corner, const Line2D& line ) const;

[[nodiscard]] bool is_internal(
const Corner2D& corner, const Surface2D& surface ) const;

Expand Down
6 changes: 6 additions & 0 deletions src/geode/model/representation/builder/brep_builder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,12 @@ namespace geode
add_boundary_relation( surface.component_id(), block.component_id() );
}

void BRepBuilder::add_corner_line_internal_relationship(
const Corner3D& corner, const Line3D& line )
{
add_internal_relation( corner.component_id(), line.component_id() );
}

void BRepBuilder::add_line_surface_internal_relationship(
const Line3D& line, const Surface3D& surface )
{
Expand Down
6 changes: 6 additions & 0 deletions src/geode/model/representation/builder/section_builder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,12 @@ namespace geode
add_boundary_relation( line.component_id(), surface.component_id() );
}

void SectionBuilder::add_corner_line_internal_relationship(
const Corner2D& corner, const Line2D& line )
{
add_internal_relation( corner.component_id(), line.component_id() );
}

void SectionBuilder::add_corner_surface_internal_relationship(
const Corner2D& corner, const Surface2D& surface )
{
Expand Down
Loading
Loading