viewer.h 2.89 KB
Newer Older
Pierre Kraemer's avatar
Pierre Kraemer committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps  *
* version 0.1                                                                  *
* Copyright (C) 2009, IGG Team, LSIIT, University of Strasbourg                *
*                                                                              *
* This library is free software; you can redistribute it and/or modify it      *
* under the terms of the GNU Lesser General Public License as published by the *
* Free Software Foundation; either version 2.1 of the License, or (at your     *
* option) any later version.                                                   *
*                                                                              *
* This library is distributed in the hope that it will be useful, but WITHOUT  *
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or        *
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License  *
* for more details.                                                            *
*                                                                              *
* You should have received a copy of the GNU Lesser General Public License     *
* along with this library; if not, write to the Free Software Foundation,      *
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA.           *
*                                                                              *
* Web site: https://iggservis.u-strasbg.fr/CGoGN/                              *
* Contact information: cgogn@unistra.fr                                        *
*                                                                              *
*******************************************************************************/

#include <iostream>

Pierre Kraemer's avatar
Pierre Kraemer committed
27 28 29
#include "Utils/qtSimple.h"
#include "ui_socialAgents.h"
#include "Utils/qtui.h"
Pierre Kraemer's avatar
Pierre Kraemer committed
30 31 32 33

#include "simulator.h"
#include "env_render.h"

Pierre Kraemer's avatar
Pierre Kraemer committed
34
#include "Algo/Geometry/boundingbox.h"
Pierre Kraemer's avatar
Pierre Kraemer committed
35
#include "Algo/Export/exportPov.h"
Pierre Kraemer's avatar
Pierre Kraemer committed
36
#include "Utils/GLSLShader.h"
Pierre Kraemer's avatar
Pierre Kraemer committed
37 38 39 40 41 42 43
#include "Algo/Render/GL1/map_glRender.h"
#include "Algo/Render/GL1/topo_render.h"

using namespace CGoGN ;

typedef PFP::MAP MAP;

Pierre Kraemer's avatar
Pierre Kraemer committed
44
class SocialAgents : public Utils::QT::SimpleQT
Pierre Kraemer's avatar
Pierre Kraemer committed
45
{
Pierre Kraemer's avatar
Pierre Kraemer committed
46 47
	Q_OBJECT

Pierre Kraemer's avatar
Pierre Kraemer committed
48
public:
Pierre Kraemer's avatar
Pierre Kraemer committed
49
	SocialAgents() ;
Pierre Kraemer's avatar
Pierre Kraemer committed
50

Pierre Kraemer's avatar
Pierre Kraemer committed
51 52 53 54
	void initGUI() ;

	void cb_initGL() ;
	void cb_redraw() ;
Pierre Kraemer's avatar
Pierre Kraemer committed
55 56 57

//	bool exportScenePov(PFP::MAP& map, PFP::TVEC3& position, const std::string& filename, PFP::VEC3 cameraPos, PFP::VEC3 cameraLook, PFP::VEC3 translate, float angle_X, float angle_Y, float angle_Z,const FunctorSelect& good = SelectorTrue());
	
Pierre Kraemer's avatar
Pierre Kraemer committed
58 59 60 61 62
	void cb_keyPress(int keycode) ;

    Utils::QT::uiDockInterface dock ;

    QTimer* timer;
Pierre Kraemer's avatar
Pierre Kraemer committed
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77

	// to count fps
	int frames;
	clock_t nextUpdate;
	bool displayFps;
	float fps;
	
	Simulator sim;
	SelectorTrue allDarts;

	bool render_anim;
	int visu;
	int nbGenerated;

	float explode;
Pierre Kraemer's avatar
Pierre Kraemer committed
78 79 80

public slots:
	void animate() ;
Pierre Kraemer's avatar
Pierre Kraemer committed
81
} ;