TsRtree.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 TsRTree.h
22 
23  \brief Test suite for the RTree class.
24  */
25 
26 #ifndef __TERRALIB_UNITTEST_SAM_INTERNAL_RTREE_H
27 #define __TERRALIB_UNITTEST_SAM_INTERNAL_RTREE_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 #include <terralib/sam.h>
42 
43 
44 // cppUnit
45 #include <cppunit/extensions/HelperMacros.h>
46 
47 /*!
48  \class TsRTree
49 
50  \brief Test suite for the RTree Class.
51 
52  This test suite will check the following:
53  <ul>
54  <li> </li>
55  <li></li>
56  <li></li>
57  <li></li>
58  </ul>
59  */
60 
61 class TsRTree : public CPPUNIT_NS::TestFixture
62 {
63 // It registers this class as a Test Suit
65 
66 // It registers the class methods as Test Cases belonging to the suit
67 
76 
78 
79  public:
80 
81 // It sets up context before running the test.
82  void setUp();
83 
84 // It cleann up after the test run.
85  void tearDown();
86 
87  protected:
88 
89 // Test Cases:
90 
91  /*! \brief Test Case: Constructs an RTree using int as DATATYPE . */
92  void tcRTreeInts();
93  /*! \brief Test Case: Constructs an RTree using unsigned int as DATATYPE . */
94  void tcRTreeUnsignedInts();
95  /*! \brief Test Case: Constructs an RTree using pointer as DATATYPE . */
96  void tcRTreePointers();
97  /*! \brief Test Case: Constructs an RTree inserting a gride of ints . */
98  void tcRTreeGradeInts();
99  /*! \brief Test Case: Constructs an RTree inserting a gride of unitary box . */
100  void tcRTreeBox();
101  /*! \brief Test Case: Constructs an RTree (MAXNODE = 4) inserting the defined rectangles and search the RTree. */
102  void tcRTreeBox_4();
103  /*! \brief Test Case: Constructs an RTree (MAXNODE = 3) inserting the defined rectangles and search the RTree. */
104  void tcRTreeBox_3();
105  /*! \brief Test Case: Constructs an RTree (MAXNODE = 2) inserting the defined rectangles and search the RTree. */
106  void tcRTreeBox_2();
107 
108 // Boxes to be inserted in a RTree in the last 3 test cases
109  te::gm::Envelope* r15; // new te::gm::Envelope(1.0,1.0, 2.5,2.5);
110  te::gm::Envelope* r16; // new te::gm::Envelope(3.2,1.0, 7.5,4.0);
111  te::gm::Envelope* r17; // new te::gm::Envelope(12.5,3.5, 17.5,5.0);
112  te::gm::Envelope* r18; // new te::gm::Envelope(14.0,1.7, 15,5.9);
113  te::gm::Envelope* r19; // new te::gm::Envelope(14.5,2.5, 16.5,3.5);
114  te::gm::Envelope* r12; // new te::gm::Envelope(5.0,4.5, 8.5,6.5);
115  te::gm::Envelope* r08; // new te::gm::Envelope(3.3,6.5, 4.5,7.5);
116  te::gm::Envelope* r09; // new te::gm::Envelope(5.2,8.5, 6.3,9.5);
117  te::gm::Envelope* r10; // new te::gm::Envelope(5.2,7.2, 6.3,8.2);
118  te::gm::Envelope* r11; // new te::gm::Envelope(8,1.8, 9,10.5);
119  te::gm::Envelope* r13; // new te::gm::Envelope(11,4.3, 11.9,9);
120  te::gm::Envelope* r14; // new te::gm::Envelope(10.2,11.5, 6.3,8.0);
121 
122 //Researching boxes
123  te::gm::Envelope* r1; // new te::gm::Envelope(3.0,1.5, 9.5,10.6);
124  te::gm::Envelope* r2; // new te::gm::Envelope(0.5,0.5, 18.0,6.0);
125  te::gm::Envelope* r3; // new te::gm::Envelope(2.7,6.7, 6.5,9.9);
126  te::gm::Envelope* r4; // new te::gm::Envelope(4.6,1.7, 9.3,10.8);
127  te::gm::Envelope* r5; // new te::gm::Envelope(9.5,4.5, 12,9.5);
128  te::gm::Envelope* r6; // new te::gm::Envelope(0.7,0.7,7.7, 4.3);
129  te::gm::Envelope* r7; // new te::gm::Envelope(12.5,1.5,18, 6.0);
130 
131 
132  private:
133 
134 };
135 
136 #endif // __TERRALIB_UNITTEST_SAM_INTERNAL_RTREE_H
137 
te::gm::Envelope * r13
Definition: TsRtree.h:119
This file contains include headers for TerraLib Spatial Access Methods module.
void tearDown()
Definition: TsRtree.cpp:63
void tcRTreePointers()
Test Case: Constructs an RTree using pointer as DATATYPE .
Definition: TsRtree.cpp:142
void tcRTreeUnsignedInts()
Test Case: Constructs an RTree using unsigned int as DATATYPE .
Definition: TsRtree.cpp:67
Test suite for the RTree Class.
Definition: TsRtree.h:61
te::gm::Envelope * r17
Definition: TsRtree.h:111
CPPUNIT_TEST_SUITE(TsRTree)
void tcRTreeGradeInts()
Test Case: Constructs an RTree inserting a gride of ints .
Definition: TsRtree.cpp:180
te::gm::Envelope * r08
Definition: TsRtree.h:115
te::gm::Envelope * r2
Definition: TsRtree.h:124
te::gm::Envelope * r3
Definition: TsRtree.h:125
te::gm::Envelope * r5
Definition: TsRtree.h:127
te::gm::Envelope * r15
Definition: TsRtree.h:109
void tcRTreeBox_3()
Test Case: Constructs an RTree (MAXNODE = 3) inserting the defined rectangles and search the RTree...
Definition: TsRtree.cpp:433
te::gm::Envelope * r12
Definition: TsRtree.h:114
An Envelope defines a 2D rectangular region.
te::gm::Envelope * r09
Definition: TsRtree.h:116
void tcRTreeBox()
Test Case: Constructs an RTree inserting a gride of unitary box .
Definition: TsRtree.cpp:231
CPPUNIT_TEST(tcRTreeInts)
te::gm::Envelope * r4
Definition: TsRtree.h:126
te::gm::Envelope * r18
Definition: TsRtree.h:112
void setUp()
Definition: TsRtree.cpp:36
void tcRTreeInts()
Test Case: Constructs an RTree using int as DATATYPE .
Definition: TsRtree.cpp:97
te::gm::Envelope * r7
Definition: TsRtree.h:129
void tcRTreeBox_2()
Test Case: Constructs an RTree (MAXNODE = 2) inserting the defined rectangles and search the RTree...
Definition: TsRtree.cpp:554
te::gm::Envelope * r16
Definition: TsRtree.h:110
te::gm::Envelope * r11
Definition: TsRtree.h:118
te::gm::Envelope * r1
Definition: TsRtree.h:123
This file contains include headers for the TerraLib Common Runtime module.
te::gm::Envelope * r6
Definition: TsRtree.h:128
This file contains include headers for the Vector Geometry model of TerraLib.
CPPUNIT_TEST_SUITE_END()
te::gm::Envelope * r19
Definition: TsRtree.h:113
te::gm::Envelope * r10
Definition: TsRtree.h:117
te::gm::Envelope * r14
Definition: TsRtree.h:120
void tcRTreeBox_4()
Test Case: Constructs an RTree (MAXNODE = 4) inserting the defined rectangles and search the RTree...
Definition: TsRtree.cpp:314