VR-Forces 4.1 Class Documentation
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions
DtObjectSelector Class Reference

contains a number of different formulas to select items from a given point More...

Inheritance diagram for DtObjectSelector:
Inheritance graph
[legend]

Public Types

enum  DtSelectorType {
  DtNone = 0, DtRectSelector, DtCircleSelector, DtCirclePointsSelector,
  DtCircleInscribedPointsSelector, DtSinglePointSelector, DtMAXSelectorType
}
- Public Types inherited from DtSymbolSelector
enum  DtSelectorType {
  DtNone = 0, DtRectSelector, DtCircleSelector, DtCirclePointsSelector,
  DtCircleInscribedPointsSelector, DtSinglePointSelector, DtMAXSelectorType
}

Public Member Functions

 DtObjectSelector ()
 Default constructor.
virtual ~DtObjectSelector ()
 Destructor.
virtual void selectSymbols (DtModelDataIter *iter, Qt::KeyboardModifiers keyState, Qt::MouseButtons mouseState)
 Selects symbols based upon current selector type.
virtual void setSelectionFilter (const DtFilter &)
 Set filter to filter objects that can be selected.
virtual const DtFilterselectionFilter () const
virtual void revalidateSelectedKeys (DtModelDataIter *iter)
 Revalidates current selected keys against the current filter.
virtual void clearFilter ()
 Clears out filter and sets selection mode to normal.
virtual DtSymbolsymbolAtLocation (DtModelDataIter *iter, const DtPoint &pnt)
 Given the database location, return the symbol at the specified location.
virtual void backupSelectionFilter ()
 Backs-up/restores backed up selection filter.
virtual bool restoreSelectionFilter ()
- Public Member Functions inherited from DtSymbolSelector
 DtSymbolSelector ()
virtual ~DtSymbolSelector ()
virtual void draw (QPainter *dc)
 Draws the rubber band onto the DC.
virtual void setSelectorType (DtSelectorType type)
 Sets current selector type.
virtual DtSelectorType selectorType ()
 Returns current selector type.
virtual QPoint firstEdgeWindowPoint ()
 Returns first edge point (DtCircleSelector), or start point.
virtual QPoint secondEdgeWindowPoint ()
 Returns second edge point (DtCircleSelector), or end point.
virtual DtPoint firstEdgePoint ()
 Returns first edge point (DtCircleSelector), or start point.
virtual DtPoint secondEdgePoint ()
 Returns second edge point (DtCircleSelector), or end point.
virtual bool selectionInProgress ()
 Returns true if startSelection() has been called.
virtual void setViewportExtents (const DtTMViewportExtents *v)
 Sets the viewport extents.
virtual void setViewDriver (DtViewDriver *v)
 Sets the view driver.
virtual QVector< DtModelKey > & selectedModelKeys ()
 Returns list of current symbol data.
virtual void setSelectionMode (int mode)
 Accessors for selection mode.
virtual int selectionMode () const
virtual void clear ()
 Clears out any internal state.
virtual void highlightNoSymbols ()
virtual void remove (const DtModelKey &key)
 Removes a model key from the selected list.
virtual void setSelectedKeys (const QVector< DtModelKey > &keys)
 Sets the selected keys to the specified list.
virtual void setRightClickMaintainsSelection (bool b)
virtual bool rightClickMaintainsSelection () const
virtual bool keepUnknownKeys () const

Static Public Member Functions

static DtObjectSelectorcreate ()
 Static creator function.

Protected Member Functions

virtual bool isValidForSelectionMode (const DtModelData *data)
 Returns true if this model data is valid for the specified selection mode.
virtual bool isValidForSelectionMode (const DtSymbol *symbol)
 Returns true if this symbol is valid for the specified selection mode.
virtual bool isValidForMode (const DtModelData *data, const DtSymbol *s)
 Calls either selection mode validators depending on how flags are set.
virtual void select (DtModelDataIter *iter, QVector< DtModelKey > &keys, Qt::KeyboardModifiers keyState, Qt::MouseButtons mouseState)
 Selects symbols by using appropriate selection mode.
virtual bool isInRectangle (const DtModelData *data, DtSymbol *s, const QPoint &start, const QPoint &end) const
 Different selection modes.
