Commit 18afaf68 authored by Maire Nicolas's avatar Maire Nicolas

Intégration du clipping à l'application test stage_shader.

parent 8fe57b53
......@@ -75,6 +75,22 @@ void StageShader::slot_explodTopoPhi3(double c)
updateGL();
}
void StageShader::slot_doubleSpinBox_Plane(double c)
{
float aPlane = dynamic_cast<Utils::QT::uiDockInterface*>(dockWidget())->doubleSpinBox_aPlane->value();
float bPlane = dynamic_cast<Utils::QT::uiDockInterface*>(dockWidget())->doubleSpinBox_bPlane->value();
float cPlane = dynamic_cast<Utils::QT::uiDockInterface*>(dockWidget())->doubleSpinBox_cPlane->value();
float dPlane = dynamic_cast<Utils::QT::uiDockInterface*>(dockWidget())->doubleSpinBox_dPlane->value();
m_shader->setPlaneClippingParams(Geom::Vec4f(aPlane, bPlane, cPlane, dPlane));
updateGL();
}
void StageShader::slot_doubleSpinBox_ColorAttenuationFactor(double c)
{
m_shader->setClippingColorAttenuationFactor((float)c);
updateGL();
}
void StageShader::button_compile()
{
QString st1 = dynamic_cast<Utils::QT::uiDockInterface*>(dockWidget())->vertexEdit->toPlainText();
......@@ -125,7 +141,7 @@ StageShader::StageShader():
void StageShader::initGUI()
{
CGoGNStream::allToConsole(this) ;
CGoGNStream::allToStd(false) ;
CGoGNStream::allToStd(true) ;
setDock(&dock);
......@@ -140,6 +156,13 @@ void StageShader::initGUI()
setCallBack(dock.explod_phi2, SIGNAL(valueChanged(double)), SLOT(slot_explodTopoPhi2(double)));
setCallBack(dock.explod_phi3, SIGNAL(valueChanged(double)), SLOT(slot_explodTopoPhi3(double)));
setCallBack(dock.doubleSpinBox_aPlane, SIGNAL(valueChanged(double)), SLOT(slot_doubleSpinBox_Plane(double)));
setCallBack(dock.doubleSpinBox_bPlane, SIGNAL(valueChanged(double)), SLOT(slot_doubleSpinBox_Plane(double)));
setCallBack(dock.doubleSpinBox_cPlane, SIGNAL(valueChanged(double)), SLOT(slot_doubleSpinBox_Plane(double)));
setCallBack(dock.doubleSpinBox_dPlane, SIGNAL(valueChanged(double)), SLOT(slot_doubleSpinBox_Plane(double)));
setCallBack(dock.doubleSpinBox_ColorAttenuationFactor, SIGNAL(valueChanged(double)), SLOT(slot_doubleSpinBox_ColorAttenuationFactor(double)));
setCallBack(&dock, SIGNAL(topLevelChanged(bool)), SLOT(dockWidget_topLevelChanged(bool)));
setCallBack(dock.compileButton, SIGNAL(clicked()), SLOT(button_compile()) );
......@@ -230,6 +253,8 @@ void StageShader::cb_initGL()
m_shader->setColor(Geom::Vec4f(0.,1.,0.,0.));
registerShader(m_shader);
m_shader->addPlaneClippingToShaderSource();
}
void StageShader::updateVBOprimitives(int upType)
......
......@@ -119,6 +119,10 @@ public slots:
void slot_explodTopoPhi2(double c);
void slot_explodTopoPhi3(double c);
void slot_doubleSpinBox_Plane(double c);
void slot_doubleSpinBox_ColorAttenuationFactor(double c);
void dockWidget_topLevelChanged(bool isFloating);
void button_compile();
......
......@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>324</width>
<height>473</height>
<height>526</height>
</rect>
</property>
<property name="allowedAreas">
......@@ -189,6 +189,180 @@
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QGroupBox" name="groupBox_clipping">
<property name="enabled">
<bool>true</bool>
</property>
<property name="title">
<string>Clipping</string>
</property>
<widget class="QDoubleSpinBox" name="doubleSpinBox_aPlane">
<property name="geometry">
<rect>
<x>0</x>
<y>70</y>
<width>63</width>
<height>28</height>
</rect>
</property>
<property name="minimum">
<double>-99.989999999999995</double>
</property>
<property name="singleStep">
<double>0.100000000000000</double>
</property>
<property name="value">
<double>0.500000000000000</double>
</property>
</widget>
<widget class="QDoubleSpinBox" name="doubleSpinBox_bPlane">
<property name="geometry">
<rect>
<x>60</x>
<y>70</y>
<width>63</width>
<height>28</height>
</rect>
</property>
<property name="minimum">
<double>-99.989999999999995</double>
</property>
<property name="singleStep">
<double>0.100000000000000</double>
</property>
<property name="value">
<double>0.500000000000000</double>
</property>
</widget>
<widget class="QDoubleSpinBox" name="doubleSpinBox_cPlane">
<property name="geometry">
<rect>
<x>120</x>
<y>70</y>
<width>63</width>
<height>28</height>
</rect>
</property>
<property name="minimum">
<double>-99.989999999999995</double>
</property>
<property name="singleStep">
<double>0.100000000000000</double>
</property>
<property name="value">
<double>0.500000000000000</double>
</property>
</widget>
<widget class="QDoubleSpinBox" name="doubleSpinBox_dPlane">
<property name="geometry">
<rect>
<x>180</x>
<y>70</y>
<width>63</width>
<height>28</height>
</rect>
</property>
<property name="minimum">
<double>-99.989999999999995</double>
</property>
<property name="singleStep">
<double>0.100000000000000</double>
</property>
</widget>
<widget class="QLabel" name="label_Plane">
<property name="geometry">
<rect>
<x>0</x>
<y>30</y>
<width>69</width>
<height>18</height>
</rect>
</property>
<property name="text">
<string>Plane :</string>
</property>
</widget>
<widget class="QLabel" name="label_aPlane">
<property name="geometry">
<rect>
<x>10</x>
<y>50</y>
<width>31</width>
<height>18</height>
</rect>
</property>
<property name="text">
<string>a :</string>
</property>
</widget>
<widget class="QLabel" name="label_bPlane">
<property name="geometry">
<rect>
<x>70</x>
<y>50</y>
<width>31</width>
<height>18</height>
</rect>
</property>
<property name="text">
<string>b :</string>
</property>
</widget>
<widget class="QLabel" name="label_cPlane">
<property name="geometry">
<rect>
<x>130</x>
<y>50</y>
<width>31</width>
<height>18</height>
</rect>
</property>
<property name="text">
<string>c :</string>
</property>
</widget>
<widget class="QLabel" name="label_dPlane">
<property name="geometry">
<rect>
<x>190</x>
<y>50</y>
<width>31</width>
<height>18</height>
</rect>
</property>
<property name="text">
<string>d :</string>
</property>
</widget>
<widget class="QLabel" name="label_ColorAttenuationFactor">
<property name="geometry">
<rect>
<x>0</x>
<y>100</y>
<width>201</width>
<height>18</height>
</rect>
</property>
<property name="text">
<string>Color Attenuation Factor :</string>
</property>
</widget>
<widget class="QDoubleSpinBox" name="doubleSpinBox_ColorAttenuationFactor">
<property name="geometry">
<rect>
<x>0</x>
<y>120</y>
<width>63</width>
<height>28</height>
</rect>
</property>
<property name="singleStep">
<double>1.000000000000000</double>
</property>
</widget>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_2">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment