VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
networkNode.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 2001 MAK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************/
5 /*********************************************************************
6 ** $RCSfile: netwrkNode.h,v $ $Revision: 1.21 $ $State: Exp $
7 *********************************************************************/
8 #ifndef networkNode_H_
9 #define networkNode_H_
10 
11 // \file netwrkNode.h
12 // \brief Contains the declaration of the DtNetworkNode class, as well as related interface functions.
13 //
14 
15 #include "gdb/gdbDefines.h"
18 
19 #include <vlutil/vlConfig.h>
20 #include <geometry/point.h>
21 #include <vlutil/vlNetTypes.h>
22 #include <vlutil/vlPrint.h>
23 #include <matrix/3dBoundingVolume.h>
24 #include <matrix/vlDcm.h>
25 
26 #include <set>
27 #include <assert.h>
28 
29 class DtNetworkEdge;
30 
31 
32 //
33 // DtNetworkNode represents a node in the vector network. Typically, it is used
34 // to approximate point objects at the level of detail of the network. For instance,
35 // in most terrains, trees and other similar objects are usually represented by
36 // nodes. Additionally, the nodes are used as glue to join separate edges together
37 // to create the connected network.
39 {
40 public:
41 
42  typedef std::set<DtNetworkEdge*> DtConnectedEdgeContainer;
43  typedef DtConnectedEdgeContainer::iterator DtConnectedEdgeIter;
44  typedef DtConnectedEdgeContainer::const_iterator DtConnectedEdgeConstIter;
45 
46  // default constructor
47  DtNetworkNode();
48 
49  // destructor
50  virtual ~DtNetworkNode();
51 
52  virtual void addEdge(DtNetworkEdge& edge);
53  virtual void removeEdge(DtNetworkEdge& edge);
54 
55  // get the connected edges.
56  virtual const DtConnectedEdgeContainer& connectedEdges() const;
57 
58  // Get the number of edges connected to the node
59  virtual unsigned int degree() const;
60 
61  // get/set location
62  virtual const DtPoint& location() const;
63  virtual void setLocation(const DtPoint& location);
64 
65  virtual DtString type();
66 
67  virtual int sizeInBytes() const;
68 
69  // Override to update our bounding volume and orientation
70  virtual bool setSpecification(const DtSpecification& newSpecification,
71  bool allowDuplicates = false);
72  virtual void setSpecificationID(DtSpecificationID specID);
73 
74  const Dt3dBoundingVolume& boundingVolume() const;
75  const DtDcm& orientation() const;
76 
77 protected:
78 
79  virtual void setBoundingVolumeFromSpecification();
80  virtual void setOrientationFromSpecification();
81 
82 protected:
83 
86 
87  // Bounding volume of node, based on DtWidth, DtHeight, and
88  // DtLength specification attributes.
89  Dt3dBoundingVolume myBoundingVolume;
90 
91  // Orientaion of node, based on DtOrienation specification
92  // attribute. In database coordinates.
94 
95 private:
96  // These are private because there is a relationship between
97  // nodes and edges that cannot be shared between nodes. If a node
98  // is a start node of an edge, then using that node to construct
99  // another node, or to assign it to another node, is improper.
100 
101  // copy constructor
102  DtNetworkNode(const DtNetworkNode& orig);
103 
104  // assignment operator
105  DtNetworkNode& operator=(const DtNetworkNode& orig);
106 
107 };
108 
109 
110 bool DtNodeIsCircular(const DtNetworkNode& node);
111 
112 
113 #endif
DtPoint myLocation
Definition: networkNode.h:84
std::set< DtNetworkEdge * > DtConnectedEdgeContainer
Definition: networkNode.h:42
unsigned int DtSpecificationID
Definition: specificationManager.h:22
Definition: networkSpecificationElement.h:32
bool DtNodeIsCircular(const DtNetworkNode &node)
DtNetworkSpecificationElement & operator=(const DtNetworkSpecificationElement &orig)
DtConnectedEdgeContainer::const_iterator DtConnectedEdgeConstIter
Definition: networkNode.h:44
#define DT_DLL_gdb
Definition: gdbDefines.h:25
Definition: networkNode.h:38
Dt3dBoundingVolume myBoundingVolume
Definition: networkNode.h:89
Definition: specification.h:27
Definition: networkEdge.h:28
virtual DtString type()=0
DtConnectedEdgeContainer myEdges
Definition: networkNode.h:85
virtual void setSpecificationID(DtSpecificationID specID)
DtConnectedEdgeContainer::iterator DtConnectedEdgeIter
Definition: networkNode.h:43
Definition: point.h:34
virtual bool setSpecification(const DtSpecification &newSpecification, bool allowDuplicates=false)
DtDcm myOrientation
Definition: networkNode.h:93

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)