17 #ifndef AGXPOWERLINE_CONNECTOR_H
18 #define AGXPOWERLINE_CONNECTOR_H
38 class PhysicalDimensionMultiBodyConstraintImplementation;
39 class ElementaryPhysicalDimensionConstraint;
306 virtual
bool postStore(
agxStream::StorageStream& str ) const;
307 virtual
bool postRestore(
agxStream::StorageStream& str);
338 bool isConstraintValid() const;
345 virtual
bool store(
agxStream::StorageStream& str) const override;
350 virtual
bool restore(
agxStream::StorageStream& str) override;
352 bool getIgnoreForStoreRestoreStream() const;
353 void setIgnoreForStoreRestoreStream(
bool ignore);
365 void setRatioDerivative(
agx::
Real ratioDerivative);
370 bool hasNonValidInputConnection() const;
371 bool hasNonValidOutputConnection() const;
#define AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE(T)
Use this in a pure abstract Serializable class to add the required methods Important: Use full namesp...
Links two connections together.
virtual bool connect(agxPowerLine::Unit *unit)
Connect a unit to this Connector.
agxPowerLine::ConnectionRefVector & getInputConnections()
return vector to all input connections from this connector
bool hasInputConnection(Connection *connection)
Find out if the connection belongs to this connector.
agxPowerLine::Connection * getInputConnection(size_t index)
return a specific input connection
const DimensionTypeVector & getTypes(agxPowerLine::Side side) const
int getNumOutputConnections() const
int getNumPossibleOutputConnections() const
bool getInputUnits(UnitPtrSetVector &units, const bool startFromCleanUnitSet=true)
PhysicalDimension * getInputDimension(const PhysicalDimension::Type dimensionType) const
agxPowerLine::Connection * findOutputConnection(const agxPowerLine::Unit *unit)
void setNumPossibleOutputConnections(int num)
Define number of output dimensions the constraint should handle.
PhysicalDimensionMultiBodyConstraintImplementation * m_constraint
bool getUnits(UnitConstPtrSetVector &units, const bool startFromCleanUnitSet=true) const
PhysicalDimension * getOutputDimension(const PhysicalDimension::Type dimensionType) const
int getNumPossibleInputConnections() const
virtual bool connect(agxPowerLine::Side mySide, agxPowerLine::Side unitSide, agxPowerLine::Unit *unit)
DimensionTypeVector m_outputTypes
static PhysicalDimension * getDimension(const ConnectionRefVector &connections, const PhysicalDimension::Type dimensionType)
const agxPowerLine::Connection * getInputConnection(size_t index) const
return a specific output connection
ConnectionRefVector m_outputConnections
bool hasFreeConnection() const
bool compareWithInputTypes(PhysicalDimensionRefVector &dimensions) const
const agxPowerLine::ConnectionRefVector & getOutputConnections() const
return vector to all output connections from this connector
const agxPowerLine::ConnectionRefVector & getInputConnections() const
return vector to all input connections from this connector
ConnectionRefVector m_inputConnections
virtual bool addNotification(agxSDK::Simulation *simulation) override
bool getUnits(UnitConstPtrSetVector &units, agxPowerLine::Side side, const bool startFromCleanUnitSet=true) const
const DimensionTypeVector & getInputTypes() const
const agxPowerLine::Connection * findInputConnection(const agxPowerLine::Unit *unit) const
agxPowerLine::Connection * getOutputConnection(size_t index)
return a specific input connection
bool hasOutputConnection(Connection *connection)
agx::Real getPowerOut() const
agx::Real m_ratioDerivative
int getNumConnections(agxPowerLine::Side side) const
agx::Real getPowerIn() const
bool hasFreeInputConnection() const
virtual bool disconnect(agxPowerLine::Unit *unit)
Disconnect the given unit from this Connector.
bool getOutputUnits(UnitPtrSetVector &units, const bool startFromCleanUnitSet=true)
agxPowerLine::Connection * findInputConnection(const agxPowerLine::Unit *unit)
int getNumFreeConnections() const
virtual bool disconnect()
bool getUnits(UnitPtrSetVector &units, const bool startFromCleanUnitSet=true)
int getNumFreeConnections(agxPowerLine::Side side) const
virtual bool connect(agxPowerLine::Unit *inputUnit, agxPowerLine::Side inputUnitSide, agxPowerLine::Side outputUnitSide, agxPowerLine::Unit *outputUnit)
void setNumPossibleInputConnections(int num)
Define number of input dimensions the constraint should handle.
bool m_ignoreMeForStoreRestoreStream
virtual void initConstraint()
const agxPowerLine::ConnectionRefVector & getConnections(agxPowerLine::Side side) const
const agxPowerLine::Connection * findOutputConnection(const agxPowerLine::Unit *unit) const
bool hasFreeConnection(agxPowerLine::Side side) const
bool getUnits(UnitPtrSetVector &units, agxPowerLine::Side side, const bool startFromCleanUnitSet=true)
virtual agx::Real calculateViolation() const
calculate violation for constraint
bool getInputUnits(UnitConstPtrSetVector &units, const bool startFromCleanUnitSet=true) const
const agxPowerLine::Connection * findConnection(const agxPowerLine::Unit *unit, agxPowerLine::Side side) const
int getNumFreeOutputConnections() const
int getNumConnections() const
virtual bool removeNotification(agxUtil::ConstraintHolder *holder, agxSDK::Simulation *simulation) override
remove connector and constraint from simulation
int getNumFreeInputConnections() const
Connector()
create a connector
const agxPowerLine::Connection * getOutputConnection(size_t index) const
return a specific output connection
const DimensionTypeVector & getOutputTypes() const
DimensionTypeVector m_inputTypes
bool hasFreeOutputConnection() const
agxPowerLine::Connection * findConnection(const agxPowerLine::Unit *unit, agxPowerLine::Side side)
bool getOutputUnits(UnitConstPtrSetVector &units, const bool startFromCleanUnitSet=true) const
bool compareWithOutputTypes(PhysicalDimensionRefVector &dimensions) const
agx::Real calculateEfficiency() const
calculate simulated efficiency
int getNumInputConnections() const
virtual agxPowerLine::Side getSide(const agxPowerLine::Unit *unit) const
agxPowerLine::ConnectionRefVector & getOutputConnections()
return vector to all output connections from this connector
Constraint implementation for constraining a number of physical dimensions of the same type.
PowerLine is the base class for a system of power transfer integrated into the rigid body simulation.
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Utility class to hold custom implementations of constraints.
This class is a combined container which has the find complexity of a HashTable, deterministic iterat...
Smart pointer for handling referenced counted objects.
#define DOXYGEN_END_INTERNAL_BLOCK()
#define DOXYGEN_START_INTERNAL_BLOCK()
AGXFMI_EXPORT InputVariable_Real * setDamping(agx::Constraint *constraint)
agxPowerLine contains a collection of connected components that transport power across a system.
agx::SetVector< Unit * > UnitPtrSetVector
agx::SetVector< Connector * > ConnectorPtrSetVector
agx::Vector< UnitRef > UnitRefVector
agx::Vector< ConnectorObserver > ConnectorObserverVector
agx::SetVector< const Unit * > UnitConstPtrSetVector
agx::SetVector< ConnectorRef > ConnectorRefSet
agx::Vector< ConnectorRef > ConnectorRefVector
agx::ref_ptr< Unit > UnitRef
agx::Vector< PhysicalDimension::Type > DimensionTypeVector
agx::Vector< Connector * > ConnectorPtrVector
agx::ref_ptr< Connector > ConnectorRef
This namespace contain classes for streaming classes into archives, ASCII, binary for storage (serial...
InputRef< T > in(const char *name, T &obj)
Create an object with a name and a reference to the object that should be restored (usually a pointer...
OutputRef< Serializable > out(const char *name, const Serializable *obj)
Return an object that contain the name and the object that should be serialized to an archive.
The agx namespace contains the dynamics/math part of the AGX Dynamics API.