This file is indexed.

/usr/include/terralib/kernel/TeAbstractTheme.h is in libterralib-dev 4.3.0+dfsg.2-4build2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
/************************************************************************************
TerraLib - a library for developing GIS applications.
Copyright � 2001-2007 INPE and Tecgraf/PUC-Rio.

This code is part of the TerraLib library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

You should have received a copy of the GNU Lesser General Public
License along with this library.

The authors reassure the license terms regarding the warranties.
They specifically disclaim any warranties, including, but not limited to,
the implied warranties of merchantability and fitness for a particular purpose.
The library provided hereunder is on an "as is" basis, and the authors have no
obligation to provide maintenance, support, updates, enhancements, or modifications.
In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
indirect, special, incidental, or consequential damages arising out of the use
of this library and its documentation.
*************************************************************************************/
/*! \file TeAbstractTheme.h
	\brief This file contains definitions about an abstract theme in TerraLib. 
*/
#ifndef  __TERRALIB_INTERNAL_ABSTRACT_THEME_H
#define  __TERRALIB_INTERNAL_ABSTRACT_THEME_H

#include "TeDefines.h"
#include "TeLegendEntry.h"
#include "TeGeometry.h"
#include "TeViewNode.h"
#include "TeAttribute.h"

class TeRasterTransform;
class TeRaster;
class TeDatabase;
struct TeRepresentation;

#include <string>
#include <set>

//! A grouping structure
/*!
	The TeGrouping is a structure that describes how the objects of a theme should
	be grouped, or separated in groups.
*/
struct TL_DLL TeGrouping
{
	//! Returns the attribute used to group the objects of the theme
	TeAttributeRep	groupAttribute_;
	
	//! Returns the attribute used to normalize a grouping 
	string	groupNormAttribute_;
	
	//! Returns the grouping mode 
	TeGroupingMode	groupMode_;			
	
	//! Returns the number of groups
	int	groupNumSlices_;	
	
	//! Returns the numeric precision used to group objects
	int	groupPrecision_;

	//! Returns the deviation parameter used to group objects
	double	groupStdDev_;

	//! Aggregate function
	string	groupFunction_; 

	//! Show missing data
	bool	groupNullAttr_; 

	//! Minimum value used to calculate a equal step grouping
	double groupMinVal_;

	//! Maximum value used to calculate a equal step grouping 
	double groupMaxVal_;

	//! Chronon used for grouping
	TeChronon groupChronon_;

	//! Constructor
	TeGrouping(TeAttributeRep att=TeAttributeRep(), const string& normAttr="", 
				TeGroupingMode gMode=TeNoGrouping, int numSlice=0, int gPrecision=6,  
				double	gStDev=1.0, const string& func="", TeChronon gChronon = TeNOCHRONON): 
			groupAttribute_(att),
			groupNormAttribute_(normAttr),
			groupMode_(gMode),
			groupNumSlices_(numSlice),
			groupPrecision_(gPrecision),
			groupStdDev_(gStDev),
			groupFunction_(func),
			groupNullAttr_(false),
			groupMinVal_(TeMAXFLOAT),
			groupMaxVal_(TeMINFLOAT),
			groupChronon_(gChronon)
			{}

	//! Copy constructor
	TeGrouping(const TeGrouping& other)
	{	
		groupAttribute_		= other.groupAttribute_;
		groupNormAttribute_	= other.groupNormAttribute_;
		groupMode_			= other.groupMode_;
		groupNumSlices_		= other.groupNumSlices_;
		groupPrecision_		= other.groupPrecision_;
		groupStdDev_		= other.groupStdDev_;
		groupFunction_		= other.groupFunction_;
		groupNullAttr_		= other.groupNullAttr_;
		groupMinVal_		= other.groupMinVal_;
		groupMaxVal_		= other.groupMaxVal_;
		groupChronon_			= other.groupChronon_;
	}
			
	//! Destructor
	~TeGrouping() {}
	
	//! Copy constructor
	TeGrouping& operator= (const TeGrouping& other)
	{	
		if ( this != &other )
		{		
			groupAttribute_		= other.groupAttribute_;
			groupNormAttribute_	= other.groupNormAttribute_;
			groupMode_			= other.groupMode_;
			groupNumSlices_		= other.groupNumSlices_;
			groupPrecision_		= other.groupPrecision_;
			groupStdDev_		= other.groupStdDev_;
			groupFunction_		= other.groupFunction_;
			groupNullAttr_		= other.groupNullAttr_;
			groupNullAttr_		= other.groupNullAttr_;
			groupMinVal_		= other.groupMinVal_;
			groupMaxVal_		= other.groupMaxVal_;
			groupChronon_		= other.groupChronon_;
		}
		return *this;
	}
};

