VR-Forces 4.2 Class Documentation
List of all members | Public Slots | Signals | Public Member Functions | Protected Member Functions | Protected Attributes
DtCreationHandler Class Reference

This handler creates entities. More...

Inheritance diagram for DtCreationHandler:
Inheritance graph
[legend]

Public Slots

virtual bool mouseEvent (DtTMMapArea *area, QMouseEvent *evnt, const DtPoint &pnt)
virtual void stop (const DtPoint &p)
virtual void updateTempSymbol ()=0
- Public Slots inherited from DtEventHandler
virtual bool mouseEvent (DtTMMapArea *, QMouseEvent *evnt, const DtPoint &pnt)
virtual bool symbolsSelected (DtTMMapArea *area, DtSymbolList *sl)
virtual bool selectionUpdated (DtTMMapArea *area, const QVector< DtModelKey > &d)
virtual bool selectionInProgress (DtTMMapArea *area, DtSymbolSelector &d)
virtual bool focusEvent (DtTMMapArea *, QEvent *evnt)
virtual bool leaveEvent (DtTMMapArea *area, QEvent *evnt)
virtual bool dropEvent (DtTMMapArea *area, QDropEvent *evnt)
virtual bool dragEnterEvent (DtTMMapArea *area, QDragEnterEvent *evnt)
virtual bool dragMoveEvent (DtTMMapArea *area, QDragMoveEvent *evnt)
virtual bool dragLeaveEvent (DtTMMapArea *area, QDragLeaveEvent *evnt)
virtual bool userDefinedAction (DtUserDefinedType iAction, void *usr)
virtual bool aboutToDraw (DtTMMapArea *area, QPainter *)
virtual bool mapActivated (DtTMMapArea *area)
virtual bool selectedModelDataUpdated (DtTMMapArea *area)
virtual bool symbolAdded (DtTMMapArea *area, const DtModelKey &)
virtual bool symbolRemoved (DtTMMapArea *area, const DtModelKey &)
virtual bool disconnecting (DtTMMapArea *area)
 Called when a map is being disconnect from an event handler.
virtual bool connecting (DtTMMapArea *area)
 Called when a map is being connected to an event handler.
virtual void tick ()
virtual void clearDialog ()

Signals

void creationSignal (const DtString &name, const DtEntityMapperKey &type, const DtList &vertices, const DtString &label, int appearance, int force, bool projection, bool closedFigure, DtReal heading, bool createSubObjects, DtSymbol *tempSymbol)
 Both signals are emitted if myEmitCreateSignal is true.
void editSignal (const DtString &name, const DtEntityMapperKey &type, const DtList &vertices, const DtString &label, int appearance, int force, DtReal heading, DtSymbol *tempSymbol)
- Signals inherited from DtEventHandler
void closedDialog ()

Public Member Functions

 DtCreationHandler ()
 Default Constructor.
virtual ~DtCreationHandler ()
 Destructor.
virtual void setCreationObject (DtEntityMapperKey obj, int frc)
 Set the object you are creating.
virtual void activate ()
 Called when this event handler first becomes active.
virtual DtSymbolcreateTempSymbol (DtTMMapArea *area)
 Creates and removes the symbol that will follow the cursor on creation.
virtual void removeTempSymbol (DtTMMapArea *area)
virtual void setEditMode (bool b)
virtual void setModelData (DtModelData *d)
virtual void setShowDialog (DtShowDialogType type)
virtual void setEmitCreateSignal (bool)
 Emits signal when create, not actually do the creation. Default is false.
- Public Member Functions inherited from DtEventHandler
 DtEventHandler ()
 Default Constructor.
virtual ~DtEventHandler ()
 Destructor.
virtual void setEventController (DtEventController *)
virtual void setInitialSelection (const QVector< DtModelKey > &d)
virtual QWidgetcreateDialog (QWidget *w)
 Creates the dialog associated with this handler (if there is one)
virtual QWidgetdialog (bool createIfMissing=true, QWidget *parent=NULL)
 If createIfMissing is true, will create the dialog based on the supplied parent window, else will simply return the dialog pointer.
virtual void reset ()
virtual DtBaseWindowbaseWindow () const
 Returns the base window of the event controller.
virtual void setBaseWindow (DtBaseWindow *w)
 Called when the base window is set for the event controller.
virtual void init ()
 Called when the handler is first created, initialize context.
