TdkLayer Class Reference
[The Core Module]

Defines the TdkLayer class. More...

#include <TdkLayer.h>

Inheritance diagram for TdkLayer:

TdkObjectCollection TdkObject TdkEventHandler TdkPersistenceObject List of all members.

Multiresolution

Multiresolution protected methods and properties

TdkGeneralizationRepsMap generalizationRepsMap_
virtual std::vector< int > getObjectBlocksId (const std::string &objectId, TdkGeneralizationRepresentation &srep)
virtual int getNearBlockId (TeBox &box, TdkGeneralizationRepresentation &srep)
virtual bool addAggregationGeometry (TePointSet &geomSet, TdkGeneralizationRepresentation &srep, bool updateDB=true)
virtual bool addIndexingGeometry (TeLineSet &geomSet, TdkGeneralizationRepresentation &srep, int blockId, bool updateDB=true)
virtual bool addIndexingGeometry (TePointSet &geomSet, TdkGeneralizationRepresentation &srep, int blockId, bool updateDB=true)
virtual bool addIndexingGeometry (TePolygonSet &geomSet, TdkGeneralizationRepresentation &srep, int blockId, bool updateDB=true)
virtual bool updateIndexingGeometry (TeLine2D &geom, TdkGeneralizationRepresentation &srep, bool updateDB=true)
virtual bool updateIndexingGeometry (TePoint &geom, TdkGeneralizationRepresentation &srep, bool updateDB=true)
virtual bool updateIndexingGeometry (TePolygon &geom, TdkGeneralizationRepresentation &srep, bool updateDB=true)
virtual bool loadMRStrategies ()
virtual std::string createGeneralizationTable (TeGeomRep geomRep, double level)
 Creates an generalization table. Returns the table name.
virtual void insertIndexEntry (const std::string &indexTableName, int block_id, const string &object_id)
 Inserts an indexing entry.
virtual void removeIndexEntry (const std::string &indexTableName, int block_id, const string &object_id)
virtual void insertBlock (const std::string &tableName, int block_id, int num_objects, int num_coords, TeBox &box, unsigned char *data, long data_size)
 Inserts an geometry block.
virtual void updateBlock (const std::string &tableName, int block_id, int num_objects, int num_coords, TeBox &box, unsigned char *data, long data_size)
 Updates an generalization geometry block.
void updateAggregationBlock (std::string &tableName, int geo_level, unsigned char *data, long data_size)
 Updates an aggregation geometry block vector of representations associated to this layer .

Public Member Functions

virtual TdkThemequery (TdkQueryParams &params)
 Creates a theme from this layer.
virtual bool needToLoad (TdkLoadParams &params)
 Verify if loads the object from the database is necessary.
void setAllAttrsInCache (bool allAttrsInCache)
bool getAllAttrsInCache ()
virtual bool insertAttributes (TdkObjectTypeDef &type)
 Adds all de attribute table definitions to layer vector of attribute tables (in memory).
virtual bool unlinkAttrTables (std::string tableName)
virtual bool linkAttrTable (std::string tableName, std::string linkAttrName, std::string refTableName="", std::string refLinkAttrName="")
virtual TeBox & getBoundingBox ()
virtual void setBoundingBox (TeBox &box)
virtual void setProjection (TeProjection *proj)
virtual void import (TdkObject &object)
virtual std::string getStringAttr (std::string attr_name)
 Returns the value for the given attribute. The attribute type must be string.
virtual void setStringAttr (std::string attr_name, std::string value)
 Sets the value for the given attribute. The attribute type must be string.
virtual int getIntegerAttr (std::string attr_name)
 Returns the value for the given attribute. The attribute type must be integer.
virtual void setIntegerAttr (std::string attr_name, int value)
 Gets the value for the given attribute. The attribute type must be integer.
virtual double getRealAttr (std::string attr_name)
 Returns the value for the given attribute. The attribute type must be real.
virtual void setRealAttr (std::string attr_name, double value)
 Gets the value for the given attribute. The attribute type must be real.
virtual void checkThemes ()
 Checks the themes that is using this layer.
 TdkLayer (TeDatabase *db)
 Empty constructor.
 TdkLayer (const string &name, TeDatabase *db=NULL, TeProjection *proj=NULL)
 Constructor with parameters.
 TdkLayer (const string &name, TeDatabase *db, TeBox &box, TeProjection *proj=NULL)
 Constructor with parameters.
 TdkLayer (int id)
 TdkLayer (const TdkObjectGID &objectGID)
 TdkLayer (TdkLayer &layer)
virtual void operator= (TdkObject &object)
virtual TdkObjectcopy ()
 Creates a copy of the object.
virtual void setGID (const TdkObjectGID &objectGID)
virtual ~TdkLayer ()
virtual void id (int id)
virtual int id ()
virtual TeBox & box ()
virtual void setLayerBox (const TeBox &box)
virtual void updateLayerBox (const TeBox &box)
virtual void updateLayerBox ()
virtual bool addGeometriesRepresentations (TeGeomRep geomTypes)
 Sets the name of the media table associated to layer.
