QGIS API Documentation  3.10.0-A Coruña (6c816b4204)
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 
35 class ANALYSIS_EXPORT ParametricLine
36 {
37  protected:
39  int mDegree = 0;
41  ParametricLine *mParent = nullptr;
43  QVector<QgsPoint *> *mControlPoly = nullptr;
44  public:
46  ParametricLine() = default;
47 
51  ParametricLine( ParametricLine *par SIP_TRANSFER, QVector<QgsPoint *> *controlpoly );
52  virtual ~ParametricLine() = default;
53  virtual void add( ParametricLine *pl SIP_TRANSFER ) = 0;
54  virtual void calcFirstDer( float t, Vector3D *v SIP_OUT ) = 0;
55  virtual void calcSecDer( float t, Vector3D *v SIP_OUT ) = 0;
56  //virtual QgsPoint calcPoint(float t);
57  virtual void calcPoint( float t, QgsPoint *p SIP_OUT ) = 0;
58  virtual void changeDirection() = 0;
59  //virtual void draw(QPainter* p);
60  virtual const QgsPoint *getControlPoint( int number ) const = 0;
61  virtual const QVector<QgsPoint *> *getControlPoly() const = 0;
62  virtual int getDegree() const = 0;
63  virtual ParametricLine *getParent() const = 0;
64  //virtual bool intersects(ParametricLine* pal);
65  virtual void remove( int i ) = 0;
66  virtual void setControlPoly( QVector<QgsPoint *> *cp ) = 0;
67  virtual void setParent( ParametricLine *paral ) = 0;
68 };
69 
70 #ifndef SIP_RUN
71 
72 //-----------------------------------------constructors and destructor----------------------
73 
74 inline ParametricLine::ParametricLine( ParametricLine *par, QVector<QgsPoint *> *controlpoly )
75  : mParent( par )
76  , mControlPoly( controlpoly )
77 {
78 
79 }
80 
81 #endif
82 
83 #endif
84 
85 
86 
87 
88 
89 
90 
91 
Class Vector3D represents a 3D-Vector, capable to store x-,y- and z-coordinates in double values...
Definition: Vector3D.h:33
ParametricLine()=default
Default constructor.
#define SIP_TRANSFER
Definition: qgis_sip.h:36
ParametricLine is an Interface for parametric lines.
Point geometry type, with support for z-dimension and m-values.
Definition: qgspoint.h:37
#define SIP_OUT
Definition: qgis_sip.h:58