ViewProviderDocumentObject.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (c) 2004 Jürgen Riegel <juergen.riegel@web.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 
00024 #ifndef GUI_VIEWPROVIDER_DOCUMENTOBJECT_H
00025 #define GUI_VIEWPROVIDER_DOCUMENTOBJECT_H
00026 
00027 #include <Inventor/SoType.h>
00028 
00029 #include "ViewProvider.h"
00030 #include <App/DocumentObject.h>
00031 
00032 class SoMaterial;
00033 class SoDrawStyle;
00034 class SoType;
00035 
00036 namespace App
00037 {
00038   class DocumentObject;
00039   class Material;
00040 }
00041 
00042 
00043 namespace Gui {
00044 
00045 class MDIView;
00046 
00047 class GuiExport ViewProviderDocumentObject : public ViewProvider
00048 {
00049     PROPERTY_HEADER(Gui::ViewProviderDocumentObject);
00050 
00051 public:
00053     ViewProviderDocumentObject();
00054 
00056     virtual ~ViewProviderDocumentObject();
00057 
00058     // Display properties
00059     App::PropertyEnumeration DisplayMode;
00060     App::PropertyBool Visibility;
00061 
00062     virtual void attach(App::DocumentObject *pcObject);
00064     virtual const char* getDefaultDisplayMode() const;
00066     virtual std::vector<std::string> getDisplayModes(void) const;
00068     void setActiveMode();
00070     virtual void hide(void);
00072     virtual void show(void);
00073 
00075     virtual void getTaskViewContent(std::vector<Gui::TaskView::TaskContent*>&) const;
00076 
00078     void updateView();
00080     virtual void updateData(const App::Property*){};
00082     App::DocumentObject *getObject(void) const {return pcObject;}
00084     PyObject* getPyObject();
00085 
00088     virtual void startRestoring();
00089     virtual void finishRestoring();
00091 
00092 protected:
00094     Gui::MDIView* getActiveView() const;
00096     virtual void onChanged(const App::Property* prop);
00104     SoNode* findFrontRootOfType(const SoType& type) const;
00105 
00106 protected:
00107     App::DocumentObject *pcObject;
00108 
00109 private:
00110     std::vector<const char*> aDisplayEnumsArray;
00111     std::vector<std::string> aDisplayModesArray;
00112 };
00113 
00114 
00115 } // namespace Gui
00116 
00117 #endif // GUI_VIEWPROVIDER_DOCUMENTOBJECT_H
00118 

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