![]() |
VR-Forces 4.10 Class Documentation
|
DtScalingAlgorithmFactory provides a mechanism to register creators for and create different model scaling algorithms. More...

Public Types | |
| typedef boost::unordered_map < std::string, DtScalingAlgorithmCreator * > | RegistrationMap |
Public Member Functions | |
| DtScalingAlgorithmFactory (DtDe &de) | |
| CTOR. More... | |
| virtual | ~DtScalingAlgorithmFactory () |
| DTOR. More... | |
| virtual void | registerCreator (DtScalingAlgorithmCreator *creator)=0 |
| Register a scaling algorithm creator. More... | |
| virtual DtScalingAlgorithm * | getOrCreate (const std::string &name)=0 |
| If an instance the scaling algorithm exists, return it. More... | |
| virtual const RegistrationMap & | scalingAlgorithmCreators () const |
| Get the map of registered creators. More... | |
Public Member Functions inherited from makVrv::DtVirtualBaseClass | |
| DtVirtualBaseClass () | |
| Do nothing constructor. More... | |
| virtual | ~DtVirtualBaseClass () |
| Virtual do nothing destructor. More... | |
Static Public Member Functions | |
| static DtScalingAlgorithmFactory & | instance (DtDe &de) |
| Get an instance of the DtScalingAlgorithmFactory. More... | |
| static void | registerInstance (DtDe &de, DtScalingAlgorithmFactory *anInstance) |
| Register an instance of a DtScalingAlgorithmFactory. More... | |
Protected Attributes | |
| DtDe & | myDe |
| RegistrationMap | myCreators |
Private Member Functions | |
| DtScalingAlgorithmFactory () | |
| Unimplemented Default constructor. More... | |
| DtScalingAlgorithmFactory (const DtScalingAlgorithmFactory &orig) | |
| Unimplemented Copy constructor. More... | |
| DtScalingAlgorithmFactory & | operator= (const DtScalingAlgorithmFactory &rhs) |
| Unimplemented assignment operator. More... | |
DtScalingAlgorithmFactory provides a mechanism to register creators for and create different model scaling algorithms.
The algorithm types are specified by a string (which is returned from the scaling implementation). Since the scaling algorithms themselves operate without the need for member variables (other than holding initial values for scale factor and max scale factor), all relevant functions are const; and scaling algorithm instances can be shared amongst different threads; so there is no need to delete and recreate them each time they are needed. Hence factory implementations are expected to cache instances of each type when requested, and only delete those instances on exit, or if a different creator is registered for an existing cached instance. Since the scaling algorithms themselves are vrvOsg-specific, this caching management needs to happen in the vrvOsg-specific implementation (see DtOsgScalingAlgorithmFactory). The map of current creators can be accessed, with each registered creator able to provide the type of scaling it implements and a display name for that scale type, which may be used to create and manage the list of scaling algorithms that users may choose.
| typedef boost::unordered_map<std::string, DtScalingAlgorithmCreator*> makVrv::DtScalingAlgorithmFactory::RegistrationMap |
| makVrv::DtScalingAlgorithmFactory::DtScalingAlgorithmFactory | ( | DtDe & | de | ) |
CTOR.
|
virtual |
DTOR.
|
private |
Unimplemented Default constructor.
|
private |
Unimplemented Copy constructor.
|
static |
Get an instance of the DtScalingAlgorithmFactory.
Note that an implementation must be registered first (the vrvOsg plugin registers a DtOsgScalingAlgorithmFactory instance). This method will throw DtCorruptedState if no instance is available
|
static |
Register an instance of a DtScalingAlgorithmFactory.
An instance must be registered before the instance() method may be called
|
pure virtual |
Register a scaling algorithm creator.
Implemented in makVrv::DtOsgScalingAlgorithmFactory.
|
pure virtual |
If an instance the scaling algorithm exists, return it.
Otherwise create a new one, cache it, and return that.
Implemented in makVrv::DtOsgScalingAlgorithmFactory.
|
virtual |
Get the map of registered creators.
|
private |
Unimplemented assignment operator.
|
protected |
|
protected |