qocccontroller.h

Go to the documentation of this file.
00001 /************************************************************************************
00002 **
00003 ** This file is part of the QtOPENCASCADE Toolkit.
00004 **
00005 ** Copyright (C) 2006, 2007, 2008 QtOCC Team Members
00006 **               Peter Dolbey, Marc Britten, Stephane Routelous
00007 **               Stefan Boeykens, Pawel Dobrolowski, Walter Steffe
00008 **               Álvaro Castro Castilla, Dirk Burski, Fotis Sioutis
00009 **
00010 ** This library is free software; you can redistribute it and/or
00011 ** modify it under the terms of the GNU Lesser General Public
00012 ** License as published by the Free Software Foundation; either
00013 ** version 2.1 of the License, or (at your option) any later version.
00014 ** 
00015 ** This library is distributed in the hope that it will be useful,
00016 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00017 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018 ** Lesser General Public License for more details.
00019 ** 
00020 ** You should have received a copy of the GNU Lesser General Public
00021 ** License along with this library; if not, write to the Free Software
00022 ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00023 **
00024 ***********************************************************************************/
00025 
00026 #ifndef QOCCCONTROLLER_H
00027 #define QOCCCONTROLLER_H
00028 
00029 #include <QtCore/QObject>
00030 #include "qocc.h"
00031 #include "qoccdocument.h"
00032 
00033 #include <TopAbs_ShapeEnum.hxx>
00034 
00035 class QoccCommand;
00036 class Qocc3dWidget;
00037 class QMouseEvent;
00038 
00039 class QOCC_DECLSPEC QoccController : public QObject
00040 {
00041 
00042         Q_OBJECT
00043 
00044 public:
00045 
00046     QoccController();
00047         QoccController( QoccDocument* qDoc );
00048     ~QoccController();
00049 
00050         Handle(V3d_Viewer)&             getViewer( void )  { return myViewer; }
00051     Handle(AIS_InteractiveContext)& getContext( void ) { return myContext; }
00052         QoccDocument*                                   getDocument( void ){ return myDocument; }
00053         int                                                             id( void )         { return myDocument->id(); }
00054 
00055         Handle(V3d_Viewer) createViewer( const Standard_CString aDisplay,
00056                                                                          const Standard_ExtString aName,
00057                                                                          const Standard_CString aDomain,
00058                                                                          const Standard_Real ViewSize );
00059 
00060         TopAbs_ShapeEnum localContext() { return myLcType; }
00061         void setLocalContext( TopAbs_ShapeEnum lcType );
00062         void clearLocalContext( void );
00063         void clearAllLocalContexts( void );
00064         bool hasLocalContext( void );
00065 
00066         void deleteAllObjects( void );
00067 
00068         void setGridOffset ( Quantity_Length offset );
00069 
00070         bool isCommandActive( void )    { return !(myCommand == NULL); }
00071         bool isDrawing( void );         
00072 
00073         QoccCommand* getCommand( void ) { return myCommand; }
00074         void setCommand ( QoccCommand* command );
00075         void clearCommand ( void );
00076 
00077         void undo( void );
00078         void redo( void );
00079 
00080         void update( void );
00081 
00082 public slots:
00083 
00084         void gridXY   ( void );
00085         void gridXZ   ( void );
00086         void gridYZ   ( void );
00087         void gridOn   ( void );
00088         void gridOff  ( void );
00089         void gridRect ( void );
00090         void gridCirc ( void );
00091 
00092         void clickEvent(Qocc3dWidget* widget, QMouseEvent* e);
00093         void moveEvent (Qocc3dWidget* widget, QMouseEvent* e);
00094 
00095 
00096 signals:
00097 
00098         void error (int errorCode, QString& errorDescription);
00099 
00100 private:
00101 
00102         Handle(V3d_Viewer)                              myViewer;
00103         Handle(AIS_InteractiveContext)  myContext;
00104         Aspect_GridType                                 myGridType;
00105         Aspect_GridDrawMode                             myGridMode;
00106         Quantity_NameOfColor                    myGridColor;
00107         Quantity_NameOfColor                    myGridTenthColor;
00108         QoccCommand*                                    myCommand;
00109         QoccDocument*                                   myDocument;
00110         bool                                                    myIsDrawing;
00111         TopAbs_ShapeEnum                                myLcType;
00112 
00113 };
00114 
00115 #endif // QOCCCONTROLLER_H

Generated on Sat Feb 23 21:22:15 2008 for QtGEOM by  doxygen 1.4.7