EnvironmentIO.XMLEnvironmentReader Class Reference

#include <class_environment_i_o_1_1_x_m_l_environment_reader.h>

Inheritance diagram for EnvironmentIO.XMLEnvironmentReader:
Inheritance graph
[legend]

List of all members.

Public Member Functions

  getConverters ()
  Override this method to supply feature data converters.
  to_v2008_XX ()
  Convert the old Double3 light colour to Double4.
  to_v2008_05 ()
  Convert initial environment by name -> by id.
  to_v2008_09 ()
  Convert envId to an absolute path based on the paths that are listed in the userPrefs.
  to_v2011_01 ()
  2011.01 Convert envId to an absolute path based on the paths that are listed in the userPrefs Before 2011_01 we used to have:
  read ()
  Override this method in derived classes.
  postRead ()
  Copy the envrionments that live in the companion directory to the working directory.

Member Function Documentation

EnvironmentIO.XMLEnvironmentReader.getConverters ( )

Override this method to supply feature data converters.

Return a tuple containing ( method, version ) pairs. The order in which you specify the pairs is important, that is the oldest converter must be listed first, and the most recent converter listed last.

The method must have the following signature:

def <some_name>( self, xmlData ): # Convert data to a particular version.

The version indicates when the data converter method is applied.

For example:

class YourFeatureReader( FeatureReader ):

def getConverters( self ): return ( ( self.convert_to_v2, theVersionManager[ VersionLabel.v2 ] ) , ( self.convert_to_v4, theVersionManager[ VersionLabel.v4 ] ) )

def convert_to_v2( self, xmlData ): # # Convert the given xml data to whatever is required # by version 2 of the application. # pass

def convert_to_v4( self, xmlData ): # # Convert the given xml data to whatever is required # by version 4 of the application. # # Note the convert_to_v2 converter will have already # been applied to the xmlData. # pass

Note that all necessary converters will be applied to bring the document data up to what's needed. That is if a version 1 file is opened then the v2 converter will be applied followed by the v4 converter. If a version 3 file is opened then only the v4 converter is applied. If a version 4 file is opened then no converters will need to be called.

Reimplemented from FeatureReader.FeatureReader.

EnvironmentIO.XMLEnvironmentReader.to_v2008_XX ( )

Convert the old Double3 light colour to Double4.

EnvironmentIO.XMLEnvironmentReader.to_v2008_05 ( )

Convert initial environment by name -> by id.

EnvironmentIO.XMLEnvironmentReader.to_v2008_09 ( )

Convert envId to an absolute path based on the paths that are listed in the userPrefs.

EnvironmentIO.XMLEnvironmentReader.to_v2011_01 ( )

2011.01 Convert envId to an absolute path based on the paths that are listed in the userPrefs Before 2011_01 we used to have:

<environments default="Empty\Empty.a3e" lib="Environments">

<environment src="Empty\Empty.a3e" name="Empty" lib="Environments" home="HOME"> .... {overrides} ..... </environment> .... </environments> We need to convert to the following (no overrides)

<environments default="Empty.a3e" id="Empty\Empty.a3e" lib="Environments"> <environment id="Empty\Empty.a3e" src="Empty.a3e" name="Empty" lib="Environments" image="Empty.tif" home="HOME"> </environment> ... </environments>

===> we need to convert original src attribute to id and new value for src.

EnvironmentIO.XMLEnvironmentReader.read ( )

Override this method in derived classes.

This method is responsible for populating the given document with the data provided in the given source. It should return True if the read was successful; False otherwise.

Reimplemented from FeatureReader.FeatureReader.

EnvironmentIO.XMLEnvironmentReader.postRead ( )

Copy the envrionments that live in the companion directory to the working directory.

Reimplemented from FeatureReader.FeatureReader.


EnvironmentIO.XMLEnvironmentReader EnvironmentIO.XMLEnvironmentReader EnvironmentIO.XMLEnvironmentReader EnvironmentIO.XMLEnvironmentReader EnvironmentIO.XMLEnvironmentReader EnvironmentIO.XMLEnvironmentReader EnvironmentIO.XMLEnvironmentReader EnvironmentIO.XMLEnvironmentReader EnvironmentIO.XMLEnvironmentReader EnvironmentIO.XMLEnvironmentReader
EnvironmentIO.XMLEnvironmentReader EnvironmentIO.XMLEnvironmentReader EnvironmentIO.XMLEnvironmentReader EnvironmentIO.XMLEnvironmentReader EnvironmentIO.XMLEnvironmentReader EnvironmentIO.XMLEnvironmentReader EnvironmentIO.XMLEnvironmentReader EnvironmentIO.XMLEnvironmentReader EnvironmentIO.XMLEnvironmentReader EnvironmentIO.XMLEnvironmentReader