Commit b798097a authored by Alexander Stukowski's avatar Alexander Stukowski

Fixed a crash related to viewport input modes and in particular the 'Pick...

Fixed a crash related to viewport input modes and in particular the 'Pick three points' function of the Slice modifier
parent cb71c7c2
///////////////////////////////////////////////////////////////////////////////
//
//
// Copyright (2018) Alexander Stukowski
//
// This file is part of OVITO (Open Visualization Tool).
......@@ -37,8 +37,8 @@ LoadStream::LoadStream(QDataStream& source) : _is(source)
OVITO_ASSERT_MSG(!_is.device()->isSequential(), "LoadStream constructor", "LoadStream class requires a seekable input stream.");
if(_is.device()->isSequential())
throw Exception("LoadStream class requires a seekable input stream.");
// Read file header.
// Read file header.
_isOpen = true;
......@@ -47,7 +47,7 @@ LoadStream::LoadStream(QDataStream& source) : _is(source)
*this >> magic1 >> magic2;
*this >> _fileFormat;
*this >> _fpPrecision;
_isOpen = false;
if(magic1 != 0x0FACC5AB || magic2 != 0x0AFCCA5A)
......@@ -77,7 +77,7 @@ LoadStream::LoadStream(QDataStream& source) : _is(source)
// OVITO 3.x cannot read state files written by OVITO 2.x:
if(_fileFormat < 30001)
throw Exception(tr("This file has been written by %1 %2 and %3 %4.x cannot read it anymore. Please use the old program version to open the file.")
.arg(_applicationName).arg(_applicationVersionString).arg(QCoreApplication::applicationName()).arg(Application::applicationVersionMajor()));
.arg(_applicationName).arg(_applicationVersionString).arg(QCoreApplication::applicationName()).arg(Application::applicationVersionMajor()));
}
/******************************************************************************
......@@ -115,9 +115,9 @@ void LoadStream::read(void* buffer, size_t numBytes)
* Opens the next chunk in the stream.
******************************************************************************/
quint32 LoadStream::openChunk()
{
{
quint32 chunkId;
quint32 chunkSize;
quint32 chunkSize;
*this >> chunkId >> chunkSize;
_chunks.emplace_back(chunkId, (qint64)chunkSize + filePosition());
return chunkId;
......@@ -181,10 +181,10 @@ void LoadStream::closeChunk()
/******************************************************************************
* Reads a pointer to an object of type T from the input stream.
* This method will patch the address immediately if it is available,
* otherwise it will happen later when it is known.
* This method will patch the address immediately if it is available,
* otherwise it will happen later when it is known.
******************************************************************************/
quint64 LoadStream::readPointer(void** patchPointer)
quint64 LoadStream::readPointer(void** patchPointer)
{
quint64 id;
*this >> id;
......@@ -203,7 +203,7 @@ quint64 LoadStream::readPointer(void** patchPointer)
* This method will backpatch all registered pointers with the given ID.
******************************************************************************/
void LoadStream::resolvePointer(quint64 id, void* pointer)
{
{
OVITO_ASSERT(id != 0);
OVITO_ASSERT(id >= _resolvedPointers.size() || !_resolvedPointers[id]);
if(id >= _pointerMap.size()) {
......@@ -243,7 +243,7 @@ void LoadStream::checkErrorCondition()
* Reads a reference to an OvitoObject derived class type from the input stream.
******************************************************************************/
LoadStream& operator>>(LoadStream& stream, OvitoClassPtr& clazz)
{
{
clazz = OvitoClass::deserializeRTTI(stream);
return stream;
}
......
///////////////////////////////////////////////////////////////////////////////
//
//
// Copyright (2018) Alexander Stukowski
//
// This file is part of OVITO (Open Visualization Tool).
......@@ -34,7 +34,15 @@ namespace Ovito { OVITO_BEGIN_INLINE_NAMESPACE(Gui) OVITO_BEGIN_INLINE_NAMESPACE
******************************************************************************/
ViewportInputMode::~ViewportInputMode()
{
// Remove input mode from stack if it gets destroyed.
// Mode must not be in use when it gets destroyed.
OVITO_ASSERT(!_manager || std::find(_manager->stack().begin(), _manager->stack().end(), this) == _manager->stack().end());
}
/******************************************************************************
* Removes this input mode from the mode stack of the ViewportInputManager.
******************************************************************************/
void ViewportInputMode::removeMode()
{
if(_manager)
_manager->removeInputMode(this);
}
......
......@@ -128,6 +128,11 @@ public:
/// \brief Redraws all viewports.
void requestViewportUpdate();
public Q_SLOTS:
/// Removes this input mode from the mode stack of the ViewportInputManager.
void removeMode();
Q_SIGNALS:
/// \brief This signal is emitted when the input mode has become the active mode or is no longer the active mode.
......
///////////////////////////////////////////////////////////////////////////////
//
//
// Copyright (2014) Alexander Stukowski
//
// This file is part of OVITO (Open Visualization Tool).
......@@ -69,6 +69,7 @@ void CoordinateTripodOverlayEditor::createUI(const RolloutInsertionParameters& r
layout->addLayout(offsetYPUI->createFieldLayout(), 2, 1);
ViewportInputMode* moveOverlayMode = new MoveOverlayInputMode(this);
connect(this, &QObject::destroyed, moveOverlayMode, &ViewportInputMode::removeMode);
ViewportModeAction* moveOverlayAction = new ViewportModeAction(mainWindow(), tr("Move using mouse"), this, moveOverlayMode);
layout->addWidget(moveOverlayAction->createPushButton(), 3, 1);
......
///////////////////////////////////////////////////////////////////////////////
//
//
// Copyright (2016) Alexander Stukowski
//
// This file is part of OVITO (Open Visualization Tool).
......@@ -135,6 +135,7 @@ void TextLabelOverlayEditor::createUI(const RolloutInsertionParameters& rolloutP
layout->addLayout(offsetYPUI->createFieldLayout(), 4, 1, 1, 2);
ViewportInputMode* moveOverlayMode = new MoveOverlayInputMode(this);
connect(this, &QObject::destroyed, moveOverlayMode, &ViewportInputMode::removeMode);
ViewportModeAction* moveOverlayAction = new ViewportModeAction(mainWindow(), tr("Move using mouse"), this, moveOverlayMode);
layout->addWidget(moveOverlayAction->createPushButton(), 5, 1, 1, 2);
......
......@@ -53,6 +53,7 @@ QWidget* DislocationInspectionApplet::createWidget(MainWindow* mainWindow)
layout->setSpacing(0);
_pickingMode = new PickingMode(this);
connect(this, &QObject::destroyed, _pickingMode, &ViewportInputMode::removeMode);
ViewportModeAction* pickModeAction = new ViewportModeAction(mainWindow, tr("Select in viewports"), this, _pickingMode);
pickModeAction->setIcon(QIcon(":/particles/icons/select_mode.svg"));
......@@ -113,7 +114,7 @@ void DislocationInspectionApplet::updateDisplay(const PipelineFlowState& state,
******************************************************************************/
void DislocationInspectionApplet::deactivate(MainWindow* mainWindow)
{
mainWindow->viewportInputManager()->removeInputMode(_pickingMode);
_pickingMode->removeMode();
}
/******************************************************************************
......
......@@ -120,7 +120,7 @@ void OSPRayRendererEditor::createUI(const RolloutInsertionParameters& rolloutPar
IntegerParameterUI* refinementIterationsUI = new IntegerParameterUI(this, PROPERTY_FIELD(OSPRayRenderer::refinementIterations));
layout->addWidget(refinementIterationsUI->label(), 0, 0);
layout->addLayout(refinementIterationsUI->createFieldLayout(), 0, 1);
IntegerParameterUI* aaSamplesUI = new IntegerParameterUI(this, PROPERTY_FIELD(OSPRayRenderer::samplesPerPixel));
layout->addWidget(aaSamplesUI->label(), 1, 0);
layout->addLayout(aaSamplesUI->createFieldLayout(), 1, 1);
......@@ -128,7 +128,7 @@ void OSPRayRendererEditor::createUI(const RolloutInsertionParameters& rolloutPar
IntegerParameterUI* maxRayRecursionUI = new IntegerParameterUI(this, PROPERTY_FIELD(OSPRayRenderer::maxRayRecursion));
layout->addWidget(maxRayRecursionUI->label(), 2, 0);
layout->addLayout(maxRayRecursionUI->createFieldLayout(), 2, 1);
BooleanGroupBoxParameterUI* enableDirectLightUI = new BooleanGroupBoxParameterUI(this, PROPERTY_FIELD(OSPRayRenderer::directLightSourceEnabled));
QGroupBox* directLightsGroupBox = enableDirectLightUI->groupBox();
mainLayout->addWidget(directLightsGroupBox);
......@@ -148,7 +148,7 @@ void OSPRayRendererEditor::createUI(const RolloutInsertionParameters& rolloutPar
FloatParameterUI* defaultLightSourceAngularDiameterUI = new FloatParameterUI(this, PROPERTY_FIELD(OSPRayRenderer::defaultLightSourceAngularDiameter));
layout->addWidget(defaultLightSourceAngularDiameterUI->label(), 1, 0);
layout->addLayout(defaultLightSourceAngularDiameterUI->createFieldLayout(), 1, 1);
BooleanGroupBoxParameterUI* enableAmbientLightUI = new BooleanGroupBoxParameterUI(this, PROPERTY_FIELD(OSPRayRenderer::ambientLightEnabled));
QGroupBox* ambientLightsGroupBox = enableAmbientLightUI->groupBox();
mainLayout->addWidget(ambientLightsGroupBox);
......@@ -157,7 +157,7 @@ void OSPRayRendererEditor::createUI(const RolloutInsertionParameters& rolloutPar
layout->setContentsMargins(4,4,4,4);
layout->setSpacing(4);
layout->setColumnStretch(1, 1);
// Ambient brightness.
FloatParameterUI* ambientBrightnessUI = new FloatParameterUI(this, PROPERTY_FIELD(OSPRayRenderer::ambientBrightness));
ambientBrightnessUI->label()->setText(tr("Brightness:"));
......@@ -198,6 +198,7 @@ void OSPRayRendererEditor::createUI(const RolloutInsertionParameters& rolloutPar
// Focal length picking mode.
ViewportInputMode* pickFocalLengthMode = new PickFocalLengthInputMode(this);
connect(this, &QObject::destroyed, pickFocalLengthMode, &ViewportInputMode::removeMode);
ViewportModeAction* modeAction = new ViewportModeAction(mainWindow(), tr("Pick in viewport"), this, pickFocalLengthMode);
layout->addWidget(modeAction->createPushButton(), 0, 2);
......@@ -210,7 +211,7 @@ void OSPRayRendererEditor::createUI(const RolloutInsertionParameters& rolloutPar
QPushButton* switchBackendButton = new QPushButton(tr("Switch OSPRay backend..."));
connect(switchBackendButton, &QPushButton::clicked, this, &OSPRayRendererEditor::onSwitchBackend);
mainLayout->addWidget(switchBackendButton);
// Open a sub-editor for the backend.
new SubObjectParameterUI(this, PROPERTY_FIELD(OSPRayRenderer::backend), rolloutParams.after(rollout));
}
......@@ -227,7 +228,7 @@ void OSPRayRendererEditor::onSwitchBackend()
QVector<OvitoClassPtr> backendClasses = PluginManager::instance().listClasses(OSPRayBackend::OOClass());
int current = -1;
int index = 0;
QStringList items;
QStringList items;
for(const OvitoClassPtr& clazz : backendClasses) {
items << clazz->displayName();
if(renderer->backend() && &renderer->backend()->getOOClass() == clazz)
......@@ -237,7 +238,7 @@ void OSPRayRendererEditor::onSwitchBackend()
// Let user choose a new backend.
bool ok;
QString item = QInputDialog::getItem(container(), tr("Switch OSPRay backend"),
QString item = QInputDialog::getItem(container(), tr("Switch OSPRay backend"),
tr("Select an OSPRay rendering backend."), items, current, false, &ok);
if(!ok) return;
......@@ -250,7 +251,7 @@ void OSPRayRendererEditor::onSwitchBackend()
renderer->setBackend(backend);
});
}
}
}
}
OVITO_END_INLINE_NAMESPACE
......
......@@ -31,8 +31,8 @@ namespace Ovito { namespace Particles { OVITO_BEGIN_INLINE_NAMESPACE(Util) OVITO
IMPLEMENT_OVITO_CLASS(BondInspectionApplet);
/******************************************************************************
* Lets the applet create the UI widget that is to be placed into the data
* inspector panel.
* Lets the applet create the UI widget that is to be placed into the data
* inspector panel.
******************************************************************************/
QWidget* BondInspectionApplet::createWidget(MainWindow* mainWindow)
{
......@@ -44,7 +44,8 @@ QWidget* BondInspectionApplet::createWidget(MainWindow* mainWindow)
layout->setSpacing(0);
_pickingMode = new PickingMode(this);
ViewportModeAction* pickModeAction = new ViewportModeAction(mainWindow, tr("Select in viewports"), this, _pickingMode);
connect(this, &QObject::destroyed, _pickingMode, &ViewportInputMode::removeMode);
ViewportModeAction* pickModeAction = new ViewportModeAction(mainWindow, tr("Select in viewports"), this, _pickingMode);
pickModeAction->setIcon(QIcon(":/particles/icons/select_mode.svg"));
QToolBar* toolbar = new QToolBar();
......@@ -63,7 +64,7 @@ QWidget* BondInspectionApplet::createWidget(MainWindow* mainWindow)
QWidget* pickModeButton = toolbar->widgetForAction(pickModeAction);
connect(_pickingMode, &ViewportInputMode::statusChanged, pickModeButton, [pickModeButton,this](bool active) {
if(active) {
QToolTip::showText(pickModeButton->mapToGlobal(pickModeButton->rect().bottomRight()),
QToolTip::showText(pickModeButton->mapToGlobal(pickModeButton->rect().bottomRight()),
#ifndef Q_OS_MACX
tr("Pick a bond in the viewports. Hold down the CONTROL key to select multiple bonds."),
#else
......@@ -88,7 +89,7 @@ void BondInspectionApplet::updateDisplay(const PipelineFlowState& state, Pipelin
// Clear selection when a different scene node has been selected.
if(sceneNode != currentSceneNode())
_pickingMode->resetSelection();
PropertyInspectionApplet::updateDisplay(state, sceneNode);
}
......@@ -97,7 +98,7 @@ void BondInspectionApplet::updateDisplay(const PipelineFlowState& state, Pipelin
******************************************************************************/
void BondInspectionApplet::deactivate(MainWindow* mainWindow)
{
mainWindow->viewportInputManager()->removeInputMode(_pickingMode);
_pickingMode->removeMode();
}
/******************************************************************************
......
......@@ -32,8 +32,8 @@ namespace Ovito { namespace Particles { OVITO_BEGIN_INLINE_NAMESPACE(Util) OVITO
IMPLEMENT_OVITO_CLASS(ParticleInspectionApplet);
/******************************************************************************
* Lets the applet create the UI widget that is to be placed into the data
* inspector panel.
* Lets the applet create the UI widget that is to be placed into the data
* inspector panel.
******************************************************************************/
QWidget* ParticleInspectionApplet::createWidget(MainWindow* mainWindow)
{
......@@ -45,7 +45,8 @@ QWidget* ParticleInspectionApplet::createWidget(MainWindow* mainWindow)
layout->setSpacing(0);
_pickingMode = new PickingMode(this);
ViewportModeAction* pickModeAction = new ViewportModeAction(mainWindow, tr("Select in viewports"), this, _pickingMode);
connect(this, &QObject::destroyed, _pickingMode, &ViewportInputMode::removeMode);
ViewportModeAction* pickModeAction = new ViewportModeAction(mainWindow, tr("Select in viewports"), this, _pickingMode);
pickModeAction->setIcon(QIcon(":/particles/icons/select_mode.svg"));
_measuringModeAction = new QAction(QIcon(":/particles/icons/measure_distances.svg"), tr("Show distances and angles"), this);
......@@ -64,7 +65,7 @@ QWidget* ParticleInspectionApplet::createWidget(MainWindow* mainWindow)
QWidget* pickModeButton = toolbar->widgetForAction(pickModeAction);
connect(_pickingMode, &ViewportInputMode::statusChanged, pickModeButton, [pickModeButton,this](bool active) {
if(active) {
QToolTip::showText(pickModeButton->mapToGlobal(pickModeButton->rect().bottomRight()),
QToolTip::showText(pickModeButton->mapToGlobal(pickModeButton->rect().bottomRight()),
#ifndef Q_OS_MACX
tr("Pick a particle in the viewports. Hold down the CONTROL key to select multiple particles."),
#else
......@@ -83,7 +84,7 @@ QWidget* ParticleInspectionApplet::createWidget(MainWindow* mainWindow)
_distanceTable = new QTableWidget(0, 3);
_distanceTable->hide();
_distanceTable->setHorizontalHeaderLabels(QStringList() << tr("Pair A-B") << tr("Distance") << tr("Vector"));
_distanceTable->setHorizontalHeaderLabels(QStringList() << tr("Pair A-B") << tr("Distance") << tr("Vector"));
_distanceTable->horizontalHeader()->setStretchLastSection(true);
_distanceTable->verticalHeader()->hide();
_distanceTable->setEditTriggers(QAbstractItemView::NoEditTriggers);
......@@ -91,7 +92,7 @@ QWidget* ParticleInspectionApplet::createWidget(MainWindow* mainWindow)
_angleTable = new QTableWidget(0, 2);
_angleTable->hide();
_angleTable->setHorizontalHeaderLabels(QStringList() << tr("Triplet A-B-C") << tr("Angle"));
_angleTable->setHorizontalHeaderLabels(QStringList() << tr("Triplet A-B-C") << tr("Angle"));
_angleTable->horizontalHeader()->setStretchLastSection(true);
_angleTable->verticalHeader()->hide();
_angleTable->setEditTriggers(QAbstractItemView::NoEditTriggers);
......@@ -118,7 +119,7 @@ void ParticleInspectionApplet::updateDisplay(const PipelineFlowState& state, Pip
// Clear selection when a different scene node has been selected.
if(sceneNode != currentSceneNode())
_pickingMode->resetSelection();
PropertyInspectionApplet::updateDisplay(state, sceneNode);
if(_measuringModeAction->isChecked()) {
......@@ -211,7 +212,7 @@ void ParticleInspectionApplet::updateAngleTable()
******************************************************************************/
void ParticleInspectionApplet::deactivate(MainWindow* mainWindow)
{
mainWindow->viewportInputManager()->removeInputMode(_pickingMode);
_pickingMode->removeMode();
}
/******************************************************************************
......@@ -307,7 +308,7 @@ void ParticleInspectionApplet::PickingMode::renderOverlay3D(Viewport* vp, Viewpo
*outVertex++ = posProperty->getPoint3(particleIndex);
}
}
if(outVertex == vertices.end())
if(outVertex == vertices.end())
break;
}
......
......@@ -119,7 +119,7 @@ void POVRayRendererEditor::createUI(const RolloutInsertionParameters& rolloutPar
IntegerParameterUI* qualityLevelUI = new IntegerParameterUI(this, PROPERTY_FIELD(POVRayRenderer::qualityLevel));
layout->addWidget(qualityLevelUI->label(), 0, 0);
layout->addLayout(qualityLevelUI->createFieldLayout(), 0, 1);
// Antialiasing
BooleanGroupBoxParameterUI* enableAntialiasingUI = new BooleanGroupBoxParameterUI(this, PROPERTY_FIELD(POVRayRenderer::antialiasingEnabled));
QGroupBox* aaGroupBox = enableAntialiasingUI->groupBox();
......@@ -191,6 +191,7 @@ void POVRayRendererEditor::createUI(const RolloutInsertionParameters& rolloutPar
// Focal length picking mode.
ViewportInputMode* pickFocalLengthMode = new PickFocalLengthInputMode(this);
connect(this, &QObject::destroyed, pickFocalLengthMode, &ViewportInputMode::removeMode);
ViewportModeAction* modeAction = new ViewportModeAction(mainWindow(), tr("Pick in viewport"), this, pickFocalLengthMode);
layout->addWidget(modeAction->createPushButton(), 0, 2);
......@@ -230,7 +231,7 @@ void POVRayRendererEditor::createUI(const RolloutInsertionParameters& rolloutPar
// POV-Ray executable path
layout->addWidget(new QLabel(tr("POV-Ray executable:")), 0, 0, 1, 2);
StringParameterUI* povrayExecutablePUI = new StringParameterUI(this, PROPERTY_FIELD(POVRayRenderer::povrayExecutable));
layout->addWidget(new QLabel(tr("POV-Ray executable:")), 0, 0);
static_cast<QLineEdit*>(povrayExecutablePUI->textBox())->setPlaceholderText(QStringLiteral("povray"));
......@@ -239,7 +240,7 @@ void POVRayRendererEditor::createUI(const RolloutInsertionParameters& rolloutPar
connect(selectExecutablePathButton, &QPushButton::clicked, this, [this]{
try {
POVRayRenderer* renderer = static_object_cast<POVRayRenderer>(editObject());
if(!renderer) return;
if(!renderer) return;
QString path = QFileDialog::getOpenFileName(container(), tr("Select POV-Ray Executable"), renderer->povrayExecutable());
if(!path.isEmpty()) {
UndoableTransaction::handleExceptions(renderer->dataset()->undoStack(), tr("Set executable path"), [renderer, &path]() {
......@@ -250,7 +251,7 @@ void POVRayRendererEditor::createUI(const RolloutInsertionParameters& rolloutPar
}
catch(const Exception& ex) {
ex.reportError();
}
}
});
layout->addWidget(selectExecutablePathButton, 1, 1);
......
///////////////////////////////////////////////////////////////////////////////
//
//
// Copyright (2016) Alexander Stukowski
//
// This file is part of OVITO (Open Visualization Tool).
......@@ -150,6 +150,7 @@ void ColorLegendOverlayEditor::createUI(const RolloutInsertionParameters& rollou
sublayout->addLayout(offsetYPUI->createFieldLayout(), 2, 1);
ViewportInputMode* moveOverlayMode = new MoveOverlayInputMode(this);
connect(this, &QObject::destroyed, moveOverlayMode, &ViewportInputMode::removeMode);
ViewportModeAction* moveOverlayAction = new ViewportModeAction(mainWindow(), tr("Move using mouse"), this, moveOverlayMode);
sublayout->addWidget(moveOverlayAction->createPushButton(), 3, 0, 1, 2);
......
......@@ -94,7 +94,7 @@ public:
// Switch back to default mouse cursor.
setCursor(QCursor());
}
}
ManualSelectionModifierEditor* _editor;
};
......@@ -227,10 +227,12 @@ void ManualSelectionModifierEditor::createUI(const RolloutInsertionParameters& r
layout->addWidget(mouseSelectionGroup);
PickElementMode* pickElementMode = new PickElementMode(this);
connect(this, &QObject::destroyed, pickElementMode, &ViewportInputMode::removeMode);
ViewportModeAction* pickModeAction = new ViewportModeAction(mainWindow(), tr("Pick"), this, pickElementMode);
sublayout->addWidget(pickModeAction->createPushButton());
FenceSelectionMode* fenceMode = new FenceSelectionMode(this);
connect(this, &QObject::destroyed, fenceMode, &ViewportInputMode::removeMode);
ViewportModeAction* fenceModeAction = new ViewportModeAction(mainWindow(), tr("Fence selection"), this, fenceMode);
sublayout->addWidget(fenceModeAction->createPushButton());
......
......@@ -116,6 +116,7 @@ void SliceModifierEditor::createUI(const RolloutInsertionParameters& rolloutPara
layout->addWidget(alignPlaneToViewBtn);
_pickPlanePointsInputMode = new PickPlanePointsInputMode(this);
connect(this, &QObject::destroyed, _pickPlanePointsInputMode, &ViewportInputMode::removeMode);
_pickPlanePointsInputModeAction = new ViewportModeAction(mainWindow(), tr("Pick three points"), this, _pickPlanePointsInputMode);
layout->addWidget(_pickPlanePointsInputModeAction->createPushButton());
......@@ -128,7 +129,7 @@ void SliceModifierEditor::createUI(const RolloutInsertionParameters& rolloutPara
// Create a second rollout.
rollout = createRollout(tr("Operate on"), rolloutParams.after(rollout), "particles.modifiers.slice.html");
// Create the rollout contents.
layout = new QVBoxLayout(rollout);
layout->setContentsMargins(4,4,4,4);
......@@ -296,7 +297,7 @@ void PickPlanePointsInputMode::mouseMoveEvent(ViewportWindow* vpwin, QMouseEvent
_hasPreliminaryPoint = true;
requestViewportUpdate();
}
else {
else {
if(_hasPreliminaryPoint)
requestViewportUpdate();
_hasPreliminaryPoint = false;
......@@ -432,7 +433,7 @@ void PickPlanePointsInputMode::renderOverlay3D(Viewport* vp, ViewportSceneRender
}
else {
for(int i = 0; i < npoints; i++)
renderer->addToLocalBoundingBox(_pickedPoints[i]);
renderer->addToLocalBoundingBox(_pickedPoints[i]);
}
}
......
......@@ -111,7 +111,7 @@ private:
/// Indicates whether a preliminary point is available.
bool _hasPreliminaryPoint = false;
/// The properties editor of the SliceModifier.
SliceModifierEditor* _editor;
};
......
......@@ -177,6 +177,7 @@ void TachyonRendererEditor::createUI(const RolloutInsertionParameters& rolloutPa
// Focal length picking mode.
ViewportInputMode* pickFocalLengthMode = new PickFocalLengthInputMode(this);
connect(this, &QObject::destroyed, pickFocalLengthMode, &ViewportInputMode::removeMode);
ViewportModeAction* modeAction = new ViewportModeAction(mainWindow(), tr("Pick in viewport"), this, pickFocalLengthMode);
layout->addWidget(modeAction->createPushButton(), 0, 2);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment