tsc_CustomProjectionType

SCAPI allows the addition of custom projection types.  Inherit from this abstract base class to create a factory-object that creates instances of your custom projection.

Once the required methods have been implemented you can register an instance of this object with Survey Core by calling the static RegisterCustomProjectionType method during your tsc_InitializePlugin function.  SurveyCore will take ownership of the object and use it to create and load instances of the projection for the lifespan of the SurveyCore session; this lifespan may be both before and after the main plugin application has started and finished respectively - please do not assume that other UI code in your plugin will have been initialised or currently runnable.

If this registration is successful, users will be able to access your projection type and use it natively within SurveyCore.  Coordinate system details (of your choosing) will be stored in the job and exported in formats that are modern enough to be aware of this feature (i.e. JXL v5.61+).

In cases where the format is unable to represent the custom projection feature or when your plugin is unavailable to implement the stored custom projection, the projection load will result in a 'No Projection-No Datum' coordinate system.

Abstract methods

virtual tsc_String DisplayName() const;

You must supply a tsc_String representing the projection type, this name is for display to the user and could be translated from a PX_Code, e.g. "Transverse Mercator".

virtual tsc_String JxlName() const;

You must supply an untranslated (constant) string for representing the projection type in formats such as Jxl, e.g. "Trimble_ExampleApp_TransverseMercatorProjection".

The string should be unique and could include things like the company name, a GUID, or a version.  It is possible that several applications could share a common custom projection type.

virtual tsc_CustomProjection* CreateNewProjection() const;

Create a new instance of the derived projection type, SurveyCore will take ownership of the allocated projection.  It is useful to set any parameters to the default values at this stage.

virtual tsc_CustomProjection* LoadProjection (const tsc_XmlElement& jxlSource) const;

Create a new instance of the derived projection based on the JXL from the database.

Static methods

static bool RegisterCustomProjectionType(tsc_CustomProjectionType* instance, const char* licenseGuid);

Registers your custom projection type with SurveyCore.  Call this in your tsc_InitializePlugin function.

SurveyCore will take ownership of the instance pointer.  Your translated DisplayName must be unique amongst the existing projection names or the function will fail.

You must also pass in a GUID representing a valid license, typically this is your application GUID.  If this license is missing or not valid then the registration will fail.