|
AGX Dynamics 2.42.3.1
|
Each type of physical dimension handled by the power line has to have a unique name. More...
#include <PowerLineController.h>
Inheritance diagram for agxPowerLine::PowerLineController:Public Types | |
| typedef std::function< Connector *()> | ConnectorFactory |
Public Types inherited from agx::Singleton | |
| enum | Priority { HIGHEST_PRIORITY = 2147483647 , LOWEST_PRIORITY = 10000 , DEFAULT_PRIORITY = 1073741824 } |
| Specifies the ranges of the priority which can be assigned to a singleton at the time of creation. More... | |
Public Member Functions | |
| void | add (agxPowerLine::Connector *connector) |
| The PowerLineController is in charge of keeping reference pointers to connectors that are created but not added to the simulation yet. | |
| bool | addPhysicalDimension (std::string name) |
| Add a named physical dimension. | |
| void | clearStoredPhysicalDimensionIds () |
| Clear the stored-to-current type ID mappings so that future PowerLine restores doesn't accidentally use stored IDs from the previous restore. | |
| agxPowerLine::Connector * | createConnector (agxPowerLine::PhysicalDimension::Type inputType, agxPowerLine::PhysicalDimension::Type outputType) const |
| int | getCurrentPhysicalDimensionId (int storedId) |
| Converts a stored PhysicalDimension type ID to the corresponding ID for the current PowerLineController. | |
| int | getDimensionType (std::string name) |
| std::string | getDimensionTypeName (size_t id) |
| agxPowerLine::PhysicalDimension::Type | getNumberOfPhysicalDimensions () |
| bool | getPowerLines (agxSDK::Simulation *simulation, PowerLinePtrVector &powerLines) |
| int | getStoredPhysicalDimensionId (int currentId) |
| Usable during restore of power line to map between indices in PhysicalDimension::m_dimensions. | |
| bool | hasStoredDimensionsMappings () const |
| Return true if mappings for stored dimensions IDs has been configured. | |
| void | registerDefaultConnector (agxPowerLine::PhysicalDimension::Type inputType, agxPowerLine::PhysicalDimension::Type outputType, ConnectorFactory connectorCreator) |
| void | remove (agxPowerLine::Connector *connector) |
| void | setStoredPhysicalDimensionId (int currentId, int previousId) |
| Used while preparing power line for being restored. | |
Public Member Functions inherited from agx::Singleton | |
| Singleton (int priority=DEFAULT_PRIORITY) | |
| Default constructor. | |
| virtual std::string | getClassName () const =0 |
| int | getPriority () const |
| Return the shutdown priority of the singleton instance. | |
| virtual void | shutdown ()=0 |
| Implement this method to cleanup your Singleton class. | |
Static Public Member Functions | |
| static PowerLineController * | instance () |
| static bool | isInitialized () |
Protected Types | |
| typedef agx::HashTable< DimTypePair, ConnectorFactory > | ConnectorFactoryTable |
| typedef agx::HashTable< std::string, int > | DimensionNameIdTable |
| typedef agx::SymmetricPair< agxPowerLine::PhysicalDimension::Type > | DimTypePair |
| typedef agx::HashTable< agxSDK::Simulation *, PowerLinesHandlerRef > | SimulationPowerLinesHash |
Protected Member Functions | |
| PowerLineController () | |
| virtual | ~PowerLineController () |
| DimensionNameIdTable::iterator | findIndex (int index) |
| void | replaceIndexWhenRestoring (std::string name, int index) |
| virtual void | shutdown () override |
| Implement this method to cleanup your Singleton class. | |
Protected Member Functions inherited from agx::Singleton | |
| virtual | ~Singleton () |
| Destructor. | |
| void | _shutdown () |
Each type of physical dimension handled by the power line has to have a unique name.
When a physical dimension object is created its unique name will be indexed and hashed in the power line dimension name singleton.
The indices could as well be a pre defined enum. But then each new implementation of a physical dimension would have to be added to the enum and AGX would have to be recompiled.
Using this approach a user with only the agx binaries and .h files can add his own physical dimension.
Definition at line 88 of file PowerLineController.h.
| typedef std::function<Connector*()> agxPowerLine::PowerLineController::ConnectorFactory |
Definition at line 91 of file PowerLineController.h.
|
protected |
Definition at line 223 of file PowerLineController.h.
|
protected |
Definition at line 204 of file PowerLineController.h.
|
protected |
Definition at line 222 of file PowerLineController.h.
|
protected |
Definition at line 219 of file PowerLineController.h.
|
protected |
|
protectedvirtual |
| void agxPowerLine::PowerLineController::add | ( | agxPowerLine::Connector * | connector | ) |
The PowerLineController is in charge of keeping reference pointers to connectors that are created but not added to the simulation yet.
This is needed since ConnectOperations creates default connectors that are hidden to the user.
| bool agxPowerLine::PowerLineController::addPhysicalDimension | ( | std::string | name | ) |
Add a named physical dimension.
(introduce it to the name singleton and the simulation).
| void agxPowerLine::PowerLineController::clearStoredPhysicalDimensionIds | ( | ) |
Clear the stored-to-current type ID mappings so that future PowerLine restores doesn't accidentally use stored IDs from the previous restore.
| agxPowerLine::Connector * agxPowerLine::PowerLineController::createConnector | ( | agxPowerLine::PhysicalDimension::Type | inputType, |
| agxPowerLine::PhysicalDimension::Type | outputType | ||
| ) | const |
|
protected |
| int agxPowerLine::PowerLineController::getCurrentPhysicalDimensionId | ( | int | storedId | ) |
Converts a stored PhysicalDimension type ID to the corresponding ID for the current PowerLineController.
If no mapping has been registered for the given ID then agx::InvalidIndex is returned.
| storedId | A PhysicalDimension type ID read from a serialization. |
| int agxPowerLine::PowerLineController::getDimensionType | ( | std::string | name | ) |
| std::string agxPowerLine::PowerLineController::getDimensionTypeName | ( | size_t | id | ) |
| agxPowerLine::PhysicalDimension::Type agxPowerLine::PowerLineController::getNumberOfPhysicalDimensions | ( | ) |
| bool agxPowerLine::PowerLineController::getPowerLines | ( | agxSDK::Simulation * | simulation, |
| PowerLinePtrVector & | powerLines | ||
| ) |
| int agxPowerLine::PowerLineController::getStoredPhysicalDimensionId | ( | int | currentId | ) |
Usable during restore of power line to map between indices in PhysicalDimension::m_dimensions.
If there is no mapping then agx::InvalidIndex is returned.
| currentId | - The id for the physical dimension in this simulation. |
| bool agxPowerLine::PowerLineController::hasStoredDimensionsMappings | ( | ) | const |
|
static |
|
static |
| void agxPowerLine::PowerLineController::registerDefaultConnector | ( | agxPowerLine::PhysicalDimension::Type | inputType, |
| agxPowerLine::PhysicalDimension::Type | outputType, | ||
| ConnectorFactory | connectorCreator | ||
| ) |
| void agxPowerLine::PowerLineController::remove | ( | agxPowerLine::Connector * | connector | ) |
|
protected |
| void agxPowerLine::PowerLineController::setStoredPhysicalDimensionId | ( | int | currentId, |
| int | previousId | ||
| ) |
Used while preparing power line for being restored.
| currentId | - the id for the physical dimension in this simulation |
| previousId | - the id for the physical dimension in the restored simulation |
|
overrideprotectedvirtual |
Implement this method to cleanup your Singleton class.
Implements agx::Singleton.
|
protected |
Definition at line 224 of file PowerLineController.h.
|
protected |
Definition at line 216 of file PowerLineController.h.
|
protected |
Definition at line 220 of file PowerLineController.h.
|
protected |
Definition at line 217 of file PowerLineController.h.