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
2 changes: 0 additions & 2 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# DO NOT MODIFY DIRECTLY THIS FILE
# LOOK AT https://github.com/Geode-solutions/actions
AccessModifierOffset: -4
AlignAfterOpenBracket: DontAlign
AlignConsecutiveAssignments: false
Expand Down
9 changes: 4 additions & 5 deletions bindings/python/src/implicit/representation/core/helpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
#include <geode/geosciences/implicit/representation/core/stratigraphic_model.hpp>
#include <geode/geosciences/implicit/representation/core/stratigraphic_section.hpp>

namespace geode

Check warning on line 33 in bindings/python/src/implicit/representation/core/helpers.hpp

View workflow job for this annotation

GitHub Actions / test / tidy

bindings/python/src/implicit/representation/core/helpers.hpp:33:1 [modernize-concat-nested-namespaces]

nested namespaces can be concatenated
{
namespace detail
{
void define_implicit_model_helpers( pybind11::module& module )

Check failure on line 37 in bindings/python/src/implicit/representation/core/helpers.hpp

View workflow job for this annotation

GitHub Actions / test / tidy

bindings/python/src/implicit/representation/core/helpers.hpp:37:45 [clang-diagnostic-error]

use of undeclared identifier 'pybind11'
{
module
.def( "rescale_model_implicit_value",
Expand Down Expand Up @@ -67,15 +67,14 @@
.def( "horizon_id_from_name_2d", &horizon_id_from_name< 2 > )
.def( "horizon_id_from_name_3d", &horizon_id_from_name< 3 > )
.def( "implicit_section_from_cross_section_scalar_field",
[]( CrossSection& model, std::string_view attribute_name ) {
[]( CrossSection& model, const uuid& attribute_id ) {
return implicit_section_from_cross_section_scalar_field(
model.clone(), attribute_name );
model.clone(), attribute_id );
} )
.def( "implicit_model_from_structural_model_scalar_field",
[]( StructuralModel& model,
std::string_view attribute_name ) {
[]( StructuralModel& model, const uuid& attribute_id ) {
return implicit_model_from_structural_model_scalar_field(
model.clone(), attribute_name );
model.clone(), attribute_id );
} )
.def( "stratigraphic_model_from_implicit_model_and_coords",
[]( ImplicitStructuralModel& implicit_model,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,12 @@ def import_section_with_stratigraphy():

for surface in stratigraphic_section.surfaces():
mesh = surface.mesh()
scalar_attribute = mesh.vertex_attribute_manager().find_attribute_double(
scalar_attributes = mesh.vertex_attribute_manager().attribute_ids_matching_name(
"curvature_min"
)
scalar_attribute = mesh.vertex_attribute_manager().find_read_only_attribute_double(
scalar_attributes[0]
)
for vertex_id in range(mesh.nb_vertices()):
model_builder.set_stratigraphic_coordinates(
surface,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

namespace geode
{
struct opengeode_geosciences_explicit_api GeographicCoordinateSystemInfo

Check warning on line 39 in include/geode/geosciences/explicit/geometry/geographic_coordinate_system.hpp

View workflow job for this annotation

GitHub Actions / test / tidy

include/geode/geosciences/explicit/geometry/geographic_coordinate_system.hpp:39:47 [cppcoreguidelines-special-member-functions]

class 'GeographicCoordinateSystemInfo' defines a destructor but does not define a copy constructor, a copy assignment operator, a move constructor or a move assignment operator
{
GeographicCoordinateSystemInfo( std::string authority_in,
std::string code_in,
Expand All @@ -59,7 +59,7 @@
{
archive.ext( *this,
Growable< Archive, GeographicCoordinateSystemInfo >{
{ []( Archive& a, GeographicCoordinateSystemInfo& info ) {

Check warning on line 62 in include/geode/geosciences/explicit/geometry/geographic_coordinate_system.hpp

View workflow job for this annotation

GitHub Actions / test / tidy

include/geode/geosciences/explicit/geometry/geographic_coordinate_system.hpp:62:36 [readability-identifier-length]

parameter name 'a' is too short, expected at least 3 characters
a.text1b( info.authority, info.authority.max_size() );
a.text1b( info.code, info.code.max_size() );
a.text1b( info.name, info.name.max_size() );
Expand All @@ -72,7 +72,7 @@
};

template < index_t dimension >
class GeographicCoordinateSystem

Check warning on line 75 in include/geode/geosciences/explicit/geometry/geographic_coordinate_system.hpp

View workflow job for this annotation

GitHub Actions / test / tidy

include/geode/geosciences/explicit/geometry/geographic_coordinate_system.hpp:75:11 [cppcoreguidelines-special-member-functions]

class 'GeographicCoordinateSystem' defines a destructor but does not define a copy constructor, a copy assignment operator, a move constructor or a move assignment operator
: public AttributeCoordinateReferenceSystem< dimension >
{
friend class bitsery::Access;
Expand All @@ -80,6 +80,11 @@
public:
GeographicCoordinateSystem(
AttributeManager& manager, GeographicCoordinateSystemInfo info );

GeographicCoordinateSystem( AttributeManager& manager,
const geode::uuid& uuid,
GeographicCoordinateSystemInfo info );

~GeographicCoordinateSystem();

[[nodiscard]] static GeographicCoordinateSystem< dimension >
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#pragma once

#include <geode/basic/algorithm.hpp>
#include <geode/basic/bitsery_archive.hpp>

#include <geode/model/mixin/core/corner.hpp>
#include <geode/model/mixin/core/corner_collection.hpp>
Expand Down Expand Up @@ -51,7 +52,7 @@
* A Cross Section is a Section composed of Faults and Horizons (as Lines)
* and FaultBlocks and StratigraphicUnits (as Surfaces).
*/
class opengeode_geosciences_explicit_api CrossSection

Check warning on line 55 in include/geode/geosciences/explicit/representation/core/cross_section.hpp

View workflow job for this annotation

GitHub Actions / test / tidy

include/geode/geosciences/explicit/representation/core/cross_section.hpp:55:46 [cppcoreguidelines-special-member-functions]

class 'CrossSection' defines a move constructor but does not define a destructor, a copy constructor, a copy assignment operator or a move assignment operator
: public Section,
public Faults2D,
public Horizons2D,
Expand All @@ -59,7 +60,7 @@
public StratigraphicUnits2D
{
public:
class opengeode_geosciences_explicit_api HorizonItemRange

Check warning on line 63 in include/geode/geosciences/explicit/representation/core/cross_section.hpp

View workflow job for this annotation

GitHub Actions / test / tidy

include/geode/geosciences/explicit/representation/core/cross_section.hpp:63:50 [cppcoreguidelines-special-member-functions]

class 'HorizonItemRange' 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::ItemRangeIterator
{
public:
Expand All @@ -78,7 +79,7 @@
const CrossSection& cross_section_;
};

class opengeode_geosciences_explicit_api FaultItemRange

Check warning on line 82 in include/geode/geosciences/explicit/representation/core/cross_section.hpp

View workflow job for this annotation

GitHub Actions / test / tidy

include/geode/geosciences/explicit/representation/core/cross_section.hpp:82:50 [cppcoreguidelines-special-member-functions]

class 'FaultItemRange' 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::ItemRangeIterator
{
public:
Expand All @@ -97,7 +98,7 @@
const CrossSection& cross_section_;
};

class opengeode_geosciences_explicit_api FaultBlockItemRange

Check warning on line 101 in include/geode/geosciences/explicit/representation/core/cross_section.hpp

View workflow job for this annotation

GitHub Actions / test / tidy

include/geode/geosciences/explicit/representation/core/cross_section.hpp:101:50 [cppcoreguidelines-special-member-functions]

class 'FaultBlockItemRange' 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::ItemRangeIterator
{
public:
Expand All @@ -116,7 +117,7 @@
const CrossSection& cross_section_;
};

class opengeode_geosciences_explicit_api StratigraphicUnitItemRange

Check warning on line 120 in include/geode/geosciences/explicit/representation/core/cross_section.hpp

View workflow job for this annotation

GitHub Actions / test / tidy

include/geode/geosciences/explicit/representation/core/cross_section.hpp:120:50 [cppcoreguidelines-special-member-functions]

class 'StratigraphicUnitItemRange' 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::ItemRangeIterator
{
public:
Expand Down Expand Up @@ -147,6 +148,7 @@
using Components = tuple_cat< MeshComponents, CollectionComponents >;

CrossSection() = default;
CrossSection( BITSERY );

Check warning on line 151 in include/geode/geosciences/explicit/representation/core/cross_section.hpp

View workflow job for this annotation

GitHub Actions / test / tidy

include/geode/geosciences/explicit/representation/core/cross_section.hpp:151:9 [google-explicit-constructor]

single-argument constructors must be marked explicit to avoid unintentional implicit conversions
CrossSection( CrossSection&& ) noexcept = default;
explicit CrossSection( Section&& section ) noexcept;
CrossSection( const CrossSection& initial_model,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#pragma once

#include <geode/basic/algorithm.hpp>
#include <geode/basic/bitsery_archive.hpp>

#include <geode/model/mixin/core/block.hpp>
#include <geode/model/mixin/core/block_collection.hpp>
Expand Down Expand Up @@ -150,6 +151,7 @@ namespace geode
using Components = tuple_cat< MeshComponents, CollectionComponents >;

StructuralModel() = default;
StructuralModel( BITSERY );
StructuralModel( StructuralModel&& ) noexcept = default;
explicit StructuralModel( BRep&& brep ) noexcept;
StructuralModel( const StructuralModel& initial_model,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ namespace geode

public:
StratigraphicRelationships();
StratigraphicRelationships( BITSERY );
~StratigraphicRelationships();

[[nodiscard]] bool is_above(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,11 @@ namespace geode

[[nodiscard]] ImplicitCrossSection opengeode_geosciences_implicit_api
implicit_section_from_cross_section_scalar_field(
CrossSection&& section,
std::string_view scalar_attribute_name );
CrossSection&& section, const uuid& scalar_attribute_id );

[[nodiscard]] ImplicitStructuralModel opengeode_geosciences_implicit_api
implicit_model_from_structural_model_scalar_field(
StructuralModel&& model,
std::string_view scalar_attribute_name );
StructuralModel&& model, const uuid& scalar_attribute_id );

[[nodiscard]] StratigraphicModel opengeode_geosciences_implicit_api
stratigraphic_model_from_implicit_model_and_coords(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

#pragma once

#include <geode/basic/bitsery_archive.hpp>
#include <geode/basic/identifier.hpp>
#include <geode/basic/pimpl.hpp>

Expand Down Expand Up @@ -134,6 +135,7 @@ namespace geode
using Components = tuple_cat< MeshComponents, CollectionComponents >;

HorizonsStack();
HorizonsStack( BITSERY );
HorizonsStack( HorizonsStack< dimension >&& horizons_stack ) noexcept;
~HorizonsStack();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

#include <optional>

#include <geode/basic/bitsery_archive.hpp>
#include <geode/basic/pimpl.hpp>

#include <geode/geosciences/explicit/representation/core/cross_section.hpp>
Expand Down Expand Up @@ -56,6 +57,7 @@ namespace geode
"geode_implicit_attribute";
using implicit_attribute_type = double;
ImplicitCrossSection();
ImplicitCrossSection( BITSERY );
ImplicitCrossSection( ImplicitCrossSection&& implicit_model ) noexcept;
explicit ImplicitCrossSection( CrossSection&& cross_section ) noexcept;
ImplicitCrossSection( const ImplicitCrossSection& initial_model,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

#include <optional>

#include <geode/basic/bitsery_archive.hpp>
#include <geode/basic/pimpl.hpp>

#include <geode/geosciences/explicit/representation/core/structural_model.hpp>
Expand Down Expand Up @@ -63,6 +64,7 @@ namespace geode
"geode_implicit_attribute";
using implicit_attribute_type = double;
ImplicitStructuralModel();
ImplicitStructuralModel( BITSERY );
ImplicitStructuralModel(
ImplicitStructuralModel&& implicit_model ) noexcept;
explicit ImplicitStructuralModel(
Expand All @@ -87,6 +89,9 @@ namespace geode
return native_extension_static();
}

[[nodiscard]] uuid block_implicit_function_attribute_id(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const uuid& ?

const uuid& block_id ) const;

/*!
* Return the implicit value at the given vertex of the given block.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

#pragma once

#include <geode/basic/bitsery_archive.hpp>
#include <geode/basic/pimpl.hpp>

#include <geode/geosciences/implicit/common.hpp>
Expand Down Expand Up @@ -59,6 +60,7 @@ namespace geode
"geode_associated_block_polyhedron_facet";
using stratigraphic_location_type = Point2D;
StratigraphicModel();
StratigraphicModel( BITSERY );
StratigraphicModel( StratigraphicModel&& implicit_model ) noexcept;
explicit StratigraphicModel(
ImplicitStructuralModel&& structural_model ) noexcept;
Expand Down Expand Up @@ -142,6 +144,9 @@ namespace geode

[[nodiscard]] BoundingBox3D stratigraphic_bounding_box() const;

[[nodiscard]] uuid block_stratigraphic_location_attribute_id(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const& ?

const uuid& block_id ) const;

public:
void initialize_stratigraphic_query_trees(
StratigraphicModelBuilderKey );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

#include <optional>

#include <geode/basic/bitsery_archive.hpp>
#include <geode/basic/pimpl.hpp>

#include <geode/geosciences/implicit/common.hpp>
Expand Down Expand Up @@ -62,6 +63,7 @@ namespace geode

using stratigraphic_location_type = Point1D;
StratigraphicSection();
StratigraphicSection( BITSERY );
StratigraphicSection(
StratigraphicSection&& stratigraphic_section ) noexcept;
explicit StratigraphicSection(
Expand Down Expand Up @@ -145,6 +147,9 @@ namespace geode

[[nodiscard]] BoundingBox2D stratigraphic_bounding_box() const;

[[nodiscard]] uuid surface_stratigraphic_location_attribute_id(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const& ?

const uuid& surface ) const;

public:
void initialize_stratigraphic_query_trees(
StratigraphicSectionBuilderKey );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,16 @@ namespace geode
{
}

template < index_t dimension >
GeographicCoordinateSystem< dimension >::GeographicCoordinateSystem(
AttributeManager& manager,
const uuid& uuid,
GeographicCoordinateSystemInfo info )
: AttributeCoordinateReferenceSystem< dimension >{ manager, uuid },
impl_{ std::move( info ) }
{
}

template < index_t dimension >
GeographicCoordinateSystem< dimension >::~GeographicCoordinateSystem() =
default;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,17 @@
const geode::AttributeCoordinateReferenceSystem< Mesh::dim >& >(
crs_manager.find_coordinate_reference_system( old_crs_name ) );
auto& attribute_manager = mesh.vertex_attribute_manager();
attribute_manager.rename_attribute(
attribute_crs.attribute_name(), info.name );
auto attribute =
attribute_manager.template find_attribute< geode::VariableAttribute,

Check failure on line 119 in src/geode/geosciences/explicit/geometry/geographic_coordinate_system_helper.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/geosciences/explicit/geometry/geographic_coordinate_system_helper.cpp:119:63 [clang-diagnostic-error]

no member named 'VariableAttribute' in namespace 'geode'
geode::Point< Mesh::dim > >( attribute_crs.attribute_id() );
geode::IdentifierBuilder attribute_identifier_builder{ *attribute };
attribute_identifier_builder.set_name( info.name );
auto crs_builder =
builder.main_coordinate_reference_system_manager_builder();
crs_builder.register_coordinate_reference_system( crs_name,
std::make_shared< geode::GeographicCoordinateSystem< Mesh::dim > >(
attribute_manager, std::move( info ) ) );
attribute_manager, attribute_crs.attribute_id(),
std::move( info ) ) );
crs_builder.delete_coordinate_reference_system( old_crs_name );
crs_builder.set_active_coordinate_reference_system( crs_name );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@ namespace geode
return { *this, stratigraphic_unit };
}

CrossSection::CrossSection( BITSERY bitsery ) : Section{ bitsery } {}

CrossSection::CrossSection( Section&& section ) noexcept
: Section{ std::move( section ) }
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ namespace geode
return { *this, stratigraphic_unit };
}

StructuralModel::StructuralModel( BITSERY bitery ) : BRep{ bitery } {}

StructuralModel::StructuralModel( BRep&& brep ) noexcept
: BRep{ std::move( brep ) }
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ namespace geode
{
const UnzipFile zip_reader{ filename(), uuid{}.string() };
zip_reader.extract_all();
CrossSection cross_section;
CrossSection cross_section{ BITSERY::constructor };
detail::load_cross_section_files(
cross_section, zip_reader.directory() );
return cross_section;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ namespace geode
{
const UnzipFile zip_reader{ filename(), uuid{}.string() };
zip_reader.extract_all();
StructuralModel structural_model;
StructuralModel structural_model{ BITSERY::constructor };
detail::load_structural_model_files(
structural_model, zip_reader.directory() );
return structural_model;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ namespace geode
initialize_relation_attributes();
}

Impl( BITSERY bitsery ) : RelationshipsImpl( bitsery ) {}

bool is_above( const uuid& above_id, const uuid& under_id ) const
{
auto current = under_id;
Expand Down Expand Up @@ -202,10 +204,24 @@ namespace geode
private:
void initialize_relation_attributes()
{
above_relations_ =
const auto ids =
relation_attribute_manager().attribute_ids_matching_name(
"geode_above_relations" );
if( ids.has_value() )
{
above_relations_ = relation_attribute_manager()
.find_attribute< SparseAttribute, bool >(
ids.value()[0] );
return;
}
const auto above_relations_id =
relation_attribute_manager()
.find_or_create_attribute< SparseAttribute, bool >(
"geode_above_relations", false );
.create_attribute< SparseAttribute, bool >(
"geode_above_relations", false,
geode::AttributeProperties{} );
above_relations_ = relation_attribute_manager()
.find_attribute< SparseAttribute, bool >(
above_relations_id );
}

std::optional< index_t > relation_edge(
Expand Down Expand Up @@ -284,6 +300,10 @@ namespace geode
};

StratigraphicRelationships::StratigraphicRelationships() = default;
StratigraphicRelationships::StratigraphicRelationships( BITSERY bitsery )
: impl_( bitsery )
{
}
StratigraphicRelationships::StratigraphicRelationships(
StratigraphicRelationships&& ) noexcept = default;
StratigraphicRelationships& StratigraphicRelationships::operator=(
Expand Down
Loading
Loading