void setSuspended (bool)
 Set when something wants to suspend some aspect of this handler without deactivating it.
bool suspended () const
virtual void dialogDestroyedEvent ()
 Called when dialog is destroyed.
- Public Member Functions inherited from DtArchivableObject
 DtArchivableObject (QString name, DtArchivableObjectCreator fcn)
 This constructor will add this object to the archivable object factory.
 DtArchivableObject (QString name)
 DtArchivableObject ()
virtual ~DtArchivableObject ()
virtual QString name () const
DtArchiverarchiver ()
 Returns the archiver of this object.
virtual void read (QTextStream &s)
 Reads/writes archiver.
virtual void write (QTextStream &s)
virtual void setLevel (int i)
virtual int level () const
virtual DtArchivableObjectclone ()
 Allows for cloning of this object.

Protected Member Functions

virtual DtSymbolcreateSymbol (DtTMMapArea *area)=0
 Subclasses need to create temp symbol.
virtual void pointSelected (const DtPoint &p)=0
virtual void cancel ()=0
 Handle the cancelling of this object creation.
virtual bool enterEvent (DtTMMapArea *area, QEvent *evnt)
 Handles when the mouse enters a particular map area.
virtual void switchActiveMap (DtTMMapArea *area)
 Switches to the new active map and also sets up mouse tracking by turning off from old and activating on new.
virtual void trackMouseFor (DtTMMapArea *area, bool enable)
 Enables/disables mouse tracking for requested area.
virtual void deactivate ()
 Called when we are decativated, acts as a cancel on the current event.
virtual void showDialog (bool b)
 Override to show dialog only is dialog show type is WhenStartCreate, else show dialog when the appropriate conditions are met.
virtual void createComplete (bool finalPointSelected)
 Called at end of creation, will let the controller know we are done.
virtual QPixmap createCursor ()
 Creates/restores the override cusror to display that the handler is in creation mode.
virtual void restoreCursor ()
virtual bool keyboardEvent (DtTMMapArea *area, QKeyEvent *evnt)
 Add escape key cancel.

Protected Attributes

DtEntityMapperKey myCurrentObjectType
int myCurrentForceType
DtSymbolmyTempSymbol
DtTMMapAreamyActiveMap
bool myEditNotCreate
bool myStopped
bool myInvalid
DtModelDatamyModelData
DtShowDialogType myShowDialogType
DtTerrainModelDatamyCreatingFromTerrainData
 If non-NULL, creating this point from the supplied model data.
bool myDeactivating
bool myEmitCreateSignal
bool myCursorSet
Qt::KeyboardModifiers myKeyboardModifiers
- Protected Attributes inherited from DtEventHandler
QWidgetmyEventDlg
DtEventControllermyEventController
bool mySuspended
- Protected Attributes inherited from DtArchivableObject
DtArchivermyArchiver

Detailed Description

This handler creates entities.

Constructor & Destructor Documentation

DtCreationHandler::DtCreationHandler ( )

Default Constructor.

virtual DtCreationHandler::~DtCreationHandler ( )
virtual

Destructor.

Member Function Documentation

virtual void DtCreationHandler::setCreationObject ( DtEntityMapperKey  obj,
int  frc 
)
virtual

Set the object you are creating.

Reimplemented in DtCreateControlObjectHandler.

virtual void DtCreationHandler::activate ( )
virtual

Called when this event handler first becomes active.

Reimplemented from DtEventHandler.

Reimplemented in DtCreateControlObjectHandler, and DtTerrainCreatePointHandler.

virtual DtSymbol* DtCreationHandler::createTempSymbol ( DtTMMapArea area)
virtual

Creates and removes the symbol that will follow the cursor on creation.

Reimplemented in DtCreateControlObjectHandler, and DtTerrainCreateLineHandler.

virtual void DtCreationHandler::removeTempSymbol ( DtTMMapArea area)
virtual
virtual void DtCreationHandler::setEditMode ( bool  b)
virtual
virtual void DtCreationHandler::setModelData ( DtModelData d)
virtual
virtual void DtCreationHandler::setShowDialog ( DtShowDialogType  type)
virtual
void DtCreationHandler::setEmitCreateSignal ( bool  b)
inlinevirtual

Emits signal when create, not actually do the creation. Default is false.

Reimplemented in DtCreateLineHandler, and DtCreatePointHandler.

References myEmitCreateSignal.