using namespace std;


//! An abstract theme class
class TL_DLL TeAbstractTheme: public TeViewNode
{

	friend class TeDatabase;
public :
	//! return the temporary state of theme
	short temporaryVisibility(void) { return temporaryVisibility_;}
	//! set the temporary state of theme
	void temporaryVisibility(short state) { temporaryVisibility_=state;}
	//! Set the visible temporary representation
	void temporaryRepresentation(int rep) { temporaryRepresentation_=rep;}
	//! Return the visible temporary representation
	int temporaryRepresentation(void) { return temporaryRepresentation_;}

protected :

	// if theme is visible or not only memory (TeCanvas)
	short		temporaryVisibility_;
	
	// set the active representation on memory (TeCanvas);
	int			temporaryRepresentation_;

public:
	//! Constructor
    TeAbstractTheme(const string& name, TeViewNode* parent, const int& view, const int& id, const TeViewNodeType& nodeType);

	//! Constructor
	TeAbstractTheme(const TeViewNodeParams& params);

	//! Copy constructor
	TeAbstractTheme(const TeAbstractTheme& other);

	//! Destructor
	virtual ~TeAbstractTheme();

	//! Assignment operator
	TeAbstractTheme& operator= (const TeAbstractTheme& other); 

	/** @name Scale
		Methods related to the range of scales where this theme should be visible
	*/
	//@{	

	//! Returns a pointer to a projection that is the spatial reference for the objects of this theme
	/*! Concrete classes should reimplement this method.*/
	virtual TeProjection* getThemeProjection() = 0;

	//! Returns the minimum scale in which the theme is visible
	virtual double minScale() { return minScale_; }

	//! Sets the minimum scale in which the theme is visible
	virtual void minScale(double s) { minScale_ = s; }

	//! Returns the maximum scale in which the theme is visible
	virtual double maxScale() { return maxScale_; }

	//! Sets the maximum scale in which the theme is visible
	virtual void maxScale(double s) { maxScale_ = s; }
	//@}

	/** @name Restrictions
		Methods related to the restrictions over the theme used to generate this theme
	*/
	//@{
	//! Verifies if this theme has any kind of restrictions
	virtual bool hasRestriction() { return (!(generateAttributeRest_.empty() || 
									  generateTemporalRest_.empty()) && hasSpatialRes_); }

	//! Returns the attribute restriction (where clause) used to generate the theme  
	virtual string attributeRest() { return generateAttributeRest_; }

	//! Sets the attribute restriction (where clause) used to generate the theme
	virtual void attributeRest(const string& s) { generateAttributeRest_ = s; }

	//! Returns if there is an attribute restriction  
	virtual bool hasAttrRest () { return (!generateAttributeRest_.empty());}

	//! Returns the temporal restriction used to generate the theme
	virtual string temporalRest() { return generateTemporalRest_; }

	//! Sets the temporal restriction used to generate the theme
	virtual void temporalRest(const string& t) { generateTemporalRest_ = t; };

	//! Returns TRUE if there is a temporal restriction defined in the theme 
	virtual bool hasTemporalRest() { return (!generateTemporalRest_.empty());}

	//! Returns the spatial restriction used to generate the theme
	virtual string spatialRest() { return generateSpatialRest_; }

	//! Sets the spatial restriction used to generate the theme
	virtual void spatialRest(const string& s) { generateSpatialRest_ = s; };
	
	//! Returns the spatial relation (e.g WITHIN, COVERED BY, etc.) associate to the spatial restriction
	virtual TeSpatialRelation	spatialRelation() { return spatialRelation_;}

	//! Sets the spatial relation (e.g WITHIN, COVERED BY, etc.) associate to the spatial restriction
	virtual void spatialRelation(TeSpatialRelation s) {spatialRelation_=s;}
	
	//! Returns TRUE if this theme has a spatial restriction  
	virtual bool hasSpatialRest() { return hasSpatialRes_;}

	//! Sets the flag that indicates that there is a spatial restriction 
	virtual void hasSpatialRest(bool a) {hasSpatialRes_ = a;}
	
	//! Returns the box associated with the spatial restriction
	virtual TeBox boxRestriction() { return boxRest_;}

