GEOS 3.3.8

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List

IntervalRTreeBranchNode.h
1 /**********************************************************************
2 * $Id: IntervalRTreeBranchNode.h 2263 2009-01-29 18:56:00Z mloskot $
3 *
4 * GEOS - Geometry Engine Open Source
5 * http://geos.refractions.net
6 *
7 * Copyright (C) 2006 Refractions Research Inc.
8 *
9 * This is free software; you can redistribute and/or modify it under
10 * the terms of the GNU Lesser General Public Licence as published
11 * by the Free Software Foundation.
12 * See the COPYING file for more information.
13 *
14 *
15 **********************************************************************/
16
17 #ifndef GEOS_INDEX_INTERVALRTREE_INTERVALRTREEBRANCHNODE_H
18 #define GEOS_INDEX_INTERVALRTREE_INTERVALRTREEBRANCHNODE_H
19
20 #include <geos/index/intervalrtree/IntervalRTreeNode.h> // inherited
21
22 #include <algorithm>
23
24 // forward declarations
25 namespace geos {
26 namespace index {
27 class ItemVisitor;
28 }
29 }
30
31
32 namespace geos {
33 namespace index {
34 namespace intervalrtree {
35
36 class IntervalRTreeBranchNode : public IntervalRTreeNode
37 {
38 private:
39 const IntervalRTreeNode * node1;
40 const IntervalRTreeNode * node2;
41
42 //void buildExtent( IntervalRTreeNode * n1, IntervalRTreeNode * n2)
43 //{
44 // min = std::min( n1->min, n2->min);
45 // max = std::max( n1->max, n2->max);
46 //}
47
48 protected:
49 public:
50 IntervalRTreeBranchNode( const IntervalRTreeNode * n1, const IntervalRTreeNode * n2)
51 : IntervalRTreeNode( std::min( n1->getMin(), n2->getMin()), std::max( n1->getMax(), n2->getMax())),
52 node1( n1),
53 node2( n2)
54 { }
55
56 ~IntervalRTreeBranchNode()
57 {
58 delete node1;
59 delete node2;
60 }
61
62
63 void query(double queryMin, double queryMax, index::ItemVisitor * visitor) const;
64 };
65
66 } // geos::intervalrtree
67 } // geos::index
68 } // geos
69
70 #endif // GEOS_INDEX_INTERVALRTREE_INTERVALRTREEBRANCHNODE_H
71 /**********************************************************************
72 * $Log$
73 **********************************************************************/
74