TeBaseSTInstance< GeometryType, TimeType > Class Template Reference

#include <TeBaseSTInstance.h>


Detailed Description

template<typename GeometryType, typename TimeType>
class TeBaseSTInstance< GeometryType, TimeType >

A spatio-temporal instance (STInstance) is composite of an attribute set and geometries of a spatial element or object that are valid in a specific time. This class implements a base generic spatio-temporal instance that can be specialized according to the types that represent its geometries and its valid time.

Definition at line 54 of file TeBaseSTInstance.h.


Public Member Functions

virtual bool addProperty (TeAttribute &rep)
 Adds a new attribute in the attribute list.
virtual bool addProperty (TeProperty &prop)
 Adds a new property or set its value.
virtual void addPropertyValue (const string &val)
 Adds a new property value.
virtual void addUniqueId (const string &id)
 Adds an unique identification.
virtual void clear ()
 Clears the instance, its attributes. It must be implemented by specialized classes to clear its geometries.
virtual GeometryType & geometries ()
 Deprecated: Returns the geometries.
virtual double getArea ()
 Returns an area the geometries of the instance.
const TeAttributeListgetAttrList ()
 Gets a pointer to attribute desciptions.
virtual TeCoord2D getCentroid ()
 Returns a centroid associated to the geometries of the instance.
virtual GeometryType & getGeometries ()
 Returns the geometries.
virtual string getObjectId ()
 Returns the object identification.
virtual vector
< string > & 
getProperties ()
 Returns the property value vector.
virtual bool getProperty (TeProperty &prop, string name)
 Gets the property named "name".
virtual bool getProperty (TeProperty &prop, unsigned int i=0)
 Gets the i-th property.
virtual bool getPropertyValue (const string &name, string &val)
 Gets the the value (as a string) of a property named "name".
virtual bool getPropertyValue (string &val, const int &i=0)
 Gets the value (as a string) of the i-th property.
TePropertyVector getPropertyVector ()
 Deprecated: Returns the property vector from the ST instance.
virtual void getPropertyVector (TePropertyVector &propVec)
 Gets the property vector.
virtual int getSlice ()
 Returns the group or slice that contains this instance.
virtual TimeType getTime ()
 Returns the valid time.
virtual string getUniqueId (const int &i)
 Returns the unique identification of the i-th attribute table.
virtual vector
< string > & 
getUniqueId ()
 Returns the unique identification in all attribute tables.
virtual bool isTimeValid ()
 Verifies if the time associated with this instance is valid. It must be implemented by specialized classes.
virtual void objectId (const string &id)
 Deprecated: Sets the object identification.
virtual string objectId ()
 Deprecated: Returns the object identification.
virtual bool operator== (const TeBaseSTInstance< GeometryType, TimeType > &other)
 Equal operator.
virtual double operator[] (int i)
 Returns the value (as a double) of the i-th property.
virtual void properties (TePropertyVector &p)
 Deprecated: Sets the property vector to the ST instance.
virtual bool removePropertyValue (const int &i)
 Removes the i-th property value.
void setAttrList (TeSharedPtr< TeAttributeList > &attrList)
 Sets a shared pointer to attribute descriptions.
void setAttrList (const TeAttributeList &attList)
 Creates a new internal copy of the attribute description.
virtual void setGeometry (const GeometryType &g)
 Sets the geometries.
virtual void setObjectId (const string &id)
 Sets the object identification.
virtual void setProperties (TePropertyVector &p)
 Deprecated: Sets the property vector to the ST instance.
virtual void setProperties (const vector< string > &p)
 Sets the property value vector.
virtual bool setPropertyValue (const string &name, const string &val)
 Sets the value (as a string) of a property named 'name'.
virtual bool setPropertyValue (const int &i, const string &val)
 Sets the value (as a string) of the i-th property.
virtual void setSlice (int s)
 Sets the group or slice that contains this instance.
virtual void setTime (const TimeType &t)
 Sets the valid time.
virtual void setUniqueId (const vector< string > &id)
 Sets the unique identification in all attribute tables.
virtual int slice ()
 Deprecated: Returns the group or slice that contains this instance.
virtual void slice (int s)
 Deprecated: Sets the group or slice that contains this instance.
 TeBaseSTInstance (const string &object_id, const vector< string > &prop, TeAttributeList *attList, const GeometryType &geometries, const int &slice, const TimeType &time)
 Constructor.
 TeBaseSTInstance (const string &object_id, const GeometryType &geometries, const TimeType &time, const int &s=-1)
 Constructor.
 TeBaseSTInstance (const string &object_id, const vector< string > &prop, TeAttributeList *attList=0, const int &s=-1)
 Constructor.
 TeBaseSTInstance ()
 Empty constructor.
virtual void theme (TeTheme *)
 Deprecated: Sets the theme that contains this instance.
virtual TeThemetheme ()
 Deprecated: Returns the theme pointer that contains this instance.
virtual void uniqueId (const vector< string > &ids)
 Deprecated: Sets the instance identifications in all attribute tables.
