ToolMap
Loading...
Searching...
No Matches
tmExportData Class Reference

Parent class for exporting data. More...

#include <tmexportdata.h>

Inheritance diagram for tmExportData:
tmExportDataSHP

Public Member Functions

 tmExportData ()
 Constructor.
 
 tmExportData (DataBaseTM *database)
 Constructor.
 
void Create (DataBaseTM *database)
 Creator.
 
 ~tmExportData ()
 destructor
 
int GetSizeOfObjDesc (int layerindex)
 Getting size of Object Desc column.
 
wxString GetFileExtension ()
 Return extension without the leading dot.
 
void SetExportAttributEnumeration (bool useAttributCode)
 
bool DoExportAttributEnumerationCode ()
 
virtual bool CreateEmptyExportFile (ProjectDefMemoryLayers *myLayer, const wxString &path)
 
virtual bool CreatePrjFile (ProjectDefMemoryLayers *myLayer, const wxString &path, PRJDEF_PROJ_TYPE proj)
 
virtual bool AddOptFields (const PrjMemFieldArray &myfields)
 
virtual bool AddGenericFields (int iSize)
 
virtual bool AddFIDField ()
 
virtual void SetFrame (wxRealPoint *points, int nbvertex)
 
virtual bool WriteLines (ProjectDefMemoryLayers *myLayer)
 
virtual bool WritePoints (ProjectDefMemoryLayers *myLayer)
 
virtual bool WritePolygons (ProjectDefMemoryLayers *myLayer)
 
virtual bool WriteLabels (ProjectDefMemoryLayers *myLayer)
 
virtual long WriteConcatGeometries (ProjectDefMemoryLayers *layer, wxProgressDialog *progDlg, tmPercent *percent)
 
virtual bool AddConcatAttributs (ProjectDefMemoryLayers *layer, PrjDefMemManage *projdef, long loop, wxProgressDialog *progDlg, tmPercent *percent)
 
virtual bool SetAttributsBasic (DataBaseResult &results)
 
virtual bool SetAttributsAdvanced (DataBaseResult &results, ProjectDefMemoryLayers *layer)
 
virtual bool GetPolyExportInfo (ProjectDefMemoryLayers *layer, bool usefastexport)
 
virtual bool CreateSpatialIndex (ProjectDefMemoryLayers *layer)
 
virtual bool HasFeatures ()
 
virtual void SetEmptyLayer ()
 
virtual bool DeleteLayer (ProjectDefMemoryLayers *layer, const wxString &path)
 
void SetCropBufferDistance (double value)
 
double GetCropBufferDistance ()
 
void SetOverwrite (bool value)
 
bool DoOverwrite ()
 

Protected Member Functions

wxFileName * GetFileName (ProjectDefMemoryLayers *myLayer, const wxString &path)
 Create a file name.
 
wxFileName * GetFileNamePrj (ProjectDefMemoryLayers *myLayer, const wxString &path)
 Create a prj file name.
 
int GetSizeOfEnum (const PrjMemFieldCodedValArray &mCodedVal)
 Get the max size of the items stored into array.
 
bool GetSimpleAttribData (PRJDEF_LAYERS_TYPE layertype, long layerindex)
 Process query for getting simple attributs.
 
bool GetSimpleAttribDataWithSpatial (PRJDEF_LAYERS_TYPE layertype, long layerindex)
 Process query for getting simple attributs and spatial data.
 
bool GetAdvancedAttribution (ProjectDefMemoryLayers *layer)
 Process the query for getting advanced values from database.
 
virtual bool SetPolyExportInfo (ProjectDefMemoryLayers *layer)
 

Protected Attributes

DataBaseTMm_pDB
 
wxString m_Extension
 
bool m_Overwrite
 
bool m_EmptyLayer
 

Detailed Description

Parent class for exporting data.

This class is used by the tmExportManager to abstract the access to the data and to allow us to implement new export format

Author
Lucien Schreiber (c) CREALP 2008
Date
14 November 2008

Constructor & Destructor Documentation

◆ tmExportData() [1/2]

tmExportData::tmExportData ( )

Constructor.

Use tmExportData::Create() for two step initialization

Author
Lucien Schreiber (c) CREALP 2008
Date
14 November 2008

◆ tmExportData() [2/2]

tmExportData::tmExportData ( DataBaseTM database)

Constructor.

Parameters
databaseA valid DataBaseTM object (an assert is done in debug mode)
Author
Lucien Schreiber (c) CREALP 2008
Date
14 November 2008

◆ ~tmExportData()

tmExportData::~tmExportData ( )

destructor

Author
Lucien Schreiber (c) CREALP 2008
Date
14 November 2008

Member Function Documentation

◆ AddFIDField()

virtual bool tmExportData::AddFIDField ( )
inlinevirtual

Reimplemented in tmExportDataSHP.

◆ AddGenericFields()

virtual bool tmExportData::AddGenericFields ( int  iSize)
inlinevirtual

