QGIS API Documentation  2.99.0-Master (b681b7b)
Node.h
Go to the documentation of this file.
1 /***************************************************************************
2  Node.h - description
3  -------------------
4  copyright : (C) 2004 by Marco Hugentobler
5  email : [email protected]
6  ***************************************************************************/
7 
8 /***************************************************************************
9  * *
10  * This program is free software; you can redistribute it and/or modify *
11  * it under the terms of the GNU General Public License as published by *
12  * the Free Software Foundation; either version 2 of the License, or *
13  * (at your option) any later version. *
14  * *
15  ***************************************************************************/
16 
17 #ifndef NODE_H
18 #define NODE_H
19 
20 #include "Point3D.h"
21 #include "qgis_analysis.h"
22 
25 class ANALYSIS_EXPORT Node
26 {
27  protected:
29  Point3D* mPoint = nullptr;
31  Node* mNext = nullptr;
32  public:
33  Node();
34  Node( const Node& n );
35  ~Node();
36  Node& operator=( const Node& n );
38  Node* getNext() const;
40  Point3D* getPoint() const;
42  void setNext( Node* n );
44  void setPoint( Point3D* p );
45 };
46 
47 inline Node::Node()
48  : mPoint( nullptr )
49  , mNext( nullptr )
50 {
51 
52 }
53 
54 inline Node::~Node()
55 {
56  delete mPoint;
57 }
58 
59 inline Node* Node::getNext() const
60 {
61  return mNext;
62 }
63 
64 inline Point3D* Node::getPoint() const
65 {
66  return mPoint;
67 }
68 
69 inline void Node::setNext( Node* n )
70 {
71  mNext = n;
72 }
73 
74 inline void Node::setPoint( Point3D* p )
75 {
76  mPoint = p;
77 }
78 
79 #endif
Node is a class used by Line3D.
Definition: Node.h:25
Node()
Definition: Node.h:47
Point3D is a class to represent a three dimensional point.
Definition: Point3D.h:25
Point3D * getPoint() const
Returns a pointer to the Point3D object associated with the node.
Definition: Node.h:64
Node * getNext() const
Returns a pointer to the next element in the linked list.
Definition: Node.h:59
~Node()
Definition: Node.h:54
void setPoint(Point3D *p)
Sets a new pointer to an associated Point3D object.
Definition: Node.h:74
void setNext(Node *n)
Sets the pointer to the next node.
Definition: Node.h:69
Node * mNext
Pointer to the next Node in the linked list.
Definition: Node.h:31
Point3D * mPoint
Pointer to the Point3D object associated with the node.
Definition: Node.h:29