virtual string uniqueId (int index)
 Deprecated: Returns the instance identification in the index-th attribute table.
virtual vector
< string > & 
uniqueId ()
 Deprecated: Returns the instance identification in all attribute tables.
virtual ~TeBaseSTInstance ()
 Destructor.

Protected Attributes

TeSharedPtr
< TeAttributeList
attrList_
 a shared pointer to the descriptions of all attributes
GeometryType geometries_
 geometries
string object_id_
 object identification
vector< stringproperties_
 set of properties or attributes values
int slice_
 the slice or group that contains this instance
TimeType time_
 valid time
vector< stringunique_id_
 unique identification in each attribute table

Constructor & Destructor Documentation

template<typename GeometryType, typename TimeType>
TeBaseSTInstance< GeometryType, TimeType >::TeBaseSTInstance (  )  [inline]

Definition at line 76 of file TeBaseSTInstance.h.

00076                            : object_id_(""), slice_(-1), attrList_(0)
00077         { }

template<typename GeometryType, typename TimeType>
TeBaseSTInstance< GeometryType, TimeType >::TeBaseSTInstance ( const string object_id,
const vector< string > &  prop,
TeAttributeList attList = 0,
const int &  s = -1 
) [inline]

Definition at line 80 of file TeBaseSTInstance.h.

00080                                                                                                                                 : 
00081                 object_id_(object_id), 
00082                 properties_(prop),
00083                 slice_(s),
00084                 attrList_(TeSharedPtr<TeAttributeList>(attList))
00085                 { } 

template<typename GeometryType, typename TimeType>
TeBaseSTInstance< GeometryType, TimeType >::TeBaseSTInstance ( const string object_id,
const GeometryType &  geometries,
const TimeType &  time,
const int &  s = -1 
) [inline]

Definition at line 88 of file TeBaseSTInstance.h.

00089                                    : 
00090                 object_id_(object_id), 
00091                 geometries_(geometries),
00092                 time_(time),
00093                 slice_(s),
00094                 attrList_(0)
00095                 { } 

template<typename GeometryType, typename TimeType>
TeBaseSTInstance< GeometryType, TimeType >::TeBaseSTInstance ( const string object_id,
const vector< string > &  prop,
TeAttributeList attList,
const GeometryType &  geometries,
const int &  slice,
const TimeType &  time 
) [inline]

Definition at line 98 of file TeBaseSTInstance.h.

00099                                                                                          :
00100                 object_id_(object_id), 
00101                 properties_(prop),
00102                 geometries_(geometries),
00103                 time_(time),
00104                 slice_(slice),
00105                 attrList_(TeSharedPtr<TeAttributeList>(attList))
00106                 { } 
                        

template<typename GeometryType, typename TimeType>
virtual TeBaseSTInstance< GeometryType, TimeType >::~TeBaseSTInstance (  )  [inline, virtual]

Definition at line 109 of file TeBaseSTInstance.h.

00110         { } 


Member Function Documentation

template<typename GeometryType, typename TimeType>
bool TeBaseSTInstance< GeometryType, TimeType >::addProperty ( TeAttribute rep  )  [inline, virtual]

Definition at line 492 of file TeBaseSTInstance.h.

References TeBaseSTInstance< GeometryType, TimeType >::attrList_.

00493 {
00494         if(!attrList_.isActive())
00495                 return false;
00496         attrList_->push_back(attr);
00497         return true; 
00498 }

template<typename GeometryType, typename TimeType>
bool TeBaseSTInstance< GeometryType, TimeType >::addProperty ( TeProperty prop  )  [inline, virtual]

Verifies if there is this property in the attribute list. If not, adds it in the ST instance and in the attribute list. Otherwise, set the property value

Definition at line 461 of file TeBaseSTInstance.h.

References TeProperty::attr_, TeBaseSTInstance< GeometryType, TimeType >::attrList_, TeAttributeRep::name_, TeBaseSTInstance< GeometryType, TimeType >::properties_, TeAttribute::rep_, TeConvertToUpperCase(), and TeProperty::value_.

Referenced by TeCellInterpolate(), TeExportLinesToOGR(), TeExportPointsToOGR(), TeExportPolygonsToOGR(), and TeFillCellAggregateOperation().

00462 {
00463         if(!attrList_.isActive())
00464                 return false;
00465 
00466         string newName = TeConvertToUpperCase(prop.attr_.rep_.name_); 
00467         size_t pos = (prop.attr_.rep_.name_).find(".", 0, 1);
00468         if (pos != string::npos)
00469                 newName = TeConvertToUpperCase(prop.attr_.rep_.name_.substr(pos+1));
00470 
00471         for(unsigned int i=0; i<attrList_->size(); ++i)
00472         {
00473                 string s = TeConvertToUpperCase((attrList_->operator[](i)).rep_.name_); 
00474                 if((s == TeConvertToUpperCase(prop.attr_.rep_.name_)) || (s == newName))
00475                 {
00476                         //the property already exists
00477                         if(i>=properties_.size())
00478                                 properties_.push_back (prop.value_);
00479                         else
00480                                 properties_[i] = prop.value_;
00481                         return true;
00482                 }
00483         }
00484 
00485         // Adds a new property
00486         attrList_->push_back(prop.attr_);
00487         properties_.push_back (prop.value_);
00488         return true; 
00489 }