virtual bool addGeometry (TeGeomRep repType, const string &tableName="", const string &desc="", bool updateDB=true)
 Creates a new geometry representation to a layer.
virtual bool pointsGetBBox (double &xmin, double &ymin, double &xmax, double &ymax)
bool linesGetBBox (double &xmin, double &ymin, double &xmax, double &ymax)
bool polysGetBBox (double &xmin, double &ymin, double &xmax, double &ymax)
bool rasterGetBBox (double &xmin, double &ymin, double &xmax, double &ymax)
bool getBBox (double &xmin, double &ymin, double &xmax, double &ymax)
 Compute the bounding box of the entire spatial data of the given layer.
bool loadProjection ()
int clipStatements (double xmin, double ymin, double xmax, double ymax, char *pt_clip, char *poly_clip)
 Create sql statements for retrieving elements from the layer.
int clipStatements (TeBox &inBox, char *pt_clip, char *poly_clip)
int clipStatements1 (TeBox &inBox, char *pt_clip, char *poly_clip)
std::string geomByIdSQL (TeGeomRep rep, std::string objId="")
char * pointClipRectStatement (double xmin, double ymin, double xmax, double ymax)
char * clipRectStatement (double xmin, double ymin, double xmax, double ymax)
virtual bool updateLine (TeLine2D &line, bool updateDB=true)
virtual bool updatePoint (TePoint &point, bool updateDB=true)
virtual bool updatePolygon (TePolygon &poly, bool updateDB=true)
virtual bool updateText (TeText &text, bool updateDB=true)
virtual bool addPoints (TePointSet &pointSet, bool createObjectId=false, bool createGeometry=true, bool updateDB=true)
 Adds a set of points to a layer.
virtual bool addLines (TeLineSet &lineSet, bool createObjectId=false, bool createGeometry=true, bool updateDB=true)
 Adds a set of lines to a layer.
virtual bool addPolygons (TePolygonSet &polySet, bool createObjectId=false, bool createGeometry=true, bool updateDB=true)
 Adds a set of polygons to a layer.
virtual bool addTexts (TeTextSet &textSet, const string &tName, bool createObjectId=false, bool createGeometry=true, bool updateDB=true)
 Adds a set of text to a layer.
virtual bool addLine (TeLine2D &line, bool createObjectId=false, bool createGeometry=true, bool updateDB=true)
virtual bool addPoint (TePoint &point, bool createObjectId=false, bool createGeometry=true, bool updateDB=true)
virtual bool addPolygon (TePolygon &poly, bool createObjectId=false, bool createGeometry=true, bool updateDB=true)
virtual bool addText (TeText &text, const std::string &tName=std::string(""), bool createObjectId=false, bool createGeometry=true, bool updateDB=true)
virtual bool removePointSet (TePointSet &pointSet, bool updateDB=true)
virtual bool removeLineSet (TeLineSet &lineSet, bool updateDB=true)
virtual bool removePolygonSet (TePolygonSet &polygonSet, bool updateDB=true)
virtual bool removeTextSet (TeTextSet &textSet, bool updateDB=true)
virtual bool removePoint (TePoint &point, bool updateDB=true)
virtual bool removeLine (TeLine2D &line, bool updateDB=true)
virtual bool removePolygon (TePolygon &polygon, bool updateDB=true)
virtual bool removeText (TeText &text, bool updateDB=true)
bool removeIndexingGeometry (TePoint &geom, TdkGeneralizationRepresentation &srep, bool updateDB)
bool removeIndexingGeometry (TeLine2D &geom, TdkGeneralizationRepresentation &srep, bool updateDB)
bool removeIndexingGeometry (TePolygon &geom, TdkGeneralizationRepresentation &srep, bool updateDB)
virtual bool deleteGeometry (TeGeomRep rep, int geomId)
bool deleteObjects (std::vector< string > objIds)
int numThemes ()
 Returns the number of themes that are associated to the given layer.
int numThemes (int view_id)
int numVisThemes (int view_id)
int bboxRestriction (TeBox &inBox, std::string &rest)
void linkThemesChildrenGIDs (TdkEventHandlerVector &objects, bool updateDB=true)
void linkThemesChildGID (TdkObjectGID &gid, bool updateDB=true)
void unlinkThemesChildGID (const TdkObjectGID &gid, bool updateDB=true)
void linkThemesChildGIDAsSelectedObject (TdkObjectGID &gid)
void addThemesGeometry (double errorLevel, TePolygonSet &geomSet)
void addThemesGeometry (double errorLevel, TeLineSet &geomSet)
void addThemesGeometry (double errorLevel, TePointSet &geomSet)
void addThemesGeometry (double errorLevel, TeTextSet &geomSet)
void updateThemesAttributes (TdkObject &object)
void updateThemesGeometry (double errorLevel, TePolygon &geom)
void updateThemesGeometry (double errorLevel, TeLine2D &geom)
void updateThemesGeometry (double errorLevel, TePoint &geom)
void updateThemesGeometry (double errorLevel, TeText &geom)
void generateThemesCollectionTables ()
void updateThemesCollectionTables ()
void updateThemesBoundaringBox ()
template<class T>
void updateThemesBoundaringBox (TeGeomComposite< T > &geomSet)
void clearThemesCache ()
void removeThemesGeometry (std::string objectId)
void refreshThemesChildren ()
void refreshChildren ()
bool importShp (std::string shapeFilename, std::string linkColumn="", bool importDBF=true, int chunkSize=60)
virtual void clearVectRepres ()
 Clears the geometric representation vector.
