23#ifndef VCL_MESH_COMPONENTS_NAME_H
24#define VCL_MESH_COMPONENTS_NAME_H
26#include "base/component.h"
27#include "base/predicates.h"
29#include <vclib/base.h>
58template<
typename ParentElemType =
void,
bool OPT = false>
61 Name<ParentElemType, OPT>,
65 !std::is_same_v<ParentElemType, void>,
68 using Base = Component<
73 !std::is_same_v<ParentElemType, void>,
90 std::string&
name() {
return Base::data(); }
96 const std::string&
name()
const {
return Base::data(); }
100 template<
typename Element>
101 void importFrom(
const Element& e,
bool =
true);
103 void serialize(std::ostream&
os)
const { vcl::serialize(
os,
name()); }
105 void deserialize(std::istream& is) { vcl::deserialize(is,
name()); }
122concept HasName = TB::IsDerivedFromSpecializationOfV<T, Name>;
126template<
typename ParentElemType,
bool OPT>
127template<
typename Element>
128void Name<ParentElemType, OPT>::importFrom(
const Element& e,
bool)
148bool isNameAvailableOn(
const auto& element)
A class representing a box in N-dimensional space.
Definition box.h:46
The Element class.
Definition element.h:75
The Name component class represents a simple name stored as string. This class is usually used as a c...
Definition name.h:67
Name()=default
Initilizes an empty name.
std::string & name()
Returns the name of this object.
Definition name.h:90
const std::string & name() const
Returns the name of this object.
Definition name.h:96
A concept that checks whether a type T (that should be a Mesh) has the Name component (inherits from ...
Definition name.h:122