23#ifndef VCL_MESH_COMPONENTS_COLOR_H
24#define VCL_MESH_COMPONENTS_COLOR_H
26#include "bases/component.h"
28#include <vclib/concepts/mesh/components/color.h>
29#include <vclib/space/core/color.h>
57template<
typename ParentElemType =
void,
bool OPT = false>
60 Color<ParentElemType, OPT>,
64 !std::is_same_v<ParentElemType, void>,
67 using Base = Component<
72 !std::is_same_v<ParentElemType, void>,
104 template<
typename Element>
105 void importFrom(
const Element& e,
bool =
true)
108 if (isColorAvailableOn(e)) {
114 void serialize(std::ostream& os)
const {
color().serialize(os); }
116 void deserialize(std::istream& is) {
color().deserialize(is); }
133bool isColorAvailableOn(
const ElementOrMeshConcept
auto& element)
135 return isComponentAvailableOn<CompId::COLOR>(element);
The Color class represents a 32 bit color.
Definition color.h:48
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 Color class represents a RGBA color that will be part of an Element (e.g. Vertex,...
Definition color.h:66
vcl::Color & color()
Returns a reference pf the color of the element.
Definition color.h:100
const vcl::Color & color() const
Returns a const reference of the color of the element.
Definition color.h:94
Color()=default
Initilizes the color to black (with alpha 255).
HasColor concept is satisfied only if a Element/Mesh class provides the types and member functions sp...
Definition color.h:47