1 /****************************************************************************
2 * MeshLab                                                           o o     *
3 * A versatile mesh processing toolbox                             o     o   *
4 *                                                                _   O  _   *
5 * Copyright(C) 2005                                                \/)\/    *
6 * Visual Computing Lab                                            /\/|      *
7 * ISTI - Italian National Research Council                           |      *
8 *                                                                    \      *
9 * All rights reserved.                                                      *
10 *                                                                           *
11 * This program is free software; you can redistribute it and/or modify      *
12 * it under the terms of the GNU General Public License as published by      *
13 * the Free Software Foundation; either version 2 of the License, or         *
14 * (at your option) any later version.                                       *
15 *                                                                           *
16 * This program is distributed in the hope that it will be useful,           *
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of            *
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             *
19 * GNU General Public License (http://www.gnu.org/licenses/gpl.txt)          *
20 * for more details.                                                         *
21 *                                                                           *
22 ****************************************************************************/
23 
24 #ifndef CADtexturingEDITPLUGIN_H
25 #define CADtexturingEDITPLUGIN_H
26 
27 #include <QObject>
28 #include <meshlab/glarea.h>
29 #include <common/interfaces.h>
30 #include "CADtexturingControl.h"
31 #include <wrap/gl/trimesh.h>
32 
33 class CADtexturingEditPlugin : public QObject, public MeshEditInterface
34 {
35 	Q_OBJECT
36 	Q_INTERFACES(MeshEditInterface)
37 
38 public:
39     CADtexturingEditPlugin();
~CADtexturingEditPlugin()40     virtual ~CADtexturingEditPlugin() {}
41 
42     static const QString Info();
43 
44     bool StartEdit(MeshModel &/*m*/, GLArea * /*parent*/, MLSceneGLSharedDataContext* /*cont*/);
45     void EndEdit(MeshModel &/*m*/, GLArea * /*parent*/, MLSceneGLSharedDataContext* /*cont*/);
46     void Decorate(MeshModel &/*m*/, GLArea * /*parent*/, QPainter *p);
Decorate(MeshModel &,GLArea *)47     void Decorate (MeshModel &/*m*/, GLArea * ){};
mousePressEvent(QMouseEvent *,MeshModel &,GLArea *)48     void mousePressEvent(QMouseEvent *, MeshModel &, GLArea * ) {};
mouseMoveEvent(QMouseEvent *,MeshModel &,GLArea *)49     void mouseMoveEvent(QMouseEvent *, MeshModel &, GLArea * ) {};
50     void mouseReleaseEvent(QMouseEvent *event, MeshModel &/*m*/, GLArea * );
51 	void keyReleaseEvent(QKeyEvent *, MeshModel &, GLArea *);
52 	void ComputeNearFar(const vcg::Shotf &  s, float & near, float & far);
53 
54 	void renderEdges(GLArea *gla);
55 	vcg::GlTrimesh<CMeshO> drawer;
56 
57 private:
58 	bool drawEdgesTrigger, saveRenderingTrigger;
59 	MeshModel * meshmodel;
60 	QDockWidget* dock;
61 	CADtexturingControl * control;
62 	GLArea * glarea;
63 signals:
64 	void suspendEditToggle();
65 
66 	public slots:
67 	void on_renderEdges(int);
68 	void on_saverendering();
69 };
70 
71 #endif
72