template<typename GeometryType, typename TimeType>
virtual void TeBaseSTInstance< GeometryType, TimeType >::addPropertyValue ( const string val  )  [inline, virtual]

Definition at line 180 of file TeBaseSTInstance.h.

Referenced by Convert2TerraLib(), TeQuerierDBStr3::fillSTO(), TeQuerierDBStr2::fillSTO(), TeQuerierDBStr1::fillSTONoGrouped(), TeBaseSTInstance< GeometryType, TimeType >::setProperties(), TeFillCellInitSTO(), and TeGlobalMoranSignificance().

00181         {       properties_.push_back (val); }

template<typename GeometryType, typename TimeType>
virtual void TeBaseSTInstance< GeometryType, TimeType >::addUniqueId ( const string id  )  [inline, virtual]

Definition at line 143 of file TeBaseSTInstance.h.

Referenced by TeQuerierDBStr3::fillSTO(), TeQuerierDBStr2::fillSTO(), TeQuerierDBStr1::fillSTOGrouped(), TeQuerierDBStr1::fillSTONoGrouped(), TeFillCellAggregateOperation(), TeFillCellConnectionOperation(), and TeFillCellInitSTO().

00144         {       unique_id_.push_back(id);       }

template<typename GeometryType, typename TimeType>
void TeBaseSTInstance< GeometryType, TimeType >::clear (  )  [inline, virtual]

Reimplemented in TeSTEvent, and TeSTInstance.

Definition at line 529 of file TeBaseSTInstance.h.

References TeBaseSTInstance< GeometryType, TimeType >::attrList_, TeBaseSTInstance< GeometryType, TimeType >::object_id_, TeBaseSTInstance< GeometryType, TimeType >::properties_, TeBaseSTInstance< GeometryType, TimeType >::slice_, and TeBaseSTInstance< GeometryType, TimeType >::unique_id_.

Referenced by TeSTInstance::clear(), and TeSTEvent::clear().

00530 {
00531         object_id_ = ""; 
00532         slice_ = -1; 
00533     properties_.clear(); 
00534         unique_id_.clear();
00535         attrList_.reset(0);
00536 }

template<typename GeometryType, typename TimeType>
virtual GeometryType& TeBaseSTInstance< GeometryType, TimeType >::geometries (  )  [inline, virtual]

Definition at line 235 of file TeBaseSTInstance.h.

Referenced by TeOGRDriver::addElement(), CalculateDistance(), TeMinimumDistancePolygonsStrategy::compute(), TeSumWeighByAreaStrategy::compute(), TeLineLengthStrategy::compute(), TeCountPolygonalObjectsStrategy::compute(), TeCountLineObjectsStrategy::compute(), TeTotalAreaPercentageStrategy::compute(), TeCategoryMajorityStrategy::compute(), TeAverageWeighByAreaStrategy::compute(), TeQuerierSHP::fetchInstance(), TeSTEvent::getGeometry(), TeShapefileDriver::loadData(), TeGeoOpAdd(), TeMinimumDistanceLinesStrategy::TeMinimumDistanceLinesStrategy(), TeMinimumDistancePointsStrategy::TeMinimumDistancePointsStrategy(), TeMinimumDistancePolygonsStrategy::TeMinimumDistancePolygonsStrategy(), and TeSTOSetBuildSHP().

00236         {       return getGeometries();}

template<typename GeometryType, typename TimeType>
double TeBaseSTInstance< GeometryType, TimeType >::getArea (  )  [inline, virtual]

Definition at line 546 of file TeBaseSTInstance.h.

References TeGeometryArea().

00547 {
00548         return TeGeometryArea(this->getGeometries());
00549 }

template<typename GeometryType, typename TimeType>
const TeAttributeList* TeBaseSTInstance< GeometryType, TimeType >::getAttrList (  )  [inline]

Definition at line 255 of file TeBaseSTInstance.h.

00256         {       return attrList_.nakedPointer(); }

template<typename GeometryType, typename TimeType>
TeCoord2D TeBaseSTInstance< GeometryType, TimeType >::getCentroid (  )  [inline, virtual]

Definition at line 540 of file TeBaseSTInstance.h.

References TeFindCentroid().

00541 {
00542         return TeFindCentroid(this->getGeometries());
00543 }

template<typename GeometryType, typename TimeType>
virtual GeometryType& TeBaseSTInstance< GeometryType, TimeType >::getGeometries (  )  [inline, virtual]

Definition at line 227 of file TeBaseSTInstance.h.

Referenced by TeQuerierDBStr3::fetchInstance(), TeQuerierDBStr1::fetchInstance(), and TeBaseSTInstance< TePoint, long >::geometries().

