AGX Dynamics  2.37.3.2
agxOSG/Node.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_NODE_H
18 #define AGXOSG_NODE_H
19 
20 #include <agxOSG/export.h>
21 
22 #include <agx/PushDisableWarnings.h> // Disabling warnings. Include agx/PopDisableWarnings.h below!
23 #include <osg/Group>
24 #include <osg/MatrixTransform>
25 #include <osg/Texture2D>
26 #include <agxOSG/SceneDecorator.h>
27 #include <agx/PopDisableWarnings.h> // End of disabled warnings.
28 #include <agx/Vec3.h>
29 #include <agx/AffineMatrix4x4.h>
30 
31 
32 
33 namespace agxOSG
34 {
35 
37  public:
38  Texture2D(osg::Texture2D *texture) : m_texture(texture) {}
39 
40  operator osg::Texture2D* () { return m_texture.get(); }
41  operator const osg::Texture2D* () const { return m_texture.get(); }
42 
43  osg::Texture2D *getTexture() { return m_texture.get(); }
44 
45  protected:
46  virtual ~Texture2D() {}
47 
48  osg::ref_ptr<osg::Texture2D> m_texture;
49  };
50 
51 
52  class GeometryNode;
53 
54 
55 
56 
57  class AGXOSG_EXPORT Transform : public osg::MatrixTransform
58  {
59  public:
60  Transform();
61  void setName( const std::string& name );
62  bool addChild( osg::Node *child );
63  bool addChild( agxOSG::GeometryNode *child );
64  void setMatrix( const agx::AffineMatrix4x4& m);
65  void setScale( const agx::Vec3& scale );
66  protected:
67  virtual ~Transform();
68 
69  };
70 }
71 #endif
#define AGXOSG_EXPORT
osg::ref_ptr< osg::Texture2D > m_texture
Definition: agxOSG/Node.h:48
osg::Texture2D * getTexture()
Definition: agxOSG/Node.h:43
Base class providing referencing counted objects.
Definition: Referenced.h:119
Texture2D(osg::Texture2D *texture)
Definition: agxOSG/Node.h:38
virtual ~Texture2D()
Definition: agxOSG/Node.h:46
The agxOSG namespace provides functionality for visualizing AGX simulations with OpenSceneGraph.
A node that can be associated with a collision geometry so that the transformation of this node is up...
Definition: GeometryNode.h:41