ViewProviderCurvature.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef MESHGUI_VIEWPROVIDER_MESH_CURVATURE_H
00024 #define MESHGUI_VIEWPROVIDER_MESH_CURVATURE_H
00025
00026 #include <Base/Observer.h>
00027 #include <App/DocumentObserver.h>
00028 #include "ViewProvider.h"
00029
00030 class SoSeparator;
00031 class SbVec3f;
00032 class SoSwitch;
00033 class SoCoordinate3;
00034 class SoNormal;
00035 class SoIndexedFaceSet;
00036 class SoFaceSet;
00037 class SoPath;
00038 class SoLocateHighlight;
00039 class SoTransformerManip;
00040
00041 namespace Gui {
00042 class SoFCColorBar;
00043 class View3DInventorViewer;
00044 }
00045
00046 namespace Mesh {
00047 class PropertyCurvatureList;
00048 }
00049
00050 namespace MeshGui {
00051
00058 class MeshGuiExport ViewProviderMeshCurvature : public Gui::ViewProviderDocumentObject,
00059 public App::DocumentObserver,
00060 public Base::Observer<int> {
00061 typedef Gui::ViewProviderDocumentObject inherited;
00062
00063 PROPERTY_HEADER(MeshGui::ViewProviderMeshCurvature);
00064
00065 public:
00066 ViewProviderMeshCurvature();
00067 virtual ~ViewProviderMeshCurvature();
00068
00069 App::PropertyMaterial TextureMaterial;
00070
00072 void attach(App::DocumentObject* pcFeature);
00074 void setDisplayMode(const char* ModeName);
00076 virtual const char* getDefaultDisplayMode() const;
00078 std::vector<std::string> getDisplayModes(void) const;
00080 void updateData(const App::Property*);
00082 QIcon getIcon() const;
00084 void OnChange(Base::Subject<int> &rCaller,int rcReason);
00086 SoSeparator* getFrontRoot(void) const;
00088 virtual void hide(void);
00090 virtual void show(void);
00091
00092 public:
00093 static void curvatureInfoCallback(void * ud, SoEventCallback * n);
00094
00095 protected:
00096 void onChanged(const App::Property* prop);
00097 void setVertexCurvatureMode(int mode);
00098 std::string curvatureInfo(bool detail, int index1, int index2, int index3) const;
00099
00100 private:
00101 void init(const Mesh::PropertyCurvatureList *prop);
00102
00104 void slotCreatedDocument(const App::Document& Doc);
00106 void slotDeletedDocument(const App::Document& Doc);
00108 void slotCreatedObject(const App::DocumentObject& Obj);
00110 void slotDeletedObject(const App::DocumentObject& Obj);
00112 void slotChangedObject(const App::DocumentObject& Obj, const App::Property& Prop);
00113
00114 protected:
00115 SoMaterial * pcColorMat;
00116 SoGroup * pcLinkRoot;
00117 Gui::SoFCColorBar* pcColorBar;
00118 SoDrawStyle * pcColorStyle;
00119 SoSeparator * pcColorRoot;
00120
00121 private:
00122 static bool addflag;
00123 };
00124
00125 }
00126
00127
00128 #endif // MESHGUI_VIEWPROVIDER_MESH_CURVATURE_H
00129