Fesapi  2.0.0.0
This project provides C++ classes which allow an easy access in import and export to the Energistics standards.
AbstractColorMap.h
1 /*-----------------------------------------------------------------------
2 Licensed to the Apache Software Foundation (ASF) under one
3 or more contributor license agreements. See the NOTICE file
4 distributed with this work for additional information
5 regarding copyright ownership. The ASF licenses this file
6 to you under the Apache License, Version 2.0 (the
7 "License"; you may not use this file except in compliance
8 with the License. You may obtain a copy of the License at
9 
10 http://www.apache.org/licenses/LICENSE-2.0
11 
12 Unless required by applicable law or agreed to in writing,
13 software distributed under the License is distributed on an
14 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 KIND, either express or implied. See the License for the
16 specific language governing permissions and limitations
17 under the License.
18 -----------------------------------------------------------------------*/
19 #pragma once
20 
21 #include "../common/AbstractObject.h"
22 
23 namespace 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(unsigned int colorCount,
40  double const* hsvColors, double const* alphas = nullptr, std::vector<std::string> const& colorTitles = std::vector<std::string>(),
41  double const* indices = nullptr) = 0;
42 
51  DLL_IMPORT_OR_EXPORT void setRgbColors(unsigned int colorCount,
52  double const* rgbColors, double const* alphas = nullptr, std::vector<std::string> const& colorTitles = std::vector<std::string>(),
53  double const* indices = nullptr);
54 
63  DLL_IMPORT_OR_EXPORT void setRgbColors(unsigned int colorCount,
64  unsigned int const* rgbColors, double const* alphas = nullptr, std::vector<std::string> const& colorTitles = std::vector<std::string>(),
65  double const* indices = nullptr);
66 
72  virtual DLL_IMPORT_OR_EXPORT unsigned int getColorCount() const = 0;
73 
78  DLL_IMPORT_OR_EXPORT double getHue(double colorIndex) const;
79 
84  DLL_IMPORT_OR_EXPORT double getSaturation(double colorIndex) const;
85 
90  DLL_IMPORT_OR_EXPORT double getValue(double colorIndex) const;
91 
96  DLL_IMPORT_OR_EXPORT double getAlpha(double colorIndex) const;
97 
104  DLL_IMPORT_OR_EXPORT void getRgbColor(double colorIndex, double& red, double& green, double& blue) const;
105 
112  DLL_IMPORT_OR_EXPORT void getRgbColor(double colorIndex, unsigned int& red, unsigned int& green, unsigned int& blue) const;
113 
121  DLL_IMPORT_OR_EXPORT bool hasColorTitle(double colorIndex) const;
122 
130  DLL_IMPORT_OR_EXPORT std::string getColorTitle(double colorIndex) const;
131 
133 
134  private:
138  virtual gsoap_eml2_3::resqml22__HsvColor* getColor(double colorIndex) const = 0;
139 
140  protected:
144  DLL_IMPORT_OR_EXPORT AbstractColorMap(gsoap_resqml2_0_1::eml20__DataObjectReference* partialObject) : COMMON_NS::AbstractObject(partialObject) {}
145 
149  AbstractColorMap(gsoap_eml2_3::resqml22__AbstractColorMap* fromGsoap) : COMMON_NS::AbstractObject(fromGsoap) {}
150 
155  AbstractColorMap() {}
156  };
157 }
Map of abstract colors.
Definition: AbstractColorMap.h:27
double getHue(double colorIndex) const
double getAlpha(double colorIndex) const
bool hasColorTitle(double colorIndex) const
Queries if 'colorIndex' has color title.
double getValue(double colorIndex) const
std::string getColorTitle(double colorIndex) const
Gets color title.
double getSaturation(double colorIndex) const
void getRgbColor(double colorIndex, double &red, double &green, double &blue) const
void loadTargetRelationships()
Definition: AbstractColorMap.h:132
void setRgbColors(unsigned int colorCount, double const *rgbColors, double const *alphas=nullptr, std::vector< std::string > const &colorTitles=std::vector< std::string >(), double const *indices=nullptr)
void setRgbColors(unsigned int colorCount, unsigned int const *rgbColors, double const *alphas=nullptr, std::vector< std::string > const &colorTitles=std::vector< std::string >(), double const *indices=nullptr)
virtual void setHsvColors(unsigned int colorCount, double const *hsvColors, double const *alphas=nullptr, std::vector< std::string > const &colorTitles=std::vector< std::string >(), double const *indices=nullptr)=0
virtual unsigned int getColorCount() const =0
Gets color count.
void getRgbColor(double colorIndex, unsigned int &red, unsigned int &green, unsigned int &blue) const