QGIS API Documentation  2.99.0-Master (7d4f81d)
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 "qgspoint.h"
21 #include "qgis_analysis.h"
22 
25 class ANALYSIS_EXPORT Node
26 {
27  protected:
29  QgsPoint *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  QgsPoint *getPoint() const;
42  void setNext( Node *n );
44  void setPoint( QgsPoint *p );
45 };
46 
47 #ifndef SIP_RUN
48 
49 
50 inline Node::Node()
51  : mPoint( nullptr )
52  , mNext( nullptr )
53 {
54 
55 }
56 
57 inline Node::~Node()
58 {
59  delete mPoint;
60 }
61 
62 inline Node *Node::getNext() const
63 {
64  return mNext;
65 }
66 
67 inline QgsPoint *Node::getPoint() const
68 {
69  return mPoint;
70 }
71 
72 inline void Node::setNext( Node *n )
73 {
74  mNext = n;
75 }
76 
77 inline void Node::setPoint( QgsPoint *p )
78 {
79  mPoint = p;
80 }
81 
82 #endif
83 #endif
Node is a class used by Line3D.
Definition: Node.h:25
Node()
Definition: Node.h:50
QgsPoint * mPoint
Pointer to the QgsPoint object associated with the node.
Definition: Node.h:29
void setPoint(QgsPoint *p)
Sets a new pointer to an associated QgsPoint object.
Definition: Node.h:77
Point geometry type, with support for z-dimension and m-values.
Definition: qgspoint.h:36
QgsPoint * getPoint() const
Returns a pointer to the QgsPoint object associated with the node.
Definition: Node.h:67
Node * getNext() const
Returns a pointer to the next element in the linked list.
Definition: Node.h:62
~Node()
Definition: Node.h:57
void setNext(Node *n)
Sets the pointer to the next node.
Definition: Node.h:72
Node * mNext
Pointer to the next Node in the linked list.
Definition: Node.h:31