virtual bool isInPoint (const DtModelData *data, DtSymbol *s, const QPoint &start, const QPoint &end) const
virtual bool isInCircle (const DtModelData *data, DtSymbol *s, const QPoint &start, const QPoint &end) const
virtual bool isInRectCircle (const DtModelData *data, DtSymbol *s, const QPoint &start, const QPoint &end) const
virtual bool selectForMode (const DtModelData *data, DtSymbol *s, const QPoint &start, const QPoint &end) const
 Given the selection mode, sees if the symbol can be selected.
virtual void postProcessForMode (DtModelDataIter *iter, const QPoint &start, const QPoint &end, QVector< DtModelKey > &keys)
 Does any final processing for selection mode.
virtual void postProcessRectangleMode (DtModelDataIter *iter, const QPoint &start, const QPoint &end, QVector< DtModelKey > &keys)
virtual void highlightSymbols (QVector< DtModelKey > *display=NULL)
 Highlights all symbols in symbol list.
virtual bool passesFinalSelectionTest (const DtSymbol *s)
virtual void removeSingleSelectionItems (DtModelDataIter *iter, QVector< DtModelKey > &)
 Given a list, removes any item that is a "single selection" item.
virtual bool isSingleSelectionItem (DtModelData *data, DtSymbol *s) const
- Protected Member Functions inherited from DtSymbolSelector
virtual void drawRect (QPainter *paint)
 Draws a rectangle based on selection points.
virtual void drawCircle (QPainter *paint)
 Draws a circle based on selection points.
virtual void drawCirclePoints (QPainter *paint)
 Draws circle points based on selection points.
virtual QPoint getWindowPoint (const DtPoint &p)
 Update window point from database point.
virtual void merge (const QVector< DtModelKey > &keys, QVector< DtModelKey > &result)
 Merge the model keys specified in keys into result by adding new keys and removing keys that are common.

Protected Attributes

DtFiltermySelectionFilter
DtPtrQList< DtFilter * > myFilterBackups
- Protected Attributes inherited from DtSymbolSelector
const DtTMViewportExtentsmyViewportExtents
DtViewDrivermyViewDriver
bool mySelectionInProgress
DtPoint myStartPoint
DtPoint myEndPoint
DtSelectorType mySelectorType
int mySelectionMode
QVector< DtModelKeymySelectedModelKeys
QVector< DtModelKeymyLastSelectedModelKeys
bool myRightClickMaintainsSelection

Private Member Functions

 DtObjectSelector (const DtObjectSelector &orig)
 Copy constructor.
DtObjectSelectoroperator= (const DtObjectSelector &orig)
 Assignment operator.

Additional Inherited Members

- Public Slots inherited from DtSymbolSelector
virtual void startSelection (const QPoint &pnt)
 Starts the selection process.
virtual void updateLocation (const QPoint &pnt)
 Update selection with latest mouse location.
virtual void endSelection (Qt::KeyboardModifiers keyState, Qt::MouseButtons mouseState)
 Ends the selection process.

Detailed Description

contains a number of different formulas to select items from a given point

Member Enumeration Documentation

Enumerator:
DtNone 

No selection

DtRectSelector 

Rectangle selection

DtCircleSelector 

Circle Selection (Center Point + radius)

DtCirclePointsSelector 

