TsNoAreaRings.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 TsNoAreaRings.cpp
22 
23  \brief A test suit for the Fix Geometries class.
24  */
25 
26 // Unit-Test Terralib
27 #include "TsNoAreaRings.h"
28 #include "../Config.h"
29 
30 // Terralib
31 #include <terralib/Defines.h>
32 #include <terralib/common.h>
34 #include <terralib/geometry.h>
35 
36 // STL
37 #include <cstdio>
38 #include <cstdlib>
39 #include <cstring>
40 
41 // Boost
42 #include <boost/shared_ptr.hpp>
43 
45 
47 {
48  //#ifdef TE_COMPILE_ALL
49 
51  line->setPoint(0, 1.0, 1.5);
52  line->setPoint(1, 1.0, 3.3);
53  line->setPoint(2, 3.0, 3.3);
54  line->setPoint(3, 3.0, 1.5);
55 
57  poly->setRingN(0, line);
58 
59  //test para garantir que ele eh invalido
60  try
61  {
62  CPPUNIT_ASSERT(poly->isValid() == false);
63  CPPUNIT_ASSERT(false);
64  }
65  catch (const std::exception& e)
66  {
67  }
68 
69  //fix geometry
70  //line->setPointN(4, te::gm::Point(1.0, 1.5, 4326));
71 
72  //teste para garantir que ele eh valido
73 
74  try
75  {
76  CPPUNIT_ASSERT(poly->isValid() == true);
77  }
78  catch (const std::exception& e)
79  {
80  CPPUNIT_ASSERT(false);
81  }
82 
83  //#endif
84 }
Proxy file for the real file terralib_defines.h.
An static class with global definitions.
unsigned int line
A LinearRing is a LineString that is both closed and simple.
Definition: LinearRing.h:53
void setPoint(std::size_t i, const double &x, const double &y)
It sets the value of the specified point.
virtual bool isValid() const _NOEXCEPT_OP(false)
It tells if the geometry is well formed.
CPPUNIT_TEST_SUITE_REGISTRATION(TsNoAreaRings)
Polygon is a subclass of CurvePolygon whose rings are defined by linear rings.
Definition: Polygon.h:50
void tcCreatePolygon()
This file contains include headers for the TerraLib Common Runtime module.
This file contains include headers for the Vector Geometry model of TerraLib.
void setRingN(std::size_t i, Curve *r)
It sets the informed position ring to the new one.
A test suit for the Fix Geometries class interface.
Definition: TsNoAreaRings.h:44