QGIS API Documentation  2.99.0-Master (01468d0)
ParametricLine.h
Go to the documentation of this file.
1 /***************************************************************************
2  ParametricLine.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 PARAMETRICLINE_H
18 #define PARAMETRICLINE_H
19 
20 #include "qgspoint.h"
21 #include <QVector>
22 #include "qgis_analysis.h"
23 #include "qgis_sip.h"
24 
25 class Vector3D;
26 
27 #define SIP_NO_FILE
28 
34 class ANALYSIS_EXPORT ParametricLine
35 {
36  protected:
38  int mDegree;
40  ParametricLine *mParent = nullptr;
42  QVector<QgsPoint *> *mControlPoly;
43  public:
46 
49  ParametricLine( ParametricLine *par SIP_TRANSFER, QVector<QgsPoint *> *controlpoly );
50  virtual ~ParametricLine();
51  virtual void add( ParametricLine *pl SIP_TRANSFER ) = 0;
52  virtual void calcFirstDer( float t, Vector3D *v SIP_OUT ) = 0;
53  virtual void calcSecDer( float t, Vector3D *v SIP_OUT ) = 0;
54  //virtual QgsPoint calcPoint(float t);
55  virtual void calcPoint( float t, QgsPoint *p SIP_OUT ) = 0;
56  virtual void changeDirection() = 0;
57  //virtual void draw(QPainter* p);
58  virtual const QgsPoint *getControlPoint( int number ) const = 0;
59  virtual const QVector<QgsPoint *> *getControlPoly() const = 0;
60  virtual int getDegree() const = 0;
61  virtual ParametricLine *getParent() const = 0;
62  //virtual bool intersects(ParametricLine* pal);
63  virtual void remove( int i ) = 0;
64  virtual void setControlPoly( QVector<QgsPoint *> *cp ) = 0;
65  virtual void setParent( ParametricLine *paral ) = 0;
66 };
67 
68 #ifndef SIP_RUN
69 
70 //-----------------------------------------constructors and destructor----------------------
71 
73  : mDegree( 0 )
74  , mParent( nullptr )
75  , mControlPoly( nullptr )
76 {
77 
78 }
79 
80 inline ParametricLine::ParametricLine( ParametricLine *par, QVector<QgsPoint *> *controlpoly )
81  : mDegree( 0 )
82  , mParent( par )
83  , mControlPoly( controlpoly )
84 {
85 
86 }
87 
89 {
90  //delete mParent;
91 }
92 
93 #endif
94 
95 #endif
96 
97 
98 
99 
100 
101 
102 
103 
QVector< QgsPoint * > * mControlPoly
MControlPoly stores the points of the control polygon.
virtual ~ParametricLine()
Class Vector3D represents a 3D-Vector, capable to store x-,y- and z-coordinates in double values...
Definition: Vector3D.h:32
int mDegree
Degree of the parametric Line.
ParametricLine * mParent
Pointer to the parent object. If there isn&#39;t one, mParent is 0.
#define SIP_TRANSFER
Definition: qgis_sip.h:36
ParametricLine is an Interface for parametric lines.
ParametricLine()
Default constructor.
Point geometry type, with support for z-dimension and m-values.
Definition: qgspoint.h:36
#define SIP_OUT
Definition: qgis_sip.h:51