QGIS API Documentation  2.99.0-Master (0cba29c)
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 
30 class ANALYSIS_EXPORT ParametricLine
31 {
32  protected:
34  int mDegree;
36  ParametricLine *mParent = nullptr;
38  QVector<QgsPoint *> *mControlPoly;
39  public:
42 
45  ParametricLine( ParametricLine *par SIP_TRANSFER, QVector<QgsPoint *> *controlpoly );
46  virtual ~ParametricLine();
47  virtual void add( ParametricLine *pl SIP_TRANSFER ) = 0;
48  virtual void calcFirstDer( float t, Vector3D *v SIP_OUT ) = 0;
49  virtual void calcSecDer( float t, Vector3D *v SIP_OUT ) = 0;
50  //virtual QgsPoint calcPoint(float t);
51  virtual void calcPoint( float t, QgsPoint *p SIP_OUT ) = 0;
52  virtual void changeDirection() = 0;
53  //virtual void draw(QPainter* p);
54  virtual const QgsPoint *getControlPoint( int number ) const = 0;
55  virtual const QVector<QgsPoint *> *getControlPoly() const = 0;
56  virtual int getDegree() const = 0;
57  virtual ParametricLine *getParent() const = 0;
58  //virtual bool intersects(ParametricLine* pal);
59  virtual void remove( int i ) = 0;
60  virtual void setControlPoly( QVector<QgsPoint *> *cp ) = 0;
61  virtual void setParent( ParametricLine *paral ) = 0;
62 };
63 
64 #ifndef SIP_RUN
65 
66 //-----------------------------------------constructors and destructor----------------------
67 
69  : mDegree( 0 )
70  , mParent( nullptr )
71  , mControlPoly( nullptr )
72 {
73 
74 }
75 
76 inline ParametricLine::ParametricLine( ParametricLine *par, QVector<QgsPoint *> *controlpoly )
77  : mDegree( 0 )
78  , mParent( par )
79  , mControlPoly( controlpoly )
80 {
81 
82 }
83 
85 {
86  //delete mParent;
87 }
88 
89 #endif
90 
91 #endif
92 
93 
94 
95 
96 
97 
98 
99 
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:29
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