	//! Sets the box associated with the spatial restriction
	virtual void boxRestriction(TeBox& b) {boxRest_ = b;}

	//! Returns a pointer to the geometry associated with the spatial restriction
	virtual TeGeometry* geomRestriction() { return geomRest_;}

	//! Sets a pointer to the geometry associated with the spatial restriction
	virtual void geomRestriction(TeGeometry* g) {geomRest_ = g;}

	//! Returns the geometry representation of the theme which will be considered in the spatial restriction  
	virtual TeGeomRep geomRepRestriction() { return geomRepRest_; }

	//! Sets the geometry representation of the theme which will be considered in the spatial restriction  
	virtual void geomRepRestriction (TeGeomRep& rep) { geomRepRest_ = rep; }

	//! Sets the spatial restriction to be a spatial relation with a box
	virtual void setSpatialRest(TeBox& box, TeGeomRep rep, TeSpatialRelation relation = TeWITHIN); 

	//! Sets the spatial restriction to be a spatial relation with a geometry
	virtual void setSpatialRest(TeGeometry* geom, TeGeomRep rep, TeSpatialRelation relation = TeWITHIN); 
	//@}
	
	
	/** @name Visibility/Status
		Methods related to the visibility/status of the theme and its components: graphs,
		geometrical representations of the objects, grouping.
	*/
	//@{
	//! Sets the components or representations of the theme that are visible
	/*!
		The param rep is a combination of any type of geometrical representation (TeGeomRep) plus:
		- 0x20000000: representing the visibility of the legend
		- 0x40000000: representing the visibility of the groupings
		- 0x80000000: representing the visibility of the pie/chart graphs
	*/
	virtual void visibleRep(int rep) { visibleRep_ = rep; }

	//! Returns the components or representations of the theme that are visible 
	/*!
		The result is a combination of any type of geometrical representation (TeGeomRep) plus:
		- 0x20000000: representing the visibility of the legend
		- 0x40000000: representing the visibility of the groupings
		- 0x80000000: representing the visibility of the pie/chart graphs
	*/
	virtual int visibleRep() { return visibleRep_; }

	//! Returns the geometrical representations of the theme that are visible
	virtual int visibleGeoRep();

	virtual void setAvailability(const bool& avaiability);

	const bool& isAvailable() const;

	/** \brief
	 * 	\return
	 */
	bool isEditable() const;

	/**	\brief
	 * 	\param editable
	 */
	void setEditable(const bool& editable);

	//! Returns a status of a theme
	/*! 
		- Returns 0 if the theme is not visible and not active
		- Returns 1 if the theme is visible and not active
		- Returns 2 if theme is and active and not visible
		- Returns 3 if theme is and visible and active
	 */
	virtual int visibility()
	{	return enableVisibility_; }

	//! Sets whether the theme should be visible and/or active
	/*! 
		- Returns 0 if the theme is not visible and not active
		- Returns 1 if the theme is visible and not active
		- Returns 2 if theme is and active and not visible
		- Returns 3 if theme is and visible and active
	 */
	virtual void visibility(int v)
	{	enableVisibility_ = v; }
	//@}
	
	/** @name Grouping
		Methods related to grouping of objects of the theme. Each group is
		represented by a specific presentation visual called legend. An slice
		represents the range of values of an attribute that characterizes a group.
	*/
	//@{
	//! Returns a grouping associated the theme 
	virtual TeGrouping& grouping() { return grouping_; }
	
	//! Sets a grouping associated to the theme
	virtual void grouping(const TeGrouping& g) 
	{ grouping_ = g; }

	//! Returns the vector of legends of the theme
	virtual TeLegendEntryVector& legend() { return legend_; }

	//! Sets the visual associated to a geometric representation in the n-th group of the theme 
	virtual bool setGroupingVisual(int n, TeVisual* visual, TeGeomRep rep);

	//! Sets the visual of the n-th group of the theme
	virtual bool setGroupingVisual(int n, TeGeomRepVisualMap& vismap);

	//! Clear the existing grouping of objects of this theme
	virtual void resetGrouping ();

	//! Clear the vector of legends
	virtual void cleanLegend(); 

	//! Save grouping parameters in memory passing an arbitrary set of slices
	virtual bool buildGrouping(const TeGrouping& g, vector<TeSlice>& slices);

	//! Returns the slices associated to the grouping of the theme
	virtual TeSliceVector getSlices();
	//@}

