/usr/include/qgis/Bezier3D.h is in libqgis-dev 2.8.6+dfsg-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 | /***************************************************************************
Bezier3D.h - description
-------------------
copyright : (C) 2004 by Marco Hugentobler
email : mhugent@geo.unizh.ch
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef BEZIER3D_H
#define BEZIER3D_H
#include "ParametricLine.h"
#include "Vector3D.h"
#include "MathUtils.h"
#include "qgslogger.h"
/**Class Bezier3D represents a bezier curve, represented by control points. Parameter t is running from 0 to 1. The class is capable to calculate the curve point and the first two derivatives belonging to t.*/
class ANALYSIS_EXPORT Bezier3D: public ParametricLine
{
protected:
public:
/**Default constructor*/
Bezier3D();
/**Constructor, par is a pointer to the parent, controlpoly a controlpolygon*/
//! @note not available in python binding
Bezier3D( ParametricLine* par, QVector<Point3D*>* controlpoly );
/**Destructor*/
virtual ~Bezier3D();
/**Do not use this method, since a Bezier curve does not consist of other curves*/
virtual void add( ParametricLine *pl ) override;
/**Calculates the first derivative and assigns it to v*/
virtual void calcFirstDer( float t, Vector3D* v ) override;
/**Calculates the second derivative and assigns it to v*/
virtual void calcSecDer( float t, Vector3D* v ) override;
//virtual Point3D calcPoint(float t);
/**Calculates the point on the curve and assigns it to p*/
virtual void calcPoint( float t, Point3D* p ) override;
/**changes the order of control points*/
virtual void changeDirection() override;
//virtual void draw(QPainter* p);
//virtual bool intersects(ParametricLine* pal);
/**Do not use this method, since a Bezier curve does not consist of other curves*/
virtual void remove( int i ) override;
/**Returns a control point*/
virtual const Point3D* getControlPoint( int number ) const override;
/**Returns a pointer to the control polygon*/
//! @note not available in python binding
virtual const QVector<Point3D*>* getControlPoly() const override;
/**Returns the degree of the curve*/
virtual int getDegree() const override;
/**Returns the parent*/
virtual ParametricLine* getParent() const override;
/** Sets the parent*/
virtual void setParent( ParametricLine* par ) override;
/**Sets the control polygon*/
//! @note not available in python binding
virtual void setControlPoly( QVector<Point3D*>* cp ) override;
};
//-----------------------------------------------constructors, destructor and assignment operator------------------------------
inline Bezier3D::Bezier3D() : ParametricLine()//default constructor
{
}
inline Bezier3D::Bezier3D( ParametricLine* parent, QVector<Point3D*>* controlpoly ) : ParametricLine( parent, controlpoly )
{
mDegree = mControlPoly->count() - 1;
}
inline Bezier3D::~Bezier3D()
{
}
//----------------------------------------------invalid methods add and remove (because of inheritance from ParametricLine)
inline void Bezier3D::add( ParametricLine *pl )
{
Q_UNUSED( pl );
QgsDebugMsg( "Error!!!!! A Bezier-curve can not be parent of a ParametricLine." );
}
inline void Bezier3D::remove( int i )
{
Q_UNUSED( i );
QgsDebugMsg( "Error!!!!! A Bezier-curve has no children to remove." );
}
//-----------------------------------------------setters and getters---------------------------------------------------------------
inline const Point3D* Bezier3D::getControlPoint( int number ) const
{
return ( *mControlPoly )[number-1];
}
inline const QVector<Point3D*>* Bezier3D::getControlPoly() const
{
return mControlPoly;
}
inline int Bezier3D::getDegree() const
{
return mDegree;
}
inline ParametricLine* Bezier3D::getParent() const
{
return mParent;
}
inline void Bezier3D::setParent( ParametricLine* par )
{
mParent = par;
}
inline void Bezier3D::setControlPoly( QVector<Point3D*>* cp )
{
mControlPoly = cp;
mDegree = mControlPoly->count() - 1;
}
#endif
|