AGXDynamics
2.35.0.2
CableDamageRenderer.h
Go to the documentation of this file.
1
/*
2
Copyright 2007-2022. Algoryx Simulation AB.
3
4
All AGX source code, intellectual property, documentation, sample code,
5
tutorials, scene files and technical white papers, are copyrighted, proprietary
6
and confidential material of Algoryx Simulation AB. You may not download, read,
7
store, distribute, publish, copy or otherwise disseminate, use or expose this
8
material unless having a written signed agreement with Algoryx Simulation AB, or having been
9
advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10
valid commercial license from Algoryx Simulation AB.
11
12
Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13
from using this software, unless otherwise stated in written agreements with
14
Algoryx Simulation AB.
15
*/
16
#pragma once
17
18
#include <
agxOSG/export.h
>
19
20
#include <
agxCable/CableDamage.h
>
21
22
#include <
agxSDK/StepEventListener.h
>
23
24
#include <
agx/Vector.h
>
25
#include <
agxOSG/Node.h
>
26
#include <
agxOSG/GeometryNode.h
>
27
28
#include <
agx/PushDisableWarnings.h
>
// Disabling warnings. Include agx/PopDisableWarnings.h below!
29
#include <osg/observer_ptr>
30
#include <
agx/PopDisableWarnings.h
>
// End of disabled warnings.
31
32
33
34
namespace
agxOSG
35
{
36
AGX_DECLARE_POINTER_TYPES
(
CableDamageRenderer
);
37
38
44
class
AGXOSG_EXPORT
CableDamageRenderer
:
public
agxSDK::StepEventListener
45
{
46
public
:
58
CableDamageRenderer
(
agxCable::CableDamage
* damage,
agx::Real
colorRangeMax, osg::Group*
root
);
59
60
void
renderCurrent();
61
void
renderAccumulated();
62
63
bool
isRenderingCurrent()
const
;
64
bool
isRenderingAccumulated()
const
;
65
72
void
setEnableRendering(
bool
enable);
73
74
78
bool
getEnableRendering()
const
;
79
84
agx::Real
getColorRangeMax()
const
;
85
92
void
setColorRangeMax(
agx::Real
colorRangeMax);
93
102
agxOSG::GeometryNode
* getOsgNode(
size_t
index);
103
108
virtual
void
last(
const
agx::Real
& timeStamp)
override
;
109
110
protected
:
111
virtual
~CableDamageRenderer
() {}
112
113
private
:
114
CableDamageRenderer
& operator=(
CableDamageRenderer
&) =
delete
;
115
116
private
:
117
agxCable::CableDamageRef
m_damage;
118
osg::observer_ptr<osg::Group> m_parent;
119
agx::Vector<osg::ref_ptr<GeometryNode>
> m_nodes;
120
agx::Real
m_colorRangeMax;
121
bool
m_renderAccumulatedInsteadOfCurrent;
122
};
123
124
}
agxCable::CableDamage
The CableDamage class is used to estimate damage caused to a cable during a simulation.
Definition:
CableDamage.h:57
agx::Real
double Real
Definition:
Real.h:42
Vector.h
agxSDK::StepEventListener
Derive from this class to implement a listener for simulation step events.
Definition:
StepEventListener.h:37
agx::Vector
Templated vector class.
Definition:
Vector.h:52
Node.h
StepEventListener.h
agxOSG::CableDamageRenderer::~CableDamageRenderer
virtual ~CableDamageRenderer()
Definition:
CableDamageRenderer.h:111
agx::ref_ptr< CableDamage >
agxOSG
The agxOSG namespace provides functionality for visualizing AGX simulations with OpenSceneGraph.
PushDisableWarnings.h
GeometryNode.h
agx::root
AGXCORE_EXPORT Component * root()
AGX_DECLARE_POINTER_TYPES
#define AGX_DECLARE_POINTER_TYPES(type)
Definition:
Referenced.h:248
export.h
CableDamage.h
agxOSG::CableDamageRenderer
Class that creates OSG rendering nodes for each segment of a cable and colors them with a color gradi...
Definition:
CableDamageRenderer.h:44
agxOSG::GeometryNode
A node that can be associated with a collision geometry so that the transformation of this node is up...
Definition:
GeometryNode.h:41
AGXOSG_EXPORT
#define AGXOSG_EXPORT
PopDisableWarnings.h
include
agxOSG
CableDamageRenderer.h
Generated on Mon Jan 30 2023 15:44:10 for AGXDynamics by
1.8.17