Skip to content

Commit 083d225

Browse files
Merge pull request #1056 from Geode-solutions/fix/sharp-block-mappings
fix(Mappings): add unmap function in GenericMapping
2 parents dee4fd3 + 2b9fc7d commit 083d225

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

include/geode/basic/mapping.hpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,24 @@ namespace geode
190190
this->out2in_mapping()[out].push_back( in );
191191
}
192192

193+
void unmap( const T1& in, const T2& out )
194+
{
195+
auto& in_map = this->in2out_mapping().at( in );
196+
const auto itr = absl::c_find( in_map, out );
197+
in_map.erase( itr );
198+
if( this->in2out( in ).empty() )
199+
{
200+
this->in2out_mapping().erase( in );
201+
}
202+
auto& out_map = this->out2in_mapping().at( out );
203+
const auto itr2 = absl::c_find( out_map, in );
204+
out_map.erase( itr2 );
205+
if( this->out2in( out ).empty() )
206+
{
207+
this->out2in_mapping().erase( out );
208+
}
209+
}
210+
193211
void erase_in( const T1& in )
194212
{
195213
if( !this->has_mapping_input( in ) )

include/geode/model/helpers/surface_radial_sort.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ namespace geode
8484

8585
[[nodiscard]] index_t next( index_t position ) const;
8686

87-
[[nodiscard]] absl::FixedArray< SidedSurface > surfaces;
87+
absl::FixedArray< SidedSurface > surfaces;
8888
};
8989

9090
[[nodiscard]] SortedSurfaces opengeode_model_api surface_radial_sort(

0 commit comments

Comments
 (0)