AGX Dynamics 2.38.0.2
Loading...
Searching...
No Matches
ParticlePostProcessColorer.h
Go to the documentation of this file.
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 unless having a written signed agreement with Algoryx Simulation AB, or having been
9advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10valid commercial license from Algoryx Simulation AB.
11
12Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13from using this software, unless otherwise stated in written agreements with
14Algoryx Simulation AB.
15*/
16
17#ifndef AGXQT_PARTICLEPOSTPROCESSCOLORER_H
18#define AGXQT_PARTICLEPOSTPROCESSCOLORER_H
19
20#include <agx/PushDisableWarnings.h> // Disabling warnings. Include agx/PopDisableWarnings.h below!
21#include <osg/ref_ptr>
22#include <agx/PopDisableWarnings.h> // End of disabled warnings.
23
24#include <functional>
25#include <agxQt/export.h>
26#include <agx/Referenced.h>
27#include <agx/Bound.h>
28#include <agx/ParticleSystem.h>
29#include <agx/AnalysisBox.h>
31
32namespace agx
33{
34 class ParticleSystem;
35}
36
37namespace agxQt
38{
39 // Forward declaration
40 class ParticleColorer;
41
45 typedef std::function<ParticleColorer*()> ColorerConstructor;
55
61 {
62 public:
64 static const char* const COLORMODE_NONE_NAME;
65
66 public:
68
69 virtual void colorParticles(agx::ParticleSystem * system, bool limitBound, const agx::AnalysisBox* box, bool modifyAlpha) = 0;
70
71 virtual void initColorRange(agx::Real minScalar, agx::Real maxScalar);
72
73 agxOSG::ScalarColorMap* getColorMap() const;
74
75 agx::Name getName() const;
76
77 protected:
78 void applyColorFromMap( agx::Vec4f& targetColorData, agx::Real scalar, bool modifyAlpha );
79
80 protected:
81 virtual ~ParticleColorer() {};
82
84 // Variables
86 protected:
89 };
90
92
94
99
105 {
106 public:
108 public:
110
111 void setMaxScalar(agx::Real maxScalar);
112
113 void setMinScalar(agx::Real minScalar);
114
115 agx::Real getMaxScalar() const;
116
117 agx::Real getMinScalar() const;
118
119 void setAnalysisBox(const agx::AnalysisBox* analysisBox);
120
122
124
125 void addCustomColorMode(const agx::String& name, ParticleColorer::GetParticleRealFunc getRealFunc, const agx::String& unitString);
126
128
130
132
134
135 void setEnableModifyScalarFromAlpha(bool enable);
136
137 void setLimitInBound(bool limitInBound);
138
139 bool getLimitInBound() const;
140
141 protected:
143
145
147
149
151
153 // Variables
155 protected:
163 };
164
166
168
170
172
174
176
178
180
185 {
186 public:
188
189 virtual void colorParticles(agx::ParticleSystem * system, bool limitBound, const agx::AnalysisBox* box, bool modifyAlpha) override;
190
191 protected:
193 };
194
199 {
200 public:
202
203 virtual void colorParticles(agx::ParticleSystem * system, bool limitBound, const agx::AnalysisBox* box, bool modifyAlpha) override;
204
205 protected:
207 };
208
213 {
214 public:
216
217 virtual void colorParticles(agx::ParticleSystem * system, bool limitBound, const agx::AnalysisBox* box, bool modifyAlpha) override;
218
219 protected:
222 };
223
228 {
229 public:
231
232 virtual void colorParticles(agx::ParticleSystem * system, bool limitBound, const agx::AnalysisBox* box, bool modifyAlpha) override;
233
234 protected:
236 };
237
242 {
243 public:
245
246 virtual void colorParticles(agx::ParticleSystem * system, bool limitBound, const agx::AnalysisBox* box, bool modifyAlpha) override;
247
248 protected:
250
252 // Variables
254 protected:
257 };
258
263 {
264 public:
266
267 virtual void colorParticles(agx::ParticleSystem * system, bool limitBound, const agx::AnalysisBox* box, bool modifyAlpha) override;
268
269 protected:
271
273 // Variables
275 protected:
276 };
277
282 {
283 public:
285
286 virtual void colorParticles(agx::ParticleSystem * system, bool limitBound, const agx::AnalysisBox* box, bool modifyAlpha) override;
287
288 protected:
290
292 // Variables
294 protected:
296 };
297}
298
299#endif
#define AGX_DECLARE_POINTER_TYPES(type)
Definition Referenced.h:254
#define AGXQT_EXPORT
Class that represents a linear scalar color map that converts a scalar interval to a specified color ...
ParticleColorMode getActiveParticleColorMode() const
void addCustomColorMode(const agx::String &name, ParticleColorer::GetParticleRealFunc getRealFunc, const agx::String &unitString)
agx::HashTable< agx::Name, ParticleColorMode > ParticleColorModeTable
void colorParticles(agx::ParticleSystem *system)
void setParticleColorModeFromName(const agx::String &name)
agxOSG::ScalarColorMap * getColorMap() const
void setAnalysisBox(const agx::AnalysisBox *analysisBox)
bool shouldLimitColorToBound() const
bool particleColorModeExists(const agx::String &name)
ParticleColorModeTable m_particleColorModeTable
void setParticleColorMode(ParticleColorMode mode)
ParticleColorModeVector getAvailableParticleColorModes()
agxOSG::ScalarColorMapRef m_colorMap
static const char *const COLORMODE_NONE_NAME
virtual void colorParticles(agx::ParticleSystem *system, bool limitBound, const agx::AnalysisBox *box, bool modifyAlpha)=0
ParticleColorer(const agx::Name &name)
void applyColorFromMap(agx::Vec4f &targetColorData, agx::Real scalar, bool modifyAlpha)
std::function< agx::Real(agx::ParticleSystem *, agx::Physics::ParticlePtr)> GetParticleRealFunc
agxOSG::ScalarColorMap * getColorMap() const
virtual void initColorRange(agx::Real minScalar, agx::Real maxScalar)
Implements the particle post processor colorer for contact force.
virtual void colorParticles(agx::ParticleSystem *system, bool limitBound, const agx::AnalysisBox *box, bool modifyAlpha) override
Implements the particle post processor colorer for velocities.
agx::HashTable< agx::Index, agx::Vec3 > m_particleIdToPosition
virtual void colorParticles(agx::ParticleSystem *system, bool limitBound, const agx::AnalysisBox *box, bool modifyAlpha) override
Implements the particle post processor colorer for contact force.
virtual void colorParticles(agx::ParticleSystem *system, bool limitBound, const agx::AnalysisBox *box, bool modifyAlpha) override
ParticlePostPorcessColorerHeight(const agx::Name &name, const agx::Vec3 &heightAxis=agx::Vec3::Z_AXIS())
Implements the particle post processor colorer for velocities.
ParticlePostPorcessColorerLambda(const agx::Name &name, ParticleColorer::GetParticleRealFunc getRealFunc)
virtual void colorParticles(agx::ParticleSystem *system, bool limitBound, const agx::AnalysisBox *box, bool modifyAlpha) override
Implements the particle post processor colorer for contact force.
virtual void colorParticles(agx::ParticleSystem *system, bool limitBound, const agx::AnalysisBox *box, bool modifyAlpha) override
Implements the particle post processor colorer for velocities.
virtual void colorParticles(agx::ParticleSystem *system, bool limitBound, const agx::AnalysisBox *box, bool modifyAlpha) override
Implements the particle post processor colorer for velocities.
virtual void colorParticles(agx::ParticleSystem *system, bool limitBound, const agx::AnalysisBox *box, bool modifyAlpha) override
Class that can be used to extract data from elements in a simulation within a specified bound.
Definition AnalysisBox.h:33
Inheritance with partial specialization due to bug with ref_ptr containers.
Representation of a name string.
Definition Name.h:33
A basic particle system that contains all the storages and buffers required for basic operation and a...
Pointer to a entity instance of type Physics.Particle.
Base class providing referencing counted objects.
Definition Referenced.h:120
static Vec3T Z_AXIS()
A class holding 4 dimensional vectors and providing basic arithmetic.
Templated vector class.
Definition agx/Vector.h:53
#define AGX_FORCE_INLINE
Definition macros.h:58
Contains classes/utility functions for connecting AGX to QT with OSG.
agx::Vector< ParticleColorMode > ParticleColorModeVector
std::function< ParticleColorer *()> ColorerConstructor
ParticleColorMode.
ParticleColorMode AGXQT_EXPORT createNoneParticleColorMode()
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
double Real
Definition Real.h:42
bool operator==(const ParticleColorMode &rhs)