00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
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
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