Reimplemented in tmExportDataSHP.

◆ AddOptFields()

virtual bool tmExportData::AddOptFields ( const PrjMemFieldArray &  myfields)
inlinevirtual

Reimplemented in tmExportDataSHP.

◆ Create()

void tmExportData::Create ( DataBaseTM database)

Creator.

For two step initialization. In case of use of the default constructor

Parameters
databaseA valid DataBaseTM object (an assert is done in debug mode)
Author
Lucien Schreiber (c) CREALP 2008
Date
14 November 2008

◆ CreateEmptyExportFile()

virtual bool tmExportData::CreateEmptyExportFile ( ProjectDefMemoryLayers myLayer,
const wxString &  path 
)
inlinevirtual

Reimplemented in tmExportDataSHP.

◆ GetAdvancedAttribution()

bool tmExportData::GetAdvancedAttribution ( ProjectDefMemoryLayers layer)
protected

Process the query for getting advanced values from database.

Parameters
layerinformations about the layer
Returns
true if query passed, false otherwise (plus informations in debug mode)
Author
Lucien Schreiber (c) CREALP 2009
Date
26 March 2009

◆ GetFileExtension()

wxString tmExportData::GetFileExtension ( )

Return extension without the leading dot.

Author
Lucien Schreiber (c) CREALP 2009
Date
08 April 2009

◆ GetFileName()

wxFileName * tmExportData::GetFileName ( ProjectDefMemoryLayers myLayer,
const wxString &  path 
)
protected

Create a file name.

Create a file name from ProjectDefMemoryLayers informations

Parameters
myLayervalid object of type ProjectDefMemoryLayers
pathThe path (with trailling separator)
Returns
A valid wxFileName or Null if an error occur. If wxFileName is returned, caller must destroy the object once finished
Author
Lucien Schreiber (c) CREALP 2008
Date
14 November 2008

◆ GetFileNamePrj()

wxFileName * tmExportData::GetFileNamePrj ( ProjectDefMemoryLayers myLayer,
const wxString &  path 
)
protected

Create a prj file name.

Create a file name for projection information

Parameters
myLayervalid object of type ProjectDefMemoryLayers
pathThe path (with trailling separator)
Returns
A valid wxFileName or Null if an error occur. If wxFileName is returned, caller must destroy the object once finished
Author
Pascal Horton (c) Terranum 2019
Date
18 October 2019

◆ GetSimpleAttribData()

bool tmExportData::GetSimpleAttribData ( PRJDEF_LAYERS_TYPE  layertype,
long  layerindex 
)
protected

Process query for getting simple attributs.

Parameters
layertypetype of the layer (point, line, polygon)
layerindexlayer index of the layer in the database
Returns
true if the query succeed, false otherwise
Author
Lucien Schreiber (c) CREALP 2008
Date
17 November 2008

◆ GetSimpleAttribDataWithSpatial()

bool tmExportData::GetSimpleAttribDataWithSpatial ( PRJDEF_LAYERS_TYPE  layertype,
long  layerindex 
)
protected

Process query for getting simple attributs and spatial data.

This function is mainly used for getting info about labels

Parameters
layertypetype of the layer (point, line, polygon)
layerindexlayer index of the layer in the database
Returns
true if the query succeed, false otherwise
Author
Lucien Schreiber (c) CREALP 2008
Date
17 November 2008

◆ GetSizeOfEnum()

int tmExportData::GetSizeOfEnum ( const PrjMemFieldCodedValArray &  mCodedVal)
protected

Get the max size of the items stored into array.

This function may be used for getting the max size we should plan for storring all enum values

Parameters
mCodedValContain all enum values
Returns
size of the field for storing those enum
Author
Lucien Schreiber (c) CREALP 2008
Date
15 November 2008

◆ GetSizeOfObjDesc()

int tmExportData::GetSizeOfObjDesc ( int  layerindex)

Getting size of Object Desc column.

This function return an array of int corresponding to the minimum size of the column needed for containing the OBJECT_DESC text

Parameters
layerindexthe Database layerindex
Returns
the size of the column Object_Description for the specified layers
Author
Lucien Schreiber (c) CREALP 2008
Date
16 November 2008

◆ SetFrame()

virtual void tmExportData::SetFrame ( wxRealPoint *  points,
int  nbvertex 
)
inlinevirtual

Reimplemented in tmExportDataSHP.

◆ WriteLines()

virtual bool tmExportData::WriteLines ( ProjectDefMemoryLayers myLayer)
inlinevirtual

Reimplemented in tmExportDataSHP.

◆ WritePoints()

virtual bool tmExportData::WritePoints ( ProjectDefMemoryLayers myLayer)
inlinevirtual

Reimplemented in tmExportDataSHP.

◆ WritePolygons()

virtual bool tmExportData::WritePolygons ( ProjectDefMemoryLayers myLayer)
inlinevirtual

Reimplemented in tmExportDataSHP.


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