Fesapi 2.10.1.0
This project provides C++ classes which allow an easy access in import and export to the Energistics standards.
Loading...
Searching...
No Matches
AbstractColorMap.h
1/*-----------------------------------------------------------------------
2Licensed to the Apache Software Foundation (ASF) under one
3or more contributor license agreements. See the NOTICE file
4distributed with this work for additional information
5regarding copyright ownership. The ASF licenses this file
6to you under the Apache License, Version 2.0 (the
7"License"; you may not use this file except in compliance
8with the License. You may obtain a copy of the License at
9
10http://www.apache.org/licenses/LICENSE-2.0
11
12Unless required by applicable law or agreed to in writing,
13software distributed under the License is distributed on an
14"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15KIND, either express or implied. See the License for the
16specific language governing permissions and limitations
17under the License.
18-----------------------------------------------------------------------*/
19#pragma once
20
21#include "../common/AbstractObject.h"
22
23namespace RESQML2_NS
24{
26 class AbstractColorMap : public COMMON_NS::AbstractObject
27 {
28 public:
29 virtual ~AbstractColorMap() = default;
30
39 virtual DLL_IMPORT_OR_EXPORT void setHsvColors(uint64_t colorCount,
40 double const* hsvColors, double const* alphas = nullptr, double const* indices = nullptr,
41 std::vector<std::string> const& colorTitles = std::vector<std::string>()) = 0;
42
51 DLL_IMPORT_OR_EXPORT void setRgbColors(uint64_t colorCount,
52 double const* rgbColors, double const* alphas = nullptr,
53 double const* indices = nullptr, std::vector<std::string> const& colorTitles = std::vector<std::string>());
54
63 DLL_IMPORT_OR_EXPORT void setRgbColors(uint64_t colorCount,
64 uint8_t const* rgbColors, double const* alphas = nullptr,
65 double const* indices = nullptr, std::vector<std::string> const& colorTitles = std::vector<std::string>());
66
72 DLL_IMPORT_OR_EXPORT virtual uint64_t getColorCount() const = 0;
73
78 DLL_IMPORT_OR_EXPORT double getHue(uint64_t colorIndex) const;
79
84 DLL_IMPORT_OR_EXPORT double getSaturation(uint64_t colorIndex) const;
85
90 DLL_IMPORT_OR_EXPORT double getValue(uint64_t colorIndex) const;
91
96 DLL_IMPORT_OR_EXPORT double getAlpha(uint64_t colorIndex) const;
97
104 DLL_IMPORT_OR_EXPORT void getRgbColor(uint64_t colorIndex, double& red, double& green, double& blue) const;
105
112 DLL_IMPORT_OR_EXPORT void getRgbColor(uint64_t colorIndex, uint8_t& red, uint8_t& green, uint8_t& blue) const;
113
121 DLL_IMPORT_OR_EXPORT bool hasColorTitle(uint64_t colorIndex) const;
122
130 DLL_IMPORT_OR_EXPORT std::string getColorTitle(uint64_t colorIndex) const;
131
142 DLL_IMPORT_OR_EXPORT void setNullHsvColor(double hue, double saturation, double value, double alpha = 1, std::string const& colorTitle = "");
143
154 DLL_IMPORT_OR_EXPORT void setNullRgbColor(double red, double green, double blue, double alpha = 1, std::string const& colorTitle = "");
155
166 DLL_IMPORT_OR_EXPORT void setNullRgbColor(uint8_t red, uint8_t green, uint8_t blue, double alpha = 1, std::string const& colorTitle = "");
167
171 DLL_IMPORT_OR_EXPORT bool hasNullColor() const { return static_cast<gsoap_eml2_3::resqml22__ContinuousColorMap const*>(gsoapProxy2_3)->NullColor != nullptr; }
172
176 DLL_IMPORT_OR_EXPORT double getNullHue() const;
177
181 DLL_IMPORT_OR_EXPORT double getNullSaturation() const;
182
186 DLL_IMPORT_OR_EXPORT double getNullValue() const;
187
191 DLL_IMPORT_OR_EXPORT double getNullAlpha() const;
192
198 DLL_IMPORT_OR_EXPORT void getNullRgbColor(double& red, double& green, double& blue) const;
199
205 DLL_IMPORT_OR_EXPORT void getNullRgbColor(uint8_t& red, uint8_t& green, uint8_t& blue) const;
206
208
209 protected:
213 DLL_IMPORT_OR_EXPORT AbstractColorMap(gsoap_resqml2_0_1::eml20__DataObjectReference* partialObject) : COMMON_NS::AbstractObject(partialObject) {}
214
218 AbstractColorMap(gsoap_eml2_3::resqml22__AbstractColorMap* fromGsoap) : COMMON_NS::AbstractObject(fromGsoap) {}
219
224 AbstractColorMap() {}
225
226 private:
230 virtual gsoap_eml2_3::resqml22__HsvColor* getColor(uint64_t colorIndex) const = 0;
231 };
232}
Map of abstract colors.
Definition AbstractColorMap.h:27
void getRgbColor(uint64_t colorIndex, double &red, double &green, double &blue) const
virtual uint64_t getColorCount() const =0
Gets color count.
double getValue(uint64_t colorIndex) const
void getRgbColor(uint64_t colorIndex, uint8_t &red, uint8_t &green, uint8_t &blue) const
double getSaturation(uint64_t colorIndex) const
void setNullRgbColor(uint8_t red, uint8_t green, uint8_t blue, double alpha=1, std::string const &colorTitle="")
Sets the NullColor value of a continuous color map.
void getNullRgbColor(double &red, double &green, double &blue) const
double getNullAlpha() const
bool hasNullColor() const
checks if the color map has a definition for the color of Null values.
Definition AbstractColorMap.h:171
void setRgbColors(uint64_t colorCount, double const *rgbColors, double const *alphas=nullptr, double const *indices=nullptr, std::vector< std::string > const &colorTitles=std::vector< std::string >())
void setNullRgbColor(double red, double green, double blue, double alpha=1, std::string const &colorTitle="")
Sets the NullColor value of a continuous color map.
void setNullHsvColor(double hue, double saturation, double value, double alpha=1, std::string const &colorTitle="")
Sets the NullColor value of a continuous color map.
virtual void setHsvColors(uint64_t colorCount, double const *hsvColors, double const *alphas=nullptr, double const *indices=nullptr, std::vector< std::string > const &colorTitles=std::vector< std::string >())=0
void loadTargetRelationships()
Definition AbstractColorMap.h:207
void getNullRgbColor(uint8_t &red, uint8_t &green, uint8_t &blue) const
double getNullValue() const
double getNullHue() const
double getHue(uint64_t colorIndex) const
bool hasColorTitle(uint64_t colorIndex) const
Queries if 'colorIndex' has color title.
std::string getColorTitle(uint64_t colorIndex) const
Gets color title.
double getAlpha(uint64_t colorIndex) const
void setRgbColors(uint64_t colorCount, uint8_t const *rgbColors, double const *alphas=nullptr, double const *indices=nullptr, std::vector< std::string > const &colorTitles=std::vector< std::string >())
double getNullSaturation() const