Commit 163a2e9e authored by Maire Nicolas's avatar Maire Nicolas
Browse files

Rajout d'une interface Qt pour pouvoir interagir avec toutes les options d'affichage des plans

parent 5159fad1
......@@ -171,6 +171,44 @@ void StageShader::slot_doubleSpinBox_ColorAttenuationFactor(double c)
updateGL();
}
void StageShader::slot_doubleSpinBox_GridDisplaySize(double c)
{
m_shader->setPlaneDisplaySize((float)c);
updateGL();
}
void StageShader::slot_spinBox_GridResolutionX(int i)
{
m_shader->setPlaneDisplayXRes((size_t)i);
updateGL();
}
void StageShader::slot_spinBox_GridResolutionY(int i)
{
m_shader->setPlaneDisplayYRes((size_t)i);
updateGL();
}
void StageShader::slot_doubleSpinBox_GridColor(double c)
{
float r = dynamic_cast<Utils::QT::uiDockInterface*>(dockWidget())->doubleSpinBox_GridColorR->value();
float g = dynamic_cast<Utils::QT::uiDockInterface*>(dockWidget())->doubleSpinBox_GridColorG->value();
float b = dynamic_cast<Utils::QT::uiDockInterface*>(dockWidget())->doubleSpinBox_GridColorB->value();
m_shader->setPlaneDisplayColor(Geom::Vec3f(r, g, b));
updateGL();
}
void StageShader::slot_horizontalSlider_GridType(int i)
{
if (i == 0)
m_shader->setPlaneDisplayType(Utils::ClippingShader::STRAIGHT_GRID);
else if (i == 1)
m_shader->setPlaneDisplayType(Utils::ClippingShader::RADIAL_GRID);
updateGL();
}
void StageShader::button_compile()
{
QString st1 = dynamic_cast<Utils::QT::uiDockInterface*>(dockWidget())->vertexEdit->toPlainText();
......@@ -236,12 +274,31 @@ void StageShader::initGUI()
setCallBack(dock.doubleSpinBox_PlaneOriginz, SIGNAL(valueChanged(double)), SLOT(slot_doubleSpinBox_PlaneOrigin(double)));
setCallBack(dock.doubleSpinBox_ColorAttenuationFactor, SIGNAL(valueChanged(double)), SLOT(slot_doubleSpinBox_ColorAttenuationFactor(double)));
setCallBack(dock.doubleSpinBox_GridDisplaySize, SIGNAL(valueChanged(double)), SLOT(slot_doubleSpinBox_GridDisplaySize(double)));
setCallBack(dock.spinBox_GridResolutionX, SIGNAL(valueChanged(int)), SLOT(slot_spinBox_GridResolutionX(int)));
setCallBack(dock.spinBox_GridResolutionY, SIGNAL(valueChanged(int)), SLOT(slot_spinBox_GridResolutionY(int)));
setCallBack(dock.doubleSpinBox_GridColorR, SIGNAL(valueChanged(double)), SLOT(slot_doubleSpinBox_GridColor(double)));
setCallBack(dock.doubleSpinBox_GridColorG, SIGNAL(valueChanged(double)), SLOT(slot_doubleSpinBox_GridColor(double)));
setCallBack(dock.doubleSpinBox_GridColorB, SIGNAL(valueChanged(double)), SLOT(slot_doubleSpinBox_GridColor(double)));
setCallBack(dock.horizontalSlider_GridType, SIGNAL(valueChanged(int)), SLOT(slot_horizontalSlider_GridType(int)));
setCallBack(dock.compileButton, SIGNAL(clicked()), SLOT(button_compile()) );
dock.vertexEdit->setPlainText(QString(m_shader->getVertexShaderSrc()));
dock.fragmentEdit->setPlainText(QString(m_shader->getFragmentShaderSrc()));
dock.doubleSpinBox_ColorAttenuationFactor->setValue(m_shader->getClippingColorAttenuationFactor());
dock.doubleSpinBox_GridDisplaySize->setValue(m_shader->getPlaneDisplaySize());
dock.spinBox_GridResolutionX->setValue(m_shader->getPlaneDisplayXRes());
dock.spinBox_GridResolutionY->setValue(m_shader->getPlaneDisplayYRes());
Geom::Vec3f col = m_shader->getPlaneDisplayColor();
dock.doubleSpinBox_GridColorR->setValue(col[0]);
dock.doubleSpinBox_GridColorG->setValue(col[1]);
dock.doubleSpinBox_GridColorB->setValue(col[2]);
if (m_shader->getPlaneDisplayType() == Utils::ClippingShader::STRAIGHT_GRID)
dock.horizontalSlider_GridType->setValue(0);
else if (m_shader->getPlaneDisplayType() == Utils::ClippingShader::RADIAL_GRID)
dock.horizontalSlider_GridType->setValue(1);
}
void StageShader::cb_Open()
......@@ -330,7 +387,6 @@ void StageShader::cb_initGL()
m_shader->setPlaneDisplayColor(Geom::Vec3f (1.0, 0.0, 0.0));
m_shader->setPlaneDisplayXRes(10);
m_shader->setPlaneDisplayYRes(5);
m_shader->setPlaneDisplayType(Utils::ClippingShader::STRAIGHT_GRID);
}
void StageShader::updateVBOprimitives(int upType)
......
......@@ -134,6 +134,11 @@ public slots:
void slot_doubleSpinBox_PlaneOrigin(double c);
void slot_doubleSpinBox_ColorAttenuationFactor(double c);
void slot_doubleSpinBox_GridDisplaySize(double c);
void slot_spinBox_GridResolutionX(int i);
void slot_spinBox_GridResolutionY(int i);
void slot_doubleSpinBox_GridColor(double c);
void slot_horizontalSlider_GridType(int i);
void button_compile();
};
......
......@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>324</width>
<height>628</height>
<width>417</width>
<height>534</height>
</rect>
</property>
<property name="allowedAreas">
......@@ -18,7 +18,7 @@
</property>
<widget class="QWidget" name="dockWidgetContents">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<item row="0" column="1">
<widget class="QTabWidget" name="tabWidget">
<property name="tabPosition">
<enum>QTabWidget::East</enum>
......@@ -32,415 +32,509 @@
</attribute>
<layout class="QGridLayout" name="gridLayout_6">
<item row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QCheckBox" name="checkBox_vertices">
<property name="text">
<string>Vertices</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_lines">
<property name="text">
<string>Lines</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_faces">
<property name="text">
<string>Faces</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_topo">
<property name="enabled">
<bool>true</bool>
</property>
<property name="title">
<string>Topo</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>false</bool>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="1" column="0">
<layout class="QGridLayout" name="gridLayout_2">
<item row="3" column="2">
<widget class="QDoubleSpinBox" name="explod_phi2">
<property name="maximum">
<double>1.000000000000000</double>
</property>
<property name="singleStep">
<double>0.100000000000000</double>
</property>
<property name="value">
<double>0.900000000000000</double>
</property>
</widget>
</item>
<item row="5" column="2">
<widget class="QDoubleSpinBox" name="explod_phi3">
<property name="maximum">
<double>1.000000000000000</double>
</property>
<property name="singleStep">
<double>0.100000000000000</double>
</property>
<property name="value">
<double>0.900000000000000</double>
<widget class="QTabWidget" name="tabWidget_3">
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="tab_Object">
<attribute name="title">
<string>Object</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QCheckBox" name="checkBox_vertices">
<property name="text">
<string>Vertices</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_lines">
<property name="text">
<string>Lines</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_faces">
<property name="text">
<string>Faces</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_topo">
<property name="enabled">
<bool>true</bool>
</property>
<property name="title">
<string>Topo</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>false</bool>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="1" column="0">
<layout class="QGridLayout" name="gridLayout_2">
<item row="3" column="2">
<widget class="QDoubleSpinBox" name="explod_phi2">
<property name="maximum">
<double>1.000000000000000</double>
</property>
<property name="singleStep">
<double>0.100000000000000</double>
</property>
<property name="value">
<double>0.900000000000000</double>
</property>
</widget>
</item>
<item row="5" column="2">
<widget class="QDoubleSpinBox" name="explod_phi3">
<property name="maximum">
<double>1.000000000000000</double>
</property>
<property name="singleStep">
<double>0.100000000000000</double>
</property>
<property name="value">
<double>0.900000000000000</double>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_faces">
<property name="text">
<string>Faces</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_volumes">
<property name="text">
<string>Volumes</string>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QDoubleSpinBox" name="explod_phi1">
<property name="prefix">
<string/>
</property>
<property name="maximum">
<double>1.000000000000000</double>
</property>
<property name="singleStep">
<double>0.100000000000000</double>
</property>
<property name="value">
<double>0.900000000000000</double>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_edges">
<property name="text">
<string>Edges</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_rotate">
<property name="title">
<string>Rotate</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>false</bool>
</property>
<layout class="QGridLayout" name="gridLayout_5">
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Speed</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QDoubleSpinBox" name="doubleSpinBox"/>
</item>
</layout>
</item>
<item row="1" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_Clipping">
<attribute name="title">
<string>Clipping</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<layout class="QVBoxLayout" name="verticalLayout_3" stretch="3,1,2">
<item>
<widget class="QGroupBox" name="groupBox_DisplayParams">
<property name="enabled">
<bool>true</bool>
</property>
<property name="title">
<string>Display Parameters</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<layout class="QGridLayout" name="gridLayout_12">
<item row="3" column="2">
<widget class="QDoubleSpinBox" name="doubleSpinBox_GridColorG">
<property name="maximum">
<double>1.000000000000000</double>
</property>
<property name="singleStep">
<double>0.100000000000000</double>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_GridResolution">
<property name="text">
<string>Res.</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_ColorAttenuationFactor">
<property name="text">
<string>Color Att.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QSpinBox" name="spinBox_GridResolutionX">
<property name="maximum">
<number>200</number>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QDoubleSpinBox" name="doubleSpinBox_ColorAttenuationFactor">
<property name="singleStep">
<double>1.000000000000000</double>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_GridColor">
<property name="text">
<string>Color</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QDoubleSpinBox" name="doubleSpinBox_GridDisplaySize"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_GridSize">
<property name="text">
<string>Size</string>
</property>
</widget>
</item>
<item row="3" column="3">
<widget class="QDoubleSpinBox" name="doubleSpinBox_GridColorB">
<property name="maximum">
<double>1.000000000000000</double>
</property>
<property name="singleStep">
<double>0.100000000000000</double>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QDoubleSpinBox" name="doubleSpinBox_GridColorR">
<property name="maximum">
<double>1.000000000000000</double>
</property>
<property name="singleStep">
<double>0.100000000000000</double>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QSpinBox" name="spinBox_GridResolutionY">
<property name="maximum">
<number>200</number>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_GridType">
<property name="text">
<string>Type</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QSlider" name="horizontalSlider_GridType">
<property name="maximum">
<number>1</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_PlanesSelection">
<property name="title">
<string>Planes Selection</string>
</property>
<widget class="QPushButton" name="pushButton_deletePlane">
<property name="geometry">
<rect>
<x>170</x>
<y>30</y>
<width>31</width>
<height>28</height>
</rect>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_faces">
<property name="text">
<string>Faces</string>
<string>-</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_volumes">
<widget class="QPushButton" name="pushButton_addPlane">
<property name="geometry">
<rect>
<x>140</x>
<y>30</y>
<width>31</width>
<height>28</height>
</rect>
</property>
<property name="text">
<string>Volumes</string>
<string>+</string>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QDoubleSpinBox" name="explod_phi1">
<property name="prefix">
<string/>
<widget class="QComboBox" name="comboBox_PlaneIndex">
<property name="enabled">
<bool>true</bool>
</property>
<property name="maximum">
<double>1.000000000000000</double>
<property name="geometry">
<rect>
<x>10</x>
<y>30</y>
<width>99</width>
<height>28</height>
</rect>
</property>
<property name="singleStep">
<double>0.100000000000000</double>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="value">
<double>0.900000000000000</double>
<property name="editable">
<bool>false</bool>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_edges">
<property name="text">
<string>Edges</string>
<property name="currentIndex">
<number>-1</number>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_rotate">
<property name="title">
<string>Rotate</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>false</bool>
</property>
<layout class="QGridLayout" name="gridLayout_5">
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Speed</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QDoubleSpinBox" name="doubleSpinBox"/>
</item>
</layout>
</item>
</layout>
</widget>
</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_PlaneVec1x">
<property name="geometry">
<rect>
<x>0</x>
<y>90</y>
<width>63</width>
<height>28</height>
</rect>
</property>
<property name="minimum">
<double>-99.989999999999995</double>
</property>