	/** @name Legends
		Legends are also used to define presentation characteristics of the objets
		of the theme that aren't grouped, according to some specific characteristics
		(such as being pointed, being queried, among others).
	*/
	//@{	
	//! Sets a default legend of the objects of the theme
	virtual void defaultLegend (TeLegendEntry& leg) 
	{ defaultLegend_ = leg; }

	//! Returns the default legend of the objects of the theme
	virtual TeLegendEntry& defaultLegend () 
	{ return defaultLegend_; }

	//! Sets the visual of the default legend for a specific geometrical representation
	virtual void setVisualDefault (TeVisual* visual, TeGeomRep rep)
	{ defaultLegend_.setVisual(visual, rep); }

	//! Sets a legend for objects of the layer that weren't selected in this theme
	/*! Useful when is necessary to see the theme in the context of the layer */
	virtual void outOfCollectionLegend (TeLegendEntry &leg) 
	{ outOfCollectionLegend_ = leg;}

	//! Returns the legend of the layer objects that are not selected in this layer.
	virtual TeLegendEntry& outOfCollectionLegend () 
	{ return outOfCollectionLegend_; } 
	
	//! Sets the visual of the non-selected objects legend for a specific geometrical representation
	virtual void setVisualOutOfCollection (TeVisual* visual, TeGeomRep rep)
	{ outOfCollectionLegend_.setVisual(visual, rep); }

	//! Sets a legend for objects that have geometries but not descriptive attributes
	/*! Useful when in intermediary situations such as editing */
	virtual void withoutDataConnectionLegend (TeLegendEntry &leg) 
	{ withoutDataConnectionLegend_ = leg; }

	//! Returns the legend of objects that have geometries but not descriptive attributes
	virtual TeLegendEntry& withoutDataConnectionLegend () 
	{ return withoutDataConnectionLegend_; }

	//! Sets the visual of the without-attributes objects legend for a specific geometrical representation
	virtual void setVisualWithoutDataConnection (TeVisual* visual, TeGeomRep rep)
	{ withoutDataConnectionLegend_.setVisual(visual, rep); }
	
	//! Sets a legend for the theme objects selected by pointing
	virtual void pointingLegend (TeLegendEntry &leg) 
	{ pointingLegend_ = leg; }

	//! Returns the legend of the theme objects selected by pointing
	virtual TeLegendEntry& pointingLegend () 
	{ return pointingLegend_; }

	//! Sets the visual of the pointed objects legend for a specific geometrical representation
	virtual void setVisualPointing (TeVisual* visual, TeGeomRep rep)
	{ pointingLegend_.setVisual(visual, rep); }

	//! Sets a legend for the theme objects selected by a query
	virtual void queryLegend (TeLegendEntry &leg) 
	{ queryLegend_ = leg; }

	//! Returns the legend of the theme objects selected by a query
	virtual TeLegendEntry& queryLegend () 
	{ return queryLegend_; }
	
	//! Sets the visual of the queried objects legend for a specific geometrical representation
	virtual void setVisualQuery (TeVisual* visual, TeGeomRep rep)
	{ queryLegend_.setVisual(visual, rep); }

	//! Sets a legend for the theme objects selected by query and pointing
	virtual void queryAndPointingLegend (TeLegendEntry &leg) 
	{ queryAndPointingLegend_ = leg; }

	//! Returns the legend of the theme objects selected by query and pointing
	virtual TeLegendEntry& queryAndPointingLegend () 
	{ return queryAndPointingLegend_; }

    //! Returns the map of legend ids associated to each object
	virtual map<string, int>& getObjLegendMap() 
	{ return objLegendMap_; }

	//! Returns the map of legend ids associated to each object
	virtual map<string, int>& getObjOwnLegendMap() 
	{ return objOwnLegendMap_; }

	//! Sets the visual of the queried and pointed objects legend for a specific geometrical representation
	virtual void setVisualQueryAndPointing (TeVisual* visual, TeGeomRep rep)
	{ queryAndPointingLegend_.setVisual(visual, rep); }

	//! Sets a legend for the theme objects
	virtual void legend(TeLegendEntry& leg); 

	/** @name Raster Visual
	*  Methods to deal with the visual presentation of the raster representations
	*/
	//@{ 
	//! Returns the visual presentation of raster geometry
	virtual TeRasterTransform* rasterVisual() 
	{ return rasterVisual_; }

	//! Sets the visual presentation of raster geometry
	virtual void rasterVisual(TeRasterTransform* r) 
	{ rasterVisual_ = r; } 