00228         {       return geometries_;}

template<typename GeometryType, typename TimeType>
virtual string TeBaseSTInstance< GeometryType, TimeType >::getObjectId (  )  [inline, virtual]

Definition at line 116 of file TeBaseSTInstance.h.

Referenced by TeSTEventSet::buildImpl(), Convert2TerraLib(), TeTin::createTIN(), and TeBaseSTInstance< TePoint, long >::objectId().

00117         {       return object_id_;      }

template<typename GeometryType, typename TimeType>
virtual vector<string>& TeBaseSTInstance< GeometryType, TimeType >::getProperties (  )  [inline, virtual]

Definition at line 198 of file TeBaseSTInstance.h.

Referenced by TeSTEventSet::buildImpl(), insertBoundaryCells(), TeGeoOpAdd(), TeGeoOpAssignByLocationCollect(), TeGeoOpAssignDataLocationDistribute(), TeGeoOpOverlayDifference(), TeGeoOpOverlayIntersection(), and TeGeoOpOverlayUnion().

00199         {       return properties_;     }

template<typename GeometryType, typename TimeType>
bool TeBaseSTInstance< GeometryType, TimeType >::getProperty ( TeProperty prop,
string  name 
) [inline, virtual]

Definition at line 400 of file TeBaseSTInstance.h.

References TeProperty::attr_, TeBaseSTInstance< GeometryType, TimeType >::attrList_, TeBaseSTInstance< GeometryType, TimeType >::properties_, TeConvertToUpperCase(), and TeProperty::value_.

00401 {
00402         if(!attrList_.isActive())
00403                 return false;
00404          if(properties_.size()!=attrList_->size())
00405                 return false;
00406 
00407         string newName = TeConvertToUpperCase(name); 
00408         size_t pos = name.find(".", 0, 1);
00409         if (pos != string::npos)
00410                 newName = TeConvertToUpperCase(name.substr(pos+1));
00411 
00412         for(unsigned int i=0; i<attrList_->size(); ++i)
00413         {
00414                 string s = TeConvertToUpperCase((attrList_->operator[](i)).rep_.name_); 
00415                 if((s == TeConvertToUpperCase(name)) || (s == newName))
00416                 {
00417                         prop.value_ = properties_[i];
00418                         prop.attr_ = attrList_->operator[](i);
00419                         return true;
00420                 }
00421         }
00422         return false; 
00423 }

template<typename GeometryType, typename TimeType>
bool TeBaseSTInstance< GeometryType, TimeType >::getProperty ( TeProperty prop,
unsigned int  i = 0 
) [inline, virtual]

Definition at line 387 of file TeBaseSTInstance.h.

References TeProperty::attr_, TeBaseSTInstance< GeometryType, TimeType >::attrList_, TeBaseSTInstance< GeometryType, TimeType >::properties_, and TeProperty::value_.

Referenced by TeBuildKDTree(), and TeSTStatInstance::TeSTStatInstance().

00388 {
00389         if(!attrList_.isActive())
00390                 return false;
00391 
00392         if(i>=properties_.size() || i>=attrList_->size())
00393                 return false;
00394         prop.value_ = properties_[i];
00395         prop.attr_ = (*attrList_)[i];
00396         return true;
00397 }

template<typename GeometryType, typename TimeType>
bool TeBaseSTInstance< GeometryType, TimeType >::getPropertyValue ( const string name,
string val 
) [inline, virtual]

Definition at line 435 of file TeBaseSTInstance.h.

References TeBaseSTInstance< GeometryType, TimeType >::attrList_, TeBaseSTInstance< GeometryType, TimeType >::properties_, and TeConvertToUpperCase().

00436 {       
00437         if(!attrList_.isActive())
00438                 return false;
00439 
00440         if(properties_.size()!=attrList_->size())
00441                 return false;
00442 
00443         string newName = TeConvertToUpperCase(name); 
00444         size_t pos = name.find(".", 0, 1);
00445         if (pos != string::npos)
00446                 newName = TeConvertToUpperCase(name.substr(pos+1));
00447 
00448         for(unsigned int i=0; i<attrList_->size(); ++i)
00449         {
00450                 string s = TeConvertToUpperCase((attrList_->operator[](i)).rep_.name_); 
00451                 if((s == TeConvertToUpperCase(name)) || (s == newName))
00452                 {
00453                         val = properties_[i];
00454                         return true;
00455                 }
00456         }
00457         return false; 
00458 }

template<typename GeometryType, typename TimeType>
bool TeBaseSTInstance< GeometryType, TimeType >::getPropertyValue ( string val,
const int &  i = 0 
) [inline, virtual]

Definition at line 426 of file TeBaseSTInstance.h.

References TeBaseSTInstance< GeometryType, TimeType >::properties_.

