Views
Maps Package API Reference Guide
Product Documentation:
Views Documentation Home
List of all members | Public Member Functions
IlvProjectionDictionary Class Reference

Provides facilities to get the list of the implemented projections and to create projection instances by their names. More...

#include <ilviews/maps/projection/projdict.h>

Public Member Functions

 IlvProjectionDictionary (IlBoolean init=IlTrue)
 Initializes a new projection dictionary. More...
 
IlvProjectioncreateProjection (const char *name) const
 Creates a projection. More...
 
const char ** getProjectionNames (IlUInt &count) const
 Returns the array of the projection names that have been registered in the dictionary. More...
 
virtual void registerProjection (IlvProjectionClassInfo *pcInfo)
 Registers a new projection in the dictionary. More...
 
virtual IlBoolean unregisterProjection (IlvProjectionClassInfo *pcInfo)
 Unregisters a projection from the dictionary. More...
 

Detailed Description

Provides facilities to get the list of the implemented projections and to create projection instances by their names.

Library: ilvmaps

It can be used, for example, in the user interface of map applications to create a projection editor.

See also
IlvProjection, IlvProjectionClassInfo, IlvProjectionInterface.

Constructor & Destructor Documentation

◆ IlvProjectionDictionary()

IlvProjectionDictionary::IlvProjectionDictionary ( IlBoolean  init = IlTrue)

Initializes a new projection dictionary.

If the init argument is not used, or if it is passed with the value IlTrue, the dictionary is initialized with all the projections in the map library, and with all the projections that have been subclassed and that are linked to the application. Otherwise, it is initialized with an empty list of projections.

Parameters
initIf set to IlTrue, creates a dictionary with all the available projection. If set to IlFalse, creates an empty list.

Member Function Documentation

◆ createProjection()

IlvProjection* IlvProjectionDictionary::createProjection ( const char *  name) const

Creates a projection.

This method can return 0 if the projection class name is not registered in the dictionary. It is typically used to create a projection instance from a name selected by the end user in a string list or in a pop-up menu of a user interface.

Note
The projection name of a projection class is the name returned by the member function getProjectionName() of the ClassInfo() of a desired projection class. For example, the projection name for the IlvMercatorProjection class is "Mercator," and the projection name for the IlvUniversalTransverseMercator class is "Universal Transverse Mercator."
Parameters
nameThe projection name.

◆ getProjectionNames()

const char** IlvProjectionDictionary::getProjectionNames ( IlUInt count) const

Returns the array of the projection names that have been registered in the dictionary.

This method sets the number of projections that have been registered into the argument count. This function is typically used to initialize a pop-up menu or a string list with a list of available projections.

Warning
The returned array must be deleted by the user.
Parameters
countThe returned number of registered projections.
Returns
The array of projection names.

◆ registerProjection()

virtual void IlvProjectionDictionary::registerProjection ( IlvProjectionClassInfo pcInfo)
virtual

Registers a new projection in the dictionary.

Parameters
pcInfoThe IlvProjectionClassInfo of the projection to register.

◆ unregisterProjection()

virtual IlBoolean IlvProjectionDictionary::unregisterProjection ( IlvProjectionClassInfo pcInfo)
virtual

Unregisters a projection from the dictionary.

Note
The class information of a projection can be accessed via the member function IlvProjection::getClassInfo(), or via the static function ClassInfo().
Parameters
pcInfoThe IlvProjectionClassInfo of the projection to unregister.
Returns
IlTrue if the projection was registered, IlFalse otherwise.