SLProject  4.2.000
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
SLCurve.h
Go to the documentation of this file.
1 /**
2  * \file math/SLCurve.h
3  * \date July 2014
4  * \authors Marcus Hudritsch
5  * \copyright http://opensource.org/licenses/GPL-3.0
6  * \remarks Please use clangformat to format the code. See more code style on
7  * https://github.com/cpvrlab/SLProject4/wiki/SLProject-Coding-Style
8 */
9 
10 #ifndef SLCURVE_H
11 #define SLCURVE_H
12 
13 #include <SLMath.h>
14 #include <SLMat4.h>
15 #include <SLVec3.h>
16 #include <SLVec4.h>
17 
18 //-----------------------------------------------------------------------------
19 //!Base class for curves defined by multiple 3D points.
20 /*!Base class for curves defined by multiple 3D points. Derived classes (e.g.
21 SLCurveBezier) implement specific curve interpolation schemes.
22 */
23 class SLCurve
24 {
25 public:
26  SLCurve() {}
27  virtual ~SLCurve() {}
28 
29  virtual void dispose() = 0;
30  virtual SLVec3f evaluate(const SLfloat t) = 0;
31  virtual void draw(const SLMat4f& wm) = 0;
32 
33 protected:
34  SLVVec4f _points; //!< Sample points (x,y,z) and time (w) of curve
35  SLVfloat _lengths; //!< Length of each curve segment
36  SLfloat _totalLength; //!< Total length of curve
37 };
38 //-----------------------------------------------------------------------------
39 #endif
float SLfloat
Definition: SL.h:173
vector< SLfloat > SLVfloat
Definition: SL.h:200
vector< SLVec4f > SLVVec4f
Definition: SLVec4.h:239
Base class for curves defined by multiple 3D points.
Definition: SLCurve.h:24
SLVVec4f _points
Sample points (x,y,z) and time (w) of curve.
Definition: SLCurve.h:34
virtual ~SLCurve()
Definition: SLCurve.h:27
SLVfloat _lengths
Length of each curve segment.
Definition: SLCurve.h:35
virtual SLVec3f evaluate(const SLfloat t)=0
SLCurve()
Definition: SLCurve.h:26
SLfloat _totalLength
Total length of curve.
Definition: SLCurve.h:36
virtual void draw(const SLMat4f &wm)=0
virtual void dispose()=0