142 lines
3.1 KiB
C++
Executable File
142 lines
3.1 KiB
C++
Executable File
#pragma once
|
|
|
|
#include <QFrame>
|
|
#include <QColor>
|
|
#include <QWidget>
|
|
#include <QDockWidget>
|
|
#include "ui_viewwidget.h"
|
|
#include "viewerinterface.h"
|
|
|
|
#include <string>
|
|
#include "dtEntity/entityid.h"
|
|
|
|
|
|
namespace osgViewer {
|
|
class View;
|
|
}
|
|
|
|
namespace VCtrl
|
|
{
|
|
class ViewWidget
|
|
: public QFrame, // QWidget, (Needs to be QFrame to set border properties such as color)
|
|
public Ui::ViewWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit ViewWidget(unsigned int contextid,
|
|
dtEntity::EntityId bid = 0,
|
|
const std::string &strFeatureID = std::string(),
|
|
bool usesExactPos = false,
|
|
QWidget *parent = nullptr);
|
|
|
|
static const QColor ColorBorder;
|
|
static const QColor ColorSelected;
|
|
static const QColor ColorHighlighted;
|
|
|
|
void setView(QWidget *view);
|
|
QWidget* accessView();
|
|
void setText(const QString &strText);
|
|
void closeEvent(QCloseEvent *e) override;
|
|
|
|
void setViewerInterface(ViewerInterface *v) { mViewerInterface = v; }
|
|
|
|
|
|
bool isOpenGlWindowExposed() const;
|
|
|
|
inline bool isMaximized() const
|
|
{
|
|
return m_isMaximized;
|
|
}
|
|
|
|
void setMaximized(bool maximized);
|
|
void setSelected(bool selected);
|
|
inline bool isSelected() const
|
|
{
|
|
return m_isSelected;
|
|
}
|
|
|
|
inline unsigned int contextID() const
|
|
{
|
|
return mContextId;
|
|
}
|
|
|
|
inline dtEntity::EntityId entityID() const
|
|
{
|
|
return m_entityID;
|
|
}
|
|
|
|
inline const std::string featureID() const
|
|
{
|
|
return m_featureID;
|
|
}
|
|
|
|
inline const std::string description() const
|
|
{
|
|
return m_label_description->text().toStdString();
|
|
}
|
|
|
|
|
|
double transparency() const;
|
|
bool lockedRotation() const;
|
|
bool dotModeActive() const;
|
|
bool nameModeActive() const;
|
|
ViewMode viewMode() const;
|
|
bool exactPos() const;
|
|
|
|
signals:
|
|
void signal_Zoom(ViewWidget *pWidget, bool zoomIn);
|
|
void signal_MaximizeRequest(ViewWidget *pWidget);
|
|
void signal_MinimizeRequest(ViewWidget *pWidget);
|
|
void signal_CloseRequest(ViewWidget *pWidget);
|
|
void signal_FocusRequest(ViewWidget *pWidget);
|
|
void signal_ViewIsShown(ViewWidget *pWidget);
|
|
|
|
|
|
public slots:
|
|
void setLockRotationCheckbox(bool);
|
|
void setDotModeCheckbox(bool);
|
|
void setNameModeCheckbox(bool);
|
|
void setDisplayedViewMode(ViewMode);
|
|
void setTransparency(float value);
|
|
void closeByAPI();
|
|
|
|
void highlightBorder(bool highlight);
|
|
|
|
|
|
protected slots:
|
|
void viewModeChanged();
|
|
void transparencyChanged(int);
|
|
void lockRotationToggled();
|
|
void dotModeToggled();
|
|
void nameModeToggled(bool);
|
|
void slotShowMore(bool);
|
|
|
|
void OnButtonMaximize(bool);
|
|
void OnButtonClose(bool);
|
|
|
|
private:
|
|
void updateTlwTransientParent();
|
|
void mouseMoveEvent(QMouseEvent *event) override;
|
|
bool eventFilter(QObject *obj, QEvent *event) override;
|
|
void showEvent(QShowEvent *event) override;
|
|
|
|
bool m_isMaximized = false;
|
|
bool m_isSelected = false;
|
|
void drawBorder(const QColor &col);
|
|
|
|
bool m_locked, m_useDotMode;
|
|
ViewMode m_viewmode = ViewMode::ISOMETRIC;
|
|
|
|
dtEntity::EntityId m_entityID;
|
|
std::string m_featureID; // E.g., "House_11" (as specified within the xml files)
|
|
unsigned int mContextId;
|
|
|
|
bool m_usesExactPos;
|
|
|
|
ViewerInterface *mViewerInterface;
|
|
bool mClosedByAPI;
|
|
QWidget* m_pView;
|
|
};
|
|
}
|