virtual void updateLayerBoxFromGeometries ()
 Updates layer box based on the geomtries.
std::string getShapeFile ()
void setShapeFile (std::string shapeFile)
TeAttributeList & getShapeAttrList ()
void setShapeAttrList (TeAttributeList &attList)
virtual void setChildrenTypeName (std::string typeName)
 Sets the type of the children.
virtual std::string getChildrenTypeName ()
 Returns the children type id.
virtual TdkObjectType getChildrenTypeId ()
 Returns the children type id.
virtual int nGeometries (const string &tName)
 Returns the number of geometries in a geometry table.
Attribute Tables
Methods to deal with the attribute tables of the layer

virtual bool createAttributeTable (TeTable &table)
 Creates a new attribute table for the layer.
virtual bool addAttributeTable (TeTable &table)
 Adds an attribute table definition to layer vector of attribute tables (in memory).
Multiresolution
Returns true if must be computed the layer bounding box.

Multiresolution public methods and properties

virtual void checkAndDeleteGeneralizationStrategy (TeGeomRep geomRep, double errorLevel)
void deleteMRStrategy (int strategyId)
 Deletes an strategy (the strategy id given by param).
virtual void eraseMRStrategy (int sid)
virtual void clearMRStrategies ()
virtual void addGeneralizationRepres (TdkGeneralizationRepresentation *rep)
 Adds a strategy representation to vector of strategy representation of the layer.
virtual TdkGeneralizationRepsMapgeneralizationRepres ()
 Returns a vector with all representations in the layer.
virtual void createGeneralizationLevel (int simplificationLevels, double minErrorLevel, double maxErrorLevel, int indexingLevels, TdkIndexingType indexingType)
virtual void populateGeneralizationTable (TePointSet &pointSet, string &tableName, string &indexTableName, double errorLevel, int indexingLevels, TdkIndexingType indexingType)
virtual void populateGeneralizationTable (TeLineSet &lineSet, string &tableName, string &indexTableName, double errorLevel, int indexingLevels, TdkIndexingType indexingType)
virtual void populateGeneralizationTable (TePolygonSet &polygonSet, string &tableName, string &indexTableName, double errorLevel, int indexingLevels, TdkIndexingType indexingType)
virtual void populateIndexingGeometryAndIndexTable (TePointSet &pointSet, string &tableName, string &indexTableName, int indexingLevels, TdkIndexingType indexingType)
virtual void populateIndexingGeometryAndIndexTable (TeLineSet &lineSet, string &tableName, string &indexTableName, int indexingLevels, TdkIndexingType indexingType)
virtual void populateIndexingGeometryAndIndexTable (TePolygonSet &polygonSet, string &tableName, string &indexTableName, int indexingLevels, TdkIndexingType indexingType)
double getEnableErrorLevel (double errorLevel)
TdkGeneralizationRepresentationfindGeneralizationRepresentation (TeGeomRep geomRep, double errorLevel=0.0)
void aggregate ()
void insertGeneralizationStrategy (TeGeomRep geomRep, TdkStrategyType type, std::string repTableName, double errorLevel)
 Inserts an generalization strategy (geom representation,generalization table name and simplification erro level are given by params).

Protected Member Functions

void init (TeProjection *proj=NULL)
virtual void createGeneralizationLevel (TeGeomRep geomRep, int simplificationLevels, double minErrorLevel, double maxErrorLevel, int indexingLevels, TdkIndexingType indexingType)
virtual std::string generateCollectionSQL (TeDatabase *db, TeRepresentation *rep=NULL)
bool getBBox (TeGeomRep rep, const char *sql_fields, double &xmin, double &ymin, double &xmax, double &ymax)
 Computes the bounding box.
virtual bool load (TeDatabase *dbCaller, TdkLoadParams &params)
 Loads the layer from the database.
virtual bool update (TeDatabase *dbCaller, TdkPersistenceParams &params)
 Updates the object in the database.
virtual void remove (TeDatabase *dbCaller, TdkPersistenceParams &params)
 Removes the object from the database.
virtual bool insert (TeDatabase *dbCaller, TdkPersistenceParams &params)
 Inserts the object in the database.
virtual bool importShapeGeometry (const string &shpFileName, string attrTableName, string objectIdAtt, int unsigned chunkSize)
 Import only the geometries and the objects id attr from a shapefile to a layer.