Referenced by TeTheme::buildGrouping(), TeSumWeighByAreaStrategy::compute(), TeCategoryMajorityStrategy::compute(), TeAverageWeighByAreaStrategy::compute(), TeQuerierDBStr3::fetchInstance(), TeQuerierDBStr2::fetchInstance(), main(), TeExportQuerierToCSV(), TeExportQuerierToMIF(), TeExportQuerierToShapefile(), TeExportQuerierToSPRING(), and TeGeoOpBuffer().

00427 {
00428         if(i<0 || i>= (int)properties_.size())
00429                 return false;
00430         val = properties_[i];
00431         return true;
00432 }

template<typename GeometryType, typename TimeType>
TePropertyVector TeBaseSTInstance< GeometryType, TimeType >::getPropertyVector (  )  [inline]

Definition at line 379 of file TeBaseSTInstance.h.

00380 {
00381         TePropertyVector vec; 
00382         this->getPropertyVector(vec);
00383         return vec;
00384 }

template<typename GeometryType, typename TimeType>
void TeBaseSTInstance< GeometryType, TimeType >::getPropertyVector ( TePropertyVector propVec  )  [inline, virtual]

Definition at line 362 of file TeBaseSTInstance.h.

References TeProperty::attr_, TeBaseSTInstance< GeometryType, TimeType >::attrList_, TeBaseSTInstance< GeometryType, TimeType >::properties_, and TeProperty::value_.

Referenced by TeOGRDriver::addElement(), TeExternalTheme::buildGrouping(), TeTin::createTIN(), decodeLayer(), main(), and TeFillCellCategoryAreaPercentageOperation().

00363 {
00364         if(!attrList_.isActive())
00365                 return;
00366     if(properties_.size()!=attrList_->size())
00367                 return;
00368         propVec.clear();
00369         for(unsigned int i=0; i<properties_.size(); ++i)
00370         {
00371                 TeProperty p;
00372                 p.value_ = properties_[i];
00373                 p.attr_ = attrList_->operator[](i);
00374                 propVec.push_back(p);
00375         }
00376 }

template<typename GeometryType, typename TimeType>
virtual int TeBaseSTInstance< GeometryType, TimeType >::getSlice (  )  [inline, virtual]

Definition at line 243 of file TeBaseSTInstance.h.

Referenced by TeBaseSTInstance< TePoint, long >::slice().

00244         {       return slice_; }

template<typename GeometryType, typename TimeType>
virtual TimeType TeBaseSTInstance< GeometryType, TimeType >::getTime (  )  [inline, virtual]

Definition at line 159 of file TeBaseSTInstance.h.

Referenced by TeSTInstance::timeInterval().

00160         {       return time_;   }

template<typename GeometryType, typename TimeType>
string TeBaseSTInstance< GeometryType, TimeType >::getUniqueId ( const int &  i  )  [inline, virtual]

Definition at line 295 of file TeBaseSTInstance.h.

References TeBaseSTInstance< GeometryType, TimeType >::unique_id_.

00296 {       
00297         if(i<(int)unique_id_.size())
00298                 return unique_id_[i];   
00299         return "";
00300 }

template<typename GeometryType, typename TimeType>
virtual vector<string>& TeBaseSTInstance< GeometryType, TimeType >::getUniqueId (  )  [inline, virtual]

Definition at line 132 of file TeBaseSTInstance.h.

Referenced by TeBaseSTInstance< TePoint, long >::uniqueId().

00133         {       return unique_id_;      }

template<typename GeometryType, typename TimeType>
virtual bool TeBaseSTInstance< GeometryType, TimeType >::isTimeValid (  )  [inline, virtual]

Reimplemented in TeSTEvent, and TeSTInstance.

Definition at line 274 of file TeBaseSTInstance.h.

00275         {       return false; } 

template<typename GeometryType, typename TimeType>
virtual void TeBaseSTInstance< GeometryType, TimeType >::objectId ( const string id  )  [inline, virtual]

Definition at line 128 of file TeBaseSTInstance.h.

00129         {       setObjectId(id);        }

template<typename GeometryType, typename TimeType>
virtual string TeBaseSTInstance< GeometryType, TimeType >::objectId (  )  [inline, virtual]

Definition at line 124 of file TeBaseSTInstance.h.

Referenced by addGeometry(), TeTheme::buildGrouping(), TeExternalTheme::buildGrouping(), TeQuerierSHP::fetchInstance(), TeQuerierDBStr3::fillSTO(), TeQuerierDBStr2::fillSTO(), TeQuerierDBStr1::fillSTOGrouped(), TeQuerierDBStr1::fillSTONoGrouped(), TeGeneralizedProxMatrix< Set >::getSTENeighbours(), TeShapefileDriver::loadData(), main(), TeCellInterpolate(), TeExportQuerierToCSV(), TeExportQuerierToMIF(), TeExportQuerierToShapefile(), TeExportQuerierToSPRING(), TeFillCellAggregateOperation(), TeFillCellConnectionOperation(), TeFillCellInitSTO(), TeGeoOpAssignByLocationCollect(), TeGeoOpAssignDataLocationDistribute(), TeGeoOpBuffer(), TeGeoOpNearestNeighbour(), TeGeoOpOverlayDifference(), TeGlobalMoranSignificance(), and TeSTOSetBuildSHP().

