VR-Forces 4.1.1 Class Documentation
List of all members | Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes
DtCreateControlObjectHandler Class Reference

This handler creates entities. More...

Inheritance diagram for DtCreateControlObjectHandler:
Inheritance graph
[legend]

Public Slots

virtual void create (QVector< DtPoint > &points, QString name, QString label, QColor color, int forceType, int appearance, bool publish, QString attachTo, DtArchivableObject *userData, bool createDone=true)
 If createDone is false, dialog will not be removed and the create process can continue.
virtual void completeEdit (QString name, QString label, QColor color, int forceType, int appearance, bool publish, DtArchivableObject *userData)
virtual void cancel ()
virtual bool mouseEvent (DtTMMapArea *area, QMouseEvent *evnt, const DtPoint &pnt)
virtual void updateTempSymbol ()
virtual void redrawSymbol ()
virtual void clearHideSymbol ()
virtual void done ()
 Called when finished creating or editing (either by OK or cancel)
- Public Slots inherited from DtCreationHandler
virtual bool mouseEvent (DtTMMapArea *area, QMouseEvent *evnt, const DtPoint &pnt)
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 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 selectedPoint (const DtPoint &p)
void userComplete (bool finish)
 Emitted when the user never wants to show the dialog, will tell the dialog that is hidden that the user has complete the operation.
- Signals inherited from DtCreationHandler
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

 DtCreateControlObjectHandler ()
 Default Constructor.
virtual ~DtCreateControlObjectHandler ()
 Destructor.
virtual QWidgetcreateDialog (QWidget *parent)
 Creates the dialog associated with this handler (if there is one)
virtual void setCreationObject (DtEntityMapperKey obj, int frc)
 Set the object you are creating.
virtual void setVertices (const QVector< DtPoint > &pnt)
 Sets the vertices used for creation.
virtual void setName (const QString &name)
- Public Member Functions inherited from DtCreationHandler
 DtCreationHandler ()
 Default Constructor.
virtual ~DtCreationHandler ()
 Destructor.
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 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
- 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.

Static Public Member Functions

static bool addDialogCreator (const DtEntityMapperKey &key, DtDialogCreator fcn)
 Adds a dialog creator function to the list of dialogs that can be created (by entity key).
static void cleanupDialogCreators ()
 Call to cleanup memory owned by myDialogCreators member.
static void setDefaultNameLabel (const QString &)
static QString defaultNameLabel ()

Protected Member Functions

virtual QWidgetcreateWidgetFor (const DtEntityMapperKey &key, QWidget *parent)
 Dialog creation routines. Creates the dialog from internally added dialog creators.
virtual void setWorkingName ()=0
 Sets the working name of the temp symbol.
virtual void additionalTempSymbolModifications (QPolygon &pts)
 Additional modifications to be made to the temp symbol by subclasses.
virtual void initDialog (QWidget *w)
 Initializes dialog with default values.
virtual void initDialogConnections ()
 Uses myEventDlg pointer to init connections.
virtual void initCreateConnections ()
 Connections that are initialized when in create mode.
virtual void initEditConnections ()
 Connections that are are made when editing.
virtual void pointSelected (const DtPoint &p)
virtual void activate ()
 Called when this event handler first becomes active.
virtual void deactivate ()
 Called when we are decativated, acts as a cancel on the current event.
virtual void stop (const DtPoint &pnt)
virtual DtSymbolcreateTempSymbol (DtTMMapArea *area)
 Creates the temp symbol and sets the working name.
virtual DtSymbolcreateSymbol (DtTMMapArea *area)
 Subclasses need to create temp symbol.
virtual void getVertices (QVector< DtPoint > &modelPoints) const
virtual bool canPublish () const
virtual bool isPublished () const
virtual void setCaption (QWidget *w)
 Sets the caption for the dialog based on mode and type.
virtual QString defaultName () const
 Default name of any item of a particular type.
virtual void sendUserComplete (bool finish=false)
 Sends user complete message if show dialog type is Never.
virtual bool userDefinedAction (DtUserDefinedType iAction, void *usr)
virtual bool complete () const
 Returns true if the item is complete by the number of points.
virtual bool finishOnCreate () const
 Return true if want to finish on create by default. Default is false.
virtual void disconnectDialogConnections ()
virtual void disconnectEditConnections ()
virtual void disconnectCreateConnections ()
virtual int publishedEditTimeout () const
 250 ms default, then, calls done to hide copied symbol
virtual const char * eventSignalName ()
virtual QPixmap createCursor ()
 Creates/restores the override cusror to display that the handler is in creation mode.
virtual void dialogDestroyedEvent ()
 Called when dialog is destroyed.
- Protected Member Functions inherited from DtCreationHandler
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 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 void restoreCursor ()
virtual bool keyboardEvent (DtTMMapArea *area, QKeyEvent *evnt)
 Add escape key cancel.

Protected Attributes