	//! Removes the visual presentation of the raster
	virtual void removeRasterVisual();

	//! Creates an appropriate visual presentation to the raster of the theme
	virtual void createRasterVisual(TeRaster* rst=0);
	//@}
	//@}

	/** @name Box
	    Methods related to the bounding box of a theme
	*/
	//@{ 
	//! Returns the theme box 
	virtual TeBox& getThemeBox()
	{	return themeBox_; }

	//! Sets the theme box 
	virtual void setThemeBox(const TeBox& box)
	{	themeBox_ = box; }

	//! Returns the theme box 
	virtual TeBox& box()
	{	return themeBox_; }
	//@}

	//! Sets the parent node. The abstract theme does not have parent node.
	virtual void setParent (TeViewNode* );
	
	//! Returns TRUE if a theme has lower priority than another
	virtual bool operator< (const TeAbstractTheme& r) const
	{	return viewNodeParams_.priority_ < r.viewNodeParams_.priority_; }

	//! Clear the set containing the objects of the theme
	virtual void clearObjectSet()
	{ objectSet_.clear(); }

	//! Return the number of objects of the layer
	virtual int getNumLayerObjects()
	{ return numLayerObjects_; }

	//! Return the map containing the status of the objects
	virtual map<string, int>& getObjStatusMap()
	{ return objStatusMap_; }

	//! Set the status of the objects to the default state
	virtual void clearObjStatus()
	{ objStatusMap_.clear(); }

	//! Set the status of the items to the default state
	virtual void clearItemStatus()
	{ itemStatusMap_.clear(); }

	//! Return the map containing the status of the items
	virtual map<string, int>& getItemStatusMap()
	{ return itemStatusMap_; }

	//! the status
	virtual void setStatus(vector<string>& oidVec, vector<string>& itemVec, int status);

	//! the status for the items that were toggled
	virtual void setStatusForItemsToggled(set<string>& oidSet, vector<string>& itemVec);

	//! Set the status for the objects that were toggled
	virtual void setStatusForObjectToggled(string oid);

	//! Set the status for the new set of objects that were pointed
	virtual void setStatusForNewObjectsPointed(set<string>& oidSet);

	//! Set the status for the additional set of objects that were pointed
	virtual void setStatusForObjectsAddedByPointing(set<string>& oidSet);

	//! Set the status for the new set of items that were pointed
	virtual void setStatusForNewItemsPointed(vector<string>& itemVec);

	//! Set the status for the additional set of items that were pointed
	virtual void setStatusForItemsAddedByPointing(vector<string>& itemVec);

	//! Set the status for the new set of items that were queried
	virtual void setStatusForNewItemsQueried(set<string>& oidSet, vector<string>& uidVec);

	//! Set the status for the additional set of items that were queried
	virtual void setStatusForItemsAddedByQuerying(set<string>& oidSet, vector<string>& uidVec);

	//! Set the status for the set of items that were filtered by a query operation
	virtual void setStatusForItemsFilteredByQuerying(set<string>& oidSet, vector<string>& uidVec);

	//! Remove the pointing color
	virtual void removePointingColor();

	//! Remove the query color
	virtual void removeQueryColor();

	//! Invert the pointing status of the objects
	virtual void invertObjectStatus();

	//! Set the objects to the default status
	virtual void setObjectsToDefaultStatus();

	//! Gets the creation time of the theme
	virtual TeTime getCreationTime() const;

	//! Sets in memory the creation time of the theme
	virtual void setCreationTime(const TeTime& creationTime);

	//! Updates the creation in memory and in the database
	virtual bool updateThemeCreationTime(TeDatabase* database);

	//! Checks if the theme is update. If FALSE, the theme may be not be updated.
	virtual bool isUpdated();

	//! Save the theme parameters
	virtual bool save() = 0;

	//! Save the grouping parameters in memory when there is no chronon
	virtual bool buildGrouping(const TeGrouping& g, TeSelectedObjects selectedObjects = TeAll,
		               vector<double>* dValuesVec = 0) = 0;

	//! Save the grouping parameters in memory when there is chronon
	virtual bool buildGrouping(const TeGrouping& g, TeChronon chr, vector<map<string, string> >& mapObjValVec) = 0;
	
	
	//! Build the grouping and associate each object to its group  
	virtual bool saveGrouping(TeSelectedObjects selectedObjects = TeAll) = 0;

	//! Delete grouping
	virtual bool deleteGrouping() = 0; 

