42 #include <geogram/basic/attributes.h> 43 #include <geogram/basic/memory.h> 62 template <
typename T,
typename U = T >
64 const std::vector< T >& in, index_t from, index_t to )
68 index_t nb_to_copy( to - from );
69 GEO::vector< U > out( nb_to_copy );
70 for(
auto i :
range( nb_to_copy ) )
72 out[i] = in[from + i];
83 template <
typename T,
typename U = T >
86 index_t size =
static_cast< index_t
>( in.size() );
87 return copy_std_vector_to_geo_vector< T, U >( in, 0, size );
107 const GEO::Mesh& M, index_t c );
124 const GEO::Mesh& M, index_t cell, index_t f );
142 template <
typename T >
155 GEO::AttributesManager& manager,
156 const std::string& attribute_name )
158 base_class::operator[]( i ) =
159 new GEO::Attribute< T >( manager, attribute_name );
164 return *base_class::operator[]( i );
169 return *base_class::operator[]( i );
174 return base_class::operator[]( i ) !=
nullptr;
179 if( base_class::operator[]( i ) )
182 operator[]( i ).unbind();
183 delete base_class::operator[]( i );
184 base_class::operator[]( i ) =
nullptr;
190 for(
auto i :
range( base_class::size() ) )
204 void div(
const std::string& title )
206 std::lock_guard< std::mutex > lock( lock_ );
207 base_class::div( title );
210 void out(
const std::string& str )
212 std::lock_guard< std::mutex > lock( lock_ );
213 base_class::out( str );
216 void warn(
const std::string& str )
218 std::lock_guard< std::mutex > lock( lock_ );
219 base_class::warn( str );
222 void err(
const std::string& str )
224 std::lock_guard< std::mutex > lock( lock_ );
225 base_class::err( str );
230 std::lock_guard< std::mutex > lock( lock_ );
231 base_class::status( str );
const GEO::Attribute< T > & operator[](index_t i) const
#define ringmesh_disable_copy_and_move(Class)
void status(const std::string &str)
Vector of pointers to Geogram attributes.
void div(const std::string &title)
vec3 RINGMESH_API mesh_cell_barycenter(const GEO::Mesh &M, index_t cell)
double RINGMESH_API mesh_cell_signed_volume(const GEO::Mesh &M, index_t c)
void RINGMESH_API print_bounded_attributes(const GEO::Mesh &M)
void warn(const std::string &str)
AttributeVector(index_t size)
double RINGMESH_API mesh_cell_volume(const GEO::Mesh &M, index_t c)
void out(const std::string &str)
void err(const std::string &str)
GEO::Attribute< T > & operator[](index_t i)
GEO::ConsoleLogger base_class
bool is_attribute_bound(index_t i) const
#define ringmesh_assert(x)
void bind_one_attribute(index_t i, GEO::AttributesManager &manager, const std::string &attribute_name)
GEO::vector< U > copy_std_vector_to_geo_vector(const std::vector< T > &in)
vec3 RINGMESH_API mesh_cell_facet_barycenter(const GEO::Mesh &M, index_t cell, index_t f)
std::vector< GEO::Attribute< T > *> base_class
Classes to build GeoModel from various inputs.
void RINGMESH_API ringmesh_mesh_io_initialize()
complement the available MeshIOHandler