Skip to content

Commit a833186

Browse files
committed
Merge branch 'next' of https://github.com/Geode-solutions/OpenGeode into fix/changing_triangle_flip_check_when_swaping_edge
2 parents cef0933 + fe41358 commit a833186

File tree

22 files changed

+278
-21
lines changed

22 files changed

+278
-21
lines changed

bindings/python/src/model/representation/core/brep.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,8 @@ namespace geode
355355
&BRep::is_surface_collection_item )
356356
.def( "is_block_collection_item", &BRep::is_block_collection_item )
357357
.def( "bounding_box", &BRep::bounding_box )
358-
.def( "native_extension", &BRep::native_extension );
358+
.def( "native_extension", &BRep::native_extension )
359+
.def( "brep_component", &BRep::component,
360+
pybind11::return_value_policy::reference );
359361
}
360362
} // namespace geode

bindings/python/src/model/representation/core/section.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,8 @@ namespace geode
214214
.def( "is_surface_collection_item",
215215
&Section::is_surface_collection_item )
216216
.def( "bounding_box", &Section::bounding_box )
217-
.def( "native_extension", &Section::native_extension );
217+
.def( "native_extension", &Section::native_extension )
218+
.def( "section_component", &Section::component,
219+
pybind11::return_value_policy::reference );
218220
}
219221
} // namespace geode

include/geode/model/mixin/core/block_collections.hpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ namespace geode
9696
[[nodiscard]] const BlockCollection< dimension >& block_collection(
9797
const uuid& id ) const;
9898

99+
[[nodiscard]] bool has_block_collection( const uuid& id ) const;
100+
99101
[[nodiscard]] BlockCollectionRange block_collections() const;
100102

101103
[[nodiscard]] BlockCollectionRange active_block_collections() const;
@@ -105,6 +107,17 @@ namespace geode
105107
return block_collections();
106108
}
107109

110+
[[nodiscard]] bool has_component( const uuid& id ) const
111+
{
112+
return has_block_collection( id );
113+
}
114+
115+
[[nodiscard]] const BlockCollection< dimension >& component(
116+
const uuid& id ) const
117+
{
118+
return block_collection( id );
119+
}
120+
108121
void save_block_collections( std::string_view directory ) const;
109122

110123
protected:

include/geode/model/mixin/core/blocks.hpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,17 @@ namespace geode
118118
return blocks();
119119
}
120120

121+
[[nodiscard]] bool has_component( const uuid& id ) const
122+
{
123+
return has_block( id );
124+
}
125+
126+
[[nodiscard]] const Block< dimension >& component(
127+
const uuid& id ) const
128+
{
129+
return block( id );
130+
}
131+
121132
/*!
122133
* Save each Block in a file located in the specified directory
123134
*/

include/geode/model/mixin/core/corner_collections.hpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ namespace geode
9999
[[nodiscard]] const CornerCollection< dimension >& corner_collection(
100100
const uuid& id ) const;
101101

102+
[[nodiscard]] bool has_corner_collection( const uuid& id ) const;
103+
102104
[[nodiscard]] CornerCollectionRange corner_collections() const;
103105

104106
[[nodiscard]] CornerCollectionRange active_corner_collections() const;
@@ -108,6 +110,17 @@ namespace geode
108110
return corner_collections();
109111
}
110112

113+
[[nodiscard]] bool has_component( const uuid& id ) const
114+
{
115+
return has_corner_collection( id );
116+
}
117+
118+
[[nodiscard]] const CornerCollection< dimension >& component(
119+
const uuid& id ) const
120+
{
121+
return corner_collection( id );
122+
}
123+
111124
void save_corner_collections( std::string_view directory ) const;
112125

113126
protected:

include/geode/model/mixin/core/corners.hpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,17 @@ namespace geode
117117
return corners();
118118
}
119119

120+
[[nodiscard]] bool has_component( const uuid& id ) const
121+
{
122+
return has_corner( id );
123+
}
124+
125+
[[nodiscard]] const Corner< dimension >& component(
126+
const uuid& id ) const
127+
{
128+
return corner( id );
129+
}
130+
120131
/*!
121132
* Save each Corner in a file located in the specified directory
122133
*/

include/geode/model/mixin/core/line_collections.hpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ namespace geode
9797
[[nodiscard]] const LineCollection< dimension >& line_collection(
9898
const uuid& id ) const;
9999

100+
[[nodiscard]] bool has_line_collection( const uuid& id ) const;
101+
100102
[[nodiscard]] LineCollectionRange line_collections() const;
101103

102104
[[nodiscard]] LineCollectionRange active_line_collections() const;
@@ -106,6 +108,17 @@ namespace geode
106108
return line_collections();
107109
}
108110

111+
[[nodiscard]] bool has_component( const uuid& id ) const
112+
{
113+
return has_line_collection( id );
114+
}
115+
116+
[[nodiscard]] const LineCollection< dimension >& component(
117+
const uuid& id ) const
118+
{
119+
return line_collection( id );
120+
}
121+
109122
void save_line_collections( std::string_view directory ) const;
110123

111124
protected:

include/geode/model/mixin/core/lines.hpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,16 @@ namespace geode
105105
return lines();
106106
}
107107

108+
[[nodiscard]] bool has_component( const uuid& id ) const
109+
{
110+
return has_line( id );
111+
}
112+
113+
[[nodiscard]] const Line< dimension >& component( const uuid& id ) const
114+
{
115+
return line( id );
116+
}
117+
108118
void save_lines( std::string_view directory ) const;
109119

110120
protected:

include/geode/model/mixin/core/model_boundaries.hpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ namespace geode
9797
[[nodiscard]] const ModelBoundary< dimension >& model_boundary(
9898
const uuid& id ) const;
9999

100+
[[nodiscard]] bool has_model_boundary( const uuid& id ) const;
101+
100102
[[nodiscard]] ModelBoundaryRange model_boundaries() const;
101103

102104
[[nodiscard]] ModelBoundaryRange active_model_boundaries() const;
@@ -106,6 +108,17 @@ namespace geode
106108
return model_boundaries();
107109
}
108110

111+
[[nodiscard]] bool has_component( const uuid& id ) const
112+
{
113+
return has_model_boundary( id );
114+
}
115+
116+
[[nodiscard]] const ModelBoundary< dimension >& component(
117+
const uuid& id ) const
118+
{
119+
return model_boundary( id );
120+
}
121+
109122
void save_model_boundaries( std::string_view directory ) const;
110123

111124
protected:

include/geode/model/mixin/core/surface_collections.hpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ namespace geode
100100
[[nodiscard]] const SurfaceCollection< dimension >& surface_collection(
101101
const uuid& id ) const;
102102

103+
[[nodiscard]] bool has_surface_collection( const uuid& id ) const;
104+
103105
[[nodiscard]] SurfaceCollectionRange surface_collections() const;
104106

105107
[[nodiscard]] SurfaceCollectionRange active_surface_collections() const;
@@ -109,6 +111,17 @@ namespace geode
109111
return surface_collections();
110112
}
111113

114+
[[nodiscard]] bool has_component( const uuid& id ) const
115+
{
116+
return has_surface_collection( id );
117+
}
118+
119+
[[nodiscard]] const SurfaceCollection< dimension >& component(
120+
const uuid& id ) const
121+
{
122+
return surface_collection( id );
123+
}
124+
112125
void save_surface_collections( std::string_view directory ) const;
113126

114127
protected:

0 commit comments

Comments
 (0)