TeView Class Reference

#include <TeView.h>


Detailed Description

A View is a structure that aggregated themes to be visualized or processed in its own projection. Views may belong to a particular user.
See also:
TeTheme TeViewNode
Examples:

createTheme.cpp, and rasterSlicing.cpp.

Definition at line 43 of file TeView.h.


Public Member Functions

virtual void add (TeViewNode *node, const bool &updatePriority=true)
 Adds a view node to the view tree.
virtual TeBox box (bool onlyVisible)
virtual int connectedId ()
 Returns the id of the connected view.
virtual void connectedId (int id)
 Sets the id of the connected view.
virtual TeThemeget (string themeName)
 Returns a node identified by its name and version.
virtual TeViewNodeget (int i)
 Returns a node identified by its position.
virtual TeBoxgetCurrentBox ()
 Returns the current box.
virtual int getCurrentTheme ()
 Returns the current theme id.
virtual void id (int id)
 Sets view unique id.
virtual int id ()
 Returns view unique id.
virtual void isVisible (bool v)
 Sets whether view is visible.
virtual bool isVisible ()
 Returns TRUE if view is visible.
virtual void moveDown (TeViewNode *node)
 Moves a node down.
virtual void moveUp (TeViewNode *node)
 Moves a node up.
virtual void name (const string &s)
 Sets the view name.
virtual string name () const
 Returns the view name.
virtual void projection (TeProjection *p)
 Sets the view projection.
virtual TeProjectionprojection ()
 Returns the view projection.
virtual TeViewNoderemove (int id)
 Removes a view node through its identifier from the view tree.
virtual TeViewNoderemove (string name)
 Removes a view node through its name from the view tree.
virtual TeViewTreeroot ()
 Returns the view tree where view belongs.
virtual void setCurrentBox (const TeBox &b)
 Sets the current box.
virtual void setCurrentTheme (const int &id)
 Sets the current theme id.
virtual unsigned int size ()
 Returns the number of themes in the view.
virtual void sort ()
 Sort the themes in the view.
virtual void swap (unsigned int i, unsigned int j)
 Swap the order of two themes.
 TeView (const string &name="", const string &user="", int id=0)
 Constructor.
virtual vector
< TeViewNode * > & 
themes ()
 Returns the vector of themes of the view sorted according to their priorities.
virtual void user (const string &i)
 Sets the view user name.
virtual string user ()
 Returns the view user name.
virtual int visibility ()
 Returns the themes visibility.
virtual void visibility (int vis)
 Sets the themes visibility.
virtual ~TeView ()
 Destructor.

Private Attributes

int connectedId_
TeBox currentBox_
int currentTheme_
int id_
bool is_visible_
string name_
TeProjectionproj_
string user_
TeViewTree viewTree_

Constructor & Destructor Documentation

TeView::TeView ( const string name = "",
const string user = "",
int  id = 0 
) [inline]

Definition at line 47 of file TeView.h.

00048                 : id_(id), name_(name), user_(user), proj_(0), is_visible_(true), connectedId_(0), currentTheme_(-1)
00049         {}

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

Definition at line 52 of file TeView.h.

00053         {
00054             viewTree_.clear();
00055             delete proj_;
00056         }


Member Function Documentation

virtual void TeView::add ( TeViewNode node,
const bool updatePriority = true 
) [inline, virtual]

Examples:
createTheme.cpp, and rasterSlicing.cpp.

Definition at line 110 of file TeView.h.

Referenced by TeAbstractTheme::copyTo(), TeDatabase::loadView(), TeDatabase::loadViewSet(), loadViewSetAndThemeGroups(), TeDatabase::loadViewTree(), main(), and TeCopyDatabase().

00111         {
00112                 node->view (id_);
00113                 viewTree_.add ( node, updatePriority );
00114         }

virtual TeBox TeView::box ( bool  onlyVisible  )  [inline, virtual]

Returns the boundary box of the view themes

Parameters:
onlyVisible If is true, returns the boundary box of visible themes, otherwise returns the boundary box of all themes

Definition at line 205 of file TeView.h.

00206         { 
00207                 TeBox retval;
00208                 if ( root() ) 
00209                         retval = root()->box(onlyVisible,proj_); 
00210                 return retval;          
00211         }; 

virtual int TeView::connectedId (  )  [inline, virtual]

Definition at line 200 of file TeView.h.

00200 {return connectedId_;}

virtual void TeView::connectedId ( int  id  )  [inline, virtual]

Definition at line 197 of file TeView.h.

00197 {connectedId_ = id;}

virtual TeTheme* TeView::get ( string  themeName  )  [inline, virtual]

Definition at line 147 of file TeView.h.

