AGX Dynamics  2.37.3.2
SplineRendererOld.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2024. 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 
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 
27 #include <agx/agx_vector_types.h>
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 
35 namespace agxCollide
36 {
37  class Geometry;
38 }
39 
40 namespace 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 
110  agx::Vec4f getColor() const;
111 
112  virtual void removeNotification();
113 
114  protected:
115  virtual ~SplineRendererOld() {}
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
CylinderGeometryShaderRef m_splineGeometry
#define AGXOSG_EXPORT
osg::ref_ptr< osg::Group > m_node
Derive from this class to implement a listener for simulation step events.
agx::RealVector m_redShiftScales
Values from 0 to 1 how red the color of the node is (0 default color, 1 red color, redShiftScale.size == spline->getNumPoints())
This namespace consists of a set of classes for handling geometric intersection tests including boole...
A class holding 4 dimensional vectors and providing basic arithmetic.
Definition: Vec4Template.h:34
const agx::RealVector & getRedShiftScales() const
agx::Real TimeStamp
Definition: TimeStamp.h:26
void setRadius(agx::Real radius)
Assign new radius of the cylinder segments.
agxUtil::Spline * getSplineModel()
agx::Real getNumSegmentsPerUnitLength() const
The agxOSG namespace provides functionality for visualizing AGX simulations with OpenSceneGraph.
agx::RealVector & getRedShiftScales()
agxUtil::SplineRef m_spline
agx::ref_ptr< SplineRendererOld > SplineRendererOldRef
agx::Real getRadius() const
void setSplineModel(agxUtil::Spline *spline)
Assign spline model.
osg::ref_ptr< CylinderGeometryShader > CylinderGeometryShaderRef
double Real
Definition: Real.h:42
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...
AGXCORE_EXPORT Component * root()
Base class for splines.
Definition: Spline.h:31
const agxUtil::Spline * getSplineModel() const
void setNumSegmentsPerUnitLength(agx::Real segmentsPerUnitLength)
Assign how many cylinder segments that should be used per unit length.