All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ObservationDataSetType.cpp
Go to the documentation of this file.
1 /* Copyright (C) 2001-2009 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18 */
19 
20 /*!
21  \file ObservationDataSetType.cpp
22 
23  \brief This file contains a class called ObservationDataSetType
24 */
25 
26 //ST
27 #include "ObservationDataSetType.h"
28 
29 te::st::ObservationDataSetType::ObservationDataSetType(int phTimeIdx, int obsPropIdx, int geomPropIdx)
30  : m_phTimePropIdx(2,-1),
31  m_geomPropIdx(geomPropIdx),
32  m_validTimePropIdx(2,-1),
33  m_resultTimePropIdx(-1)
34 {
35  m_observedPropIdx.push_back(obsPropIdx);
36  m_phTimePropIdx[0]=phTimeIdx;
37 }
38 
39 te::st::ObservationDataSetType::ObservationDataSetType(int phTimeIdx, const std::vector<int>& obsPropIdx, int geomPropIdx)
40  : m_phTimePropIdx(2,-1),
41  m_observedPropIdx(obsPropIdx),
42  m_geomPropIdx(geomPropIdx),
43  m_validTimePropIdx(2,-1),
44  m_resultTimePropIdx(-1)
45 {
46  m_phTimePropIdx[0]=phTimeIdx;
47 }
48 
49 te::st::ObservationDataSetType::ObservationDataSetType(const std::vector<int>& phTimeIdx,
50  const std::vector<int>& obsPropIdx, int geomPropIdx)
51  : m_phTimePropIdx(2,-1),
52  m_observedPropIdx(obsPropIdx),
53  m_geomPropIdx(geomPropIdx),
54  m_validTimePropIdx(2,-1),
55  m_resultTimePropIdx(-1)
56 {
57  for(std::size_t i=0; i<phTimeIdx.size(); i++)
58  m_phTimePropIdx[i]=phTimeIdx[i];
59 }
60 
61 te::st::ObservationDataSetType::ObservationDataSetType(const std::vector<int>& phTimeIdx, const std::vector<int>& obsPropIdx,
62  int geomPropIdx, const std::vector<int>& valTimeIdx, int resTimeIdx)
63  : m_phTimePropIdx(2,-1),
64  m_observedPropIdx(obsPropIdx),
65  m_geomPropIdx(geomPropIdx),
66  m_validTimePropIdx(2,-1),
67  m_resultTimePropIdx(resTimeIdx)
68 {
69  for(std::size_t i=0; i<phTimeIdx.size(); i++)
70  m_phTimePropIdx[i]=phTimeIdx[i];
71 
72  for(std::size_t i=0; i<valTimeIdx.size(); i++)
73  m_validTimePropIdx[i]=valTimeIdx[i];
74 }
75 
76 const std::vector<int>& te::st::ObservationDataSetType::getTimePropIdxs() const
77 {
78  return m_phTimePropIdx;
79 }
80 
82 {
83  return m_phTimePropIdx[0];
84 }
85 
87 {
88  return m_phTimePropIdx[1];
89 }
90 
91 void te::st::ObservationDataSetType::setTimePropIdxs(const std::vector<int>& idxs)
92 {
93  for(std::size_t i=0; i<idxs.size(); i++)
94  m_phTimePropIdx[i]=idxs[i];
95 }
96 
98 {
99  m_phTimePropIdx[0]=idx;
100 }
101 
103 {
104  m_phTimePropIdx[1]=idx;
105 }
106 
107 const std::vector<int>& te::st::ObservationDataSetType::getObsPropIdxs() const
108 {
109  return m_observedPropIdx;
110 }
111 
112 void te::st::ObservationDataSetType::setObsPropIdxs(const std::vector<int>& props)
113 {
114  m_observedPropIdx = props;
115 }
116 
118 {
119  return m_geomPropIdx;
120 }
121 
123 {
124  m_geomPropIdx = idx;
125 }
126 
128 {
129  return m_validTimePropIdx[0];
130 }
131 
133 {
134  return m_validTimePropIdx[1];
135 }
136 
138 {
139  return m_validTimePropIdx;
140 }
141 
143 {
144  m_validTimePropIdx[0]=idx;
145 }
146 
148 {
149  m_validTimePropIdx[1]=idx;
150 }
151 
152 void te::st::ObservationDataSetType::setVlTimePropIdxs(const std::vector<int>& idxs)
153 {
154  for(std::size_t i=0; i<idxs.size(); i++)
155  m_validTimePropIdx[i]=idxs[i];
156 }
157 
159 {
160  return m_resultTimePropIdx;
161 }
162 
164 {
165  m_resultTimePropIdx = idx;
166 }
167 
169 {
170 }
171 
std::vector< int > m_phTimePropIdx
The indexes of DataSet properties that contain the phenomenon time.
void setVlTimePropIdxs(const std::vector< int > &idxs)
It sets the indexes of the DataSet properties that contains the valid time.
int getGeomPropIdx() const
It returns the index of the observed property that is a geometry property.
int getVlEndTimePropIdx() const
It returns the index of the DataSet property that contains the valid end time.
const std::vector< int > & getVlTimePropIdxs() const
It returns the indexes of the DataSet properties that contains the valid time.
const std::vector< int > & getTimePropIdxs() const
It returns the indexes of the DataSetType properties that contains the phenomenon time...
virtual ~ObservationDataSetType()
Virtual destructor.
void setRsTimePropIdx(int idx)
It sets the index of the DataSet property that contains the result time.
void setBeginTimePropIdx(int idx)
It sets the index of the DataSet property that contains the phenomenon beginning time.
int getVlBeginTimePropIdx() const
It returns the index of the DataSet property that contains the valid beginning time.
void setGeomPropIdx(int idx)
It sets the index of the observed property that is a geometry property.
void setEndTimePropIdx(int idx)
It sets the index of the DataSet property that contains the phenomenon end time.
This file contains a class called ObservationDataSetType.
void setVlEndTimePropIdx(int idx)
It sets the index of the DataSet property that contains the valid end time.
void setTimePropIdxs(const std::vector< int > &idxs)
It sets the indexes of the DataSet properties that contains the phenomenon time.
int getEndTimePropIdx() const
It returns the index of the DataSet property that contains the phenomenon end time.
ObservationDataSetType(int phTimeIdx, int obsPropIdx, int geomPropIdx=-1)
Constructor.
std::vector< int > m_observedPropIdx
The indexes of DataSet properties that are observed.
int getRsTimePropIdx() const
It returns the index of the DataSet property that contains the result time.
void setVlBeginTimePropIdx(int idx)
It sets the index of the DataSet property that contains the valid beginning time. ...
const std::vector< int > & getObsPropIdxs() const
It returns the indexes of the DataSetType properties that are observed over time. ...
void setObsPropIdxs(const std::vector< int > &props)
It sets the indexes of the DataSetType properties that are observed over time.
std::vector< int > m_validTimePropIdx
The indexes of DataSet properties that contain the valid time.
int getBeginTimePropIdx() const
It returns the index of the DataSet property that contains the phenomenon beginning time...