VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | Private Member Functions
makVrv::DtScalingAlgorithmFactory Class Referenceabstract

DtScalingAlgorithmFactory provides a mechanism to register creators for and create different model scaling algorithms. More...

Inheritance diagram for makVrv::DtScalingAlgorithmFactory:
Inheritance graph
[legend]

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 DtScalingAlgorithmgetOrCreate (const std::string &name)=0
 If an instance the scaling algorithm exists, return it. More...
 
virtual const RegistrationMapscalingAlgorithmCreators () 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 DtScalingAlgorithmFactoryinstance (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

DtDemyDe
 
RegistrationMap myCreators
 

Private Member Functions

 DtScalingAlgorithmFactory ()
 Unimplemented Default constructor. More...
 
 DtScalingAlgorithmFactory (const DtScalingAlgorithmFactory &orig)
 Unimplemented Copy constructor. More...
 
DtScalingAlgorithmFactoryoperator= (const DtScalingAlgorithmFactory &rhs)
 Unimplemented assignment operator. More...
 

Detailed Description

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.

Member Typedef Documentation

Constructor & Destructor Documentation

makVrv::DtScalingAlgorithmFactory::DtScalingAlgorithmFactory ( DtDe de)

CTOR.

virtual makVrv::DtScalingAlgorithmFactory::~DtScalingAlgorithmFactory ( )
virtual

DTOR.

makVrv::DtScalingAlgorithmFactory::DtScalingAlgorithmFactory ( )
private

Unimplemented Default constructor.

makVrv::DtScalingAlgorithmFactory::DtScalingAlgorithmFactory ( const DtScalingAlgorithmFactory orig)
private

Unimplemented Copy constructor.

Member Function Documentation

static DtScalingAlgorithmFactory& makVrv::DtScalingAlgorithmFactory::instance ( DtDe de)
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 void makVrv::DtScalingAlgorithmFactory::registerInstance ( DtDe de,
DtScalingAlgorithmFactory anInstance 
)
static

Register an instance of a DtScalingAlgorithmFactory.

An instance must be registered before the instance() method may be called

virtual void makVrv::DtScalingAlgorithmFactory::registerCreator ( DtScalingAlgorithmCreator creator)
pure virtual

Register a scaling algorithm creator.

Implemented in makVrv::DtOsgScalingAlgorithmFactory.

virtual DtScalingAlgorithm* makVrv::DtScalingAlgorithmFactory::getOrCreate ( const std::string &  name)
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 const RegistrationMap& makVrv::DtScalingAlgorithmFactory::scalingAlgorithmCreators ( ) const
virtual

Get the map of registered creators.

DtScalingAlgorithmFactory& makVrv::DtScalingAlgorithmFactory::operator= ( const DtScalingAlgorithmFactory rhs)
private

Unimplemented assignment operator.

Member Data Documentation

DtDe& makVrv::DtScalingAlgorithmFactory::myDe
protected
RegistrationMap makVrv::DtScalingAlgorithmFactory::myCreators
protected

The documentation for this class was generated from the following file:

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)