00125         {       return getObjectId();   }

template<typename GeometryType, typename TimeType>
bool TeBaseSTInstance< GeometryType, TimeType >::operator== ( const TeBaseSTInstance< GeometryType, TimeType > &  other  )  [inline, virtual]

Definition at line 287 of file TeBaseSTInstance.h.

References TeBaseSTInstance< GeometryType, TimeType >::object_id_, TeBaseSTInstance< GeometryType, TimeType >::slice_, and TeBaseSTInstance< GeometryType, TimeType >::time_.

00288 {
00289         return ( (object_id_ == other.object_id_) && 
00290                          (time_ == other.time_) &&
00291                          (slice_ == other.slice_));
00292 }

template<typename GeometryType, typename TimeType>
double TeBaseSTInstance< GeometryType, TimeType >::operator[] ( int  i  )  [inline, virtual]

Definition at line 519 of file TeBaseSTInstance.h.

References TeBaseSTInstance< GeometryType, TimeType >::properties_, and TeMAXFLOAT.

00520 {       
00521         double val = TeMAXFLOAT; 
00522         if(i<0 || i>=(int)properties_.size() || properties_[i].empty())
00523                 return val;
00524         val = atof(properties_[i].c_str()); 
00525         return val;  
00526 }

template<typename GeometryType, typename TimeType>
virtual void TeBaseSTInstance< GeometryType, TimeType >::properties ( TePropertyVector p  )  [inline, virtual]

Definition at line 223 of file TeBaseSTInstance.h.

Referenced by TeQuerierSHP::fetchInstance(), TeGeneralizedProxMatrix< Set >::getSTENeighbours(), TeShapefileDriver::loadData(), and TeSTOSetBuildSHP().

00224         {       setProperties(p); }

template<typename GeometryType, typename TimeType>
bool TeBaseSTInstance< GeometryType, TimeType >::removePropertyValue ( const int &  i  )  [inline, virtual]

Definition at line 501 of file TeBaseSTInstance.h.

References TeBaseSTInstance< GeometryType, TimeType >::properties_.

00502 {
00503         int index = 0;
00504         vector<string>::iterator it = properties_.begin();
00505         while(it!=properties_.end())
00506         {
00507                 if(index==i)
00508                 {
00509                         properties_.erase(it);
00510                         return true;
00511                 }
00512                 ++it;
00513                 ++index;
00514         }
00515         return false;
00516 }

template<typename GeometryType, typename TimeType>
void TeBaseSTInstance< GeometryType, TimeType >::setAttrList ( TeSharedPtr< TeAttributeList > &  attrList  )  [inline]

Definition at line 310 of file TeBaseSTInstance.h.

References TeBaseSTInstance< GeometryType, TimeType >::attrList_.

00311 {
00312         attrList_ = attList;
00313 }

template<typename GeometryType, typename TimeType>
void TeBaseSTInstance< GeometryType, TimeType >::setAttrList ( const TeAttributeList attList  )  [inline]

Definition at line 303 of file TeBaseSTInstance.h.

References TeBaseSTInstance< GeometryType, TimeType >::attrList_.

Referenced by TeQuerierDBStr3::fillSTO(), TeQuerierDBStr2::fillSTO(), TeQuerierDBStr1::fillSTOGrouped(), TeQuerierDBStr1::fillSTONoGrouped(), TeExportLinesToOGR(), TeExportPointsToOGR(), and TeExportPolygonsToOGR().

00304 {
00305         attrList_.reset(new TeAttributeList()); 
00306         *attrList_ = attList;
00307 }

template<typename GeometryType, typename TimeType>
virtual void TeBaseSTInstance< GeometryType, TimeType >::setGeometry ( const GeometryType &  g  )  [inline, virtual]

Reimplemented in TeSTInstance.

Definition at line 231 of file TeBaseSTInstance.h.

00232         {       geometries_ = g; }

template<typename GeometryType, typename TimeType>
virtual void TeBaseSTInstance< GeometryType, TimeType >::setObjectId ( const string id  )  [inline, virtual]

Definition at line 120 of file TeBaseSTInstance.h.

Referenced by Convert2TerraLib(), TeBaseSTInstance< TePoint, long >::objectId(), TeExportLinesToOGR(), TeExportPointsToOGR(), and TeExportPolygonsToOGR().

00121         {       object_id_ = id;        }

template<typename GeometryType, typename TimeType>
void TeBaseSTInstance< GeometryType, TimeType >::setProperties ( TePropertyVector p  )  [inline, virtual]

Definition at line 316 of file TeBaseSTInstance.h.

References TeBaseSTInstance< GeometryType, TimeType >::addPropertyValue(), and TeBaseSTInstance< GeometryType, TimeType >::properties_.

00317 {
00318         properties_.clear();
00319         TePropertyVector::iterator it = p.begin();
00320         while(it!=p.end())
00321         {
00322                 addPropertyValue(it->value_); 
00323                 ++it;
00324         }
00325 }