	//! Set the legend id for each object of the theme 
	virtual void setLegendsForObjects() = 0;

	//! Set the own legend id for each object of the theme 
	virtual void setOwnLegendsForObjects() = 0;

	/** @name Locate geometries
	    Returns the geometry(ies) of the theme given coordinate
	*/
	//@{ 	
	virtual bool locatePolygon		(TeCoord2D &pt, TePolygon &polygon, const double& tol = 0.0) = 0;
	virtual bool locatePolygonSet   (TeCoord2D &pt, double tol, TePolygonSet &polygons) = 0;
	virtual bool locateLine		(TeCoord2D &pt, TeLine2D &line, const double& tol = 0.0) = 0;
	virtual bool locatePoint	(TeCoord2D &pt, TePoint &point, const double& tol = 0.0) = 0;
	virtual bool locateCell		(TeCoord2D &pt, TeCell &c, const double& tol = 0.0) = 0;
	//@}

	//! Get the set of objects corresponding to the object selection criteria
	virtual set<string> getObjects(TeSelectedObjects selectedObjects = TeAll) = 0;

	//! Get the set of objects corresponding to the list of items
	virtual set<string> getObjects(const vector<string>& itemVec) = 0;

	//! Get the set of items corresponding to the object selection criteria
	virtual vector<string> getItemVector(TeSelectedObjects selectedObjects) = 0;

	//! Get the set of items corresponding to the set of objects
	virtual vector<string> getItemVector(const set<string>& oidSet) = 0;

	//! Get the number of objects acessible by this theme
	virtual unsigned int getNumberOfObjects()=0; 

	//! Save (insert or update) the theme metadata in the database
	virtual bool saveMetadata(TeDatabase* ) = 0;	
	
protected:
	string		generateAttributeRest_;
	string		generateTemporalRest_;
	string		generateSpatialRest_; //future use

	TeSpatialRelation	spatialRelation_;
	bool				hasSpatialRes_;
	TeBox				boxRest_;		//box which defines the spatial restriction 
	TeGeometry*			geomRest_;		//geometry which defines the spatial restriction 
	TeGeomRep			geomRepRest_;	//geometry representation of the theme which will be 
										//considered in the spatial restriction  
	// Display scale
	double	minScale_;
	double	maxScale_;

	//representation visible in the theme
	int visibleRep_;

	//Theme status
	int	enableVisibility_;

	// ----------------- grouping information -----------------
	TeGrouping		grouping_;

	// ----------------- legend information -----------------
	TeLegendEntryVector	legend_;

	// Background Legend
	TeLegendEntry		outOfCollectionLegend_;			//group(-1) 
	TeLegendEntry		withoutDataConnectionLegend_;	//group(-2) 
	TeLegendEntry		defaultLegend_;					//group(-3) 
	TeLegendEntry		pointingLegend_;				//group(-4) 
	TeLegendEntry		queryLegend_;					//group(-5) 
	TeLegendEntry		queryAndPointingLegend_;		//group(-6)

	map<string, int>	objLegendMap_;					// object legend
	map<string, int>	objOwnLegendMap_;				// object own legend
		
	//! visual of raster
	TeRasterTransform*	rasterVisual_;

	bool isAvailable_, //!< Theme source can be accessed.
		isEditable_; 	//!< Theme can be edited.
	
	TeBox	themeBox_;

	//! A set containing the theme objects
	set<string> objectSet_;

	//! Number of objects of the layer
	int numLayerObjects_;

	//! Status of the item (concatenation of the unique names of each theme table)
	map<string, int> itemStatusMap_;

	//! Status of the object
	map<string, int> objStatusMap_;

	//! Stores the creation time of the theme
	TeTime creationTime_;

public:
	//! Load the theme metadata from database
	virtual bool loadMetadata(TeDatabase* ) = 0;

protected:

	//! Erase the theme metadata in the database
	virtual bool eraseMetadata(TeDatabase* ) = 0;
};

//! A vector of pointers to theme
typedef vector<TeAbstractTheme*>	TeThemeVector;

//! A map from theme identifiers to pointers to theme
typedef map<int, TeAbstractTheme*>	TeThemeMap;

/*! \example creaTeAbstractTheme.cpp
	Shows how to create themes in TerraLib.
 */

/*! \example themeGrouping.cpp
	Shows how to do a grouping on the objects of a TerraLib theme.
 */

/*! \example rasterSlicing.cpp
	Shows how to  create a legend over a raster data, stored in a layer TerraLib.
 */
#endif