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"
42#include "Inventor/nodes/SoMaterial.h"
43#include "Inventor/nodes/SoDrawStyle.h"
44#include "Inventor/nodes/SoComplexity.h"
45#include "Inventor/nodes/SoLightModel.h"
46#include <Inventor/nodes/SoSeparator.h>
47#include <Inventor/actions/SoSearchAction.h>
51#include <QTreeWidgetItem>
58 Ui::VP1AODControllerForm
ui;
105 m_d->theclass =
this;
107 m_d->ui.setupUi(
this);
129 m_d->objBrowserWidget =
m_d->ui_objBrowser.treeWidget;
130 m_d->objBrowserWidget->setSortingEnabled(
false);
132 l<<
"Object"<<
"Information";
133 m_d->objBrowserWidget->setHeaderLabels(l);
134 connect(
m_d->objBrowserWidget,SIGNAL(itemClicked(QTreeWidgetItem *,
int)),
this,SLOT(
objectBrowserClicked(QTreeWidgetItem *,
int)));
137 m_d->ui.pushButton_interactions->hide();
140 connect(
m_d->ui.pushButton_dumpToJSON,SIGNAL(pressed()),
systemBase(),SLOT(dumpToJSON()));
144 m_d->ui.pushButton_dumpToJSON->setMaximumHeight(
static_cast<int>(0.5+QFontMetricsF(
m_d->ui.pushButton_dumpToJSON->font()).height()*1.05+2));
145 m_d->ui.pushButton_dumpToJSON->setMinimumHeight(
m_d->ui.pushButton_dumpToJSON->maximumHeight());
146 m_d->ui.pushButton_dumpToJSON->setCheckable(
true);
148 QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
149 sizePolicy.setHorizontalStretch(0);
150 sizePolicy.setVerticalStretch(0);
151 sizePolicy.setHeightForWidth(
m_d->ui.pushButton_dumpToJSON->sizePolicy().hasHeightForWidth());
152 m_d->ui.pushButton_dumpToJSON->setSizePolicy(sizePolicy);
153 m_d->ui.pushButton_dumpToJSON->setFocusPolicy(Qt::NoFocus);
155 m_d->ui.pushButton_dumpToJSON->hide();
176 messageVerbose(
"AODSystemController::currentSettingsVersion() - current version: " + QString::number(version));
184 messageDebug(
"version: " + QString::number(s.version()));
197 return m_d->collwidget;
207 QString ct = cb->currentText();
211 bool save = cb->blockSignals(
true);
215 bool enabled =
false;
218 cb->setEnabled(
false);
222 int i = restoredSelection.isEmpty() ? -1 : cb->findText(restoredSelection);
224 i = ct.isEmpty() ? -1 : cb->findText(ct);
225 restoredSelection =
"";
228 cb->setCurrentIndex(i);
232 int i_vp1(-1), i_atlas(-1);
233 for (
int j = 0; j <cb->count();++j) {
234 if (i_vp1==-1&&cb->itemText(j).contains(
"vp1",Qt::CaseInsensitive))
236 if (i_atlas==-1&&cb->itemText(j).contains(
"atlas",Qt::CaseInsensitive))
240 cb->setCurrentIndex(i_vp1);
242 cb->setCurrentIndex(i_atlas);
246 cb->setEnabled(
true);
250 cb->blockSignals(
false);
291 return m_d->objBrowserWidget;
306 messageVerbose(
"AODSystemController::objectBrowserClicked: Couldn't get system base pointer");
312 messageVerbose(
"AODSystemController::objectBrowserClicked: Couldn't get VP1AODSystem pointer");
313 std::cout<<
"Pointer value = "<<sysBase<<
" and type = "<<
typeid(sysBase).name()<<std::endl;
322 std::cout<<
"Have node from browser: "<<
node<<std::endl;
329 std::cout<<
"sel->select(node): "<<
node<<std::endl;
339#define VP1CONTROLLERCLASSNAME AODSystemController
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)