2015-07-30 13:13:19 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* VCGLib o o *
|
|
|
|
* Visual and Computer Graphics Library o o *
|
|
|
|
* _ O _ *
|
|
|
|
* Copyright(C) 2007 \/)\/ *
|
|
|
|
* Visual Computing Lab /\/| *
|
|
|
|
* ISTI - Italian National Research Council | *
|
|
|
|
* \ *
|
|
|
|
* All rights reserved. *
|
|
|
|
* *
|
|
|
|
* This program is free software; you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU General Public License as published by *
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or *
|
|
|
|
* (at your option) any later version. *
|
|
|
|
* *
|
|
|
|
* This program 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 General Public License (http://www.gnu.org/licenses/gpl.txt) *
|
|
|
|
* for more details. *
|
|
|
|
* *
|
|
|
|
****************************************************************************/
|
|
|
|
/****************************************************************************
|
|
|
|
History
|
|
|
|
|
|
|
|
$Log: not supported by cvs2svn $
|
|
|
|
|
|
|
|
****************************************************************************/
|
|
|
|
#ifndef MAINWINDOW_H_
|
|
|
|
#define MAINWINDOW_H_
|
|
|
|
|
2016-05-06 04:23:45 +02:00
|
|
|
#include <GL/glew.h>
|
|
|
|
#include <QGLContext>
|
2015-07-30 13:13:19 +02:00
|
|
|
#include "ui_mainwindow.h"
|
2016-05-06 04:23:45 +02:00
|
|
|
|
|
|
|
#include "mesh.h"
|
|
|
|
#include <wrap/gl/gl_mesh_attributes_info.h>
|
|
|
|
#include <wrap/qt/qt_thread_safe_mesh_attributes_multi_viewer_bo_manager.h>
|
|
|
|
#include <wrap/qt/qt_thread_safe_memory_info.h>
|
|
|
|
#include <QProgressBar>
|
|
|
|
#include <QStatusBar>
|
|
|
|
#include <QComboBox>
|
2015-07-30 13:13:19 +02:00
|
|
|
#include "glarea.h"
|
2016-05-06 04:23:45 +02:00
|
|
|
enum MyDrawMode{MDM_SMOOTH=0,MDM_POINTS,MDM_WIRE,MDM_FLAT,MDM_QUAD_WIRE,MDM_QUAD_SMOOTH_WIRE};
|
|
|
|
|
2015-07-30 13:13:19 +02:00
|
|
|
|
|
|
|
|
|
|
|
class MainWindow:public QMainWindow
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2016-05-06 04:23:45 +02:00
|
|
|
MainWindow(QWidget * parent = 0);
|
2015-07-30 13:13:19 +02:00
|
|
|
~MainWindow();
|
2016-05-06 04:23:45 +02:00
|
|
|
|
|
|
|
CMeshO& currentMesh() {return mesh;}
|
|
|
|
SharedDataOpenGLContext::MultiViewManager* getMultiviewerManager();
|
|
|
|
void updateRenderModality(GLArea* area,int clickedindex);
|
|
|
|
static bool qCallBack(const int pos, const char * str);
|
2015-07-30 13:13:19 +02:00
|
|
|
public slots:
|
|
|
|
void chooseMesh();
|
|
|
|
void loadTetrahedron();
|
|
|
|
void loadDodecahedron();
|
2016-05-06 04:23:45 +02:00
|
|
|
void initMesh(QString& message);
|
|
|
|
void updateRenderModality(int clickedindex);
|
2015-07-30 13:13:19 +02:00
|
|
|
signals:
|
|
|
|
void loadMesh(QString newMesh);
|
2016-05-06 04:23:45 +02:00
|
|
|
void updateRenderModalityRequested(int);
|
2015-07-30 13:13:19 +02:00
|
|
|
private:
|
2016-05-06 04:23:45 +02:00
|
|
|
void initTable();
|
2015-07-30 13:13:19 +02:00
|
|
|
Ui::mainWindow ui;
|
|
|
|
GLArea* glar[2];
|
|
|
|
SharedDataOpenGLContext* shared;
|
2016-05-06 04:23:45 +02:00
|
|
|
vcg::QtThreadSafeMemoryInfo mi;
|
|
|
|
QComboBox* rendbox[2];
|
2015-07-30 13:13:19 +02:00
|
|
|
/// the active mesh instance
|
|
|
|
CMeshO mesh;
|
2016-05-06 04:23:45 +02:00
|
|
|
QMap<MyDrawMode,QString> stringrendtable;
|
|
|
|
QMap<MyDrawMode,QPair<vcg::GLMeshAttributesInfo::PRIMITIVE_MODALITY_MASK,vcg::GLMeshAttributesInfo::RendAtts> > rendtable;
|
|
|
|
static QProgressBar* qb;
|
|
|
|
static QStatusBar* sb;
|
2015-07-30 13:13:19 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /*MAINWINDOW_H_ */
|