TsEnvelop.h
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 TsEnvelop.h
22 
23  \brief Test suite for the Envelop class.
24  */
25 
26 #ifndef __TERRALIB_UNITTEST_GEOMETRY_INTERNAL_ENVELOPE_H
27 #define __TERRALIB_UNITTEST_GEOMETRY_INTERNAL_ENVELOPE_H
28 
29 // STL
30 #include <string>
31 #include <vector>
32 
33 // STL
34 #include <cstdio>
35 #include <cstdlib>
36 #include <cstring>
37 
38 //TerraLib
39 #include <terralib/common.h>
40 #include <terralib/geometry.h>
41 
42 
43 // cppUnit
44 #include <cppunit/extensions/HelperMacros.h>
45 
46 /*!
47  \class TsEnvelop
48 
49  \brief Test suite for the Envelop Class.
50 
51  This test suite will check the following:
52  <ul>
53  <li> </li>
54  <li></li>
55  <li></li>
56  <li></li>
57  </ul>
58  */
59 class TsEnvelop : public CPPUNIT_NS::TestFixture
60 {
61 // It registers this class as a Test Suit
63 
64 // It registers the class methods as Test Cases belonging to the suit
65 
87 
88 
89  //CPPUNIT_TEST( tcSpatialOperations );
91 
92  //CPPUNIT_TEST( tcOperatorCompare );
93  //CPPUNIT_TEST( tcOperatorEqual );
94  //CPPUNIT_TEST( tcTransform );
95 
97 
98  public:
99 
100 // It sets up context before running the test.
101  void setUp();
102 
103 // It cleann up after the test run.
104  void tearDown();
105 
106  protected:
107 
108 // Test Cases:
109 
110  /*! \brief Test Case: Constructs an envelope with invalid coordinates. */
111  void tcEnvelopInvalid();
112 
113  /*! \brief Test Case: Constructs an envelope with valid coordinates.. */
114  void tcEnvelopValid();
115 
116  /*! \brief Test Case: Copy a envelop. */
117  void tcEnvelopCopy();
118 
119  /*! \brief Test Case: Initialize a envelop. */
120  void tcEnvelopInit();
121 
122  /*! \brief Test Case: Check if the envelopes are "spatially equal". */
123  void tcEquals();
124 
125  /*! \brief Test Case: Get the lower left X coordinate. */
126  void tcGetLowerLeftX();
127 
128  /*! \brief Test Case: Get the lower left Y coordinate. */
129  void tcGetLowerLeftY();
130 
131  /*! \brief Test Case: Get the lower left X coordinate. */
132  void tcGetUpperRightX();
133 
134  /*! \brief Test Case: Get the lower left X coordinate. */
135  void tcGetUpperRightY();
136 
137  /*! \brief Test Case: Get the lower left Coord2D. */
138  void tcGetLowerLeftCoord2D();
139 
140  /*! \brief Test Case: Get the lower left X coordinate. */
141  void tcGetUpperRightCoord2D();
142 
143  /*! \brief Test Case: Invalidate the envelop. */
144  void tcMakeInvalid();
145 
146  void tcIsValidRect();
147 
148  void tcGetWidth_Right_Area();
149  ////void tcGetWidth();
150  ////void tcGetHeight();
151  ////void tcGetArea();
152 
153  void tcSpatialOperations();
154  void tcSpatialOperations1(); //box of Ouro Preto
155 
156  /////*! \brief Test Case: Assign operator. */
157  ////void tcOperatorAssign();
158 
159  /////*! \brief Test Case: Compare operator */
160  ////void tcOperatorCompare();
161 
162  /////*! \brief Test Case: Equals */
163  ////void tcOperatorEqual();
164 
165  /*! \brief Test Case: Disjoint */
166  void tcDisjoint();
167 
168  /*! \brief Test Case: Intersects */
169  void tcIntersects();
170 
171  /*! \brief Test Case: Touches */
172  void tcTouches();
173 
174  /*! \brief Test Case: Within */
175  void tcWithin();
176 
177  /*! \brief Test Case: Contains */
178  void tcContains();
179 
180  /*! \brief Test Case: Intersection */
181  void tcIntersection();
182 
183  /*! \brief Test Case: Updates the envelop with another envelop. */
184  void tcUnion();
185 
186 
187  private:
188 
191 
199 
204 };
205 
206 #endif // __TERRALIB_UNITTEST_GEOMETRY_INTERNAL_ENVELOPE_H
207 
void tearDown()
Definition: TsEnvelop.cpp:55
Test suite for the Envelop Class.
Definition: TsEnvelop.h:59
void tcMakeInvalid()
Test Case: Invalidate the envelop.
Definition: TsEnvelop.cpp:217
void tcEquals()
Test Case: Check if the envelopes are "spatially equal".
Definition: TsEnvelop.cpp:128
te::gm::Envelope * boxAeF
Definition: TsEnvelop.h:201
void tcContains()
Test Case: Contains.
Definition: TsEnvelop.cpp:365
void tcEnvelopValid()
Test Case: Constructs an envelope with valid coordinates..
Definition: TsEnvelop.cpp:87
void tcGetUpperRightX()
Test Case: Get the lower left X coordinate.
Definition: TsEnvelop.cpp:163
void setUp()
Definition: TsEnvelop.cpp:34
void tcSpatialOperations()
Definition: TsEnvelop.cpp:266
void tcWithin()
Test Case: Within.
Definition: TsEnvelop.cpp:369
te::gm::Envelope * boxA
Definition: TsEnvelop.h:189
CPPUNIT_TEST(tcEnvelopInvalid)
void tcEnvelopInit()
Test Case: Initialize a envelop.
Definition: TsEnvelop.cpp:114
void tcSpatialOperations1()
Definition: TsEnvelop.cpp:383
te::gm::Envelope * boxAEqual
Definition: TsEnvelop.h:190
te::gm::Envelope * boxG
Definition: TsEnvelop.h:197
An Envelope defines a 2D rectangular region.
void tcIntersects()
Test Case: Intersects.
Definition: TsEnvelop.cpp:299
CPPUNIT_TEST_SUITE(TsEnvelop)
te::gm::Envelope * boxB
Definition: TsEnvelop.h:192
te::gm::Envelope * boxGexpandedA
Definition: TsEnvelop.h:203
te::gm::Envelope * boxF
Definition: TsEnvelop.h:196
te::gm::Envelope * boxE
Definition: TsEnvelop.h:195
void tcEnvelopInvalid()
Test Case: Constructs an envelope with invalid coordinates.
Definition: TsEnvelop.cpp:73
void tcGetLowerLeftCoord2D()
Test Case: Get the lower left Coord2D.
Definition: TsEnvelop.cpp:193
void tcGetUpperRightY()
Test Case: Get the lower left X coordinate.
Definition: TsEnvelop.cpp:178
void tcTouches()
Test Case: Touches.
Definition: TsEnvelop.cpp:324
void tcIntersection()
Test Case: Intersection.
Definition: TsEnvelop.cpp:341
void tcIsValidRect()
Definition: TsEnvelop.cpp:236
void tcGetLowerLeftX()
Test Case: Get the lower left X coordinate.
Definition: TsEnvelop.cpp:133
This file contains include headers for the TerraLib Common Runtime module.
te::gm::Envelope * boxAexpandedB
Definition: TsEnvelop.h:202
te::gm::Envelope * boxC
Definition: TsEnvelop.h:193
te::gm::Envelope * boxH
Definition: TsEnvelop.h:198
void tcEnvelopCopy()
Test Case: Copy a envelop.
Definition: TsEnvelop.cpp:100
This file contains include headers for the Vector Geometry model of TerraLib.
void tcDisjoint()
Test Case: Disjoint.
Definition: TsEnvelop.cpp:314
te::gm::Envelope * boxAeB
Definition: TsEnvelop.h:200
te::gm::Envelope * boxD
Definition: TsEnvelop.h:194
void tcGetUpperRightCoord2D()
Test Case: Get the lower left X coordinate.
Definition: TsEnvelop.cpp:205
void tcGetWidth_Right_Area()
Definition: TsEnvelop.cpp:250
void tcUnion()
Test Case: Updates the envelop with another envelop.
Definition: TsEnvelop.cpp:374
CPPUNIT_TEST_SUITE_END()
void tcGetLowerLeftY()
Test Case: Get the lower left Y coordinate.
Definition: TsEnvelop.cpp:148