Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
NipscanRenderer.h
Go to the documentation of this file.
1#pragma once
5#include <xgl/Axes.h>
6#include <xgl/Cone.h>
7#include <xgl/Cube.h>
8#include <xgl/Cylinder.h>
9#include <xgl/Disk.h>
10#include <xgl/Dynamic.h>
11#include <xgl/Line.h>
12#include <xgl/Normals.h>
13#include <xgl/ShaderProgram.h>
14#include <xgl/Sphere.h>
15#include <xgl/Tube.h>
16#include <xgl/VertexArray.h>
17
18namespace sf::xgl
19{
20
21class NipscanRenderer final : public OpenGLRenderer
22{
23 Q_OBJECT
24 Q_PROPERTY(QColor lightColor READ getLightColor WRITE setLightColor)
25 Q_PROPERTY(float cutoffAngle READ getCutoffAngle WRITE setCutoffAngle)
26 Q_PROPERTY(float ambientStrength READ getAmbientStrength WRITE setAmbientStrength)
27 Q_PROPERTY(float diffuseStrength READ getDiffuseStrength WRITE setDiffuseStrength)
28 Q_PROPERTY(float specularStrength READ getSpecularStrength WRITE setSpecularStrength)
29 Q_PROPERTY(float shininess READ getShininess WRITE setShininess)
30 Q_PROPERTY(FragmentProgram fragmentProgram READ getFragmentProgram WRITE setFragmentProgram)
31
32 public:
33 explicit NipscanRenderer(OpenGLWidget* widget, xgl::ShaderProgram* sp);
34
35 ~NipscanRenderer() override;
36
40 enum FragmentProgram : int
41 {
45 fpSpotlight = 1
46 };
47 Q_ENUM(FragmentProgram)
48
49 SF_DECL_PROP_GS(QColor, LightColor)
50 SF_DECL_PROP_GS(float, CutoffAngle)
51 SF_DECL_PROP_GS(float, AmbientStrength)
52 SF_DECL_PROP_GS(float, DiffuseStrength)
53 SF_DECL_PROP_GS(float, SpecularStrength)
54 SF_DECL_PROP_GS(float, Shininess)
56
57 protected:
58 void generate() override;
59
60 void paint() override;
61
63
64 void draw() override;
65
66 void timerEvent(QTimerEvent* event) override;
67
68 void changedProperty() override;
69
70 void start(int msecs);
71
72 void setIndexValue(int index, QVariant value) override;
73
75 bool solid, double x_axis, double y_axis, double z_axis,//
76 double a_axis, double b_axis, double c_axis,//
77 const ToolInformation& tool, const ElementInformation& elem
78 );
79
81
82 private:
83 void notify(const void* member);
84
85 bool _flagPaint;
86 QColor _lightColor;
87 float _cutoffAngle;
88 float _ambientStrength;
89 float _diffuseStrength;
90 float _specularStrength;
91 float _shininess;
92 //
93 FragmentProgram _fragmentProgram;
94
95 std::array<double, 6> _indexValues;
96 ShaderProgram* _shaderProgram;
97 //
98 Dynamic* _nipscan;
99 Normals* _testNormals;
100 Sphere* _testSphere;
101 Line* _testLine;
102 Axes* _xyxAxes;
103 //
104 Cone* _lightCone;
105 //
106 Tube* _zAxisTube;
107 Disk* _zAxisDisk;
108 Sphere* _zAxisSphere;
109 Cylinder* _bAxisCylinder;
110 Cylinder* _soundBeamCylinder;
111};
112
113}// namespace sf::xgl
Holds the information on the transducer.
Definition ElementInformation.h:12
Pure virtual class to implement rendering separated from the widget and makes the sf::OpenGLWidget th...
Definition OpenGLRenderer.h:12
Widget for rendering a OpenGHL scene.
Definition OpenGLWidget.h:30
Holds the needed information on a tool to make calculations.
Definition ToolInformation.h:13
Class to render axis lines in OpenGL. All axis have the same color. Length is both positive and negat...
Definition Axes.h:15
Class to render a cone in OpenGL. Height of the cone is along the Z-axis where the tip is at (0,...
Definition Cone.h:13
Class to render a cylinder in OpenGL. Has a single color. Height of the cone is along the Z-axis wher...
Definition Cylinder.h:14
Class to render a circle in OpenGL.
Definition Disk.h:11
Dynamic object .
Definition Dynamic.h:14
Class to render a line in OpenGL.
Definition Line.h:11
Definition NipscanRenderer.h:22
void changedProperty() override
Called by sf::OpenGLWidget when a property has changed.
float diffuseStrength
Definition NipscanRenderer.h:27
float specularStrength
Definition NipscanRenderer.h:28
void renderNipscan(bool solid, double x_axis, double y_axis, double z_axis, double a_axis, double b_axis, double c_axis, const ToolInformation &tool, const ElementInformation &elem)
FragmentProgram fragmentProgram
Definition NipscanRenderer.h:30
void generate() override
Called by setup() and (re-)generates the vertices for the drawn 3D-objects.
FragmentProgram
Enumeration of available shader inner programs passed to ShaderProgram::Uniform::uProgram uniform.
Definition NipscanRenderer.h:41
@ fpSpotlight
Definition NipscanRenderer.h:45
@ fpPassthrough
Definition NipscanRenderer.h:43
float cutoffAngle
Definition NipscanRenderer.h:25
float ambientStrength
Definition NipscanRenderer.h:26
void start(int msecs)
void draw() override
Called by from the render() method.
void paint() override
Called by from the render() method.
void generateNipscan(VertexArrayBase *)
void timerEvent(QTimerEvent *event) override
void setIndexValue(int index, QVariant value) override
Sets an arbitrary value on the derived- or subclass.
QColor lightColor
Definition NipscanRenderer.h:24
float shininess
Definition NipscanRenderer.h:29
Class to render Normals from another vertex array.
Definition Normals.h:12
Shader program having a default vertex and fragment shader.
Definition ShaderProgram.h:13
Class to render a sphere in OpenGL. Center of the sphere is in (0,0,0). Has a single color.
Definition Sphere.h:14
Class to render a cylinder in OpenGL. Height of the cone is along the Z-axis where the tip is at (0,...
Definition Tube.h:13
Base class for Vertex array derived classes.
Definition VertexArrayBase.h:14
#define SF_DECL_PROP_GS(Type, Name)
Declares unreferenced getter and unreferenced setter for a property.
Definition misc/qt/Macros.h:8
Definition DemoRenderer.h:6