AGX Dynamics 2.42.3.1
Loading...
Searching...
No Matches
SubGraph.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#pragma once
18
19#include <agxModel/export.h>
20#include <agx/Constraint.h>
21
22namespace agx
23{
24 class RigidBody;
25}
26
27namespace agxPowerLine
28{
29 class PowerLine;
30 class PhysicalDimension;
31 class Connector;
32 class Unit;
33
36
41}
42
43namespace agxUtil
44{
45 class ConstraintHolder;
46}
47
48namespace agxPowerLine
49{
50
53
54
59 {
60 public:
61
63
68 void setName(const agx::Name& name);
69
73 const agx::Name& getName() const;
74
77
82
87
89 const Unit* getEnclosingUnit() const;
90
93
97 bool isEnclosedWithin(const SubGraph* component) const;
98
104
109 virtual void getUnitsRecursive(UnitPtrVector& units);
110
111
112 // Methods called by the rest of the PowerLine frame work.
113 public:
114
115 virtual bool addNotification(agxSDK::Simulation* simulation) = 0;
116
117 virtual void prepareForStore();
118 virtual void prepareForRestore();
119
120
124
125
127
138 virtual bool preUpdate(agx::Real timeStep);
139 virtual bool postUpdate(agx::Real timeStep);
140
144 virtual bool store(agxStream::StorageStream& str) const;
145
150
152 virtual void restore(agxStream::InputArchive& in) override;
153 virtual void store(agxStream::OutputArchive& out) const override;
154
155 protected:
156 virtual ~SubGraph();
157
160
163
165
166 protected:
172 };
173}
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
#define AGXMODEL_EXPORT
#define AGX_DECLARE_VECTOR_TYPES(type)
Definition: agx/Vector.h:34
Links two connections together.
Definition: Connector.h:53
PowerLine is the base class for a system of power transfer integrated into the rigid body simulation.
Definition: PowerLine.h:66
virtual void prepareForStore()
bool isEnclosedWithin(const SubGraph *component) const
const Unit * getEnclosingUnit() const
AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE(agxPowerLine::SubGraph)
void addInternalUnit(agxPowerLine::Unit *unit)
const agx::Name & getName() const
SubGraphObserver m_enclosingGraph
Definition: SubGraph.h:167
virtual bool preUpdate(agx::Real timeStep)
const agxPowerLine::ConnectorRefVector & getInternalConnectors() const
virtual void store(agxStream::OutputArchive &out) const override
virtual bool restore(agxStream::StorageStream &str)
Restores internal data from stream.
const agxPowerLine::UnitRefVector & getInternalUnits() const
virtual void getUnitsRecursive(UnitPtrVector &units)
Fill the given vector with the Units that are held by this SubGraph.
ConnectorRefVector m_internalConnectors
Definition: SubGraph.h:169
const SubGraph * getRootEnclosingGraph() const
const Connector * getEnclosingConnector() const
void setName(const agx::Name &name)
Set the name of this power line component.
virtual void restore(agxStream::InputArchive &in) override
virtual void getConnectorsRecursive(ConnectorPtrVector &connectors)
Fill the given vector with the Connectors that are held by this SubGraph.
void removeInternalConnector(agxPowerLine::Connector *connector)
virtual bool removeNotification(agxUtil::ConstraintHolder *holder, agxSDK::Simulation *simulation)=0
PowerLine * m_powerLine
Definition: SubGraph.h:170
SubGraph * getEnclosingGraph()
virtual bool postUpdate(agx::Real timeStep)
const SubGraph * getEnclosingGraph() const
SubGraph * getRootEnclosingGraph()
Connector * getEnclosingConnector()
void addInternalConnector(agxPowerLine::Connector *connector)
UnitRefVector m_internalUnits
Definition: SubGraph.h:168
void removeInternalUnit(agxPowerLine::Unit *unit)
agx::Bool replaceInternalUnit(agxPowerLine::Unit *oldUnit, agxPowerLine::Unit *newUnit)
virtual bool store(agxStream::StorageStream &str) const
Stores internal data into stream.
virtual void prepareForRestore()
virtual bool addNotification(agxSDK::Simulation *simulation)=0
Pure virtual class.
Definition: Unit.h:72
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:131
Class for reading a binary stream of serialized data.
Definition: InputArchive.h:51
Class for writing serialized data in binary format to a stream.
Definition: OutputArchive.h:57
This class is an abstract base class for all classes that can be stored and retrieved from an Archive...
Definition: Serializable.h:44
Abstract base class for storing/restoring a line/drums with version control.
Definition: StorageStream.h:49
Utility class to hold custom implementations of constraints.
Definition: agxUtil.h:523
Representation of a name string.
Definition: Name.h:33
Base class providing referencing counted objects.
Definition: Referenced.h:120
Templated vector class.
Definition: agx/Vector.h:53
Smart pointer for handling referenced counted objects.
Definition: ref_ptr.h:30
agxPowerLine contains a collection of connected components that transport power across a system.
Definition: MotorUnit.h:24
agx::Vector< UnitRef > UnitRefVector
Definition: Connector.h:46
agx::Vector< ConnectorRef > ConnectorRefVector
Definition: Connector.h:405
agx::ref_ptr< Unit > UnitRef
Definition: Connector.h:45
agx::Vector< Connector * > ConnectorPtrVector
Definition: Connector.h:401
agx::ref_ptr< Connector > ConnectorRef
Definition: Connector.h:404
agx::Vector< Unit * > UnitPtrVector
The agxUtil namespace contain classes and methods for utility functionality.
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
bool Bool
Definition: Integer.h:40
double Real
Definition: Real.h:41