AGX Dynamics 2.42.1.1
Loading...
Searching...
No Matches
agxOSG/PressureFieldRenderer.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#ifndef AGXOSG_PRESSUREFIELDRENDERER_H
18#define AGXOSG_PRESSUREFIELDRENDERER_H
19
20#include <agxOSG/export.h>
21
23
24#include <agx/Referenced.h>
25#include <agx/Vec4.h>
26
28#include <osg/Array>
29#include <osg/PrimitiveSet>
30#include <osg/Geometry>
32
33#include <mutex>
34
35namespace osg
36{
37 class Group;
38}
39
40namespace agxCollide
41{
42 class Mesh;
43}
44
45namespace agxOSG
46{
48
50 {
51 public:
56 PressureFieldRenderer( osg::Group* root, agx::Real scale = agx::Real( 1 ) );
57
58 virtual void addTriangle( const agxModel::TriangleData& tData, const agx::AffineMatrix4x4& worldToShape ) override;
59 virtual void clear() override;
60 virtual void done() override;
61 virtual void updateTransform( const agx::AffineMatrix4x4& shapeToWorld ) override;
62
63 protected:
65
66 private:
67 osg::ref_ptr<osg::FloatArray> m_heightsArray;
68 osg::ref_ptr<osg::FloatArray> m_pressureArray;
69 osg::ref_ptr<osg::Vec3Array> m_vertices;
70 osg::ref_ptr<osg::Vec3Array> m_normals;
71 osg::ref_ptr<osg::DrawArrays> m_primitiveSet;
72 osg::ref_ptr<osg::Geometry> m_geometry;
73 osg::ref_ptr<osg::MatrixTransform> m_transform;
74 agx::UInt m_activeVertices;
75 float m_maxPressure;
76 std::mutex m_mutex;
77 };
78}
79
80#endif
81
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
#define AGXOSG_EXPORT
virtual void clear() override
On clear.
virtual void done() override
On done.
virtual void updateTransform(const agx::AffineMatrix4x4 &shapeToWorld) override
Called when the shape transform may have been updated.
virtual void addTriangle(const agxModel::TriangleData &tData, const agx::AffineMatrix4x4 &worldToShape) override
On add triangle.
PressureFieldRenderer(osg::Group *root, agx::Real scale=agx::Real(1))
Construct given root node, base color and a scale of the mesh (to have it a bit larger/smaller than t...
This namespace consists of a set of classes for handling geometric intersection tests including boole...
The agxOSG namespace provides functionality for visualizing AGX simulations with OpenSceneGraph.
uint64_t UInt
Definition: Integer.h:27
double Real
Definition: Real.h:41
Triangle data for a normal or a clipped triangle.