Protected Attributes

bool allAttrsInCache_
std::string childrenTypeName_
std::string shapeFile_
TeAttributeList shapeAttList_

Private Member Functions

std::string geomRepName (TeGeomRep geomRep)
bool insertsAttributes (TeTable &table)

Detailed Description

Defines the TdkLayer class.


Constructor & Destructor Documentation

TdkLayer::TdkLayer ( TeDatabase *  db  ) 

Empty constructor.

TdkLayer::TdkLayer ( const string &  name,
TeDatabase *  db = NULL,
TeProjection *  proj = NULL 
)

Constructor with parameters.

TdkLayer::TdkLayer ( const string &  name,
TeDatabase *  db,
TeBox &  box,
TeProjection *  proj = NULL 
)

Constructor with parameters.

TdkLayer::TdkLayer ( int  id  ) 

TdkLayer::TdkLayer ( const TdkObjectGID objectGID  ) 

TdkLayer::TdkLayer ( TdkLayer layer  ) 

virtual TdkLayer::~TdkLayer (  )  [inline, virtual]


Member Function Documentation

std::string TdkLayer::geomRepName ( TeGeomRep  geomRep  )  [private]

bool TdkLayer::insertsAttributes ( TeTable &  table  )  [private]

void TdkLayer::init ( TeProjection *  proj = NULL  )  [protected]

void TdkLayer::createGeneralizationLevel ( TeGeomRep  geomRep,
int  simplificationLevels,
double  minErrorLevel,
double  maxErrorLevel,
int  indexingLevels,
TdkIndexingType  indexingType 
) [protected, virtual]

string TdkLayer::generateCollectionSQL ( TeDatabase *  db,
TeRepresentation *  rep = NULL 
) [protected, virtual]

bool TdkLayer::getBBox ( TeGeomRep  rep,
const char *  sql_fields,
double &  xmin,
double &  ymin,
double &  xmax,
double &  ymax 
) [protected]

Computes the bounding box.

Computes the bounding box of the dataset of a given layer and geometry representation.

bool TdkLayer::load ( TeDatabase *  dbCaller,
TdkLoadParams params 
) [protected, virtual]

Loads the layer from the database.

params.loadAllAttributes_ false loads the basic attributes otherwise loads the others params.loadAllAttributes_ true loads the others attributes

Reimplemented from TdkObjectCollection.

bool TdkLayer::update ( TeDatabase *  dbCaller,
TdkPersistenceParams params 
) [protected, virtual]

Updates the object in the database.

Reimplemented from TdkObjectCollection.

void TdkLayer::remove ( TeDatabase *  dbCaller,
TdkPersistenceParams params 
) [protected, virtual]

Removes the object from the database.

Reimplemented from TdkObjectCollection.

bool TdkLayer::insert ( TeDatabase *  dbCaller,
TdkPersistenceParams params 
) [protected, virtual]

Inserts the object in the database.

Reimplemented from TdkObjectCollection.

bool TdkLayer::importShapeGeometry ( const string &  shpFileName,
string  attrTableName,
string  objectIdAtt,
int unsigned  chunkSize 
) [protected, virtual]

Import only the geometries and the objects id attr from a shapefile to a layer.

Parameters:
layer pointer to a layer
shpFileName shapefile file name
attrTableName the name that the attribute table will be saved
objectIdAttr name of the attribute that has the identification of objects
chunkSize the number of objects in memory before save them in the layer

std::vector< int > TdkLayer::getObjectBlocksId ( const std::string &  objectId,
TdkGeneralizationRepresentation srep 
) [protected, virtual]

int TdkLayer::getNearBlockId ( TeBox &  box,
TdkGeneralizationRepresentation srep 
) [protected, virtual]

bool TdkLayer::addAggregationGeometry ( TePointSet &  geomSet,
TdkGeneralizationRepresentation srep,
bool  updateDB = true 
) [protected, virtual]

bool TdkLayer::addIndexingGeometry ( TeLineSet &  geomSet,
TdkGeneralizationRepresentation srep,
int  blockId,
bool  updateDB = true 
) [protected, virtual]

bool TdkLayer::addIndexingGeometry ( TePointSet &  geomSet,
TdkGeneralizationRepresentation srep,
int  blockId,
bool  updateDB = true 
) [protected, virtual]

bool TdkLayer::addIndexingGeometry ( TePolygonSet &  geomSet,
TdkGeneralizationRepresentation srep,
int  blockId,
bool  updateDB = true 
) [protected, virtual]

bool TdkLayer::updateIndexingGeometry ( TeLine2D &  geom,
TdkGeneralizationRepresentation srep,
bool  updateDB = true 
) [protected, virtual]

bool TdkLayer::updateIndexingGeometry ( TePoint &  geom,
TdkGeneralizationRepresentation srep,
bool  updateDB = true 
) [protected, virtual]

