Momentum Scripting v1
Loading...
Searching...
No Matches
ScalarColorMap.h
1/*
2Copyright 2007-2024. Algoryx Simulation AB.
3
4All AGX source code, intellectual property, documentation, sample code,
5tutorials, scene files and technical white papers, are copyrighted, proprietary
6and confidential material of Algoryx Simulation AB. You may not download, read,
7store, distribute, publish, copy or otherwise disseminate, use or expose this
8material without having a written signed agreement with Algoryx Simulation AB.
9
10Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
11from using this software, unless otherwise stated in written agreements with
12Algoryx Simulation AB.
13*/
14
15#pragma once
16
17#include "momentum_export.h"
18#include "momentum_namespace.h"
19
20#include "macros.h"
21#include "Vec4.h"
22
23#include <vector>
24
25#include <memory>
26#include <agx/ref_ptr.h>
27
28#ifndef SWIG
30#include <agxOSG/ScalarColorMap.h>
31
33#endif
34
35namespace MOMENTUM_NAMESPACE
36{
39 class MOMENTUM_EXPORT ScalarColorMap
40 {
41 public:
42#ifndef SWIG
44
48 ScalarColorMap(agxOSG::ScalarColorMap* scalarColorMap);
50
55#endif
56
61 {
72 AFMHOT
73 };
74
75#ifndef AGX_MOMENTUM_ANALYSIS_API
76
87 double minScalar,
88 double maxScalar);
89
95 void setColorsFromPreset(ColorRangePreset colorRangePreset);
96#endif
97
104 Vec4 getColor(double scalar, bool modifyAlpha = false) const;
105
106#ifndef AGX_MOMENTUM_ANALYSIS_API
113 void setMinScalar(double minScalar);
114
121 void setMaxScalar(double maxScalar);
122
130 void setScalarInterval(double minScalar, double maxScalar);
131
132 /*
133 Manually set the colors used in the interpolation range.
134 \param colorVector - a vector containing the specified colors of the interval.
135 */
136 void setColors(const std::vector<Vec4>& colorVector);
137#endif
138
142 double getMinScalar() const;
143
147 double getMaxScalar() const;
148
152 std::vector<Vec4> getColors() const;
153
154 private:
155 // static agxRender::ColorVector* toRenderColorVec(const std::vector<Vec4>& colorVector);
156
157#ifndef SWIG
159 agx::ref_ptr<agxOSG::ScalarColorMap> m_scalarColorMap;
160 agxOSG::ScalarColorMap* getAGXScalarColorMap() const;
162#endif
163 };
164
165 V1_DECLARE_CONTAINER_TYPE(ScalarColorMap);
166} // namespace momentum
167
Definition: ScalarColorMap.h:40
ColorRangePreset
Enum representation of predefined color ranges than can be set in the class.
Definition: ScalarColorMap.h:61
@ RAINBOW
Definition: ScalarColorMap.h:62
@ CIVIDIS
Definition: ScalarColorMap.h:69
@ BONE
Definition: ScalarColorMap.h:70
@ COOLWARM
Definition: ScalarColorMap.h:63
@ INFERNO
Definition: ScalarColorMap.h:65
@ VIRIDIS
Definition: ScalarColorMap.h:64
@ COPPER
Definition: ScalarColorMap.h:71
@ PLASMA
Definition: ScalarColorMap.h:66
@ BLUE_WHITE_RED
Definition: ScalarColorMap.h:68
@ GRAYSCALE
Definition: ScalarColorMap.h:67
std::vector< Vec4 > getColors() const
ScalarColorMap()
Default constructor.
void setColorsFromPreset(ColorRangePreset colorRangePreset)
Set a range of colors from an available color range preset in the class.
void setMaxScalar(double maxScalar)
Set the maximum scalar of the interval.
ScalarColorMap(double minScalar, double maxScalar)
Constructor.
void setScalarInterval(double minScalar, double maxScalar)
Set the scalars of the interval used in the color interpolation.
Vec4 getColor(double scalar, bool modifyAlpha=false) const
Get an agx representation of a color value in the map given a scalar inside the interval.
void setColors(const std::vector< Vec4 > &colorVector)
void setMinScalar(double minScalar)
Set the min scalar of the interval.
A 4 dimensional vector and contains basic arithmetic.
Definition: Vec4.h:33
Namespace for Momentum Scripting API.
Definition: AffineMatrix4x4.h:29