QVector< DtPointmyPointList
QString myObjectName
QString myLabelName
bool myFinalPointSelected
DtSymbolmyHideSymbol
DtOverlaySymbolDescriptormyDescription
bool myDeleteDescription
bool myFirstClick
DtArchivableObjectmyUserData
 Set by the dialogs, this will be passed to create and edit routines for modification.
- Protected Attributes inherited from DtCreationHandler
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

Static Protected Attributes

static QList
< DtDialogCreatorInfo * > 
myDialogCreators
 Dialog creators.
static QString theDefaultNameLabel

Detailed Description

This handler creates entities.

Constructor & Destructor Documentation

DtCreateControlObjectHandler::DtCreateControlObjectHandler ( )

Default Constructor.

virtual DtCreateControlObjectHandler::~DtCreateControlObjectHandler ( )
virtual

Destructor.

Member Function Documentation

virtual QWidget* DtCreateControlObjectHandler::createDialog ( QWidget w)
virtual

Creates the dialog associated with this handler (if there is one)

Reimplemented from DtEventHandler.

static bool DtCreateControlObjectHandler::addDialogCreator ( const DtEntityMapperKey key,
DtDialogCreator  fcn 
)
static

Adds a dialog creator function to the list of dialogs that can be created (by entity key).

If one exists with the key, replaces

static void DtCreateControlObjectHandler::cleanupDialogCreators ( )
static

Call to cleanup memory owned by myDialogCreators member.

Current called as part of application cleanup

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

Set the object you are creating.

Reimplemented from DtCreationHandler.

virtual void DtCreateControlObjectHandler::setVertices ( const QVector< DtPoint > &  pnt)
virtual

Sets the vertices used for creation.

This is used if no model data. Note the vertices are copied into the myPointsList

virtual void DtCreateControlObjectHandler::setName ( const QString &  name)
virtual
static void DtCreateControlObjectHandler::setDefaultNameLabel ( const QString &  )
static
static QString DtCreateControlObjectHandler::defaultNameLabel ( )
static
virtual void DtCreateControlObjectHandler::create ( QVector< DtPoint > &  points,
QString  name,
QString  label,
QColor  color,
int  forceType,
int  appearance,
bool  publish,
QString  attachTo,
DtArchivableObject userData,
bool  createDone = true 
)
virtualslot

If createDone is false, dialog will not be removed and the create process can continue.

virtual void DtCreateControlObjectHandler::completeEdit ( QString  name,
QString  label,
QColor  color,
int  forceType,
int  appearance,
bool  publish,
DtArchivableObject userData 
)
virtualslot
virtual void DtCreateControlObjectHandler::cancel ( )
virtualslot
virtual bool DtCreateControlObjectHandler::mouseEvent ( DtTMMapArea area,
QMouseEvent *  evnt,
const DtPoint pnt 
)
virtualslot

Reimplemented in DtCreateLineHandler.

virtual void DtCreateControlObjectHandler::updateTempSymbol ( )
virtualslot
virtual void DtCreateControlObjectHandler::redrawSymbol ( )
virtualslot
virtual void DtCreateControlObjectHandler::clearHideSymbol ( )
virtualslot
virtual void DtCreateControlObjectHandler::done ( )
virtualslot

Called when finished creating or editing (either by OK or cancel)

Reimplemented in DtTerrainCreateLineHandler.

void DtCreateControlObjectHandler::selectedPoint ( const DtPoint p)
signal
void DtCreateControlObjectHandler::userComplete ( bool  finish)
signal

Emitted when the user never wants to show the dialog, will tell the dialog that is hidden that the user has complete the operation.

If the operation is a success, it will create the object. If not, the dialog should display itself

virtual QWidget* DtCreateControlObjectHandler::createWidgetFor ( const DtEntityMapperKey key,
QWidget parent 
)
protectedvirtual

Dialog creation routines. Creates the dialog from internally added dialog creators.

Reimplemented in DtTerrainCreateLineHandler.

virtual void DtCreateControlObjectHandler::setWorkingName ( )
protectedpure virtual

Sets the working name of the temp symbol.

Implemented in DtCreateAreaHandler, DtCreateLineHandler, and DtCreatePointHandler.

virtual void DtCreateControlObjectHandler::additionalTempSymbolModifications ( QPolygon &  pts)
protectedvirtual

Additional modifications to be made to the temp symbol by subclasses.

The array is the screen point location of all points in the object

virtual void DtCreateControlObjectHandler::initDialog ( QWidget w)
protectedvirtual

Initializes dialog with default values.

Reimplemented in DtTerrainCreateLineHandler, DtCreateLineHandler, and DtCreatePointHandler.

virtual void DtCreateControlObjectHandler::initDialogConnections ( )
protectedvirtual

Uses myEventDlg pointer to init connections.

Set as function of calling createWidgetForCategory from createDialog. Common connections plus call to edit or create connections depending on mode