template<typename GeometryType, typename TimeType>
virtual void TeBaseSTInstance< GeometryType, TimeType >::setProperties ( const vector< string > &  p  )  [inline, virtual]

Definition at line 167 of file TeBaseSTInstance.h.

Referenced by TeQuerierDBStr1::fillSTOGrouped(), TeBaseSTInstance< TePoint, long >::properties(), TeFillCellInitSTO(), and TeSTOSetBuildSHP().

00168         {       properties_ = p;        }

template<typename GeometryType, typename TimeType>
bool TeBaseSTInstance< GeometryType, TimeType >::setPropertyValue ( const string name,
const string val 
) [inline, virtual]

Definition at line 337 of file TeBaseSTInstance.h.

References TeBaseSTInstance< GeometryType, TimeType >::attrList_, TeBaseSTInstance< GeometryType, TimeType >::properties_, and TeConvertToUpperCase().

00338 {       
00339         if(!attrList_.isActive())
00340                 return false;
00341 
00342         string newName = TeConvertToUpperCase(name); 
00343         size_t pos = name.find(".", 0, 1);
00344         if (pos != string::npos)
00345                 newName = TeConvertToUpperCase((name.substr(pos+1)));
00346 
00347         for(unsigned int i=0; i<attrList_->size(); ++i)
00348         {
00349                 string s = TeConvertToUpperCase((attrList_->operator[](i)).rep_.name_);
00350                 if( (s == TeConvertToUpperCase(name)) || (s == newName))
00351                 {
00352                         if(i>=properties_.size())
00353                                 return false;
00354                         properties_[i] = val;
00355                         return true;
00356                 }
00357         }
00358         return false; 
00359 }

template<typename GeometryType, typename TimeType>
bool TeBaseSTInstance< GeometryType, TimeType >::setPropertyValue ( const int &  i,
const string val 
) [inline, virtual]

Definition at line 328 of file TeBaseSTInstance.h.

References TeBaseSTInstance< GeometryType, TimeType >::properties_.

Referenced by TParticao::BFS_Salva().

00329 {       
00330         if(i<0 || i>=(int)properties_.size())
00331                 return false;
00332         properties_[i] = val;
00333         return true;
00334 }

template<typename GeometryType, typename TimeType>
virtual void TeBaseSTInstance< GeometryType, TimeType >::setSlice ( int  s  )  [inline, virtual]

Definition at line 239 of file TeBaseSTInstance.h.

Referenced by TeQuerierDBStr3::fillSTO(), TeQuerierDBStr2::fillSTO(), TeQuerierDBStr1::fillSTOGrouped(), TeQuerierDBStr1::fillSTONoGrouped(), and TeBaseSTInstance< TePoint, long >::slice().

00240         {       slice_ = s; }

template<typename GeometryType, typename TimeType>
virtual void TeBaseSTInstance< GeometryType, TimeType >::setTime ( const TimeType &  t  )  [inline, virtual]

Definition at line 163 of file TeBaseSTInstance.h.

Referenced by TeSTInstance::timeInterval().

00164         {       time_ = t;      }

template<typename GeometryType, typename TimeType>
virtual void TeBaseSTInstance< GeometryType, TimeType >::setUniqueId ( const vector< string > &  id  )  [inline, virtual]

Definition at line 139 of file TeBaseSTInstance.h.

Referenced by TeBaseSTInstance< TePoint, long >::uniqueId().

00140         {       unique_id_ = id;        }

template<typename GeometryType, typename TimeType>
virtual int TeBaseSTInstance< GeometryType, TimeType >::slice (  )  [inline, virtual]

Definition at line 251 of file TeBaseSTInstance.h.

00252         {       return getSlice(); }

template<typename GeometryType, typename TimeType>
virtual void TeBaseSTInstance< GeometryType, TimeType >::slice ( int  s  )  [inline, virtual]

Definition at line 247 of file TeBaseSTInstance.h.

Referenced by TeCreateSubTrees().

00248         {       setSlice(s); }

template<typename GeometryType, typename TimeType>
virtual void TeBaseSTInstance< GeometryType, TimeType >::theme ( TeTheme  )  [inline, virtual]

Definition at line 282 of file TeBaseSTInstance.h.

00283         {  }

template<typename GeometryType, typename TimeType>
virtual TeTheme* TeBaseSTInstance< GeometryType, TimeType >::theme (  )  [inline, virtual]

Definition at line 278 of file TeBaseSTInstance.h.

Referenced by TeQuerierSHP::fetchInstance(), TeShapefileDriver::loadData(), TeCellInterpolate(), and TeSTOSetBuildSHP().

00279         { return 0; }

template<typename GeometryType, typename TimeType>
virtual void TeBaseSTInstance< GeometryType, TimeType >::uniqueId ( const vector< string > &  ids  )  [inline, virtual]

Definition at line 155 of file TeBaseSTInstance.h.

