All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
VectorizerPolygonStructure.cpp
Go to the documentation of this file.
1 /* Copyright (C) 2008 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 terralib/raster/VectorizerPolygonStructure.cpp
22 
23  \brief A polygon container node class.
24 */
25 
26 // TerraLib
27 #include "TileIndexer.h"
29 
30 // STL
31 #include <iostream>
32 
34 {
35  init();
36 }
37 
39 {
40  init();
41 
42  reset( rhs.m_polygonPtr.get() ? (te::gm::Polygon*)rhs.m_polygonPtr->clone() :
44 }
45 
47  const unsigned int& v, const double& tidy)
48 {
49  init();
50 
51  reset(polPtr, v, tidy);
52 }
53 
55 {
56  clear();
57 }
58 
60 {
61  m_value = 0;
62  m_tileIndexerDY = 1.0;
63 }
64 
66 {
67  m_indexerPtr.reset();
68  m_polygonPtr.reset();
69  init();
70 }
71 
73  const unsigned int& v, const double& tidy)
74 {
75  clear();
76 
77  m_polygonPtr.reset( polPtr );
78  m_value = v;
79  m_tileIndexerDY = tidy;
80 
81  if( polPtr )
82  {
83  m_indexerPtr.reset( new te::rst::TileIndexer(*m_polygonPtr, m_tileIndexerDY) );
84  }
85 }
86 
89 {
90  reset( rhs.m_polygonPtr.get() ? (te::gm::Polygon*)rhs.m_polygonPtr->clone() :
92 
93  return *this;
94 }
double m_tileIndexerDY
The polygon tile indexer Y Axis resolution.
Polygon tile indexing class for optmized geometrical relational tests.
Definition: TileIndexer.h:54
VectorizerPolygonStructure & operator=(const VectorizerPolygonStructure &rhs)
Assignment operator.
A polygon container node class.
void reset(te::gm::Polygon *polPtr, const unsigned int &v, const double &tidy)
Reset the current instance.
Polygon tile indexing class for optmized geometrical relational tests.
std::auto_ptr< te::gm::Polygon > m_polygonPtr
A pointer to the stored polygon instance.
Polygon is a subclass of CurvePolygon whose rings are defined by linear rings.
Definition: Polygon.h:50
A polygon container node class.
unsigned int m_value
The value (color) related to a polygon.