QGIS API Documentation  2.99.0-Master (b698612)
Line3D.h
Go to the documentation of this file.
1 /***************************************************************************
2  Line3D.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 LINE3D_H
18 #define LINE3D_H
19 
20 #include "Node.h"
21 #include "qgis_analysis.h"
22 #include "qgis_sip.h"
23 
26 class ANALYSIS_EXPORT Line3D SIP_NODEFAULTCTORS
27 {
28  private:
30  Line3D( const Line3D & ) SIP_FORCE;
32  Line3D &operator=( const Line3D & ) SIP_FORCE;
33  protected:
34  Node *head = nullptr;
35  Node *z = nullptr;
36  Node *currentNode = nullptr;
37  unsigned int size;
38  unsigned int current;
39 
40  public:
41  Line3D();
42  ~Line3D();
44  bool empty() const;
46  void insertPoint( QgsPoint *p );
48  void removePoint();
50  QgsPoint *getPoint() const;
52  unsigned int getCurrent() const;
54  unsigned int getSize() const;
56  void goToBegin();
58  void goToNext();
59 };
60 
61 #ifndef SIP_RUN
62 
63 inline Line3D::Line3D( const Line3D & )
64 {
65 
66 }
67 
68 inline Line3D &Line3D::operator=( const Line3D & )
69 {
70  return ( *this );
71 }
72 
73 inline unsigned int Line3D::getCurrent() const
74 {
75  return current;
76 }
77 
78 inline QgsPoint *Line3D::getPoint() const
79 {
80  return ( currentNode->getPoint() );
81 }
82 
83 inline unsigned int Line3D::getSize() const
84 {
85  return size;
86 }
87 
88 #endif
89 #endif
Node is a class used by Line3D.
Definition: Node.h:25
This class represents a line.
Definition: Line3D.h:26
unsigned int size
Definition: Line3D.h:37
unsigned int getCurrent() const
Returns the current position.
Definition: Line3D.h:73
unsigned int current
Definition: Line3D.h:38
QgsPoint * getPoint() const
Gets the point at the current position.
Definition: Line3D.h:78
#define SIP_FORCE
Definition: qgis_sip.h:112
Point geometry type, with support for z-dimension and m-values.
Definition: qgspoint.h:36
#define SIP_NODEFAULTCTORS
Definition: qgis_sip.h:82
Line3D()
Definition: Line3D.cc:19
unsigned int getSize() const
Returns the size of the line (the numbero of inserted Nodes without 'head' and 'z'.
Definition: Line3D.h:83