Reimplemented in DtCreateLineHandler, and DtCreatePointHandler.

virtual void DtCreateControlObjectHandler::initCreateConnections ( )
protectedvirtual

Connections that are initialized when in create mode.

virtual void DtCreateControlObjectHandler::initEditConnections ( )
protectedvirtual

Connections that are are made when editing.

virtual void DtCreateControlObjectHandler::pointSelected ( const DtPoint p)
protectedvirtual

Implements DtCreationHandler.

Reimplemented in DtCreatePointHandler.

virtual void DtCreateControlObjectHandler::activate ( )
protectedvirtual

Called when this event handler first becomes active.

Reimplemented from DtCreationHandler.

Reimplemented in DtTerrainCreatePointHandler.

virtual void DtCreateControlObjectHandler::deactivate ( )
protectedvirtual

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

Reimplemented from DtCreationHandler.

virtual void DtCreateControlObjectHandler::stop ( const DtPoint pnt)
protectedvirtual

Reimplemented from DtCreationHandler.

virtual DtSymbol* DtCreateControlObjectHandler::createTempSymbol ( DtTMMapArea area)
protectedvirtual

Creates the temp symbol and sets the working name.

If in edit mode, hide the original symbol

Reimplemented from DtCreationHandler.

Reimplemented in DtTerrainCreateLineHandler.

virtual DtSymbol* DtCreateControlObjectHandler::createSymbol ( DtTMMapArea area)
protectedvirtual

Subclasses need to create temp symbol.

Implements DtCreationHandler.

Reimplemented in DtCreateLineHandler, and DtCreatePointHandler.

virtual void DtCreateControlObjectHandler::getVertices ( QVector< DtPoint > &  modelPoints) const
protectedvirtual
virtual bool DtCreateControlObjectHandler::canPublish ( ) const
protectedvirtual
virtual bool DtCreateControlObjectHandler::isPublished ( ) const
protectedvirtual
virtual void DtCreateControlObjectHandler::setCaption ( QWidget w)
protectedvirtual

Sets the caption for the dialog based on mode and type.

virtual QString DtCreateControlObjectHandler::defaultName ( ) const
protectedvirtual

Default name of any item of a particular type.

virtual void DtCreateControlObjectHandler::sendUserComplete ( bool  finish = false)
protectedvirtual

Sends user complete message if show dialog type is Never.

Reimplemented in DtCreatePointHandler.

virtual bool DtCreateControlObjectHandler::userDefinedAction ( DtUserDefinedType  iAction,
void *  usr 
)
protectedvirtual

Reimplemented from DtEventHandler.

virtual bool DtCreateControlObjectHandler::complete ( ) const
protectedvirtual

Returns true if the item is complete by the number of points.

Called on first click if dialog is displayed on first click

virtual bool DtCreateControlObjectHandler::finishOnCreate ( ) const
protectedvirtual

Return true if want to finish on create by default. Default is false.

Reimplemented in DtCreateLineHandler.

virtual void DtCreateControlObjectHandler::disconnectDialogConnections ( )
protectedvirtual
virtual void DtCreateControlObjectHandler::disconnectEditConnections ( )
protectedvirtual
virtual void DtCreateControlObjectHandler::disconnectCreateConnections ( )
protectedvirtual
virtual int DtCreateControlObjectHandler::publishedEditTimeout ( ) const
protectedvirtual

250 ms default, then, calls done to hide copied symbol

virtual const char* DtCreateControlObjectHandler::eventSignalName ( )
inlineprotectedvirtual
virtual QPixmap DtCreateControlObjectHandler::createCursor ( )
protectedvirtual

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

Reimplemented from DtCreationHandler.

virtual void DtCreateControlObjectHandler::dialogDestroyedEvent ( )
protectedvirtual

Called when dialog is destroyed.

Reimplemented from DtEventHandler.

Member Data Documentation

QVector<DtPoint> DtCreateControlObjectHandler::myPointList
protected
QString DtCreateControlObjectHandler::myObjectName
protected
QString DtCreateControlObjectHandler::myLabelName
protected
bool DtCreateControlObjectHandler::myFinalPointSelected
protected
DtSymbol* DtCreateControlObjectHandler::myHideSymbol
protected
DtOverlaySymbolDescriptor* DtCreateControlObjectHandler::myDescription
protected
bool DtCreateControlObjectHandler::myDeleteDescription
protected
bool DtCreateControlObjectHandler::myFirstClick
protected
DtArchivableObject* DtCreateControlObjectHandler::myUserData
protected

Set by the dialogs, this will be passed to create and edit routines for modification.

QList<DtDialogCreatorInfo*> DtCreateControlObjectHandler::myDialogCreators
staticprotected

Dialog creators.

QString DtCreateControlObjectHandler::theDefaultNameLabel
staticprotected

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

Document ID: Generated on Mon Apr 8 19:24:01 EDT 2013 from SVN revision 125877
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)