1 /**************************************************************************** 2 * MeshLab o o * 3 * A versatile mesh processing toolbox o o * 4 * _ O _ * 5 * Copyright(C) 2007 \/)\/ * 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 FILTERDIRTPLUGIN_H 25 #define FILTERDIRTPLUGIN_H 26 27 #include <QObject> 28 #include <QStringList> 29 #include <QString> 30 #include <common/meshmodel.h> 31 #include <common/interfaces.h> 32 #include<vector> 33 #include<vcg/complex/complex.h> 34 //#include "muParser.h" 35 36 using namespace vcg; 37 //using namespace mu; 38 39 40 class FilterDirt : public QObject, public MeshFilterInterface 41 { 42 Q_OBJECT 43 MESHLAB_PLUGIN_IID_EXPORTER(MESH_FILTER_INTERFACE_IID) 44 Q_INTERFACES(MeshFilterInterface) 45 protected: 46 double x,y,z,nx,ny,nz,r,g,b,q,rad; 47 //double x0,y0,z0,x1,y1,z1,x2,y2,z2,nx0,ny0,nz0,nx1,ny1,nz1,nx2,ny2,nz2,r0,g0,b0,r1,g1,b1,r2,g2,b2,q0,q1,q2; 48 double v,f,v0i,v1i,v2i; 49 std::vector<std::string> v_attrNames; 50 std::vector<double> v_attrValue; 51 //std::vector<std::string> f_attrNames; 52 //std:: vector<double> f_attrValue; 53 std::vector<CMeshO::PerVertexAttributeHandle<float> > vhandlers; 54 //std::vector<CMeshO::PerFaceAttributeHandle<float> > fhandlers; 55 56 public: 57 enum {FP_DIRT,FP_CLOUD_MOVEMENT} ; 58 59 FilterDirt(); ~FilterDirt()60 ~FilterDirt(){}; 61 62 virtual QString filterName(FilterIDType filter) const; 63 virtual QString filterInfo(FilterIDType filter) const; 64 virtual int getRequirements(QAction *); autoDialog(QAction *)65 virtual bool autoDialog(QAction *) {return true;} 66 // virtual void initParameterSet(QAction* filter,MeshModel &,RichParameterSet &){}; 67 virtual void initParameterSet(QAction *,MeshDocument &/*m*/, RichParameterSet & /*parent*/); 68 virtual bool applyFilter(QAction* filter, MeshDocument &md, RichParameterSet & par, vcg::CallBackPos *cb); applyFilter(QAction *,MeshModel &,RichParameterSet &,vcg::CallBackPos *)69 virtual bool applyFilter(QAction * /*filter */, MeshModel &, RichParameterSet & /*parent*/, vcg::CallBackPos *) { assert(0); return false;} ; 70 virtual int postCondition(QAction*) const; 71 virtual FilterClass getClass(QAction *); filterArity(QAction *)72 FILTER_ARITY filterArity(QAction*) const {return SINGLE_MESH;} 73 }; 74 75 76 #endif 77