23#ifndef VCL_MESH_COMPONENTS_COLOR_H
24#define VCL_MESH_COMPONENTS_COLOR_H
26#include "base/component.h"
27#include "base/predicates.h"
29#include <vclib/space/core.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);
107 void serialize(std::ostream&
os)
const {
color().serialize(
os); }
109 void deserialize(std::istream& is) {
color().deserialize(is); }
132concept HasColor = TB::IsDerivedFromSpecializationOfV<T, Color>;
149template<
typename ParentElemType,
bool OPT>
150template<
typename Element>
151void Color<ParentElemType, OPT>::importFrom(
const Element& e,
bool)
154 if (isColorAvailableOn(e)) {
173bool isColorAvailableOn(
const auto& element)
The Color class represents a 32 bit color.
Definition color.h:48
The Element class.
Definition element.h:75
A class representing a line segment in n-dimensional space. The class is parameterized by a PointConc...
Definition segment.h:41
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).
A concept that checks whether a type T (that should be a Element or a Mesh) has the Color component (...
Definition color.h:132
A concept that checks whether a type T (that should be a Element or a Mesh) has the Color component (...
Definition color.h:144
Evaluates to true if the type T is a component that is stored vertically in its element container,...
Definition component.h:74