References TeViewNode::name(), TeTHEME, and TeViewNode::type().

00148         {
00149                 TeTheme *ret = 0;
00150                 for (unsigned int th = 0;th < viewTree_.size();th++)
00151                 {
00152                         TeViewNode *node = viewTree_.retrieve(th);
00153                         if (node->type() == TeTHEME)
00154                         {
00155                                 TeTheme *tmp = (TeTheme*)node;
00156                                 if (tmp->name() == themeName)
00157                                 {
00158                                         ret = tmp;
00159                                         break;
00160                                 }
00161                         }
00162                 }
00163                 return ret;
00164         }

virtual TeViewNode* TeView::get ( int  i  )  [inline, virtual]

Definition at line 141 of file TeView.h.

Referenced by fillTableCombo(), TeSQLite::insertView(), TePostgreSQL::insertView(), TeOCIOracle::insertView(), TeMySQL::insertView(), TeFirebird::insertView(), TeOracle::insertView(), TeAdo::insertView(), TeCopyView(), and TePlotView().

00142         {
00143                 return viewTree_.retrieve(i);
00144         }

virtual TeBox& TeView::getCurrentBox (  )  [inline, virtual]

Definition at line 95 of file TeView.h.

Referenced by TeSQLite::insertView(), TePostgreSQL::insertView(), TeOCIOracle::insertView(), TeMySQL::insertView(), TeOracle::insertView(), TeAdo::insertView(), TeCopyView(), and TeDatabase::updateView().

00095 { return currentBox_; }

virtual int TeView::getCurrentTheme (  )  [inline, virtual]

Definition at line 101 of file TeView.h.

Referenced by TeSQLite::insertView(), TePostgreSQL::insertView(), TeOCIOracle::insertView(), TeMySQL::insertView(), TeOracle::insertView(), TeAdo::insertView(), and TeDatabase::updateView().

00101 { return currentTheme_; }

virtual void TeView::id ( int  id  )  [inline, virtual]

Definition at line 62 of file TeView.h.

00063         {
00064                 id_ = id;       // update view id
00065                 for (unsigned int th=0;th<viewTree_.size();th++)        //update its themes
00066                         viewTree_.retrieve(th)->view (id_);
00067                 viewTree_.view(id); 
00068         }

virtual int TeView::id (  )  [inline, virtual]

Definition at line 59 of file TeView.h.

Referenced by TeAbstractTheme::copyTo(), TeDatabasePortal::getView(), TeSQLite::insertView(), TePostgreSQL::insertView(), TeOCIOracle::insertView(), TeMySQL::insertView(), TeFirebird::insertView(), TeOracle::insertView(), TeAdo::insertView(), TeDatabase::loadView(), TeDatabase::loadViewSet(), loadViewSetAndThemeGroups(), TeDatabase::loadViewTree(), TeCopyDatabase(), and TeDatabase::updateView().

00059 { return id_; }

virtual void TeView::isVisible ( bool  v  )  [inline, virtual]

Definition at line 92 of file TeView.h.

00092 { is_visible_ = v; }

virtual bool TeView::isVisible (  )  [inline, virtual]

Definition at line 89 of file TeView.h.

Referenced by TeDatabasePortal::getView(), TeSQLite::insertView(), TePostgreSQL::insertView(), TeOCIOracle::insertView(), TeMySQL::insertView(), TeFirebird::insertView(), TeOracle::insertView(), TeAdo::insertView(), TeCopyDatabase(), and TeDatabase::updateView().

00089 { return is_visible_; }

virtual void TeView::moveDown ( TeViewNode node  )  [inline, virtual]

Definition at line 135 of file TeView.h.

00136         {
00137                 viewTree_.moveDown(node);
00138         }

virtual void TeView::moveUp ( TeViewNode node  )  [inline, virtual]

Definition at line 129 of file TeView.h.

00130         {
00131                 viewTree_.moveUp(node);
00132         }

virtual void TeView::name ( const string s  )  [inline, virtual]

Definition at line 74 of file TeView.h.

00074 { name_ = s; }

virtual string TeView::name (  )  const [inline, virtual]

Definition at line 71 of file TeView.h.

Referenced by TeDatabasePortal::getView(), TeSQLite::insertView(), TePostgreSQL::insertView(), TeOCIOracle::insertView(), TeMySQL::insertView(), TeFirebird::insertView(), TeOracle::insertView(), TeAdo::insertView(), TeDatabase::loadView(), TeCopyDatabase(), and TeDatabase::updateView().

00071 { return name_; }

virtual void TeView::projection ( TeProjection p  )  [inline, virtual]

Definition at line 86 of file TeView.h.

00086 { proj_ = p; }

virtual TeProjection* TeView::projection (  )  [inline, virtual]

