Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
NipscanRenderer.h
Go to the documentation of this file.
1#pragma once
6#include <xgl/Axes.h>
7#include <xgl/Cone.h>
8#include <xgl/Cube.h>
9#include <xgl/Cylinder.h>
10#include <xgl/Disk.h>
11#include <xgl/Dynamic.h>
12#include <xgl/Line.h>
13#include <xgl/Normals.h>
14#include <xgl/ShaderProgram.h>
15#include <xgl/Sphere.h>
16#include <xgl/Tube.h>
17#include <xgl/VertexArray.h>
18
19namespace sf::xgl
20{
21
23{
24 Q_OBJECT
25 Q_PROPERTY(QColor lightColor READ getLightColor WRITE setLightColor)
26 Q_PROPERTY(float cutoffAngle READ getCutoffAngle WRITE setCutoffAngle)
27 Q_PROPERTY(float ambientStrength READ getAmbientStrength WRITE setAmbientStrength)
28 Q_PROPERTY(float diffuseStrength READ getDiffuseStrength WRITE setDiffuseStrength)
29 Q_PROPERTY(float specularStrength READ getSpecularStrength WRITE setSpecularStrength)
30 Q_PROPERTY(float shininess READ getShininess WRITE setShininess)
31 Q_PROPERTY(FragmentProgram fragmentProgram READ getFragmentProgram WRITE setFragmentProgram)
32
33 public:
38
42 ~NipscanRenderer() override;
43
47 enum FragmentProgram : int
48 {
50 fpPassthrough = 0,
52 fpSpotlight = 1
53 };
54 Q_ENUM(FragmentProgram)
55
56 SF_DECL_PROP_GS(QColor, LightColor)
57 SF_DECL_PROP_GS(float, CutoffAngle)
58 SF_DECL_PROP_GS(float, AmbientStrength)
59 SF_DECL_PROP_GS(float, DiffuseStrength)
60 SF_DECL_PROP_GS(float, SpecularStrength)
61 SF_DECL_PROP_GS(float, Shininess)
62 SF_DECL_PROP_GS(FragmentProgram, FragmentProgram)
63
64
68
76 void setHandler(const HandlerType& handler);
77
81 void setToolInformation(const ToolInformation& info);
82
86 void setElementInformation(const ElementInformation&);
87
88 protected:
90 void generate() override;
91
93 void paint() override;
94
96 void renderObjects();
97
99 void draw() override;
100
102 void changedProperty() override;
103
105 void setIndexValue(int index, QVariant value) override;
106
107 void renderNipscan(bool solid, double x_axis, double y_axis, double z_axis, double a_axis, double b_axis, double c_axis);
108
109 private:
113 void generateNipscan(VertexArrayBase*);
114
119 void notify(const void* member);
120
124 bool _flagPaint;
128 bool _flagObjects;
134 QColor _lightColor;
142 float _cutoffAngle;
143 float _ambientStrength;
144 float _diffuseStrength;
145 float _specularStrength;
146 float _shininess;
147 //
148 FragmentProgram _fragmentProgram;
149 ShaderProgram* _shaderProgram;
151 std::array<double, 6> _indexValues;
153 HandlerType _handler;
155 Dynamic* _nipscan;
156 ToolInformation _toolInfo;
157 ElementInformation _elementInfo;
158 //
159 Normals* _testNormals;
160 Line* _testLine;
161 Axes* _xyxAxes;
162 Cone* _lightCone;
163 Tube* _zAxisTube;
164 Disk* _zAxisDisk;
165 Sphere* _zAxisSphere;
166 Cylinder* _bAxisCylinder;
167 Cylinder* _soundBeamCylinder;
168};
169
170}// 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:13
Widget for rendering an OpenGL scene.
Definition OpenGLWidget.h:30
Encapsulates the std::function() template.
Definition TClosure.h:14
Holds all the necessary 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. The height of the cone is along the Z-axis ...
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:23
FragmentProgram
Enumeration of available shader inner programs passed to ShaderProgram::Uniform::uProgram uniform.
Definition NipscanRenderer.h:48
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. The 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:15
#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
#define _SCN_NIPSCAN_CLASS
Definition scn/nipscan/global.h:35