View3DInventor.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_VIEW3DINVENTOR_H
00025 #define GUI_VIEW3DINVENTOR_H
00026 
00027 #include "MDIView.h"
00028 
00029 #include <Base/Parameter.h>
00030 #include <QImage>
00031 
00032 class SoNode;
00033 class QPrinter;
00034 class QStackedWidget;
00035 
00036 namespace Gui {
00037 
00038 class Document;
00039 class View3DInventorViewer;
00040 class View3DPy;
00041 
00042 class GuiExport GLOverlayWidget : public QWidget
00043 {
00044     Q_OBJECT;
00045 
00046 public:
00047     GLOverlayWidget(QWidget* parent=0) : QWidget(parent)
00048     {}
00049     ~GLOverlayWidget()
00050     {}
00051     virtual void setImage(const QImage& img)
00052     { image = img; }
00053     void paintEvent(QPaintEvent*);
00054 
00055 protected:
00056     QImage image;
00057 };
00058 
00063 class GuiExport View3DInventor : public MDIView, public ParameterGrp::ObserverType
00064 {
00065     Q_OBJECT;
00066 
00067     TYPESYSTEM_HEADER();
00068 
00069 public:
00070     View3DInventor(Gui::Document* pcDocument, QWidget* parent, Qt::WFlags wflags=0);
00071     ~View3DInventor();
00072 
00074     virtual bool onMsg(const char* pMsg, const char** ppReturn);
00075     virtual bool onHasMsg(const char* pMsg) const;
00077     virtual void OnChange(ParameterGrp::SubjectType &rCaller,ParameterGrp::MessageType Reason);
00079     virtual void onRename(Gui::Document *pDoc);
00080     virtual void onUpdate(void);
00081     virtual void viewAll();
00082     virtual const char *getName(void) const;
00083 
00085     virtual void print();
00086     virtual void printPdf();
00087     virtual void printPreview();
00088 
00089     virtual PyObject *getPyObject(void);
00097     void setCurrentViewMode(ViewMode b);
00098     bool setCamera(const char* pCamera);
00099     void toggleClippingPlane();
00100     bool hasClippingPlane() const;
00101 
00102     void setOverlayWidget(GLOverlayWidget*);
00103     void removeOverlayWidget();
00104 
00105     View3DInventorViewer *getViewer(void) const {return _viewer;}
00106   
00107 public Q_SLOTS:
00109     void setCursor(const QCursor&);
00110     void setCursor(Qt::CursorShape s);
00111 
00112     void dump(const char* filename);
00113 
00114 protected Q_SLOTS:
00115     void stopAnimating();
00116     void print(QPrinter*);
00117 
00118 public:
00119     bool eventFilter(QObject*, QEvent* );
00120 
00121 protected:
00122     void windowStateChanged(MDIView* );
00123     void dropEvent        (QDropEvent      * e);
00124     void dragEnterEvent   (QDragEnterEvent * e);
00125     void keyPressEvent    (QKeyEvent       * e);
00126     void keyReleaseEvent  (QKeyEvent       * e);
00127     void focusInEvent     (QFocusEvent     * e);
00128     void customEvent      (QEvent          * e);
00129     void contextMenuEvent (QContextMenuEvent*e);
00130 
00132     ParameterGrp::handle hGrp;
00133 
00134 private:
00135     View3DInventorViewer * _viewer;
00136     PyObject *_viewerPy;
00137     QTimer * stopSpinTimer;
00138     QStackedWidget* stack;
00139 
00140     // friends
00141     friend class View3DPy;
00142 };
00143 
00144 } // namespace Gui
00145 
00146 #endif  // GUI_VIEW3DINVENTOR_H
00147 

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