AGXDynamics  2.35.0.3
CompositeRenderer.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_COMPOSITERENDERER_H
18 #define AGXOSG_COMPOSITERENDERER_H
19 
20 #include <agx/config/AGX_USE_COMPOSITE.h>
21 #include <agx/config.h>
22 
23 #if AGX_USE_COMPOSITE()
24 
26 #include <agxWire/Composite/MultiWire.h>
27 
28 namespace agxOSG
29 {
30  class AGXOSG_EXPORT CompositeRenderer : public agxSDK::StepEventListener
31  {
32  public:
38  CompositeRenderer( agxWire::Composite::MultiWire* wire, osg::Group* root );
39 
40  void setNumSegmentsPerUnitLength( agx::Real numSegmentsPerUnitLength );
41  void setColor( const agx::Vec4f& color );
42 
43  protected:
44  virtual ~CompositeRenderer() {}
45 
46  virtual void post(const agx::TimeStamp&);
47  virtual void removeNotification();
48 
49  protected:
50  void update();
51 
53  agxWire::Composite::MultiWireRef m_wire;
54  osg::ref_ptr< osg::Group > m_root;
55 
56  agx::Real m_segmentsPerUnitLength;
57  agx::Vec4f m_color;
58  };
59 
60  typedef agx::ref_ptr< CompositeRenderer > CompositeRendererRef;
61 }
62 
63 #endif
64 #endif // AGX_USE_COMPOSITE
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
agx::Vector
Templated vector class.
Definition: Vector.h:52
agx::Vec4T
A class holding 4 dimensional vectors and providing basic arithmetic.
Definition: Vec4Template.h:34
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.
agx::root
AGXCORE_EXPORT Component * root()
agx::TimeStamp
agx::Real TimeStamp
Definition: TimeStamp.h:26
SplineRendererOld.h
AGXOSG_EXPORT
#define AGXOSG_EXPORT