RemoveComponents.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (c) 2009 Werner Mayer <wmayer[at]users.sourceforge.net>     *
00003  *                                                                         *
00004  *   This file is part of the FreeCAD CAx development system.              *
00005  *                                                                         *
00006  *   This library is free software; you can redistribute it and/or         *
00007  *   modify it under the terms of the GNU Library General Public           *
00008  *   License as published by the Free Software Foundation; either          *
00009  *   version 2 of the License, or (at your option) any later version.      *
00010  *                                                                         *
00011  *   This library  is distributed in the hope that it will be useful,      *
00012  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00013  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00014  *   GNU Library General Public License for more details.                  *
00015  *                                                                         *
00016  *   You should have received a copy of the GNU Library General Public     *
00017  *   License along with this library; see the file COPYING.LIB. If not,    *
00018  *   write to the Free Software Foundation, Inc., 59 Temple Place,         *
00019  *   Suite 330, Boston, MA  02111-1307, USA                                *
00020  *                                                                         *
00021  ***************************************************************************/
00022 
00023 
00024 #ifndef MESHGUI_REMOVECOMPONENTS_H
00025 #define MESHGUI_REMOVECOMPONENTS_H
00026 
00027 #include <QDialog>
00028 #include <Inventor/nodes/SoEventCallback.h>
00029 #include <Gui/TaskView/TaskDialog.h>
00030 #include <Gui/TaskView/TaskView.h>
00031 
00032 // forward declarations
00033 class SoEventCallback;
00034 namespace App { class DocumentObject; }
00035 namespace Gui { class View3DInventorViewer; }
00036 namespace Gui { class Document; }
00037 namespace Mesh { class Feature; }
00038 
00039 namespace MeshGui {
00040 class ViewProviderMesh;
00041 class Ui_RemoveComponents;
00042 
00048 class MeshGuiExport RemoveComponents : public QWidget
00049 {
00050     Q_OBJECT
00051 
00052 public:
00053     RemoveComponents(QWidget* parent = 0, Qt::WFlags fl = 0);
00054     ~RemoveComponents();
00055     void reject();
00056     void deleteSelection();
00057     void invertSelection();
00058 
00059 public Q_SLOTS:
00060     void on_selectRegion_clicked();
00061     void on_selectAll_clicked();
00062     void on_selectComponents_clicked();
00063     void on_selectTriangle_clicked();
00064     void on_deselectRegion_clicked();
00065     void on_deselectAll_clicked();
00066     void on_deselectComponents_clicked();
00067     void on_deselectTriangle_clicked();
00068 
00069 protected:
00070     void changeEvent(QEvent *e);
00071 
00072 private:
00073     std::list<ViewProviderMesh*> getViewProviders(const Gui::Document*) const;
00074     Gui::View3DInventorViewer* getViewer() const;
00075     void startInteractiveCallback(Gui::View3DInventorViewer* ,SoEventCallbackCB *);
00076     void stopInteractiveCallback(Gui::View3DInventorViewer*);
00077 
00078     static void selectGLCallback(void * ud, SoEventCallback * n);
00079     static void pickFaceCallback(void * ud, SoEventCallback * n);
00080 
00081 private:
00082     Ui_RemoveComponents* ui;
00083     SoEventCallbackCB *_interactiveMode;
00084     bool selectRegion;
00085 };
00086 
00090 class MeshGuiExport RemoveComponentsDialog : public QDialog
00091 {
00092     Q_OBJECT
00093 
00094 public:
00095     RemoveComponentsDialog(QWidget* parent = 0, Qt::WFlags fl = 0);
00096     ~RemoveComponentsDialog();
00097     void reject();
00098 
00099 private Q_SLOTS:
00100     void clicked(QAbstractButton* btn);
00101 
00102 private:
00103     RemoveComponents* widget;
00104 };
00105 
00109 class TaskRemoveComponents : public Gui::TaskView::TaskDialog
00110 {
00111     Q_OBJECT
00112 
00113 public:
00114     TaskRemoveComponents();
00115     ~TaskRemoveComponents();
00116 
00117 public:
00118     bool accept();
00119     void clicked(int);
00120 
00121     virtual QDialogButtonBox::StandardButtons getStandardButtons() const
00122     { return QDialogButtonBox::Ok | QDialogButtonBox::Close; }
00123     virtual bool isAllowedAlterDocument(void) const
00124     { return true; }
00125     virtual void modifyStandardButtons(QDialogButtonBox*);
00126 
00127 private:
00128     RemoveComponents* widget;
00129     Gui::TaskView::TaskBox* taskbox;
00130 };
00131 
00132 }
00133 
00134 #endif // MESHGUI_REMOVECOMPONENTS_H

Generated on Wed Nov 23 19:00:35 2011 for FreeCAD by  doxygen 1.6.1