-
Notifications
You must be signed in to change notification settings - Fork 0
/
sweepsurface.h
60 lines (44 loc) · 1.21 KB
/
sweepsurface.h
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
/*
* Datum: 14.05.2018
* Autoren: Tuyet Nguyen, Fabian Niehaus
*/
#ifndef SWEEPSURFACE_H
#define SWEEPSURFACE_H
#include <vector>
#include <QVector2D>
#include <cmath>
#include <iostream>
#include <fstream>
#include <string>
#include "vertex.h"
#include "vertexmatrix.h"
#include "quad.h"
using namespace std;
class SweepSurface
{
public:
SweepSurface(string filename);
// Daten lesen, Bezier-Kurve berechnen, Rotational Sweep Surface erstellen
void performBlackMagic();
vector<QVector2D> getPreBezierPoints() const;
vector<QVector2D> getPostBezierPoints() const;
vector<Vertex> getVertices() const;
vector<Quad> getQuads() const;
private:
string filename;
bool readSuccess = false;
// Punkte der Bezier-Kurve vor und nach der Berechnung
vector<QVector2D> preBezierPoints;
vector<QVector2D> postBezierPoints;
// Vertices und Quads der Oberfläche
vector<Vertex> sweepVertices;
VertexMatrix sweepMesh;
vector<Quad> sweepQquads;
// Anzahl der Schritte für Bezier
float resolution = 20;
const float pi = 3.1415927;
void readData();
void calculateCubicBezierCurve();
void createRotationalSweepSurface();
};
#endif // SWEEPSURFACE_H