GEOS  3.6.1
AbstractNode.h
1 /**********************************************************************
2  *
3  * GEOS - Geometry Engine Open Source
4  * http://geos.osgeo.org
5  *
6  * Copyright (C) 2006 Refractions Research Inc.
7  *
8  * This is free software; you can redistribute and/or modify it under
9  * the terms of the GNU Lesser General Public Licence as published
10  * by the Free Software Foundation.
11  * See the COPYING file for more information.
12  *
13  **********************************************************************/
14 
15 #ifndef GEOS_INDEX_STRTREE_ABSTRACTNODE_H
16 #define GEOS_INDEX_STRTREE_ABSTRACTNODE_H
17 
18 #include <geos/export.h>
19 #include <geos/index/strtree/Boundable.h> // for inheritance
20 
21 #include <vector>
22 
23 #ifdef _MSC_VER
24 #pragma warning(push)
25 #pragma warning(disable: 4251) // warning C4251: needs to have dll-interface to be used by clients of class
26 #endif
27 
28 namespace geos {
29 namespace index { // geos::index
30 namespace strtree { // geos::index::strtree
31 
42 class GEOS_DLL AbstractNode: public Boundable {
43 private:
44  std::vector<Boundable*> childBoundables;
45  int level;
46 public:
47  AbstractNode(int newLevel, int capacity=10);
48  virtual ~AbstractNode();
49 
50  // TODO: change signature to return by ref,
51  // document ownership of the return
52  inline std::vector<Boundable*>* getChildBoundables() {
53  return &childBoundables;
54  }
55 
56  // TODO: change signature to return by ref,
57  // document ownership of the return
58  inline const std::vector<Boundable*>* getChildBoundables() const {
59  return &childBoundables;
60  }
61 
74  const void* getBounds() const;
75 
76  int getLevel();
77 
78  void addChildBoundable(Boundable *childBoundable);
79 
80 protected:
81 
82  virtual void* computeBounds() const=0;
83 
84  mutable void* bounds;
85 };
86 
87 
88 } // namespace geos::index::strtree
89 } // namespace geos::index
90 } // namespace geos
91 
92 #ifdef _MSC_VER
93 #pragma warning(pop)
94 #endif
95 
96 #endif // GEOS_INDEX_STRTREE_ABSTRACTNODE_H
Basic namespace for all GEOS functionalities.
Definition: IndexedNestedRingTester.h:25
A node of the STR tree.
Definition: AbstractNode.h:42
A spatial object in an AbstractSTRtree.
Definition: Boundable.h:25