AGX Dynamics 2.42.3.1
Loading...
Searching...
No Matches
ComponentVisitor.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 AGX_COMPONENTVISITOR_H
18#define AGX_COMPONENTVISITOR_H
19
20#include <agx/Callback.h>
21
22#ifdef _MSC_VER
23# pragma warning(push)
24# pragma warning(disable: 4251) // warning C4251: class X needs to have dll-interface to be used by clients of class Y
25#endif
26
27
28namespace agx
29{
30
31 class Object;
32 class Component;
33
38 {
39 public:
40 virtual void visit( agx::Object* ) {}
41 virtual void visit( agx::Component* comp );
42 virtual ~ComponentVisitor() {}
43 };
44
49 {
50 public:
52
54
55 virtual void visit( agx::Object* obj );
56 virtual void visit( agx::Component* comp );
57
59
60 private:
61 TraverseCallback m_callback;
62 };
63}
64
65
66#ifdef _MSC_VER
67# pragma warning(pop)
68#endif
69
70
71#endif
72
#define AGXCORE_EXPORT
Templated callback with one argument.
Definition: Callback.h:101
ComponentVisitor which applies a callback function on each visited node.
virtual void visit(agx::Object *obj)
virtual void visit(agx::Component *comp)
CallbackComponentVisitor(TraverseCallback callback)
Callback1< Object * > TraverseCallback
Base class for ComponentVisitors.
virtual void visit(agx::Object *)
virtual void visit(agx::Component *comp)
A component is an object containing other objects, enabling hierarchical structuring.
Definition: Component.h:39
agx::Object is a refcounted object with a name.
Definition: Object.h:59
The agx namespace contains the dynamics/math part of the AGX Dynamics API.