bool TdkLayer::updateIndexingGeometry ( TePolygon &  geom,
TdkGeneralizationRepresentation srep,
bool  updateDB = true 
) [protected, virtual]

bool TdkLayer::loadMRStrategies (  )  [protected, virtual]

std::string TdkLayer::createGeneralizationTable ( TeGeomRep  geomRep,
double  level 
) [protected, virtual]

Creates an generalization table. Returns the table name.

Parameters:
geomRep Geometry representation.
level Simplification level.

void TdkLayer::insertIndexEntry ( const std::string &  indexTableName,
int  block_id,
const string &  object_id 
) [protected, virtual]

Inserts an indexing entry.

void TdkLayer::removeIndexEntry ( const std::string &  indexTableName,
int  block_id,
const string &  object_id 
) [protected, virtual]

void TdkLayer::insertBlock ( const std::string &  tableName,
int  block_id,
int  num_objects,
int  num_coords,
TeBox &  box,
unsigned char *  data,
long  data_size 
) [protected, virtual]

Inserts an geometry block.

void TdkLayer::updateBlock ( const std::string &  tableName,
int  block_id,
int  num_objects,
int  num_coords,
TeBox &  box,
unsigned char *  data,
long  data_size 
) [protected, virtual]

Updates an generalization geometry block.

void TdkLayer::updateAggregationBlock ( std::string &  tableName,
int  geo_level,
unsigned char *  data,
long  data_size 
) [protected]

Updates an aggregation geometry block vector of representations associated to this layer .

TdkTheme * TdkLayer::query ( TdkQueryParams params  )  [virtual]

Creates a theme from this layer.

Apply a query on the children and returns a new theme with the children that match.

Parameters:
params The query params.

bool TdkLayer::needToLoad ( TdkLoadParams params  )  [virtual]

Verify if loads the object from the database is necessary.

Reimplemented from TdkObjectCollection.

void TdkLayer::setAllAttrsInCache ( bool  allAttrsInCache  ) 

bool TdkLayer::getAllAttrsInCache (  ) 

bool TdkLayer::insertAttributes ( TdkObjectTypeDef type  )  [virtual]

Adds all de attribute table definitions to layer vector of attribute tables (in memory).

bool TdkLayer::unlinkAttrTables ( std::string  tableName  )  [virtual]

bool TdkLayer::linkAttrTable ( std::string  tableName,
std::string  linkAttrName,
std::string  refTableName = "",
std::string  refLinkAttrName = "" 
) [virtual]

virtual TeBox& TdkLayer::getBoundingBox (  )  [inline, virtual]

virtual void TdkLayer::setBoundingBox ( TeBox &  box  )  [inline, virtual]

void TdkLayer::setProjection ( TeProjection *  proj  )  [virtual]

void TdkLayer::import ( TdkObject object  )  [virtual]

< Attributes associated to a layer

< vector of representations associated to this layer

Reimplemented from TdkObjectCollection.

std::string TdkLayer::getStringAttr ( std::string  attr_name  )  [virtual]

Returns the value for the given attribute. The attribute type must be string.

Reimplemented from TdkObjectCollection.

void TdkLayer::setStringAttr ( std::string  attr_name,
std::string  value 
) [virtual]

Sets the value for the given attribute. The attribute type must be string.

Reimplemented from TdkObjectCollection.

int TdkLayer::getIntegerAttr ( std::string  attr_name  )  [virtual]

Returns the value for the given attribute. The attribute type must be integer.

Reimplemented from TdkObjectCollection.

void TdkLayer::setIntegerAttr ( std::string  attr_name,
int  value 
) [virtual]

Gets the value for the given attribute. The attribute type must be integer.

Reimplemented from TdkObjectCollection.

double TdkLayer::getRealAttr ( std::string  attr_name  )  [virtual]

Returns the value for the given attribute. The attribute type must be real.

Reimplemented from TdkObjectCollection.

void TdkLayer::setRealAttr ( std::string  attr_name,
double  value 
) [virtual]

Gets the value for the given attribute. The attribute type must be real.

Reimplemented from TdkObjectCollection.

void TdkLayer::checkThemes (  )  [virtual]

Checks the themes that is using this layer.

void TdkLayer::operator= ( TdkObject object  )  [virtual]

Reimplemented from TdkObjectCollection.

TdkObject * TdkLayer::copy (  )  [virtual]

Creates a copy of the object.

Reimplemented from TdkObjectCollection.

void TdkLayer::setGID ( const TdkObjectGID objectGID  )  [virtual]

Reimplemented from TdkObjectCollection.

void TdkLayer::id ( int  id  )  [virtual]

int TdkLayer::id (  )  [virtual]

TeBox & TdkLayer::box (  )  [virtual]

void TdkLayer::setLayerBox ( const TeBox &  box  )  [virtual]

void TdkLayer::updateLayerBox ( const TeBox &  box  )  [virtual]

void TdkLayer::updateLayerBox (  )  [virtual]

bool TdkLayer::createAttributeTable ( TeTable &  table  )  [virtual]