00156         {       setUniqueId(ids);       }

template<typename GeometryType, typename TimeType>
virtual string TeBaseSTInstance< GeometryType, TimeType >::uniqueId ( int  index  )  [inline, virtual]

Definition at line 151 of file TeBaseSTInstance.h.

00152         {       return getUniqueId(index);      }

template<typename GeometryType, typename TimeType>
virtual vector<string>& TeBaseSTInstance< GeometryType, TimeType >::uniqueId (  )  [inline, virtual]

Definition at line 147 of file TeBaseSTInstance.h.

Referenced by TeCellInterpolate().

00148         {       return getUniqueId();   }


Field Documentation

template<typename GeometryType, typename TimeType>
TeSharedPtr<TeAttributeList> TeBaseSTInstance< GeometryType, TimeType >::attrList_ [protected]

Definition at line 71 of file TeBaseSTInstance.h.

Referenced by TeBaseSTInstance< GeometryType, TimeType >::addProperty(), TeBaseSTInstance< GeometryType, TimeType >::clear(), TeBaseSTInstance< TePoint, long >::getAttrList(), TeBaseSTInstance< GeometryType, TimeType >::getProperty(), TeBaseSTInstance< GeometryType, TimeType >::getPropertyValue(), TeBaseSTInstance< GeometryType, TimeType >::getPropertyVector(), TeBaseSTInstance< GeometryType, TimeType >::setAttrList(), and TeBaseSTInstance< GeometryType, TimeType >::setPropertyValue().

template<typename GeometryType, typename TimeType>
GeometryType TeBaseSTInstance< GeometryType, TimeType >::geometries_ [protected]

Definition at line 65 of file TeBaseSTInstance.h.

Referenced by TeBaseSTInstance< TePoint, long >::getGeometries(), and TeBaseSTInstance< TePoint, long >::setGeometry().

template<typename GeometryType, typename TimeType>
string TeBaseSTInstance< GeometryType, TimeType >::object_id_ [protected]

Definition at line 59 of file TeBaseSTInstance.h.

Referenced by TeBaseSTInstance< GeometryType, TimeType >::clear(), TeBaseSTInstance< TePoint, long >::getObjectId(), TeBaseSTInstance< GeometryType, TimeType >::operator==(), and TeBaseSTInstance< TePoint, long >::setObjectId().

template<typename GeometryType, typename TimeType>
vector<string> TeBaseSTInstance< GeometryType, TimeType >::properties_ [protected]

Definition at line 63 of file TeBaseSTInstance.h.

Referenced by TeBaseSTInstance< GeometryType, TimeType >::addProperty(), TeBaseSTInstance< TePoint, long >::addPropertyValue(), TeBaseSTInstance< GeometryType, TimeType >::clear(), TeBaseSTInstance< TePoint, long >::getProperties(), TeBaseSTInstance< GeometryType, TimeType >::getProperty(), TeBaseSTInstance< GeometryType, TimeType >::getPropertyValue(), TeBaseSTInstance< GeometryType, TimeType >::getPropertyVector(), TeBaseSTInstance< GeometryType, TimeType >::operator[](), TeBaseSTInstance< GeometryType, TimeType >::removePropertyValue(), TeBaseSTInstance< GeometryType, TimeType >::setProperties(), TeBaseSTInstance< TePoint, long >::setProperties(), and TeBaseSTInstance< GeometryType, TimeType >::setPropertyValue().

template<typename GeometryType, typename TimeType>
int TeBaseSTInstance< GeometryType, TimeType >::slice_ [protected]

Definition at line 69 of file TeBaseSTInstance.h.

Referenced by TeBaseSTInstance< GeometryType, TimeType >::clear(), TeBaseSTInstance< TePoint, long >::getSlice(), TeBaseSTInstance< GeometryType, TimeType >::operator==(), and TeBaseSTInstance< TePoint, long >::setSlice().

template<typename GeometryType, typename TimeType>
TimeType TeBaseSTInstance< GeometryType, TimeType >::time_ [protected]

Definition at line 67 of file TeBaseSTInstance.h.

Referenced by TeBaseSTInstance< TePoint, long >::getTime(), TeBaseSTInstance< GeometryType, TimeType >::operator==(), and TeBaseSTInstance< TePoint, long >::setTime().

template<typename GeometryType, typename TimeType>
vector<string> TeBaseSTInstance< GeometryType, TimeType >::unique_id_ [protected]

Definition at line 61 of file TeBaseSTInstance.h.

Referenced by TeBaseSTInstance< TePoint, long >::addUniqueId(), TeBaseSTInstance< GeometryType, TimeType >::clear(), TeBaseSTInstance< GeometryType, TimeType >::getUniqueId(), TeBaseSTInstance< TePoint, long >::getUniqueId(), and TeBaseSTInstance< TePoint, long >::setUniqueId().


The documentation for this class was generated from the following file:
Generated on Sun Jul 29 04:05:27 2012 for TerraLib - Development Source by  doxygen 1.5.3