VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
pointQuadtreeNode.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 2001 MAK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************/
5 /*********************************************************************
6 ** $RCSfile: pointQTree.h,v $ $Revision: 1.12 $ $State: Exp $
7 *********************************************************************/
8 // \file pointQTree.h
9 // \brief Contains the DtPointQuadTreeNode class definition.
10 
11 #ifndef pointQuadtreeNode_H_
12 #define pointQuadtreeNode_H_
13 
14 #include "gdb/gdbDefines.h"
15 #include <stdio.h>
16 #include <vlutil/vlNetTypes.h>
17 #include <vlutil/vlConfig.h>
18 #include <list>
19 
20 class DtNetworkNode;
22 
23 //
24 // DtPointQuadtreeNode is a node for a point quadtree.
26 {
27 public:
28 
29  // default constructor
31 
32  // constructor with network node
33  DtPointQuadtreeNode(DtNetworkNode* networkNode);
34 
35  // destructor
36  virtual ~DtPointQuadtreeNode();
37 
38 private:
39 
40  // copy constructor (not implemented)
42 
43  // assignment operator (not implemented)
44  DtPointQuadtreeNode& operator=(const DtPointQuadtreeNode& orig);
45 
46 public:
47 
48  typedef std::list<const DtNetworkNode*> DtPtrConstNodeContainer;
49  typedef DtPtrConstNodeContainer::const_iterator DtPtrConstNodeConstIter;
50  typedef DtPtrConstNodeContainer::iterator DtPtrConstNodeIter;
51 
52  typedef std::list<DtNetworkNode*> DtPtrNodeContainer;
53  typedef DtPtrNodeContainer::const_iterator DtPtrNodeConstIter;
54  typedef DtPtrNodeContainer::iterator DtPtrNodeIter;
55 
56  // add a new network node (the lower and left boundaries in
57  // each quad are closed)
58  virtual void add(DtNetworkNode& newNetworkNode);
59 
60  // collect all nodes that are validated by the metric
61  virtual void collectAllNodes(const DtNetworkNodeMetric& metric,
62  DtPtrConstNodeContainer& collectedNodes) const;
63  virtual void collectAllNodes(const DtNetworkNodeMetric& metric,
64  DtPtrNodeContainer& collectedNodes);
65 
66  // find the best valid node in the tree as measured by the metric
67  virtual const DtNetworkNode* findBestNode(const DtNetworkNodeMetric& metric) const;
68 
69  // resets the state of the quadtree to an empty, initial state.
70  // (same as state resulting from *default constructor*)
71  virtual void clear();
72 
73  virtual int size() const;
74 
75  virtual int sizeInBytes() const;
76 
77 protected:
78 
79  // Adds the node to the specified quadrant. If the quadrant is 0, then it is
80  // allocated with the node as the construction parameter.
81  void addToQuadrant(DtPointQuadtreeNode*& quadrant, DtNetworkNode& element);
82 
83  // find the best valid node in a subtree. pointer best must be valid. Using
84  // this prevents the metric from being re-evaluated on the same node.
85  virtual const DtNetworkNode* findBestInSubtree(const DtNetworkNodeMetric& metric,
86  double& bestCost) const;
87 
88 protected:
89 
95 };
96 
97 #endif
std::list< const DtNetworkNode * > DtPtrConstNodeContainer
Definition: pointQuadtreeNode.h:48
DtPtrNodeContainer::iterator DtPtrNodeIter
Definition: pointQuadtreeNode.h:54
DtPtrConstNodeContainer::iterator DtPtrConstNodeIter
Definition: pointQuadtreeNode.h:50
DtPointQuadtreeNode * mySW
Definition: pointQuadtreeNode.h:91
DtNetworkNode * myElement
Definition: pointQuadtreeNode.h:90
voidpf void uLong size
Definition: ioapi.h:39
Definition: pointQuadtreeNode.h:25
std::list< DtNetworkNode * > DtPtrNodeContainer
Definition: pointQuadtreeNode.h:52
DtPointQuadtreeNode * mySE
Definition: pointQuadtreeNode.h:92
#define DT_DLL_gdb
Definition: gdbDefines.h:25
Definition: networkNode.h:38
DtNetworkNodeMetric is a metric for network nodes.
Definition: networkNodeMetric.h:18
DtPtrConstNodeContainer::const_iterator DtPtrConstNodeConstIter
Definition: pointQuadtreeNode.h:49
DtPointQuadtreeNode * myNW
Definition: pointQuadtreeNode.h:94
DtPtrNodeContainer::const_iterator DtPtrNodeConstIter
Definition: pointQuadtreeNode.h:53
DtPointQuadtreeNode * myNE
Definition: pointQuadtreeNode.h:93

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)