AGXDynamics  2.35.0.2
SplineRendererOld.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 
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;
127  agxUtil::SplineRef m_spline;
129 
134  };
135 
137 }
138 
139 #endif
agxOSG::SplineRendererOld::m_numSegmentsPerUnitLength
agx::Real m_numSegmentsPerUnitLength
Definition: SplineRendererOld.h:133
agx::Real
double Real
Definition: Real.h:42
agxSDK::StepEventListener
Derive from this class to implement a listener for simulation step events.
Definition: StepEventListener.h:37
agxOSG::SplineRendererOld::last
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...
Definition: SplineRendererOld.h:120
agxOSG::SplineRendererOld::m_splineGeometry
CylinderGeometryShaderRef m_splineGeometry
Definition: SplineRendererOld.h:128
CylinderGeometryShader.h
agxOSG::SplineRendererOld::getSplineModel
const agxUtil::Spline * getSplineModel() const
Definition: SplineRendererOld.h:77
agxOSG::SplineRendererOld::getRadius
agx::Real getRadius() const
Definition: SplineRendererOld.h:88
agxOSG::SplineRendererOld::m_redShiftScales
agx::RealVector m_redShiftScales
Values from 0 to 1 how red the color of the node is (0 default color, 1 red color,...
Definition: SplineRendererOld.h:130
agx::Vec4T
A class holding 4 dimensional vectors and providing basic arithmetic.
Definition: Vec4Template.h:34
Node.h
StepEventListener.h
agx::VectorPOD< Real >
agxOSG::SplineRendererOld::getRedShiftScales
agx::RealVector & getRedShiftScales()
Definition: SplineRendererOld.h:122
agxOSG::SplineRendererOld::getNumSegmentsPerUnitLength
agx::Real getNumSegmentsPerUnitLength() const
Definition: SplineRendererOld.h:99
agx::ref_ptr
Smart pointer for handling referenced counted objects.
Definition: ref_ptr.h:29
agxOSG
The agxOSG namespace provides functionality for visualizing AGX simulations with OpenSceneGraph.
PushDisableWarnings.h
agxOSG::SplineRendererOld::m_spline
agxUtil::SplineRef m_spline
Definition: SplineRendererOld.h:127
agxOSG::SplineRendererOld::getSplineModel
agxUtil::Spline * getSplineModel()
Definition: SplineRendererOld.h:76
agxOSG::SplineRendererOld::setRadius
void setRadius(agx::Real radius)
Assign new radius of the cylinder segments.
Definition: SplineRendererOld.h:83
agx::root
AGXCORE_EXPORT Component * root()
agxCollide
This namespace consists of a set of classes for handling geometric intersection tests including boole...
Definition: ContactForceFilterParticipant.h:22
agx::TimeStamp
agx::Real TimeStamp
Definition: TimeStamp.h:26
agxOSG::SplineRendererOld::~SplineRendererOld
virtual ~SplineRendererOld()
Definition: SplineRendererOld.h:115
agxOSG::SplineRendererOldRef
agx::ref_ptr< SplineRendererOld > SplineRendererOldRef
Definition: SplineRendererOld.h:136
agxOSG::SplineRendererOld::m_node
osg::ref_ptr< osg::Group > m_node
Definition: SplineRendererOld.h:126
export.h
agxOSG::SplineRendererOld::getRedShiftScales
const agx::RealVector & getRedShiftScales() const
Definition: SplineRendererOld.h:123
agxOSG::SplineRendererOld::setNumSegmentsPerUnitLength
void setNumSegmentsPerUnitLength(agx::Real segmentsPerUnitLength)
Assign how many cylinder segments that should be used per unit length.
Definition: SplineRendererOld.h:94
agxOSG::SplineRendererOld
Definition: SplineRendererOld.h:43
agxOSG::SplineRendererOld::m_radius
agx::Real m_radius
Definition: SplineRendererOld.h:132
agxOSG::CylinderGeometryShaderRef
osg::ref_ptr< CylinderGeometryShader > CylinderGeometryShaderRef
Definition: CylinderGeometryShader.h:106
agx_vector_types.h
AGXOSG_EXPORT
#define AGXOSG_EXPORT
Spline.h
PopDisableWarnings.h
agxOSG::SplineRendererOld::setSplineModel
void setSplineModel(agxUtil::Spline *spline)
Assign spline model.
Definition: SplineRendererOld.h:71