Commit 51b490c1 authored by Thomas Jund's avatar Thomas Jund

utilisation de QGLviewer pour gestion camera future

parent c8122245
......@@ -2,8 +2,15 @@ cmake_minimum_required(VERSION 2.8)
project(SocialAgents)
#SET ( CMAKE_VERBOSE_MAKEFILE 1 )
#add_definitions(-DSPATIAL_HASHING)
SET(QT_USE_QTXML TRUE )
SET (CGoGN_EXT_INCLUDES ${CGoGN_EXT_INCLUDES} ${QT_INCLUDE_DIR})
SET (CGoGN_EXT_LIBS ${CGoGN_EXT_LIBS} ${QT_LIBRARIES} ${QGLVIEWER_LIBRARIES})
SET(CGoGN_ROOT_DIR ${CMAKE_SOURCE_DIR}/../../CGoGN CACHE STRING "CGoGN root dir")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
include(${CGoGN_ROOT_DIR}/apps_cmake.txt)
......
......@@ -51,4 +51,4 @@ add_executable( socialAgentsD
add_dependencies(socialAgentsD shader_targetD )
target_link_libraries( socialAgentsD ${CGoGN_LIBS_D} ${COMMON_LIBS} )
target_link_libraries( socialAgentsD ${CGoGN_LIBS_D} ${COMMON_LIBS} ${CGoGN_EXT_LIBS})
......@@ -10,7 +10,6 @@ ENDIF (WIN32)
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/Release
# ${CMAKE_CURRENT_SOURCE_DIR}
../include
......@@ -30,6 +29,7 @@ add_custom_target(shader_target ${CGoGN_ROOT_DIR}/ThirdParty/bin/shader_to_h ${s
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
SOURCES ${shaders_src} )
SET(QT_USE_QTXML TRUE )
#SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
QT4_WRAP_UI( socialAgents_ui ../include/socialAgents.ui )
......@@ -52,4 +52,4 @@ add_executable( socialAgents
add_dependencies(socialAgents shader_target )
target_link_libraries( socialAgents ${CGoGN_LIBS_R} ${COMMON_LIBS} )
target_link_libraries( socialAgents ${CGoGN_LIBS_R} ${COMMON_LIBS} ${CGoGN_EXT_LIBS})
......@@ -25,7 +25,7 @@
#include <iostream>
#include <sys/time.h>
#include "Utils/Qt/qtSimple.h"
#include "Utils/Qt/qtQGLV.h"
#include "ui_socialAgents.h"
#include "Utils/Qt/qtui.h"
......@@ -59,7 +59,7 @@ using namespace CGoGN ;
typedef PFP::MAP MAP ;
class SocialAgents : public Utils::QT::SimpleQT
class SocialAgents : public Utils::QT::SimpleQGLV
{
Q_OBJECT
......
......@@ -185,8 +185,8 @@ void SocialAgents::cb_initGL()
m_sprite = new Utils::PointSprite();
m_sprite->setAttributePosition(m_agentsVBO);
// m_sprite->setSize(Agent::radius_);
m_sprite->setSize((50.0f/gWidthObj) * Agent::radius_ );
m_sprite->setSize(Agent::radius_);
// m_sprite->setSize((50.0f/gWidthObj) * Agent::radius_ );
registerShader(m_simpleColorShader);
registerShader(m_sprite);
......@@ -1698,11 +1698,11 @@ void SocialAgents::cb_keyPress(int keycode)
{
QString filename("./export/test.jpg");
// QPixmap image = QPixmap::grabWidget( this );
QImage image = m_glWidget->grabFrameBuffer ();
if( !image.save( filename, "JPG" ) )
{
QMessageBox::warning( this, "Save Image", "Error saving image." );
}
// QImage image = m_glWidget->grabFrameBuffer ();
// if( !image.save( filename, "JPG" ) )
// {
// QMessageBox::warning( this, "Save Image", "Error saving image." );
// }
break;
}
case 'p' :
......
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