![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /******************************************************************************* 00002 ** Copyright (c) 2009 MAK Technologies, Inc. 00003 ** All rights reserved. 00004 *******************************************************************************/ 00005 /******************************************************************************* 00006 ** $RCSfile: pointConfigWidget.h,v $ $Revision: 1.26 $ $State: Exp $ 00007 *******************************************************************************/ 00008 00011 00012 #ifndef POINTCONFIGWIDGET_H 00013 #define POINTCONFIGWIDGET_H 00014 00015 #include "tmqt/ui_pointConfigWidgetUi.h" 00016 #include "ngutil/entityMapperKey.h" 00017 00018 #include "geometry/point.h" 00019 00020 #include "drawerNative/convUtils.h" 00021 #include <QtCore/QHash> 00022 #include <QtCore/QList> 00023 00024 class DtTMMapArea; 00025 class DtSymbol; 00026 class DtModelData; 00027 class DtLocationEntryWidget; 00028 class DtArchivableObject; 00029 class DtUnitDisplayManager; 00030 00034 00035 #include "tmqt/tmqtDefines.h" 00036 class DT_DLL_tmqt DtPointConfigWidget : public QDialog 00037 { 00038 00039 Q_OBJECT 00040 00041 public: 00042 00044 DtPointConfigWidget(QWidget* parent = NULL, const Qt::WindowFlags& flags = 0); 00045 00047 virtual ~DtPointConfigWidget(); 00048 00049 virtual bool init 00050 ( 00051 const DtTMMapArea* converter, 00052 QVector<DtPoint>* list, 00053 QString* name, 00054 QString* label, 00055 int forceType, 00056 const DtModelData* data, 00057 bool editNotCreate = 0, 00058 DtSymbol* workingSymbol = NULL, 00059 const DtEntityMapperKey* key = NULL, 00060 DtArchivableObject* userData = NULL 00061 ); 00062 00063 virtual double heightOffset() const; 00064 00065 virtual void setNameLabel(const QString& name); 00066 00067 static QWidget* create(QWidget* parent = NULL, const Qt::WindowFlags& f = 0); 00068 00069 bool editNotCreate() const; 00070 const DtEntityMapperKey& entityMapperKey() const; 00071 00075 void setUpdateSymbolOnChange(bool); 00076 bool updateSymbolOnChange() const; 00077 00078 signals: 00079 00080 void updateSymbol(); 00081 void cancelActivated(); 00082 void createActivated(QVector<DtPoint>& points, QString name, 00083 QString label, QColor color, int forceType, 00084 int appearance, bool publish, QString attachTo, DtArchivableObject* userData, bool lastOne = true); 00085 void editActivated(QString name, QString label, QColor color, int forceType, 00086 int appearance, bool publish, DtArchivableObject* userData); 00087 void heightOffsetChanged(double); 00088 00090 void nameChanged(); 00091 00092 public slots: 00093 00094 virtual void updateUnits(const QString&, const QString&, const QString&); 00095 virtual void addPoint(const DtPoint& p); 00096 virtual void editPoint(const DtPoint& p); 00097 virtual void redisplayPoints(); 00098 virtual void cancelAndClose(); 00099 virtual void createAndClose(); 00100 virtual void editAndClose(); 00101 virtual void changePoint(); 00102 virtual void changeName(const QString& s); 00103 virtual void changeDefaultZPoint(double h); 00104 virtual void setHeightOffset(double h); 00105 00110 virtual void userComplete(bool finish); 00111 00112 private: 00113 00115 DtPointConfigWidget(const DtPointConfigWidget& orig); 00116 00118 DtPointConfigWidget& operator=(const DtPointConfigWidget& orig); 00119 00120 protected: 00121 00123 virtual void keyPressEvent(QKeyEvent *e); 00124 virtual bool initConnections(const DtTMMapArea* area); 00125 virtual void addPointToList(const DtPoint& p); 00126 virtual bool passNameCheck(); 00127 virtual bool shouldPublish() const; 00128 00129 virtual void closeEvent(QCloseEvent* c); 00130 00133 virtual void symbolUpdated(); 00134 00135 public: 00136 Ui::PointConfigWidgetUi myUiImpl; 00137 00138 protected: 00139 QVector<DtPoint> myDisplayPoints; 00140 00143 00144 const DtTMMapArea* myCSConverter; 00145 00146 QVector<DtPoint>* myPointList; 00147 00148 QString* myObjectNamePtr; 00149 QString* myLabelPtr; 00150 00151 bool myEditNotCreate; 00152 double myHeightOffset; 00153 00154 DtSymbol* myWorkingSymbol; 00155 const DtModelData* myModelData; 00156 00157 DtLocationEntryWidget* myLocationEntryWidget; 00158 DtArchivableObject* myUserData; 00159 00160 bool myClosing; 00161 00162 int myAppearance; 00163 int myDefaultTransparency; 00164 00165 DtEntityMapperKey myEntityMapperKey; 00166 bool myUpdateSymbolOnChange; 00167 }; 00168 00169 inline const DtEntityMapperKey& DtPointConfigWidget::entityMapperKey() const 00170 { 00171 return myEntityMapperKey; 00172 } 00173 00174 inline bool DtPointConfigWidget::editNotCreate() const 00175 { 00176 return myEditNotCreate; 00177 } 00178 00179 inline void DtPointConfigWidget::setUpdateSymbolOnChange(bool b) 00180 { 00181 myUpdateSymbolOnChange = b; 00182 } 00183 00184 inline bool DtPointConfigWidget::updateSymbolOnChange() const 00185 { 00186 return myUpdateSymbolOnChange; 00187 } 00188 00189 #endif