VR-Forces 4.0.4 Class Documentation
include/tmEventHandler/creationHandler.h
Go to the documentation of this file.
00001 /*******************************************************************************
00002 ** Copyright (c) 2003 MAK Technologies, Inc.
00003 ** All rights reserved.
00004 *******************************************************************************/
00005 /*******************************************************************************
00006 ** $RCSfile: creationHandler.h,v $ $Revision: 1.13 $ $State: Exp $
00007 *******************************************************************************/
00008 
00011 
00012 #ifndef CREATIONHANDLER_H_
00013 #define CREATIONHANDLER_H_
00014 
00015 #include "tmqt/eventHandler.h"
00016 #include "ngutil/entityMapperKey.h"
00017 #include "tmqt/showDialogType.h"
00018 #include <QtGui/QPixmap>
00019 
00020 class DtTMMapArea;
00021 class DtSymbol;
00022 class DtModelData;
00023 class DtTerrainModelData;
00024 class DtString;
00025 class DtList;
00026 
00028 #include "tmEventHandler/tmEventHandlerDefines.h"
00029 class DT_DLL_tmEventHandler DtCreationHandler : public DtEventHandler
00030 {
00031    Q_OBJECT
00032    
00033 public:
00034 
00036    DtCreationHandler();
00037    
00039    virtual ~DtCreationHandler();
00040    
00042    virtual void setCreationObject(DtEntityMapperKey obj, int frc);
00043    
00044    virtual void activate();
00045 
00048    virtual DtSymbol* createTempSymbol(DtTMMapArea* area);
00049    virtual void removeTempSymbol(DtTMMapArea* area);
00050 
00051    virtual void setEditMode(bool b);
00052    virtual void setModelData(DtModelData* d);
00053    virtual void setShowDialog(DtShowDialogType type);
00054 
00056    virtual void setEmitCreateSignal(bool);
00057 
00058 public slots:
00059 
00060    virtual bool mouseEvent(DtTMMapArea* area, QMouseEvent* evnt, const DtPoint& pnt);
00061    virtual void stop(const DtPoint& p);
00062    virtual void updateTempSymbol() = 0;
00063 
00064 signals:
00066 
00067    void creationSignal(const DtString& name,
00068       const DtEntityMapperKey& type,
00069       const DtList& vertices,
00070       const DtString& label,
00071       int appearance,
00072       int force,
00073       bool projection,
00074       bool closedFigure,
00075       DtReal heading,
00076       bool createSubObjects,
00077       DtSymbol* tempSymbol);
00078 
00079    void editSignal(const DtString& name,
00080       const DtEntityMapperKey& type,
00081       const DtList& vertices,
00082       const DtString& label,
00083       int appearance,
00084       int force,
00085       DtReal heading,
00086       DtSymbol* tempSymbol);
00087 
00088 protected:
00090    virtual DtSymbol* createSymbol(DtTMMapArea* area) = 0;
00091    virtual void pointSelected(const DtPoint& p) = 0;
00092 
00094    virtual void cancel() = 0;
00095 
00099    virtual bool enterEvent(DtTMMapArea* area, QEvent* evnt);
00100 
00104    virtual void switchActiveMap(DtTMMapArea* area);
00105 
00107    virtual void trackMouseFor(DtTMMapArea* area, bool enable);
00108 
00111    virtual void deactivate();
00112 
00115    virtual void showDialog(bool b);
00116 
00118    virtual void createComplete(bool finalPointSelected);
00119 
00121    virtual QPixmap createCursor();
00122    virtual void restoreCursor();
00123 
00125    virtual bool keyboardEvent(DtTMMapArea* area, QKeyEvent* evnt);
00126 
00127 protected:
00128    
00129    DtEntityMapperKey          myCurrentObjectType;
00130    int                        myCurrentForceType;
00131    DtSymbol                   *myTempSymbol;
00132    DtTMMapArea                *myActiveMap;
00133    bool                       myEditNotCreate;
00134    bool                       myStopped;
00135    bool                       myInvalid;
00136    DtModelData                *myModelData;
00137    DtShowDialogType           myShowDialogType;
00138 
00140    DtTerrainModelData         *myCreatingFromTerrainData;
00141 
00142    bool                       myDeactivating;
00143    bool                       myEmitCreateSignal;
00144    bool                       myCursorSet;
00145 
00146    Qt::KeyboardModifiers      myKeyboardModifiers;
00147 };
00148 
00149 inline void DtCreationHandler::setEmitCreateSignal(bool b)
00150 {
00151    myEmitCreateSignal = b;
00152 }
00153 
00154 #endif //CREATIONHANDLER_H_

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)