Examples:
createTheme.cpp, and rasterSlicing.cpp.

Definition at line 83 of file TeView.h.

Referenced by TeSQLite::insertView(), TePostgreSQL::insertView(), TeOCIOracle::insertView(), TeMySQL::insertView(), TeFirebird::insertView(), TeOracle::insertView(), TeAdo::insertView(), TeDatabase::loadView(), TeDatabase::loadViewSet(), loadViewSetAndThemeGroups(), main(), TeCopyDatabase(), TeCopyView(), and TeDatabase::updateView().

00083 { return proj_; }

virtual TeViewNode* TeView::remove ( int  id  )  [inline, virtual]

Definition at line 123 of file TeView.h.

00124         {
00125                 return viewTree_.removeID(id);
00126         }

virtual TeViewNode* TeView::remove ( string  name  )  [inline, virtual]

Definition at line 117 of file TeView.h.

Referenced by TeDatabase::deleteTheme(), TeSqlServer::deleteTheme(), TeDatabase::loadView(), TeDatabase::loadViewSet(), and loadViewSetAndThemeGroups().

00118         {
00119                 return viewTree_.remove(name);
00120         }

virtual TeViewTree* TeView::root (  )  [inline, virtual]

Definition at line 107 of file TeView.h.

Referenced by updateNodesTrees(), and TeDatabase::updateView().

00107 { return &viewTree_; }

virtual void TeView::setCurrentBox ( const TeBox b  )  [inline, virtual]

Definition at line 98 of file TeView.h.

Referenced by TeDatabasePortal::getView(), and TeCopyDatabase().

00098 { currentBox_ = b; }

virtual void TeView::setCurrentTheme ( const int &  id  )  [inline, virtual]

Definition at line 104 of file TeView.h.

Referenced by TeDatabasePortal::getView(), and TeCopyDatabase().

00104 { currentTheme_ = id; }

virtual unsigned int TeView::size ( void   )  [inline, virtual]

Definition at line 189 of file TeView.h.

Referenced by TeSQLite::insertView(), TePostgreSQL::insertView(), TeOCIOracle::insertView(), TeMySQL::insertView(), TeFirebird::insertView(), TeOracle::insertView(), TeAdo::insertView(), and TeCopyView().

00190                 { return viewTree_.size() ; }

virtual void TeView::sort (  )  [inline, virtual]

Definition at line 167 of file TeView.h.

References TeViewNode::sort().

00168         { viewTree_.sort(); }

virtual void TeView::swap ( unsigned int  i,
unsigned int  j 
) [inline, virtual]

Definition at line 171 of file TeView.h.

00172         {
00173                 viewTree_.swap(i,j);
00174         }

virtual vector<TeViewNode*>& TeView::themes (  )  [inline, virtual]

Definition at line 193 of file TeView.h.

Referenced by fillThemeCombo(), TeDatabase::loadView(), TeCopyDatabase(), and TePlotView().

00194         { return viewTree_.nodes();}

virtual void TeView::user ( const string i  )  [inline, virtual]

Definition at line 80 of file TeView.h.

00080 { user_ = i; }

virtual string TeView::user (  )  [inline, virtual]

Definition at line 77 of file TeView.h.

Referenced by TeDatabasePortal::getView(), TeSQLite::insertView(), TePostgreSQL::insertView(), TeOCIOracle::insertView(), TeMySQL::insertView(), TeFirebird::insertView(), TeOracle::insertView(), TeAdo::insertView(), TeDatabase::loadView(), TeCopyDatabase(), and TeDatabase::updateView().

00077 { return user_; }

virtual int TeView::visibility (  )  [inline, virtual]

Definition at line 183 of file TeView.h.

00184         {
00185                 return viewTree_.visibility();
00186         }

virtual void TeView::visibility ( int  vis  )  [inline, virtual]

Definition at line 177 of file TeView.h.

00178         {
00179                 viewTree_.visibility( vis );
00180         }


Field Documentation

int TeView::connectedId_ [private]

Definition at line 221 of file TeView.h.

TeBox TeView::currentBox_ [private]

Definition at line 223 of file TeView.h.

int TeView::currentTheme_ [private]

Definition at line 224 of file TeView.h.

int TeView::id_ [private]

Definition at line 211 of file TeView.h.

bool TeView::is_visible_ [private]

Definition at line 218 of file TeView.h.

string TeView::name_ [private]

Definition at line 215 of file TeView.h.

TeProjection* TeView::proj_ [private]

Definition at line 217 of file TeView.h.

string TeView::user_ [private]

Definition at line 216 of file TeView.h.

TeViewTree TeView::viewTree_ [private]

Definition at line 220 of file TeView.h.


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