virtual bool DtCreationHandler::mouseEvent ( DtTMMapArea area,
QMouseEvent *  evnt,
const DtPoint &  pnt 
)
virtualslot

Reimplemented in DtCreateLineHandler.

virtual void DtCreationHandler::stop ( const DtPoint &  p)
virtualslot

Reimplemented in DtCreateControlObjectHandler.

virtual void DtCreationHandler::updateTempSymbol ( )
pure virtualslot
void DtCreationHandler::creationSignal ( const DtString name,
const DtEntityMapperKey type,
const DtList &  vertices,
const DtString label,
int  appearance,
int  force,
bool  projection,
bool  closedFigure,
DtReal  heading,
bool  createSubObjects,
DtSymbol tempSymbol 
)
signal

Both signals are emitted if myEmitCreateSignal is true.

void DtCreationHandler::editSignal ( const DtString name,
const DtEntityMapperKey type,
const DtList &  vertices,
const DtString label,
int  appearance,
int  force,
DtReal  heading,
DtSymbol tempSymbol 
)
signal
virtual DtSymbol* DtCreationHandler::createSymbol ( DtTMMapArea area)
protectedpure virtual

Subclasses need to create temp symbol.

Implemented in DtCreateControlObjectHandler, DtCreateLineHandler, and DtCreatePointHandler.

virtual void DtCreationHandler::pointSelected ( const DtPoint &  p)
protectedpure virtual
virtual void DtCreationHandler::cancel ( )
protectedpure virtual

Handle the cancelling of this object creation.

virtual bool DtCreationHandler::enterEvent ( DtTMMapArea area,
QEvent *  evnt 
)
protectedvirtual

Handles when the mouse enters a particular map area.

If the area is different than the current active map, we need to change where the temp symbol is displayed

Reimplemented from DtEventHandler.

virtual void DtCreationHandler::switchActiveMap ( DtTMMapArea area)
protectedvirtual

Switches to the new active map and also sets up mouse tracking by turning off from old and activating on new.

virtual void DtCreationHandler::trackMouseFor ( DtTMMapArea area,
bool  enable 
)
protectedvirtual

Enables/disables mouse tracking for requested area.

virtual void DtCreationHandler::deactivate ( )
protectedvirtual

Called when we are decativated, acts as a cancel on the current event.

Reimplemented from DtEventHandler.

Reimplemented in DtCreateControlObjectHandler.

virtual void DtCreationHandler::showDialog ( bool  b)
protectedvirtual

Override to show dialog only is dialog show type is WhenStartCreate, else show dialog when the appropriate conditions are met.

Reimplemented from DtEventHandler.

virtual void DtCreationHandler::createComplete ( bool  finalPointSelected)
protectedvirtual

Called at end of creation, will let the controller know we are done.

virtual QPixmap DtCreationHandler::createCursor ( )
protectedvirtual

Creates/restores the override cusror to display that the handler is in creation mode.

Reimplemented in DtCreateControlObjectHandler.

virtual void DtCreationHandler::restoreCursor ( )
protectedvirtual
virtual bool DtCreationHandler::keyboardEvent ( DtTMMapArea area,
QKeyEvent *  evnt 
)
protectedvirtual

Add escape key cancel.

Reimplemented from DtEventHandler.

Member Data Documentation

DtEntityMapperKey DtCreationHandler::myCurrentObjectType
protected
int DtCreationHandler::myCurrentForceType
protected
DtSymbol* DtCreationHandler::myTempSymbol
protected
DtTMMapArea* DtCreationHandler::myActiveMap
protected
bool DtCreationHandler::myEditNotCreate
protected
bool DtCreationHandler::myStopped
protected
bool DtCreationHandler::myInvalid
protected
DtModelData* DtCreationHandler::myModelData
protected
DtShowDialogType DtCreationHandler::myShowDialogType
protected
DtTerrainModelData* DtCreationHandler::myCreatingFromTerrainData
protected

If non-NULL, creating this point from the supplied model data.

bool DtCreationHandler::myDeactivating
protected
bool DtCreationHandler::myEmitCreateSignal
protected

Referenced by setEmitCreateSignal().

bool DtCreationHandler::myCursorSet
protected
Qt::KeyboardModifiers DtCreationHandler::myKeyboardModifiers
protected

The documentation for this class was generated from the following file:

Document ID: Generated on Sun Nov 24 19:49:21 EST 2013 from SVN revision 133924
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)