Creates a new attribute table for the layer.

bool TdkLayer::addAttributeTable ( TeTable &  table  )  [virtual]

Adds an attribute table definition to layer vector of attribute tables (in memory).

bool TdkLayer::addGeometriesRepresentations ( TeGeomRep  geomTypes  )  [virtual]

Sets the name of the media table associated to layer.

bool TdkLayer::addGeometry ( TeGeomRep  repType,
const string &  tableName = "",
const string &  desc = "",
bool  updateDB = true 
) [virtual]

Creates a new geometry representation to a layer.

bool TdkLayer::pointsGetBBox ( double &  xmin,
double &  ymin,
double &  xmax,
double &  ymax 
) [virtual]

Computes the bounding box of the dataset of a given layer and geometry representation.

bool TdkLayer::linesGetBBox ( double &  xmin,
double &  ymin,
double &  xmax,
double &  ymax 
)

Computes the bounding box of the dataset of a given layer and geometry representation.

bool TdkLayer::polysGetBBox ( double &  xmin,
double &  ymin,
double &  xmax,
double &  ymax 
)

Computes the bounding box of the dataset of a given layer and geometry representation.

bool TdkLayer::rasterGetBBox ( double &  xmin,
double &  ymin,
double &  xmax,
double &  ymax 
)

Compute the bounding box of the raster associated with the given layer in the layer coordinates system if any.

bool TdkLayer::getBBox ( double &  xmin,
double &  ymin,
double &  xmax,
double &  ymax 
)

Compute the bounding box of the entire spatial data of the given layer.

bool TdkLayer::loadProjection (  ) 

Retrives information about the layer projection from the layer database and set it.

int TdkLayer::clipStatements ( double  xmin,
double  ymin,
double  xmax,
double  ymax,
char *  pt_clip,
char *  poly_clip 
)

Create sql statements for retrieving elements from the layer.

int TdkLayer::clipStatements ( TeBox &  inBox,
char *  pt_clip,
char *  poly_clip 
)

Returns values: 0 - layer bounding box is outside given rectangle 1 - layer bounding box is completely inside the given rectangle 2 - layer bounding box intersect the given rectangle

int TdkLayer::clipStatements1 ( TeBox &  inBox,
char *  pt_clip,
char *  poly_clip 
)

std::string TdkLayer::geomByIdSQL ( TeGeomRep  rep,
std::string  objId = "" 
)

This function mount an sql statement for retrieving a geometry object of the specified geometry representation from the given layer. If the parameter objId is empty (objId.size() < 1) the statement will be incomplete, the function caller will have to complete it with "objId'"

char * TdkLayer::pointClipRectStatement ( double  xmin,
double  ymin,
double  xmax,
double  ymax 
)

char* TdkLayer::clipRectStatement ( double  xmin,
double  ymin,
double  xmax,
double  ymax 
)

bool TdkLayer::updateLine ( TeLine2D &  line,
bool  updateDB = true 
) [virtual]

bool TdkLayer::updatePoint ( TePoint &  point,
bool  updateDB = true 
) [virtual]

bool TdkLayer::updatePolygon ( TePolygon &  poly,
bool  updateDB = true 
) [virtual]

bool TdkLayer::updateText ( TeText &  text,
bool  updateDB = true 
) [virtual]

bool TdkLayer::addPoints ( TePointSet &  pointSet,
bool  createObjectId = false,
bool  createGeometry = true,
bool  updateDB = true 
) [virtual]

Adds a set of points to a layer.

Adds a set of points to a layer. Generalizes the geometries. Updates the geometries caches of the layer themes.

Parameters:
pointSet Set of points to add to the layer.
createObjectId True to generate the object id based on the layer data.
createGeometry True to create the geometry representation.
updateDB True to save the object in database, false to save in cache.

bool TdkLayer::addLines ( TeLineSet &  lineSet,
bool  createObjectId = false,
bool  createGeometry = true,
bool  updateDB = true 
) [virtual]

Adds a set of lines to a layer.

Adds the geometries to a layer. Generalizes the geometries. Updates the geometries caches of the layer themes.

Parameters:
pointSet Set of points to add to the layer.
createObjectId True to generate the object id based on the layer data.
createGeometry True to create the geometry representation.
updateDB True to save the object in database, false to save in cache.

bool TdkLayer::addPolygons ( TePolygonSet &  polySet,
bool  createObjectId = false,
bool  createGeometry = true,
bool  updateDB = true 
) [virtual]

Adds a set of polygons to a layer.

Adds the geometries to a layer. Generalizes the geometries. Updates the geometries caches of the layer themes.

Parameters:
pointSet Set of points to add to the layer.
createObjectId True to generate the object id based on the layer data.
createGeometry True to create the geometry representation.
updateDB True to save the object in database, false to save in cache.

bool TdkLayer::addTexts ( TeTextSet &  textSet,
const string &  tName,
bool  createObjectId = false,
bool  createGeometry = true,
bool  updateDB = true 
) [virtual]