Circle Selection (Two edge points

DtCircleInscribedPointsSelector 

DtCirclePointsSelector with center rect

DtSinglePointSelector 

Single Point Selection selection

DtMAXSelectorType 

Constructor & Destructor Documentation

DtObjectSelector::DtObjectSelector ( )

Default constructor.

virtual DtObjectSelector::~DtObjectSelector ( )
virtual

Destructor.

DtObjectSelector::DtObjectSelector ( const DtObjectSelector orig)
private

Copy constructor.

Member Function Documentation

virtual void DtObjectSelector::selectSymbols ( DtModelDataIter iter,
Qt::KeyboardModifiers  keyState,
Qt::MouseButtons  mouseState 
)
virtual

Selects symbols based upon current selector type.

Implements DtSymbolSelector.

static DtObjectSelector* DtObjectSelector::create ( )
static

Static creator function.

virtual void DtObjectSelector::setSelectionFilter ( const DtFilter )
virtual

Set filter to filter objects that can be selected.

If filter is NULL, all objects can be selected. Note that when filter is passed in it will be cloned for use by this object. When the filter is set, it also sets selection mode to use that filter

virtual const DtFilter* DtObjectSelector::selectionFilter ( ) const
virtual
virtual void DtObjectSelector::revalidateSelectedKeys ( DtModelDataIter iter)
virtual

Revalidates current selected keys against the current filter.

virtual void DtObjectSelector::clearFilter ( )
virtual

Clears out filter and sets selection mode to normal.

virtual DtSymbol* DtObjectSelector::symbolAtLocation ( DtModelDataIter iter,
const DtPoint pnt 
)
virtual

Given the database location, return the symbol at the specified location.

Will return the first symbol found

virtual void DtObjectSelector::backupSelectionFilter ( )
virtual

Backs-up/restores backed up selection filter.

This is a push/pop mechanism, so, it can be backed up multiple types

virtual bool DtObjectSelector::restoreSelectionFilter ( )
virtual
DtObjectSelector& DtObjectSelector::operator= ( const DtObjectSelector orig)
private

Assignment operator.

virtual bool DtObjectSelector::isValidForSelectionMode ( const DtModelData data)
protectedvirtual

Returns true if this model data is valid for the specified selection mode.

virtual bool DtObjectSelector::isValidForSelectionMode ( const DtSymbol symbol)
protectedvirtual

Returns true if this symbol is valid for the specified selection mode.

virtual bool DtObjectSelector::isValidForMode ( const DtModelData data,
const DtSymbol s 
)
protectedvirtual

Calls either selection mode validators depending on how flags are set.

Can be overridden to provide additional selection functionality

virtual void DtObjectSelector::select ( DtModelDataIter iter,
QVector< DtModelKey > &  keys,
Qt::KeyboardModifiers  keyState,
Qt::MouseButtons  mouseState 
)
protectedvirtual

Selects symbols by using appropriate selection mode.

virtual bool DtObjectSelector::isInRectangle ( const DtModelData data,
DtSymbol s,
const QPoint &  start,
const QPoint &  end 
) const
protectedvirtual

Different selection modes.

virtual bool DtObjectSelector::isInPoint ( const DtModelData data,
DtSymbol s,
const QPoint &  start,
const QPoint &  end 
) const
protectedvirtual
virtual bool DtObjectSelector::isInCircle ( const DtModelData data,
DtSymbol s,
const QPoint &  start,
const QPoint &  end 
) const
protectedvirtual
virtual bool DtObjectSelector::isInRectCircle ( const DtModelData data,
DtSymbol s,
const QPoint &  start,
const QPoint &  end 
) const
protectedvirtual
virtual bool DtObjectSelector::selectForMode ( const DtModelData data,
DtSymbol s,
const QPoint &  start,
const QPoint &  end 
) const
protectedvirtual

Given the selection mode, sees if the symbol can be selected.

virtual void DtObjectSelector::postProcessForMode ( DtModelDataIter iter,
const QPoint &  start,
const QPoint &  end,
QVector< DtModelKey > &  keys 
)
protectedvirtual

Does any final processing for selection mode.

Currently only works with rect selection mode if rectangle is small (less than 2 pixels on width and height) to find closest selection

virtual void DtObjectSelector::postProcessRectangleMode ( DtModelDataIter iter,
const QPoint &  start,
const QPoint &  end,
QVector< DtModelKey > &  keys 
)
protectedvirtual
virtual void DtObjectSelector::highlightSymbols ( QVector< DtModelKey > *  display = NULL)
protectedvirtual

Highlights all symbols in symbol list.

Implements DtSymbolSelector.

virtual bool DtObjectSelector::passesFinalSelectionTest ( const DtSymbol s)
protectedvirtual
virtual void DtObjectSelector::removeSingleSelectionItems ( DtModelDataIter iter,
QVector< DtModelKey > &   
)
protectedvirtual

Given a list, removes any item that is a "single selection" item.

Currently this is just lines with a point selected

virtual bool DtObjectSelector::isSingleSelectionItem ( DtModelData data,
DtSymbol s 
) const
protectedvirtual

Member Data Documentation

DtFilter* DtObjectSelector::mySelectionFilter
protected
DtPtrQList<DtFilter*> DtObjectSelector::myFilterBackups
protected

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

Document ID: Generated on Tue Jan 29 18:21:16 EST 2013 from SVN revision 123193
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)