AGX Dynamics 2.42.3.0
Loading...
Searching...
No Matches
SplineRendererOld.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_SPLINERENDERER_OLD_H
18#define AGXOSG_SPLINERENDERER_OLD_H
19
20
21#include <agxOSG/export.h>
22
23#include <agxUtil/Spline.h>
24
26
28
29#include <agx/PushDisableWarnings.h> // Disabling warnings. Include agx/PopDisableWarnings.h below!
30#include <agxOSG/Node.h>
31#include <osg/Geometry>
33#include <agx/PopDisableWarnings.h> // End of disabled warnings.
34
35namespace agxCollide
36{
37 class Geometry;
38}
39
40namespace agxOSG
41{
42
44 {
45 public:
53 SplineRendererOld( agxUtil::Spline* spline, osg::Group* root );
54
58 virtual void update();
59
65 virtual void update( const agx::RealVector& radiiVector );
66
71 void setSplineModel( agxUtil::Spline* spline ) { m_spline = spline; }
72
76 agxUtil::Spline* getSplineModel() { return m_spline; }
77 const agxUtil::Spline* getSplineModel() const { return m_spline; }
78
83 void setRadius( agx::Real radius ) { m_radius = radius; }
84
88 agx::Real getRadius() const { return m_radius; }
89
94 void setNumSegmentsPerUnitLength( agx::Real segmentsPerUnitLength ) { m_numSegmentsPerUnitLength = segmentsPerUnitLength; }
95
99 agx::Real getNumSegmentsPerUnitLength() const { return m_numSegmentsPerUnitLength; }
100
105 void setColor( const agx::Vec4f& color );
106
111
112 virtual void removeNotification();
113
114 protected:
116
117 virtual void addNotification();
118
119 void initialize( osg::Group* root );
120 virtual void last( const agx::TimeStamp& ) { update(); }
121
122 agx::RealVector& getRedShiftScales() { return m_redShiftScales; }
123 const agx::RealVector& getRedShiftScales() const { return m_redShiftScales; }
124
125 protected:
126 osg::ref_ptr< osg::Group > m_node;
129
134 };
135
137}
138
139#endif
#define AGXOSG_EXPORT
virtual void removeNotification()
Called when this listener is removed from the simulation.
const agxUtil::Spline * getSplineModel() const
virtual void addNotification()
Called when this listener is added to the simulation.
agxUtil::Spline * getSplineModel()
virtual void update(const agx::RealVector &radiiVector)
Use this update if this spline has variable radii.
osg::ref_ptr< osg::Group > m_node
void setSplineModel(agxUtil::Spline *spline)
Assign spline model.
virtual void update()
Given the current spline control points, data will be pushed for new update.
const agx::RealVector & getRedShiftScales() const
agx::Real getRadius() const
SplineRendererOld(agxUtil::Spline *spline, osg::Group *root)
Construct spline (geometry shader) renderer.
agx::RealVector m_redShiftScales
Values from 0 to 1 how red the color of the node is (0 default color, 1 red color,...
agx::Vec4f getColor() const
void setNumSegmentsPerUnitLength(agx::Real segmentsPerUnitLength)
Assign how many cylinder segments that should be used per unit length.
CylinderGeometryShaderRef m_splineGeometry
agx::RealVector & getRedShiftScales()
agxUtil::SplineRef m_spline
void initialize(osg::Group *root)
agx::Real getNumSegmentsPerUnitLength() const
void setColor(const agx::Vec4f &color)
Assign color to this spline.
void setRadius(agx::Real radius)
Assign new radius of the cylinder segments.
virtual void last(const agx::TimeStamp &)
Called after a step is taken in the simulation Implement this method in the derived class to get call...
Derive from this class to implement a listener for simulation step events.
Base class for splines.
Definition: Spline.h:32
A class holding 4 dimensional vectors and providing basic arithmetic.
Definition: Vec4Template.h:35
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.
osg::ref_ptr< CylinderGeometryShader > CylinderGeometryShaderRef
agx::ref_ptr< SplineRendererOld > SplineRendererOldRef
double Real
Definition: Real.h:41
agx::Real TimeStamp
Definition: TimeStamp.h:26