File: POVRenderer.h

package info (click to toggle)
structure-synth 1.0.0-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 2,072 kB
  • ctags: 1,176
  • sloc: cpp: 7,070; python: 167; makefile: 66; lisp: 25
file content (78 lines) | stat: -rw-r--r-- 2,524 bytes parent folder | download
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
/// OBSOLETE CLASS. WILL BE REMOVED AT SOME POINT.

#pragma once

#include <QString>
#include "Renderer.h"

#include "../../../SyntopiaCore/Math/Vector3.h"
#include "SyntopiaCore/Math/Vector3.h"
#include "SyntopiaCore/Math/Matrix4.h"

namespace StructureSynth {
	namespace Model {	
		namespace Rendering {

			/// A renderer implementation based on the SyntopiaCore POV widget.
			class POVRenderer : public Renderer {
			public:
				POVRenderer(QString& output) : output(output) {};
				virtual ~POVRenderer() {};

				/// The primitives
				virtual void drawBox(SyntopiaCore::Math::Vector3f base, 
					          SyntopiaCore::Math::Vector3f dir1 , 
							  SyntopiaCore::Math::Vector3f dir2, 
							  SyntopiaCore::Math::Vector3f dir3,
								const QString& classID);

				
				virtual void drawMesh(  SyntopiaCore::Math::Vector3f /*startBase*/, 
										SyntopiaCore::Math::Vector3f /*startDir1*/, 
										SyntopiaCore::Math::Vector3f /*startDir2*/, 
										SyntopiaCore::Math::Vector3f /*endBase*/, 
										SyntopiaCore::Math::Vector3f /*endDir1*/, 
										SyntopiaCore::Math::Vector3f /*endDir2*/, 
										const QString& /*classID*/) {};

				virtual void drawSphere(SyntopiaCore::Math::Vector3f center, float radius,
								const QString& classID);

				virtual void drawGrid(SyntopiaCore::Math::Vector3f base, 
								SyntopiaCore::Math::Vector3f dir1, 
								SyntopiaCore::Math::Vector3f dir2, 
								SyntopiaCore::Math::Vector3f dir3,
								const QString& classID);

				virtual void drawLine(SyntopiaCore::Math::Vector3f from, 
										SyntopiaCore::Math::Vector3f to,
								const QString& classID);

				virtual void drawDot(SyntopiaCore::Math::Vector3f pos,
								const QString& classID);

				virtual void drawTriangle(SyntopiaCore::Math::Vector3f /*p1*/,
										 SyntopiaCore::Math::Vector3f /*p2*/,
									     SyntopiaCore::Math::Vector3f /*p3*/,
										 const QString& /*classID*/) {};

				virtual void begin();
				virtual void end();
				
				virtual void setColor(SyntopiaCore::Math::Vector3f rgb) { this->rgb = rgb; }
				virtual void setBackgroundColor(SyntopiaCore::Math::Vector3f rgb);
				virtual void setAlpha(double alpha) { this->alpha = alpha; }
			private:
				void operator=(const POVRenderer&) {}; 
				void writeline(QString text) const;
				void write(QString text) const;

				QString& output;
				SyntopiaCore::Math::Vector3f rgb;
				double alpha;
			};

		}
	}
}