/usr/include/terralib/kernel/TeProject.h is in libterralib-dev 4.3.0+dfsg.2-10.
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 | /************************************************************************************
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 TeProject.h
\brief This file contains structures and definitions to support the concept of a project in TerraLib
*/
#ifndef __TERRALIB_INTERNAL_PROJECT_H
#define __TERRALIB_INTERNAL_PROJECT_H
#include "TeDefines.h"
#include <string>
#include <vector>
#include <map>
class TeDatabase;
class TeProjection;
class TeView;
using std::vector;
using std::string;
using std::map;
//! A vector of the identifiers of the maps in the project.
typedef vector<int> TeViewVector;
//! A vector of the names of the views in the project.
typedef vector<string> TeViewNameVector;
//! A vector of the identifiers of the projects.
typedef vector<int> TeProjectIdVector;
/*!
This class represents a project concept.
A project is a collection of views kept in a ordered list.
A project might have the information about the current view.
*/
class TL_DLL TeProject
{
public:
//! Empty constructor
TeProject();
//! Constructor from a identifier
TeProject(int id, TeDatabase* db);
//! Constructor from a name
TeProject(const string& name, TeDatabase* db);
//! Copy Constructor
TeProject(const TeProject& other);
//! Operator =
TeProject& operator= (const TeProject& other);
//! Destructor
virtual ~TeProject();
//! Sets the project name.
virtual void setId(int id)
{id_ = id;}
//! Returns the project name.
virtual int id()
{ return id_; }
//! Sets the project name.
virtual void setName(const string& name)
{name_ = name;}
//! Returns the project name.
virtual string name()
{ return name_; }
//! Returns the project description.
virtual string description()
{ return description_; }
//! Sets the project description
virtual void setDescription(const string& desc)
{ description_ = desc ; }
//! Sets the project database
virtual void setDatabase(TeDatabase* db)
{ db_ = db; }
//! Gets the project database
virtual TeDatabase* getDatabase()
{ return db_; }
//! Returns TRUE if a view is part of a project and FALSE otherwise
virtual bool isProjectView(int viewId);
//! Returns TRUE if a project has a current view and FALSE otherwise
virtual bool hasCurrentView();
//! Sets the id of the current view in the project
virtual void setCurrentViewId(int viewId);
//! Returns the id of the current view in the project
virtual int getCurrentViewId();
//! Sets the index in the list of the current view in the project
virtual void setCurrentViewIndex(int index)
{ currentViewIndex_ = index; }
//! Returns position of the current view in the project
virtual int getCurrentViewIndex()
{ return currentViewIndex_; }
//! Returns a reference to the project list of views
const TeViewVector& getViewVector() const
{ return views_; }
//! Returns the names of the views in the project.
virtual TeViewNameVector getViewNameVector();
//! Returns the id of the index-th view of the project
virtual int getViewId(int index);
//! Creates a new view in the project and persists it in the database
/*
\param name view name
\param projection view projection. If null uses as default LatLong/SAD69
\return the id of the new view
*/
virtual int insertView(string name, TeProjection* projection = NULL);
//! Adds a new view relation with the project and persists it in the database
/*
\param view The view object
\return the id of the new view
*/
virtual int insertViewRel(int viewId);
//! Adds an view id to the views project vector
virtual int addView(int viewId);
//! Removes a view from the project (and also from the database)
virtual void deleteView(int viewId, const bool& removeFromDatabase = true);
//! Clear the project
virtual void clearViews();
private:
int id_;
string name_;
string description_;
TeViewVector views_;
int currentViewIndex_;
TeDatabase* db_;
};
//! A map from a integer unique identifier to a pointer to project
typedef map<int, TeProject*> TeProjectMap;
#endif
|