QGIS API Documentation  2.99.0-Master (9fdd060)
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 
24 #define SIP_NO_FILE
25 
31 class ANALYSIS_EXPORT Line3D SIP_NODEFAULTCTORS
32 {
33  private:
35  Line3D( const Line3D & ) SIP_FORCE;
37  Line3D &operator=( const Line3D & ) SIP_FORCE;
38  protected:
39  Node *head = nullptr;
40  Node *z = nullptr;
41  Node *currentNode = nullptr;
42  unsigned int size;
43  unsigned int current;
44 
45  public:
46  Line3D();
47  ~Line3D();
49  bool empty() const;
51  void insertPoint( QgsPoint *p );
53  void removePoint();
55  QgsPoint *getPoint() const;
57  unsigned int getCurrent() const;
59  unsigned int getSize() const;
61  void goToBegin();
63  void goToNext();
64 };
65 
66 #ifndef SIP_RUN
67 
68 inline Line3D::Line3D( const Line3D & )
69 {
70 
71 }
72 
73 inline Line3D &Line3D::operator=( const Line3D & )
74 {
75  return ( *this );
76 }
77 
78 inline unsigned int Line3D::getCurrent() const
79 {
80  return current;
81 }
82 
83 inline QgsPoint *Line3D::getPoint() const
84 {
85  return ( currentNode->getPoint() );
86 }
87 
88 inline unsigned int Line3D::getSize() const
89 {
90  return size;
91 }
92 
93 #endif
94 #endif
Node is a class used by Line3D.
Definition: Node.h:30
This class represents a line.
Definition: Line3D.h:31
unsigned int size
Definition: Line3D.h:42
unsigned int getCurrent() const
Returns the current position.
Definition: Line3D.h:78
unsigned int current
Definition: Line3D.h:43
QgsPoint * getPoint() const
Gets the point at the current position.
Definition: Line3D.h:83
#define SIP_FORCE
Definition: qgis_sip.h:124
Point geometry type, with support for z-dimension and m-values.
Definition: qgspoint.h:37
#define SIP_NODEFAULTCTORS
Definition: qgis_sip.h:94
Line3D()
Definition: Line3D.cpp:19
unsigned int getSize() const
Returns the size of the line (the numbero of inserted Nodes without 'head' and 'z'.
Definition: Line3D.h:88