Commit 4040a77e authored by Sylvain Thery's avatar Sylvain Thery

Merge branch 'master' of cgogn:/home/maire/CGoGN

Conflicts:
	src/Utils/Shaders/shaderPhong.cpp
parents 78e96120 13e149b1
SET(EXECUTABLE_OUTPUT_PATH ${CGoGN_ROOT_DIR}/bin)
SET (COMMON_LIBS ${GLUT_LIBRARY} ${OPENGL_LIBRARY} ${GLEW_LIBRARY} ${DEVIL_LIBRARIES} ${ZLIB_LIBRARIES} ${LIBXML2_LIBRARIES} gzstream AntTweakBar openctm assimp)
BOOST_LIBS(boost_regex_lib_lists "boost_regex-mt")
SET (COMMON_LIBS ${GLUT_LIBRARY} ${OPENGL_LIBRARY} ${GLEW_LIBRARY} ${DEVIL_LIBRARIES} ${ZLIB_LIBRARIES} ${LIBXML2_LIBRARIES} ${boost_regex_lib_lists} gzstream AntTweakBar openctm assimp)
SET(CGoGN_LIBS_R topology algo container utils)
......
......@@ -59,3 +59,9 @@ add_executable( viewerD ../viewer.cpp ${viewer_moc} ${viewer_ui})
target_link_libraries( viewerD
${CGoGN_LIBS_D} ${NUMERICAL_LIBS} ${COMMON_LIBS} ${QT_LIBRARIES} )
QT4_WRAP_UI( clipping_ui ../clipping.ui )
QT4_WRAP_CPP( clipping_moc ../clipping.h )
add_executable( clippingD ../clipping.cpp ${clipping_ui} ${clipping_moc})
target_link_libraries( clippingD
${CGoGN_LIBS_D} ${COMMON_LIBS} ${QT_LIBRARIES} )
......@@ -63,3 +63,9 @@ add_executable( viewer ../viewer.cpp ${viewer_moc} ${viewer_ui})
target_link_libraries( viewer
${CGoGN_LIBS_R} ${NUMERICAL_LIBS} ${COMMON_LIBS} ${QT_LIBRARIES} )
QT4_WRAP_UI( clipping_ui ../clipping.ui )
QT4_WRAP_CPP( clipping_moc ../clipping.h )
add_executable( clipping ../clipping.cpp ${clipping_ui} ${clipping_moc})
target_link_libraries( clipping
${CGoGN_LIBS_D} ${COMMON_LIBS} ${QT_LIBRARIES} )
This diff is collapsed.
......@@ -22,14 +22,15 @@
* *
*******************************************************************************/
#ifndef __STAGE_SHADER_H__
#define __STAGE_SHADER_H__
#ifndef __CLIPPING_H__
#define __CLIPPING_H__
#include <iostream>
#include "Utils/qtSimple.h"
#include "Utils/qtInputs.h"
#include "ui_stage_shader.h"
#include "ui_clipping.h"
// inclure qtui.h juste après le ui_xxx.h
#include "Utils/qtui.h"
......@@ -49,11 +50,16 @@
#include "Algo/Render/GL2/topo3Render.h"
#include "Utils/Shaders/shaderSimpleColor.h"
#include "Utils/frameManipulator.h"
#include "Utils/clippingPresets.h"
#include "Utils/cgognStream.h"
#include "Utils/drawer.h"
#include <string>
#include <sstream>
using namespace CGoGN ;
struct PFP: public PFP_STANDARD
......@@ -63,7 +69,7 @@ struct PFP: public PFP_STANDARD
};
class StageShader: public Utils::QT::SimpleQT
class Clipping: public Utils::QT::SimpleQT
{
Q_OBJECT
......@@ -80,12 +86,14 @@ public:
//Render
bool m_drawVertices;
bool m_drawLines;
bool m_drawFaces;
bool m_drawTopo;
bool m_drawFaces;
bool m_drawTopo;
Algo::Render::GL2::MapRender* m_render;
Algo::Render::GL2::Topo3RenderMapD* m_render_topo;
Geom::BoundingBox<PFP::VEC3> m_bb;
Utils::VBO* m_positionVBO;
Utils::ShaderSimpleColor* m_shader;
......@@ -94,13 +102,23 @@ public:
Utils::Drawer* chips_area;
Geom::Vec3f m_coeffTopoExplod;
Geom::Vec3f gPosObj ;
float gWidthObj ;
Geom::Vec3f gPosObj ;
float gWidthObj ;
//QT
Utils::QT::uiDockInterface dock;
//QT
Utils::QT::uiDockInterface dock;
// Picking
Utils::LineDrawable* m_planeDrawable;
Utils::LineDrawable* m_sphereDrawable;
Utils::FrameManipulator* m_frameManipulator;
unsigned int m_frameManipulatorPickedAxis;
std::vector<Utils::Pickable*> m_pickablePlanes;
std::vector<Utils::Pickable*> m_pickableSpheres;
Utils::Pickable* m_lastPickedObject;
int m_lastClickedX, m_lastClickedY;
StageShader();
Clipping();
void initGUI();
void cb_Open();
......@@ -108,6 +126,7 @@ public:
void cb_initGL();
void cb_redraw();
void cb_mousePress(int button, int x, int y);
void cb_mouseMove(int buttons, int x, int y);
void cb_keyPress(int code);
void importMesh(std::string& filename);
......@@ -121,7 +140,23 @@ public slots:
void slot_explodTopoPhi2(double c);
void slot_explodTopoPhi3(double c);
void dockWidget_topLevelChanged(bool isFloating);
void slot_pushButton_addPlane();
void slot_spinBox_GridResolution(int i);
void slot_pushButton_changePlanesColor();
void slot_pushButton_addSphere();
void slot_spinBox_SphereResolution(int i);
void slot_pushButton_changeSpheresColor();
void slot_doubleSpinBox_ColorAttenuationFactor(double c);
void slot_radioButton_ClippingMode(bool b);
void slot_radioButton_ColorAttenuationMode(bool b);
void slot_pushButton_deleteSelectedObject();
void slot_pushButton_applyClippingPreset();
void button_compile();
};
......
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DockWidget</class>
<widget class="QDockWidget" name="DockWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>374</width>
<height>783</height>
</rect>
</property>
<property name="allowedAreas">
<set>Qt::LeftDockWidgetArea|Qt::RightDockWidgetArea</set>
</property>
<property name="windowTitle">
<string>Interface</string>
</property>
<widget class="QWidget" name="dockWidgetContents">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="1">
<widget class="QTabWidget" name="tabWidget">
<property name="tabPosition">
<enum>QTabWidget::East</enum>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
<string>Visualisation</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_6">
<item row="0" column="0">
<widget class="QTabWidget" name="tabWidget_Options">
<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="1" column="1">
<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="2" column="1">
<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="1" column="0">
<widget class="QLabel" name="label_faces">
<property name="text">
<string>Faces</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_volumes">
<property name="text">
<string>Volumes</string>
</property>
</widget>
</item>
<item row="0" column="1">
<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="0" column="0">
<widget class="QLabel" name="label_edges">
<property name="text">
<string>Edges</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
</layout>
</item>
<item>
<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>
<widget class="QWidget" name="tab_Clipping">
<attribute name="title">
<string>Clipping</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_6">
<item>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<layout class="QVBoxLayout" name="verticalLayout_8">
<item>
<widget class="QGroupBox" name="groupBox_ClippingMode">
<property name="title">
<string>Clipping Mode</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_9">
<item>
<widget class="QRadioButton" name="radioButton_ClippingModeAnd">
<property name="text">
<string>AND</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButton_ClippingModeOr">
<property name="text">
<string>OR</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_5" stretch="0">
<item>
<widget class="QGroupBox" name="groupBox_clipSpheres">
<property name="enabled">
<bool>true</bool>
</property>
<property name="title">
<string>Clipping Spheres</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QPushButton" name="pushButton_addSphere">
<property name="text">
<string>Add</string>
</property>
</widget>
</item>
<item>
<layout class="QGridLayout" name="gridLayout_13">
<item row="0" column="0">
<widget class="QLabel" name="label_SphereResolution">
<property name="text">
<string>Res.</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QSpinBox" name="spinBox_SphereResolution">
<property name="maximum">
<number>200</number>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_GridColor_2">
<property name="text">
<string>Color</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QPushButton" name="pushButton_changeSpheresColor">
<property name="text">
<string>Change Color</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_3" stretch="0">
<item>
<widget class="QGroupBox" name="groupBox_clipPlanes">
<property name="enabled">
<bool>true</bool>
</property>
<property name="title">
<string>Clipping Planes</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QPushButton" name="pushButton_addPlane">
<property name="text">
<string>Add</string>
</property>
</widget>
</item>
<item>
<layout class="QGridLayout" name="gridLayout_12">
<item row="0" column="0">
<widget class="QLabel" name="label_GridResolution">
<property name="text">
<string>Res.</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QSpinBox" name="spinBox_GridResolution">
<property name="maximum">
<number>200</number>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_GridColor">
<property name="text">
<string>Color</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QPushButton" name="pushButton_changePlanesColor">
<property name="text">
<string>Change Color</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_7">
<item>
<widget class="QGroupBox" name="groupBox_ClippingPresets">
<property name="title">
<string>Clipping Presets</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_12">
<item>
<widget class="QComboBox" name="comboBox_ClippingPresets"/>
</item>
<item>
<widget class="QPushButton" name="PushButton_ApplyClippingPreset">
<property name="text">
<string>Apply Preset</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_10">
<item>
<widget class="QGroupBox" name="groupBox_ColorAttenuation">
<property name="title">
<string>Color Attenuation</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_11">
<item>
<widget class="QLabel" name="label_ColorAttenuationFactor">
<property name="text">
<string>Color Att. Factor :</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QDoubleSpinBox" name="doubleSpinBox_ColorAttenuationFactor">
<property name="decimals">
<number>4</number>
</property>
<property name="singleStep">
<double>1.000000000000000</double>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_ColorAttenuationMode">
<property name="text">
<string>Color Att. Mode :</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButton_ColorAttenuationModeLinear">
<property name="text">
<string>Linear</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButton_ColorAttenuationModeQuadratic">
<property name="text">
<string>Quadratic</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_2">
<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>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_2">
<attribute name="title">
<string>Shader</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_7">
<item row="0" column="0">
<layout class="QGridLayout" name="gridLayout_8">
<item row="0" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Shader Editor</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QPushButton" name="compileButton">
<property name="text">
<string>Recompile</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QTabWidget" name="tabWidget_2">
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="tab_3">
<attribute name="title">
<string>Vertex</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_9">
<item row="0" column="0">
<widget class="QTextEdit" name="vertexEdit"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_4">
<attribute name="title">
<string>Fragment</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_10">
<item row="0" column="0">
<widget class="QTextEdit" name="fragmentEdit"/>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
</widget>
<resources/>
<connections/>
</ui>
......@@ -47,7 +47,6 @@
#include "glm/gtc/type_precision.hpp"
#include "glm/gtc/type_ptr.hpp"
using namespace CGoGN;
struct PFP: public PFP_STANDARD
......