MeshEditor.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (c) 2010 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 #ifndef MESHGUI_MESHEDITOR_H
00024 #define MESHGUI_MESHEDITOR_H
00025 
00026 #include <QObject>
00027 #include <Mod/Mesh/Gui/ViewProvider.h>
00028 
00029 class SoCoordinate3;
00030 class SoFaceSet;
00031 class SoEventCallback;
00032 class SoPickedPoint;
00033 class SoQtViewer;
00034 
00035 namespace Gui { class View3DInventor; }
00036 
00037 namespace MeshGui {
00038 class SoFCMeshPickNode;
00039 
00043 class MeshGuiExport ViewProviderFace : public Gui::ViewProviderDocumentObject
00044 {
00045     PROPERTY_HEADER(MeshGui::ViewProviderFace);
00046 
00047 public:
00048     ViewProviderFace();
00049     virtual ~ViewProviderFace();
00050 
00051     // Build up the initial Inventor node
00052     void attach(App::DocumentObject* obj);
00053     void setDisplayMode(const char* ModeName);
00054     const char* getDefaultDisplayMode() const;
00055     std::vector<std::string> getDisplayModes(void) const;
00056     SoPickedPoint* getPickedPoint(const SbVec2s& pos, const SoQtViewer* viewer) const;
00057 
00058     ViewProviderMesh* mesh;
00059     std::vector<int> index;
00060     int current_index;
00061 
00062     SoCoordinate3   * pcCoords;
00063     SoFaceSet       * pcFaces;
00064     SoFCMeshPickNode* pcMeshPick;
00065 };
00066 
00071 class MeshGuiExport MeshFaceAddition : public QObject
00072 {
00073     Q_OBJECT
00074 
00075 public:
00076     MeshFaceAddition(Gui::View3DInventor* parent);
00077     ~MeshFaceAddition();
00078 
00079     void startEditing(ViewProviderMesh*);
00080 
00081 public Q_SLOTS:
00082     void finishEditing();
00083 
00084 private Q_SLOTS:
00085     void addFace();
00086     void clearPoints();
00087     void flipNormal();
00088 
00089 private:
00090     bool addMarkerPoint();
00091     void showMarker(SoPickedPoint*);
00092     static void addFacetCallback(void * ud, SoEventCallback * n);
00093 
00094 private:
00095     ViewProviderFace* faceView;
00096 };
00097 
00098 } // namespace MeshGui
00099 
00100 
00101 #endif // MESHGUI_MESHEDITOR_H
00102 

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