Adds a set of text to a layer.

Adds the geometries to a layer. Generalizes the geometries. Updates the geometries caches of the layer themes.

Parameters:
pointSet Set of points to add to the layer.
createObjectId True to generate the object id based on the layer data.
createGeometry True to create the geometry representation.
updateDB True to save the object in database, false to save in cache.

bool TdkLayer::addLine ( TeLine2D &  line,
bool  createObjectId = false,
bool  createGeometry = true,
bool  updateDB = true 
) [virtual]

bool TdkLayer::addPoint ( TePoint &  point,
bool  createObjectId = false,
bool  createGeometry = true,
bool  updateDB = true 
) [virtual]

bool TdkLayer::addPolygon ( TePolygon &  poly,
bool  createObjectId = false,
bool  createGeometry = true,
bool  updateDB = true 
) [virtual]

virtual bool TdkLayer::addText ( TeText &  text,
const std::string &  tName = std::string(""),
bool  createObjectId = false,
bool  createGeometry = true,
bool  updateDB = true 
) [virtual]

bool TdkLayer::removePointSet ( TePointSet &  pointSet,
bool  updateDB = true 
) [virtual]

bool TdkLayer::removeLineSet ( TeLineSet &  lineSet,
bool  updateDB = true 
) [virtual]

bool TdkLayer::removePolygonSet ( TePolygonSet &  polygonSet,
bool  updateDB = true 
) [virtual]

bool TdkLayer::removeTextSet ( TeTextSet &  textSet,
bool  updateDB = true 
) [virtual]

bool TdkLayer::removePoint ( TePoint &  point,
bool  updateDB = true 
) [virtual]

bool TdkLayer::removeLine ( TeLine2D &  line,
bool  updateDB = true 
) [virtual]

bool TdkLayer::removePolygon ( TePolygon &  polygon,
bool  updateDB = true 
) [virtual]

bool TdkLayer::removeText ( TeText &  text,
bool  updateDB = true 
) [virtual]

bool TdkLayer::removeIndexingGeometry ( TePoint &  geom,
TdkGeneralizationRepresentation srep,
bool  updateDB 
)

bool TdkLayer::removeIndexingGeometry ( TeLine2D &  geom,
TdkGeneralizationRepresentation srep,
bool  updateDB 
)

bool TdkLayer::removeIndexingGeometry ( TePolygon &  geom,
TdkGeneralizationRepresentation srep,
bool  updateDB 
)

bool TdkLayer::deleteGeometry ( TeGeomRep  rep,
int  geomId 
) [virtual]

bool TdkLayer::deleteObjects ( std::vector< string >  objIds  ) 

int TdkLayer::numThemes (  ) 

Returns the number of themes that are associated to the given layer.

int TdkLayer::numThemes ( int  view_id  ) 

Returns the number of themes from the given view that are associated to the given layer.

int TdkLayer::numVisThemes ( int  view_id  ) 

Returns the number of visible themes from the given view that are associated to the given layer.

int TdkLayer::bboxRestriction ( TeBox &  inBox,
std::string &  rest 
)

void TdkLayer::linkThemesChildrenGIDs ( TdkEventHandlerVector objects,
bool  updateDB = true 
)

void TdkLayer::linkThemesChildGID ( TdkObjectGID gid,
bool  updateDB = true 
)

void TdkLayer::unlinkThemesChildGID ( const TdkObjectGID gid,
bool  updateDB = true 
)

void TdkLayer::linkThemesChildGIDAsSelectedObject ( TdkObjectGID gid  ) 

void TdkLayer::addThemesGeometry ( double  errorLevel,
TePolygonSet &  geomSet 
)

void TdkLayer::addThemesGeometry ( double  errorLevel,
TeLineSet &  geomSet 
)

void TdkLayer::addThemesGeometry ( double  errorLevel,
TePointSet &  geomSet 
)

void TdkLayer::addThemesGeometry ( double  errorLevel,
TeTextSet &  geomSet 
)

void TdkLayer::updateThemesAttributes ( TdkObject object  ) 

void TdkLayer::updateThemesGeometry ( double  errorLevel,
TePolygon &  geom 
)

void TdkLayer::updateThemesGeometry ( double  errorLevel,
TeLine2D &  geom 
)

void TdkLayer::updateThemesGeometry ( double  errorLevel,
TePoint &  geom 
)

void TdkLayer::updateThemesGeometry ( double  errorLevel,
TeText &  geom 
)

void TdkLayer::generateThemesCollectionTables (  ) 

void TdkLayer::updateThemesCollectionTables (  ) 

void TdkLayer::updateThemesBoundaringBox (  ) 

template<class T>
void TdkLayer::updateThemesBoundaringBox ( TeGeomComposite< T > &  geomSet  )  [inline]

void TdkLayer::clearThemesCache (  ) 

Clears the geometries cache (and the geometries cache history) for each layer theme.

void TdkLayer::removeThemesGeometry ( std::string  objectId  ) 

