VR-Forces 4.0.4 Class Documentation
include/tmqt/symbolSelector.h
Go to the documentation of this file.
00001 /*******************************************************************************
00002 ** Copyright (c) 2002 MAK Technologies, Inc.
00003 ** All rights reserved.
00004 *******************************************************************************/
00005 /*******************************************************************************
00006 ** $RCSfile: symbolSelector.h,v $ $Revision: 1.23 $ $State: Exp $
00007 *******************************************************************************/
00008 
00011 
00012 #ifndef SYMBOLSELECTOR_H
00013 #define SYMBOLSELECTOR_H
00014 
00015 #include <QtCore/QObject>
00016 #include <QtCore/QVector>
00017 
00018 #include "symbolMapper/modelDataDict.h"
00019 
00020 #include "geometry/point.h"
00021 
00022 #include <QtCore/QPoint>
00023 #include <QtCore/QSize>
00024 #include <QtGui/QPaintDevice>
00025 #include <QtCore/QObject>
00026 #include <QtCore/QList>
00027 
00028 class DtTMViewportExtents;
00029 class DtViewDriver;
00030 class DtModelData;
00031 
00035 
00036 #include "tmqt/tmqtDefines.h"
00037 class DT_DLL_tmqt DtSymbolSelector : public QObject
00038 {
00039 
00040    Q_OBJECT
00041 
00042 public:
00043    
00044    enum DtSelectorType
00045    {
00046       DtNone = 0,             
00047       DtRectSelector,         
00048       DtCircleSelector,       
00049       DtCirclePointsSelector, 
00050       DtCircleInscribedPointsSelector, 
00051       DtSinglePointSelector,  
00052       DtMAXSelectorType
00053    };
00054 
00055    DtSymbolSelector();
00056    virtual ~DtSymbolSelector();
00057 
00058 private:
00060    DtSymbolSelector(const DtSymbolSelector& orig);
00061    
00063    DtSymbolSelector& operator=(const DtSymbolSelector& orig);
00064 
00065 public:
00067    virtual void draw(QPainter* dc);
00068 
00070    virtual void setSelectorType(DtSelectorType type);
00071    
00073    virtual DtSelectorType selectorType();
00074 
00076    virtual QPoint firstEdgeWindowPoint();
00077    
00079    virtual QPoint secondEdgeWindowPoint();
00080 
00082    virtual DtPoint firstEdgePoint();
00083    
00085    virtual DtPoint secondEdgePoint();
00086 
00088    virtual bool selectionInProgress();
00089 
00091    virtual void setViewportExtents(const DtTMViewportExtents* v);
00092 
00094    virtual void setViewDriver(DtViewDriver* v);
00095 
00097    virtual QVector<DtModelKey>& selectedModelKeys();
00098 
00103    virtual void setSelectionMode(int mode);
00104    virtual int selectionMode() const;
00105 
00107    virtual void clear();
00108 
00110    virtual void selectSymbols(DtModelDataIter *iter, Qt::KeyboardModifiers keyState, Qt::MouseButtons mouseState) = 0;
00111 
00113    virtual void highlightSymbols(QVector<DtModelKey>* display = NULL) = 0;
00114 
00115    virtual void highlightNoSymbols();
00116 
00118    virtual void remove(const DtModelKey& key);
00119 
00121    virtual void setSelectedKeys(const QVector<DtModelKey>& keys);
00122 
00123    virtual void setRightClickMaintainsSelection(bool b);
00124    virtual bool rightClickMaintainsSelection() const;
00125 
00126    virtual bool keepUnknownKeys() const;
00127 
00128 public slots:
00129 
00131    virtual void startSelection(const QPoint& pnt);
00132    
00134    virtual void updateLocation(const QPoint& pnt);
00135    
00137    virtual void endSelection(Qt::KeyboardModifiers keyState, Qt::MouseButtons mouseState);
00138 
00139 protected:
00141    virtual void drawRect(QPainter* paint);
00142    
00144    virtual void drawCircle(QPainter* paint);
00145 
00147    virtual void drawCirclePoints(QPainter* paint);
00148 
00150    virtual QPoint getWindowPoint(const DtPoint& p);
00151 
00154    virtual void merge(const QVector<DtModelKey>& keys, QVector<DtModelKey>& result);
00155 
00156 protected:
00157    const DtTMViewportExtents* myViewportExtents;
00158    DtViewDriver* myViewDriver;
00159    bool mySelectionInProgress;
00160    
00161    DtPoint myStartPoint;
00162    DtPoint myEndPoint;
00163 
00164    DtSelectorType mySelectorType;
00165    int mySelectionMode;
00166 
00167    QVector<DtModelKey> mySelectedModelKeys;
00168    QVector<DtModelKey> myLastSelectedModelKeys;
00169 
00170    bool myRightClickMaintainsSelection;
00171 };
00172 
00173 inline bool DtSymbolSelector::keepUnknownKeys() const
00174 {
00175    return false;
00176 }
00177 
00178 #endif //SYMBOLSELECTOR_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)