AGX Dynamics 2.42.1.1
Loading...
Searching...
No Matches
PressureToColorConverter.h
Go to the documentation of this file.
1/*
2Copyright 2007-2025. 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
18#ifndef AGXOSG_PRESSURE_TO_COLOR_CONVERTER_H
19#define AGXOSG_PRESSURE_TO_COLOR_CONVERTER_H
20
21
22#include <agx/macros.h>
23#include <agx/Referenced.h>
24
25#include <agxOSG/export.h>
26#include <agx/PushDisableWarnings.h> // Disabling warnings. Include agx/PopDisableWarnings.h below!
27#include <osg/Image>
28#include <osgSim/ColorRange>
29#include <agx/PopDisableWarnings.h> // End of disabled warnings.
30namespace agxOSG
31{
32
33 class PressureAtlas;
34
37
39 {
40 public:
42 virtual void convert(bool dirty) = 0;
43
44 osg::Image* getPressureMap();
45 osg::Image* getColorMap();
46
47 protected:
49
50 protected:
51 osg::ref_ptr<osg::Image> m_pressureMap;
52 osg::ref_ptr<osg::Image> m_colorMap;
53 };
54
55
57
59 {
60 public:
61 PressureToRgbaConverter(PressureAtlas* atlas, osgSim::ColorRange* colorRange);
62 virtual void convert(bool dirty) override;
63
64 protected:
66
67 private:
68 osg::ref_ptr<osgSim::ColorRange> m_colorRange;
69 };
70
71
73
75 {
76 public:
77 GatherMaxPressure(PressureAtlas* atlas, osgSim::ColorRange* colorRange);
78 virtual void convert(bool) override;
79
81
82 void clear();
83
84 protected:
85 virtual ~GatherMaxPressure() {}
86
87 private:
88 osg::ref_ptr<osg::Image> m_pressureMap;
89 osg::ref_ptr<osg::Image> m_maxPressure;
90 };
91
92
94
96 {
97 public:
98 GatherAvgPressure(PressureAtlas* atlas, osgSim::ColorRange* colorRange);
99 virtual void convert(bool dirty) override;
100
102
103 void clear();
104
105 protected:
107
108 private:
109 osg::ref_ptr<osg::Image> m_pressureMap;
110 double* m_totalPressure;
111 osg::ref_ptr<osg::Image> m_avgPressure;
112 size_t m_numSamples;
113 };
114
115}
116#endif
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
#define AGXOSG_EXPORT
#define AGX_DECLARE_VECTOR_TYPES(type)
Definition: agx/Vector.h:34
GatherAvgPressure(PressureAtlas *atlas, osgSim::ColorRange *colorRange)
virtual void convert(bool dirty) override
virtual void convert(bool) override
GatherMaxPressure(PressureAtlas *atlas, osgSim::ColorRange *colorRange)
A pressure map for a single trimesh.
Definition: PressureAtlas.h:44
PressureToColorConverter(agxOSG::PressureAtlas *atlas)
virtual void convert(bool dirty)=0
osg::ref_ptr< osg::Image > m_pressureMap
osg::ref_ptr< osg::Image > m_colorMap
PressureToRgbaConverter(PressureAtlas *atlas, osgSim::ColorRange *colorRange)
virtual void convert(bool dirty) override
Base class providing referencing counted objects.
Definition: Referenced.h:120
The agxOSG namespace provides functionality for visualizing AGX simulations with OpenSceneGraph.