14#include <Inventor/C/errors/debugerror.h>
15#include <Inventor/nodes/SoSelection.h>
23#include "ui_vp1aodcontrollerform.h"
24#include "ui_settings_cuts_form.h"
25#include "ui_objectbrowser.h"
43#include "Inventor/nodes/SoMaterial.h"
44#include "Inventor/nodes/SoDrawStyle.h"
45#include "Inventor/nodes/SoComplexity.h"
46#include "Inventor/nodes/SoLightModel.h"
47#include <Inventor/nodes/SoSeparator.h>
48#include <Inventor/actions/SoSearchAction.h>
52#include <QTreeWidgetItem>
59 Ui::VP1AODControllerForm
ui;
106 m_d->theclass =
this;
108 m_d->ui.setupUi(
this);
130 m_d->objBrowserWidget =
m_d->ui_objBrowser.treeWidget;
131 m_d->objBrowserWidget->setSortingEnabled(
false);
133 l<<
"Object"<<
"Information";
134 m_d->objBrowserWidget->setHeaderLabels(l);
135 connect(
m_d->objBrowserWidget,SIGNAL(itemClicked(QTreeWidgetItem *,
int)),
this,SLOT(
objectBrowserClicked(QTreeWidgetItem *,
int)));
138 m_d->ui.pushButton_interactions->hide();
141 connect(
m_d->ui.pushButton_dumpToJSON,SIGNAL(pressed()),
systemBase(),SLOT(dumpToJSON()));
145 m_d->ui.pushButton_dumpToJSON->setMaximumHeight(
static_cast<int>(0.5+QFontMetricsF(
m_d->ui.pushButton_dumpToJSON->font()).height()*1.05+2));
146 m_d->ui.pushButton_dumpToJSON->setMinimumHeight(
m_d->ui.pushButton_dumpToJSON->maximumHeight());
147 m_d->ui.pushButton_dumpToJSON->setCheckable(
true);
149 QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
150 sizePolicy.setHorizontalStretch(0);
151 sizePolicy.setVerticalStretch(0);
152 sizePolicy.setHeightForWidth(
m_d->ui.pushButton_dumpToJSON->sizePolicy().hasHeightForWidth());
153 m_d->ui.pushButton_dumpToJSON->setSizePolicy(sizePolicy);
154 m_d->ui.pushButton_dumpToJSON->setFocusPolicy(Qt::NoFocus);
156 m_d->ui.pushButton_dumpToJSON->hide();
177 messageVerbose(
"AODSystemController::currentSettingsVersion() - current version: " + QString::number(version));
185 messageDebug(
"version: " + QString::number(s.version()));
198 return m_d->collwidget;
208 QString ct = cb->currentText();
212 bool save = cb->blockSignals(
true);
216 bool enabled =
false;
219 cb->setEnabled(
false);
223 int i = restoredSelection.isEmpty() ? -1 : cb->findText(restoredSelection);
225 i = ct.isEmpty() ? -1 : cb->findText(ct);
226 restoredSelection =
"";
229 cb->setCurrentIndex(i);
233 int i_vp1(-1), i_atlas(-1);
234 for (
int j = 0; j <cb->count();++j) {
235 if (i_vp1==-1&&cb->itemText(j).contains(
"vp1",Qt::CaseInsensitive))
237 if (i_atlas==-1&&cb->itemText(j).contains(
"atlas",Qt::CaseInsensitive))
241 cb->setCurrentIndex(i_vp1);
243 cb->setCurrentIndex(i_atlas);
247 cb->setEnabled(
true);
251 cb->blockSignals(
false);
292 return m_d->objBrowserWidget;
307 messageVerbose(
"AODSystemController::objectBrowserClicked: Couldn't get system base pointer");
313 messageVerbose(
"AODSystemController::objectBrowserClicked: Couldn't get VP1AODSystem pointer");
314 std::cout<<
"Pointer value = "<<sysBase<<
" and type = "<<
typeid(sysBase).name()<<std::endl;
323 std::cout<<
"Have node from browser: "<<
node<<std::endl;
330 std::cout<<
"sel->select(node): "<<
node<<std::endl;
340#define VP1CONTROLLERCLASSNAME AODSystemController
virtual QStringList clicked() const =0
Called when user selects the node (stringlist is displayed in messagebox).
AODHandleBase * getHandleFromNode(SoNode *node)
SoNode * getNodeFromBrowser(QTreeWidgetItem *item)
AODSystemController * theclass
AODCollWidget * collwidget
Ui::AODObjectBrowser ui_objBrowser
bool updateComboBoxContents(QComboBox *cb, QStringList l, QString &restoredSelection)
static const QString noneAvailString
Ui::VP1AODControllerForm ui
QTreeWidget * objBrowserWidget
virtual ~AODSystemController()
QTreeWidget * objBrowser() const
Returns a pointer to the Track Object Browser (if it exists)
void actualSaveSettings(VP1Serialise &) const
bool printTotMomentumOnMultiTrackSelection() const
bool orientAndZoomOnSingleSelection() const
bool printVerboseInfoOnSingleSelection() const
void actualRestoreSettings(VP1Deserialise &)
bool showTotMomentumOnMultiTrackSelection() const
AODSysCommonData * common() const
Returns a pointer to the common data (if it exists)
bool printInfoOnSingleSelection() const
AODSystemController(IVP1System *sys)
AODCollWidget * collWidget() const
Return widget which fills the collection selection list in the GUI (i.e. which finds and lists the av...
void setCommonData(AODSysCommonData *)
set pointer to the common data
void objectBrowserClicked(QTreeWidgetItem *item, int)
int currentSettingsVersion() const
void initDialog(T &theUI, QPushButton *launchbutton, QAbstractButton *enabledButton=0)
void setupCollWidgetInScrollArea(QScrollArea *scrollarea, VP1CollectionWidget *collWidget)
VP1Controller(IVP1System *sys, const QString &classname)
void messageVerbose(const QString &) const
IVP1System * systemBase() const
void messageDebug(const QString &) const
static bool environmentVariableIsSet(const QString &name)