228 SINGLETON_CLASSNAME_METHOD()
Links two connections together.
Each type of physical dimension handled by the power line has to have a unique name.
void clearStoredPhysicalDimensionIds()
Clear the stored-to-current type ID mappings so that future PowerLine restores doesn't accidentally u...
void setStoredPhysicalDimensionId(int currentId, int previousId)
Used while preparing power line for being restored.
agx::HashVector< int, int > m_storeRestoreIdTranslator
DimensionNameIdTable::iterator findIndex(int index)
int getDimensionType(std::string name)
agx::HashTable< DimTypePair, ConnectorFactory > ConnectorFactoryTable
int getStoredPhysicalDimensionId(int currentId)
Usable during restore of power line to map between indices in PhysicalDimension::m_dimensions.
virtual ~PowerLineController()
bool getPowerLines(agxSDK::Simulation *simulation, PowerLinePtrVector &powerLines)
agx::HashTable< agxSDK::Simulation *, PowerLinesHandlerRef > SimulationPowerLinesHash
bool addPhysicalDimension(std::string name)
Add a named physical dimension.
std::function< Connector *()> ConnectorFactory
static PowerLineController * instance()
agxPowerLine::Connector * createConnector(agxPowerLine::PhysicalDimension::Type inputType, agxPowerLine::PhysicalDimension::Type outputType) const
agxPowerLine::PhysicalDimension::Type getNumberOfPhysicalDimensions()
agx::HashTable< std::string, int > DimensionNameIdTable
void replaceIndexWhenRestoring(std::string name, int index)
agx::SymmetricPair< agxPowerLine::PhysicalDimension::Type > DimTypePair
bool hasStoredDimensionsMappings() const
Return true if mappings for stored dimensions IDs has been configured.
virtual void shutdown() override
Implement this method to cleanup your Singleton class.
int getCurrentPhysicalDimensionId(int storedId)
Converts a stored PhysicalDimension type ID to the corresponding ID for the current PowerLineControll...
SimulationPowerLinesHash m_powerLinesInSimulation
std::string getDimensionTypeName(size_t id)
void registerDefaultConnector(agxPowerLine::PhysicalDimension::Type inputType, agxPowerLine::PhysicalDimension::Type outputType, ConnectorFactory connectorCreator)
void remove(agxPowerLine::Connector *connector)
static bool isInitialized()
DimensionNameIdTable m_nameIdTable
void add(agxPowerLine::Connector *connector)
The PowerLineController is in charge of keeping reference pointers to connectors that are created but...
ConnectorFactoryTable m_connectorFactories
PowerLine is the base class for a system of power transfer integrated into the rigid body simulation.
A PowerLinesHandler is a collection of PowerLines that are part of the same agxSDK::Simulation.
void addPowerLine(agxPowerLine::PowerLine *powerLine)
Called from the PowerLine's addNotification, via the PowerLineController, when a PowerLine has been a...
virtual void post(const agx::TimeStamp &time) override
Called after a step is taken in the simulation Implement this method in the derived class to get call...
const agxPowerLine::PowerLineRefVector & getPowerLines()
Provides read access to the list of PowerLines that are part of this PowerLinesHandler.
virtual void pre(const agx::TimeStamp &time) override
Called before a step is taken in the simulation Implement this method in the derived class to get cal...
void removePowerLine(agxPowerLine::PowerLine *powerLine)
Called from the PowerLine's removeNotification, via the PowerLineController, when a PowerLine has bee...
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Derive from this class to implement a listener for simulation step events.
This class is a combined container which has the find complexity of a HashTable, deterministic iterat...
Inheritance with partial specialization due to bug with ref_ptr containers.
Base class for Singletons that should have its shutdown called explicitly before exit of the applicat...
A std::pair, with both elements of the same type, and symmetric so (a, b) == (b, a)
Vector containing 'raw' data.
Smart pointer for handling referenced counted objects.
agxPowerLine contains a collection of connected components that transport power across a system.
agx::ref_ptr< PowerLinesHandler > PowerLinesHandlerRef