Loading...
Searching...
No Matches
PartitionVars.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 Branch.h
22
23 \brief Auxiliary structure when searching for a split partition.
24*/
25
26#ifndef __TERRALIB_SAM_RTREE_INTERNAL_PARTITIONVARS_H
27#define __TERRALIB_SAM_RTREE_INTERNAL_PARTITIONVARS_H
28
29// TerraLib
30#include "../../geometry/Envelope.h"
31
32namespace te
33{
34 namespace sam
35 {
36 namespace rtree
37 {
38 /*!
39 \struct PartitionVars
40
41 \brief Auxiliary structure when searching for a split partition.
42 */
43 template<class BRANCH, int MAXNODES> struct PartitionVars
44 {
45 int m_partition[MAXNODES + 1]; //!< Auxiliary partition vector.
46 int m_taken[MAXNODES + 1]; //!< Flag to indicate that entry is ok.
47 int m_count[2]; //!< Number of entries in each new page.
48 te::gm::Envelope m_cover[2]; //!< Auxiliary box of each new page.
49 double m_area[2]; //!< Auxiliary area of each new page.
50 BRANCH m_branchBuf[MAXNODES + 1]; //!< Auxiliary branch buffer.
51 te::gm::Envelope m_coverSplit; //!< Auxiliary box covering branchBuf.
52
53 /*! \brief Initializes partition vars. */
54 void init()
55 {
56 m_count[0] = 0;
57 m_count[1] = 0;
58
59 for(int i = 0; i <= MAXNODES; ++i)
60 {
61 m_taken[i] = 0;
62 m_partition[i] = -1;
63 }
64 }
65 };
66
67 } // end namespace rtree
68 } // end namespace sam
69} // end namespace te
70
71
72#endif // __TERRALIB_SAM_RTREE_INTERNAL_PARTITIONVARS_H
73
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:52
TerraLib.
Auxiliary structure when searching for a split partition.
Definition: PartitionVars.h:44
te::gm::Envelope m_cover[2]
Auxiliary box of each new page.
Definition: PartitionVars.h:48
int m_count[2]
Number of entries in each new page.
Definition: PartitionVars.h:47
te::gm::Envelope m_coverSplit
Auxiliary box covering branchBuf.
Definition: PartitionVars.h:51
int m_taken[MAXNODES+1]
Flag to indicate that entry is ok.
Definition: PartitionVars.h:46
void init()
Initializes partition vars.
Definition: PartitionVars.h:54
double m_area[2]
Auxiliary area of each new page.
Definition: PartitionVars.h:49
int m_partition[MAXNODES+1]
Auxiliary partition vector.
Definition: PartitionVars.h:45
BRANCH m_branchBuf[MAXNODES+1]
Auxiliary branch buffer.
Definition: PartitionVars.h:50