VR-Forces 4.0.4 Class Documentation
include/vrvCoreQt/DtPropsWidget.h
Go to the documentation of this file.
00001 /*****************************************************************************
00002  * Copyright (c) 2012 MAK Technologies, Inc.
00003  * All rights reserved.
00004  *****************************************************************************/
00005 
00009 
00010 #pragma once
00011 
00012 #include <vrvCoreQt/DtPropsInterface.h>
00013 #include <boost/unordered_map.hpp>
00014 #include <QtGui/QWidget>
00015 
00016 class QTreeWidgetItem;
00017 class QDoubleSpinBox;
00018 class QTreeWidget;
00019 class QPushButton;
00020 class QCheckBox;
00021 class QSlider;
00022 class QLabel;
00023 
00024 namespace makVrv
00025 {
00026 
00027    class DtPropTypeComboBox;
00028    class DtModelDefinitionComboBox;
00029    class DtTreeWidget;
00030    class DtUnicode;
00031 
00034    class DT_DLL_VRVCOREQT DtPropsWidget : public QWidget,
00035       public DtPropsInterface
00036    {
00037 
00038       Q_OBJECT
00039 
00040    public:
00041 
00043       DtPropsWidget( DtDe& de, QWidget* parent = 0, Qt::WindowFlags flags = 0 );
00044 
00046       virtual ~DtPropsWidget();
00047 
00051 
00054       virtual void addPropType( std::string propType );
00055 
00058       virtual void removePropType( std::string propType );
00059 
00062       virtual void addProp( const std::string& propName,
00063          const std::string& propType, DtUniqueID id );
00064 
00067       virtual void removeProp( const std::string& propName,
00068          const std::string& propType, DtUniqueID id );
00069 
00071       virtual void setOpacity( int opacity );
00072 
00074       virtual void setVisibility( int visibility );
00075 
00077       virtual void setPropType( const std::string& propType );
00078 
00080       virtual void setModelDefinition( const std::string& modelDef );
00081 
00083       virtual void setPropSelected( DtUniqueID id, bool selected );
00084 
00086       virtual void setPropsSelected( const DtPropsInterface::UniqueIdSet& ids );
00087 
00089       virtual void setPropsDeselected( const DtPropsInterface::UniqueIdSet& ids );
00090 
00092       virtual void setValidSchemas( const std::vector<std::string>& schemaNames );
00093 
00095       virtual void setPosition( double x, double y, double z );
00096 
00098       virtual void setPositionUnits( const DtUnicode& units );
00099 
00101       virtual void setPositionPrecisions( int distDecimals, int altDecimals );
00102 
00104       virtual void setOrientation( const double yaw,
00105          const double pitch, const double roll );
00106 
00108       virtual void setOrientationUnits( const DtUnicode& units );
00109 
00111       virtual void setOrientationPrecision( int decimals );
00112 
00114       void clear();
00115 
00117 
00118    protected slots:
00119 
00123 
00125       void onSelectionChanged();
00126 
00128       void onRemovePropsBtnClicked();
00129 
00131       void onOpacityChanged( int opacity );
00132 
00134       void onVisibilityChanged( int visibilty );
00135 
00137       void onPropTypeComboChanged( int index );
00138 
00140       void onModelDefComboChanged( int index );
00141 
00143       void onPositionChanged();
00144 
00146       void onOrientationChanged();
00147 
00149       void onRightClicked( QTreeWidgetItem*, QMouseEvent*, int col );
00150 
00152 
00153    protected:
00154 
00157       void setupGui();
00158 
00161       void connectToSignals();
00162 
00164       QTreeWidgetItem* findPropTypeItem( const std::string& propType );
00165 
00167       QTreeWidgetItem* findPropItem( DtUniqueID name );
00168 
00170       void setItemName( QTreeWidgetItem* item, const std::string& name );
00171 
00173       QString itemName( const QTreeWidgetItem* item );
00174 
00176       void setItemPropType( QTreeWidgetItem* item, const std::string& propType );
00177 
00179       QString itemPropType( const QTreeWidgetItem* item );
00180 
00182       void setItemUniqueID( QTreeWidgetItem* item, DtUniqueID id );
00183 
00185       DtUniqueID itemUniqueID( const QTreeWidgetItem* item );
00186 
00188       bool isItemProp( QTreeWidgetItem* item );
00189 
00191       void setStateStuffEnabled( bool bEnable );
00192 
00193    protected:
00194 
00195       typedef boost::unordered_map<DtUniqueID,QTreeWidgetItem*> UniqueItemMap;
00196       typedef boost::unordered_map<std::string,QTreeWidgetItem*> ItemMap;
00197 
00198       DtDe& myDe;
00199       DtTreeWidget* myTreeWidget;
00200       QPushButton* myRemovePropsBtn;
00201       DtPropTypeComboBox* myPropTypeCombo;
00202       DtModelDefinitionComboBox* myModelDefCombo;
00203       QCheckBox* myVisibleCheckbox;
00204       QLabel* opacityLabel;
00205       QSlider* myOpacitySlider;
00206       ItemMap myPropTypeItems;
00207       UniqueItemMap myPropItems;
00208 
00209       QLabel* myXLabel;
00210       QLabel* myYLabel;
00211       QLabel* myZLabel;
00212       QDoubleSpinBox* myXSpinbox;
00213       QDoubleSpinBox* myYSpinbox;
00214       QDoubleSpinBox* myZSpinbox;
00215 
00216       QLabel* myYawLabel;
00217       QLabel* myPitchLabel;
00218       QLabel* myRollLabel;
00219       QDoubleSpinBox* myYawSpinbox;
00220       QDoubleSpinBox* myPitchSpinbox;
00221       QDoubleSpinBox* myRollSpinbox;
00222 
00223    };
00224 
00225 }

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)