23#ifndef VCL_MESH_COMPONENTS_NAME_H
24#define VCL_MESH_COMPONENTS_NAME_H
26#include "bases/component.h"
28#include <vclib/concepts/mesh/components/name.h>
29#include <vclib/misc/string.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)
108 void serialize(std::ostream& os)
const { vcl::serialize(os,
name()); }
110 void deserialize(std::istream& is) { vcl::deserialize(is,
name()); }
127bool isNameAvailableOn(
const ElementOrMeshConcept
auto& element)
129 return isComponentAvailableOn<CompId::NAME>(element);
The Element class.
Definition element.h:57
A class representing a line segment in n-dimensional space. The class is parameterized by a PointConc...
Definition segment.h:43
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
HasName concept is satisfied only if a Element or Mesh class provides the member functions specified ...
Definition name.h:40