void TdkLayer::refreshThemesChildren (  ) 

Refresh the children vector for each theme of the layer.

void TdkLayer::refreshChildren (  ) 

Refresh the children vector of the layer.

bool TdkLayer::importShp ( std::string  shapeFilename,
std::string  linkColumn = "",
bool  importDBF = true,
int  chunkSize = 60 
)

Import a shapefile to a layer

Parameters:
shpFileName Shapefile file name]
linkColumn Column that is the link between attributes and geometries
importDBF If is true import the geometries and attributes, otherwise only import the geometries
chunkSize The number of objects in memory before save them in the layer

void TdkLayer::clearVectRepres (  )  [virtual]

Clears the geometric representation vector.

void TdkLayer::updateLayerBoxFromGeometries (  )  [virtual]

Updates layer box based on the geomtries.

void TdkLayer::checkAndDeleteGeneralizationStrategy ( TeGeomRep  geomRep,
double  errorLevel 
) [virtual]

void TdkLayer::deleteMRStrategy ( int  strategyId  ) 

Deletes an strategy (the strategy id given by param).

void TdkLayer::eraseMRStrategy ( int  sid  )  [virtual]

void TdkLayer::clearMRStrategies (  )  [virtual]

virtual void TdkLayer::addGeneralizationRepres ( TdkGeneralizationRepresentation rep  )  [inline, virtual]

Adds a strategy representation to vector of strategy representation of the layer.

virtual TdkGeneralizationRepsMap& TdkLayer::generalizationRepres (  )  [inline, virtual]

Returns a vector with all representations in the layer.

void TdkLayer::createGeneralizationLevel ( int  simplificationLevels,
double  minErrorLevel,
double  maxErrorLevel,
int  indexingLevels,
TdkIndexingType  indexingType 
) [virtual]

void TdkLayer::populateGeneralizationTable ( TePointSet &  pointSet,
string &  tableName,
string &  indexTableName,
double  errorLevel,
int  indexingLevels,
TdkIndexingType  indexingType 
) [virtual]

void TdkLayer::populateGeneralizationTable ( TeLineSet &  lineSet,
string &  tableName,
string &  indexTableName,
double  errorLevel,
int  indexingLevels,
TdkIndexingType  indexingType 
) [virtual]

void TdkLayer::populateGeneralizationTable ( TePolygonSet &  polygonSet,
string &  tableName,
string &  indexTableName,
double  errorLevel,
int  indexingLevels,
TdkIndexingType  indexingType 
) [virtual]

void TdkLayer::populateIndexingGeometryAndIndexTable ( TePointSet &  pointSet,
string &  tableName,
string &  indexTableName,
int  indexingLevels,
TdkIndexingType  indexingType 
) [virtual]

void TdkLayer::populateIndexingGeometryAndIndexTable ( TeLineSet &  lineSet,
string &  tableName,
string &  indexTableName,
int  indexingLevels,
TdkIndexingType  indexingType 
) [virtual]

void TdkLayer::populateIndexingGeometryAndIndexTable ( TePolygonSet &  polygonSet,
string &  tableName,
string &  indexTableName,
int  indexingLevels,
TdkIndexingType  indexingType 
) [virtual]

double TdkLayer::getEnableErrorLevel ( double  errorLevel  ) 

TdkGeneralizationRepresentation * TdkLayer::findGeneralizationRepresentation ( TeGeomRep  geomRep,
double  errorLevel = 0.0 
)

void TdkLayer::aggregate (  ) 

void TdkLayer::insertGeneralizationStrategy ( TeGeomRep  geomRep,
TdkStrategyType  type,
std::string  repTableName,
double  errorLevel 
)

Inserts an generalization strategy (geom representation,generalization table name and simplification erro level are given by params).

std::string TdkLayer::getShapeFile (  ) 

void TdkLayer::setShapeFile ( std::string  shapeFile  ) 

TeAttributeList & TdkLayer::getShapeAttrList (  ) 

void TdkLayer::setShapeAttrList ( TeAttributeList &  attList  ) 

virtual void TdkLayer::setChildrenTypeName ( std::string  typeName  )  [virtual]

Sets the type of the children.

std::string TdkLayer::getChildrenTypeName (  )  [virtual]

Returns the children type id.

TdkObjectType TdkLayer::getChildrenTypeId (  )  [virtual]

Returns the children type id.

int TdkLayer::nGeometries ( const string &  tName  )  [virtual]

Returns the number of geometries in a geometry table.


Member Data Documentation

bool TdkLayer::allAttrsInCache_ [protected]

std::string TdkLayer::childrenTypeName_ [protected]

TdkGeneralizationRepsMap TdkLayer::generalizationRepsMap_ [protected]

std::string TdkLayer::shapeFile_ [protected]

TeAttributeList TdkLayer::shapeAttList_ [protected]


The documentation for this class was generated from the following files:
Generated on Fri Jun 15 16:54:42 2007 for TDK by  doxygen 1.5.2