qoccapplication.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 #ifndef QOCCAPPLICATION_H
00026 #define QOCCAPPLICATION_H
00027 
00028 #include <QtCore/QObject>
00029 #include <QtGui/QApplication>
00030 #include <QtGui/QPixmap>
00031 #include <QtGui/QSplashScreen>
00032 
00033 #include "qocc.h"
00034 
00035 class QoccDocument;
00036 class QOCC_DECLSPEC QoccApplication : public QApplication
00037 {
00038 
00039         Q_OBJECT
00040 
00041 public:
00042 
00043     QoccApplication( int &argc, char **argv, int = QT_VERSION );
00044     ~QoccApplication( );
00045 
00046         void splashScreen ( const QPixmap &pixmap = QPixmap() );
00047         void splashMessage ( const QString &message,
00048                                                  int alignment = Qt::AlignLeft,
00049                                                  const QColor &color = Qt::black );
00050         void splashFinish ( QWidget* w, long millisecs );
00051         void msleep ( unsigned long millisecs );
00052 
00053         QoccDocument* createDocument();
00054         GEOMImpl_Gen* getEngine() { return myEngine; }
00055 
00056         void Undo( QoccDocument* aDoc );
00057         void Redo( QoccDocument* aDoc );
00058 
00059         bool SaveDocument( QoccDocument* aDoc );
00060         bool SaveDocumentAs( QoccDocument* aDoc, char* theFormat, char* theFileName );
00061 
00062         QoccDocument* QoccApplication::LoadDocument( char* theFileName );
00063 
00064         bool ResetDocument( QoccDocument* aDoc );
00065 
00066         // Utility Getter Functions
00067         GEOMImpl_IBasicOperations*              basicOps    ( int id ) { return getEngine()->GetIBasicOperations( id ); }
00068         GEOMImpl_ITransformOperations*  transformOps( int id ) { return getEngine()->GetITransformOperations( id ); }
00069         GEOMImpl_I3DPrimOperations*             primitiveOps( int id ) { return getEngine()->GetI3DPrimOperations( id ); }
00070         GEOMImpl_IShapesOperations*             shapesOps   ( int id ) { return getEngine()->GetIShapesOperations( id ); }
00071         GEOMImpl_IBlocksOperations*             blocksOps   ( int id ) { return getEngine()->GetIBlocksOperations( id ); }
00072         GEOMImpl_IMeasureOperations*    measureOps  ( int id ) { return getEngine()->GetIMeasureOperations( id ); }
00073         GEOMImpl_IBooleanOperations*    booleanOps  ( int id ) { return getEngine()->GetIBooleanOperations( id ); }
00074         GEOMImpl_ICurvesOperations*             curvesOps   ( int id ) { return getEngine()->GetICurvesOperations( id ); }
00075         GEOMImpl_ILocalOperations*              localOps    ( int id ) { return getEngine()->GetILocalOperations( id ); }
00076         GEOMImpl_IInsertOperations*             insertOps   ( int id ) { return getEngine()->GetIInsertOperations( id ); }
00077         GEOMImpl_IHealingOperations*    healingOps  ( int id ) { return getEngine()->GetIHealingOperations( id ); }
00078         GEOMImpl_IGroupOperations*              groupOps    ( int id ) { return getEngine()->GetIGroupOperations( id ); }
00079         
00080 private:
00081 
00082         QSplashScreen* mySplash;
00083         GEOMImpl_Gen*  myEngine;
00084         int                        myNextID;
00085 
00086 };
00087 
00088 #define qGeomApp (static_cast<QoccApplication *>(QCoreApplication::instance()))
00089 #define qGeomEngine qGeomApp->getEngine()
00090 
00091 #endif // QOCCAPPLICATION_H

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