ViewProviderMeshNode.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (c) 2006 Werner Mayer <werner.wm.mayer@gmx.de>              *
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_VIEWPROVIDERMESHNODE_H
00024 #define MESHGUI_VIEWPROVIDERMESHNODE_H
00025 
00026 #include <Gui/ViewProviderGeometryObject.h>
00027 #include <Mod/Mesh/App/Core/Elements.h>
00028 
00029 #include <vector>
00030 #include <Inventor/fields/SoSFVec2f.h>
00031 
00032 class SbViewVolume;
00033 class SoBaseColor;
00034 
00035 namespace Gui {
00036   class SoFCSelection;
00037   class AbstractMouseModel;
00038 }
00039 namespace MeshGui {
00040 
00045 class MeshGuiExport ViewProviderMeshNode : public Gui::ViewProviderGeometryObject
00046 {
00047   PROPERTY_HEADER(TriangulationGui::ViewProviderMeshNode);
00048 
00049 public:
00050   ViewProviderMeshNode();
00051   virtual ~ViewProviderMeshNode();
00052   
00053   // Display properties
00054   App::PropertyFloatConstraint LineWidth;
00055   App::PropertyFloatConstraint PointSize;
00056   App::PropertyBool OpenEdges;
00057 
00058   void attach(App::DocumentObject *pcFeat);
00059   virtual void updateData(const App::Property*);
00060   virtual QIcon getIcon() const;
00061   virtual void setDisplayMode(const char* ModeName);
00062   virtual std::vector<std::string> getDisplayModes() const;
00063 
00066   // Draws the picked polygon
00067   bool handleEvent(const SoEvent * const ev,Gui::View3DInventorViewer &Viewer);
00069   bool setEdit(int ModNum=0);
00071   void unsetEdit(void);
00073   const char* getEditModeName(void);
00075 
00076 protected:
00078   void onChanged(const App::Property* prop);
00079   void showOpenEdges( bool );
00080   void setOpenEdgeColorFrom( const App::Color& col );
00081 
00082   SoDrawStyle    *pcLineStyle;
00083   SoDrawStyle    *pcPointStyle;
00084   SoSeparator    *pcOpenEdge;
00085   SoBaseColor    *pOpenColor;
00086 
00087 private:
00088   bool m_bEdit;
00089 
00090   static App::PropertyFloatConstraint::Constraints floatRange;
00091 };
00092 
00093 } // namespace MeshGui
00094 
00095 
00096 #endif // MESHGUI_VIEWPROVIDERMESHNODE_H
00097 

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