/****************************************************************************** * Sets up the UI widgets of the editor. ******************************************************************************/ void SimulationCellDisplayEditor::createUI(const RolloutInsertionParameters& rolloutParams) { // Create a rollout. QWidget* rollout = createRollout(tr("Simulation cell"), rolloutParams); // Create the rollout contents. QGridLayout* layout = new QGridLayout(rollout); layout->setContentsMargins(4,4,4,4); layout->setSpacing(4); layout->setColumnStretch(1, 1); // Render cell BooleanParameterUI* renderCellUI = new BooleanParameterUI(this, PROPERTY_FIELD(SimulationCellDisplay::_renderSimulationCell)); layout->addWidget(renderCellUI->checkBox(), 0, 0, 1, 2); // Line width FloatParameterUI* scalingFactorUI = new FloatParameterUI(this, PROPERTY_FIELD(SimulationCellDisplay::_simulationCellLineWidth)); layout->addWidget(scalingFactorUI->label(), 1, 0); layout->addLayout(scalingFactorUI->createFieldLayout(), 1, 1); scalingFactorUI->setMinValue(0); // Line color ColorParameterUI* lineColorUI = new ColorParameterUI(this, PROPERTY_FIELD(SimulationCellDisplay::_simulationCellColor)); layout->addWidget(lineColorUI->label(), 2, 0); layout->addWidget(lineColorUI->colorPicker(), 2, 1); }
/****************************************************************************** * Sets up the UI widgets of the editor. ******************************************************************************/ void TrajectoryDisplayEditor::createUI(const RolloutInsertionParameters& rolloutParams) { // Create a rollout. QWidget* rollout = createRollout(tr("Trajectory display"), rolloutParams); // Create the rollout contents. QGridLayout* layout = new QGridLayout(rollout); layout->setContentsMargins(4,4,4,4); layout->setSpacing(4); layout->setColumnStretch(1, 1); // Shading mode. VariantComboBoxParameterUI* shadingModeUI = new VariantComboBoxParameterUI(this, "shadingMode"); shadingModeUI->comboBox()->addItem(tr("Normal"), qVariantFromValue(ArrowPrimitive::NormalShading)); shadingModeUI->comboBox()->addItem(tr("Flat"), qVariantFromValue(ArrowPrimitive::FlatShading)); layout->addWidget(new QLabel(tr("Shading:")), 0, 0); layout->addWidget(shadingModeUI->comboBox(), 0, 1); // Line width. FloatParameterUI* lineWidthUI = new FloatParameterUI(this, PROPERTY_FIELD(TrajectoryDisplay::_lineWidth)); layout->addWidget(lineWidthUI->label(), 1, 0); layout->addLayout(lineWidthUI->createFieldLayout(), 1, 1); lineWidthUI->setMinValue(0); // Line color. ColorParameterUI* lineColorUI = new ColorParameterUI(this, PROPERTY_FIELD(TrajectoryDisplay::_lineColor)); layout->addWidget(lineColorUI->label(), 2, 0); layout->addWidget(lineColorUI->colorPicker(), 2, 1); // Up to current time. BooleanParameterUI* showUpToCurrentTimeUI = new BooleanParameterUI(this, PROPERTY_FIELD(TrajectoryDisplay::_showUpToCurrentTime)); layout->addWidget(showUpToCurrentTimeUI->checkBox(), 3, 0, 1, 2); }
/****************************************************************************** * Sets up the UI widgets of the editor. ******************************************************************************/ void VoronoiAnalysisModifierEditor::createUI(const RolloutInsertionParameters& rolloutParams) { // Create a rollout. QWidget* rollout = createRollout(tr("Voronoi analysis"), rolloutParams, "particles.modifiers.voronoi_analysis.html"); // Create the rollout contents. QVBoxLayout* layout = new QVBoxLayout(rollout); layout->setContentsMargins(4,4,4,4); layout->setSpacing(4); QGridLayout* gridlayout = new QGridLayout(); QGridLayout* sublayout; gridlayout->setContentsMargins(4,4,4,4); gridlayout->setSpacing(4); gridlayout->setColumnStretch(1, 1); int row = 0; // Face threshold. FloatParameterUI* faceThresholdPUI = new FloatParameterUI(this, PROPERTY_FIELD(VoronoiAnalysisModifier::_faceThreshold)); gridlayout->addWidget(faceThresholdPUI->label(), row, 0); gridlayout->addLayout(faceThresholdPUI->createFieldLayout(), row++, 1); faceThresholdPUI->setMinValue(0); // Compute indices. BooleanGroupBoxParameterUI* computeIndicesPUI = new BooleanGroupBoxParameterUI(this, PROPERTY_FIELD(VoronoiAnalysisModifier::_computeIndices)); gridlayout->addWidget(computeIndicesPUI->groupBox(), row++, 0, 1, 2); sublayout = new QGridLayout(computeIndicesPUI->childContainer()); sublayout->setContentsMargins(4,4,4,4); sublayout->setSpacing(4); sublayout->setColumnStretch(1, 1); // Edge count parameter. IntegerParameterUI* edgeCountPUI = new IntegerParameterUI(this, PROPERTY_FIELD(VoronoiAnalysisModifier::_edgeCount)); sublayout->addWidget(edgeCountPUI->label(), 0, 0); sublayout->addLayout(edgeCountPUI->createFieldLayout(), 0, 1); edgeCountPUI->setMinValue(3); edgeCountPUI->setMaxValue(18); // Edge threshold. FloatParameterUI* edgeThresholdPUI = new FloatParameterUI(this, PROPERTY_FIELD(VoronoiAnalysisModifier::_edgeThreshold)); sublayout->addWidget(edgeThresholdPUI->label(), 1, 0); sublayout->addLayout(edgeThresholdPUI->createFieldLayout(), 1, 1); edgeThresholdPUI->setMinValue(0); // Atomic radii. BooleanParameterUI* useRadiiPUI = new BooleanParameterUI(this, PROPERTY_FIELD(VoronoiAnalysisModifier::_useRadii)); gridlayout->addWidget(useRadiiPUI->checkBox(), row++, 0, 1, 2); // Only selected particles. BooleanParameterUI* onlySelectedPUI = new BooleanParameterUI(this, PROPERTY_FIELD(VoronoiAnalysisModifier::_onlySelected)); gridlayout->addWidget(onlySelectedPUI->checkBox(), row++, 0, 1, 2); layout->addLayout(gridlayout); // Status label. layout->addSpacing(6); layout->addWidget(statusLabel()); }
/****************************************************************************** * Sets up the UI widgets of the editor. ******************************************************************************/ void DislocationNetworkEditor::createUI(const RolloutInsertionParameters& rolloutParams) { // Create a rollout. QWidget* rollout = createRollout(tr("Dislocations"), rolloutParams); QVBoxLayout* rolloutLayout = new QVBoxLayout(rollout); QPushButton* openInspectorButton = new QPushButton(tr("Open Dislocation Inspector"), rollout); rolloutLayout->addWidget(openInspectorButton); connect(openInspectorButton, &QPushButton::clicked, this, &DislocationNetworkEditor::onOpenInspector); }
/****************************************************************************** * Sets up the UI widgets of the editor. ******************************************************************************/ void CreateBondsModifierEditor::createUI(const RolloutInsertionParameters& rolloutParams) { // Create a rollout. QWidget* rollout = createRollout(tr("Create bonds"), rolloutParams, "particles.modifiers.create_bonds.html"); // Create the rollout contents. QVBoxLayout* layout1 = new QVBoxLayout(rollout); layout1->setContentsMargins(4,4,4,4); layout1->setSpacing(6); QGridLayout* gridlayout = new QGridLayout(); gridlayout->setContentsMargins(0,0,0,0); gridlayout->setColumnStretch(1, 1); IntegerRadioButtonParameterUI* cutoffModePUI = new IntegerRadioButtonParameterUI(this, PROPERTY_FIELD(CreateBondsModifier::_cutoffMode)); QRadioButton* uniformCutoffModeBtn = cutoffModePUI->addRadioButton(CreateBondsModifier::UniformCutoff, tr("Uniform cutoff radius")); // Cutoff parameter. FloatParameterUI* cutoffRadiusPUI = new FloatParameterUI(this, PROPERTY_FIELD(CreateBondsModifier::_uniformCutoff)); gridlayout->addWidget(uniformCutoffModeBtn, 0, 0); gridlayout->addLayout(cutoffRadiusPUI->createFieldLayout(), 0, 1); cutoffRadiusPUI->setMinValue(0); cutoffRadiusPUI->setEnabled(false); connect(uniformCutoffModeBtn, &QRadioButton::toggled, cutoffRadiusPUI, &FloatParameterUI::setEnabled); layout1->addLayout(gridlayout); QRadioButton* pairCutoffModeBtn = cutoffModePUI->addRadioButton(CreateBondsModifier::PairCutoff, tr("Pair-wise cutoff radii:")); layout1->addWidget(pairCutoffModeBtn); _pairCutoffTable = new QTableView(); _pairCutoffTable->verticalHeader()->setVisible(false); _pairCutoffTable->setEnabled(false); _pairCutoffTableModel = new PairCutoffTableModel(_pairCutoffTable); _pairCutoffTable->setModel(_pairCutoffTableModel); connect(pairCutoffModeBtn,&QRadioButton::toggled, _pairCutoffTable, &QTableView::setEnabled); layout1->addWidget(_pairCutoffTable); // Status label. layout1->addSpacing(10); layout1->addWidget(statusLabel()); // Open a sub-editor for the bonds display object. new SubObjectParameterUI(this, PROPERTY_FIELD(CreateBondsModifier::_bondsDisplay), rolloutParams.after(rollout)); // Update pair-wise cutoff table whenever a modifier has been loaded into the editor. connect(this, &CreateBondsModifierEditor::contentsReplaced, this, &CreateBondsModifierEditor::updatePairCutoffList); connect(this, &CreateBondsModifierEditor::contentsChanged, this, &CreateBondsModifierEditor::updatePairCutoffListValues); }
/****************************************************************************** * Sets up the UI widgets of the editor. ******************************************************************************/ void SmoothSurfaceModifierEditor::createUI(const RolloutInsertionParameters& rolloutParams) { // Create the first rollout. QWidget* rollout = createRollout(tr("Smooth surface"), rolloutParams); QGridLayout* layout = new QGridLayout(rollout); layout->setContentsMargins(4,4,4,4); layout->setSpacing(6); layout->setColumnStretch(1, 1); IntegerParameterUI* smoothingLevelUI = new IntegerParameterUI(this, PROPERTY_FIELD(SmoothSurfaceModifier::_smoothingLevel)); layout->addWidget(smoothingLevelUI->label(), 0, 0); layout->addLayout(smoothingLevelUI->createFieldLayout(), 0, 1); smoothingLevelUI->setMinValue(0); }
/****************************************************************************** * Sets up the UI widgets of the editor. ******************************************************************************/ void ParticleDisplayEditor::createUI(const RolloutInsertionParameters& rolloutParams) { // Create a rollout. QWidget* rollout = createRollout(tr("Particle display"), rolloutParams, "display_objects.particles.html"); // Create the rollout contents. QGridLayout* layout = new QGridLayout(rollout); layout->setContentsMargins(4,4,4,4); layout->setSpacing(4); layout->setColumnStretch(1, 1); // Shading mode. VariantComboBoxParameterUI* shadingModeUI = new VariantComboBoxParameterUI(this, "shadingMode"); shadingModeUI->comboBox()->addItem(tr("Normal"), qVariantFromValue(ParticlePrimitive::NormalShading)); shadingModeUI->comboBox()->addItem(tr("Flat"), qVariantFromValue(ParticlePrimitive::FlatShading)); layout->addWidget(new QLabel(tr("Shading mode:")), 0, 0); layout->addWidget(shadingModeUI->comboBox(), 0, 1); // Rendering quality. VariantComboBoxParameterUI* renderingQualityUI = new VariantComboBoxParameterUI(this, "renderingQuality"); renderingQualityUI->comboBox()->addItem(tr("Low"), qVariantFromValue(ParticlePrimitive::LowQuality)); renderingQualityUI->comboBox()->addItem(tr("Medium"), qVariantFromValue(ParticlePrimitive::MediumQuality)); renderingQualityUI->comboBox()->addItem(tr("High"), qVariantFromValue(ParticlePrimitive::HighQuality)); renderingQualityUI->comboBox()->addItem(tr("Automatic"), qVariantFromValue(ParticlePrimitive::AutoQuality)); layout->addWidget(new QLabel(tr("Rendering quality:")), 1, 0); layout->addWidget(renderingQualityUI->comboBox(), 1, 1); // Shape. VariantComboBoxParameterUI* particleShapeUI = new VariantComboBoxParameterUI(this, "particleShape"); particleShapeUI->comboBox()->addItem(tr("Spherical"), qVariantFromValue(ParticlePrimitive::SphericalShape)); particleShapeUI->comboBox()->addItem(tr("Square"), qVariantFromValue(ParticlePrimitive::SquareShape)); layout->addWidget(new QLabel(tr("Shape:")), 2, 0); layout->addWidget(particleShapeUI->comboBox(), 2, 1); // Default radius. FloatParameterUI* radiusUI = new FloatParameterUI(this, PROPERTY_FIELD(ParticleDisplay::_defaultParticleRadius)); layout->addWidget(radiusUI->label(), 3, 0); layout->addLayout(radiusUI->createFieldLayout(), 3, 1); radiusUI->setMinValue(0); }
/****************************************************************************** * Sets up the UI widgets of the editor. ******************************************************************************/ void BondAngleAnalysisModifierEditor::createUI(const RolloutInsertionParameters& rolloutParams) { // Create a rollout. QWidget* rollout = createRollout(tr("Bond-angle analysis"), rolloutParams, "particles.modifiers.bond_angle_analysis.html"); // Create the rollout contents. QVBoxLayout* layout1 = new QVBoxLayout(rollout); layout1->setContentsMargins(4,4,4,4); layout1->setSpacing(4); // Status label. layout1->addSpacing(10); layout1->addWidget(statusLabel()); StructureListParameterUI* structureTypesPUI = new StructureListParameterUI(this); layout1->addSpacing(10); layout1->addWidget(new QLabel(tr("Structure types:"))); layout1->addWidget(structureTypesPUI->tableWidget()); QLabel* label = new QLabel(tr("<p style=\"font-size: small;\">Double-click to change colors. Defaults can be set in the application settings.</p>")); label->setWordWrap(true); layout1->addWidget(label); }
/****************************************************************************** * Sets up the UI widgets of the editor. ******************************************************************************/ void BinAndReduceModifierEditor::createUI(const RolloutInsertionParameters& rolloutParams) { // Create a rollout. QWidget* rollout = createRollout(tr("Bin and reduce"), rolloutParams, "particles.modifiers.bin_and_reduce.html"); // Create the rollout contents. QVBoxLayout* layout = new QVBoxLayout(rollout); layout->setContentsMargins(4,4,4,4); layout->setSpacing(4); ParticlePropertyParameterUI* sourcePropertyUI = new ParticlePropertyParameterUI(this, PROPERTY_FIELD(BinAndReduceModifier::_sourceProperty)); layout->addWidget(new QLabel(tr("Particle property:"), rollout)); layout->addWidget(sourcePropertyUI->comboBox()); QGridLayout* gridlayout = new QGridLayout(); gridlayout->addWidget(new QLabel(tr("Reduction operation:"), rollout), 0, 0); VariantComboBoxParameterUI* reductionOperationPUI = new VariantComboBoxParameterUI(this, PROPERTY_FIELD(BinAndReduceModifier::_reductionOperation)); reductionOperationPUI->comboBox()->addItem(tr("mean"), qVariantFromValue(BinAndReduceModifier::RED_MEAN)); reductionOperationPUI->comboBox()->addItem(tr("sum"), qVariantFromValue(BinAndReduceModifier::RED_SUM)); reductionOperationPUI->comboBox()->addItem(tr("sum divided by bin volume"), qVariantFromValue(BinAndReduceModifier::RED_SUM_VOL)); reductionOperationPUI->comboBox()->addItem(tr("min"), qVariantFromValue(BinAndReduceModifier::RED_MIN)); reductionOperationPUI->comboBox()->addItem(tr("max"), qVariantFromValue(BinAndReduceModifier::RED_MAX)); gridlayout->addWidget(reductionOperationPUI->comboBox(), 0, 1); layout->addLayout(gridlayout); gridlayout = new QGridLayout(); gridlayout->addWidget(new QLabel(tr("Binning direction:"), rollout), 0, 0); VariantComboBoxParameterUI* binDirectionPUI = new VariantComboBoxParameterUI(this, PROPERTY_FIELD(BinAndReduceModifier::_binDirection)); binDirectionPUI->comboBox()->addItem("cell vector 1", qVariantFromValue(BinAndReduceModifier::CELL_VECTOR_1)); binDirectionPUI->comboBox()->addItem("cell vector 2", qVariantFromValue(BinAndReduceModifier::CELL_VECTOR_2)); binDirectionPUI->comboBox()->addItem("cell vector 3", qVariantFromValue(BinAndReduceModifier::CELL_VECTOR_3)); binDirectionPUI->comboBox()->addItem("vectors 1 and 2", qVariantFromValue(BinAndReduceModifier::CELL_VECTORS_1_2)); binDirectionPUI->comboBox()->addItem("vectors 1 and 3", qVariantFromValue(BinAndReduceModifier::CELL_VECTORS_1_3)); binDirectionPUI->comboBox()->addItem("vectors 2 and 3", qVariantFromValue(BinAndReduceModifier::CELL_VECTORS_2_3)); gridlayout->addWidget(binDirectionPUI->comboBox(), 0, 1); layout->addLayout(gridlayout); _firstDerivativePUI = new BooleanParameterUI(this, PROPERTY_FIELD(BinAndReduceModifier::_firstDerivative)); _firstDerivativePUI->setEnabled(false); layout->addWidget(_firstDerivativePUI->checkBox()); gridlayout = new QGridLayout(); gridlayout->setContentsMargins(0,0,0,0); gridlayout->setColumnStretch(1, 1); gridlayout->setColumnStretch(2, 1); // Number of bins parameters. IntegerParameterUI* numBinsXPUI = new IntegerParameterUI(this, PROPERTY_FIELD(BinAndReduceModifier::_numberOfBinsX)); gridlayout->addWidget(numBinsXPUI->label(), 0, 0); gridlayout->addLayout(numBinsXPUI->createFieldLayout(), 0, 1); numBinsXPUI->setMinValue(1); _numBinsYPUI = new IntegerParameterUI(this, PROPERTY_FIELD(BinAndReduceModifier::_numberOfBinsY)); gridlayout->addLayout(_numBinsYPUI->createFieldLayout(), 0, 2); _numBinsYPUI->setMinValue(1); _numBinsYPUI->setEnabled(false); layout->addLayout(gridlayout); _averagesPlot = new QCustomPlot(); _averagesPlot->setMinimumHeight(240); _averagesPlot->axisRect()->setRangeDrag(Qt::Vertical); _averagesPlot->axisRect()->setRangeZoom(Qt::Vertical); _averagesPlot->xAxis->setLabel("Position"); connect(_averagesPlot->yAxis, SIGNAL(rangeChanged(const QCPRange&)), this, SLOT(updatePropertyAxisRange(const QCPRange&))); layout->addWidget(new QLabel(tr("Reduction:"))); layout->addWidget(_averagesPlot); connect(this, &BinAndReduceModifierEditor::contentsReplaced, this, &BinAndReduceModifierEditor::plotData); QPushButton* saveDataButton = new QPushButton(tr("Save data")); layout->addWidget(saveDataButton); connect(saveDataButton, &QPushButton::clicked, this, &BinAndReduceModifierEditor::onSaveData); // Axes. QGroupBox* axesBox = new QGroupBox(tr("Plot axes"), rollout); QVBoxLayout* axesSublayout = new QVBoxLayout(axesBox); axesSublayout->setContentsMargins(4,4,4,4); layout->addWidget(axesBox); BooleanParameterUI* rangeUI = new BooleanParameterUI(this, PROPERTY_FIELD(BinAndReduceModifier::_fixPropertyAxisRange)); axesSublayout->addWidget(rangeUI->checkBox()); QHBoxLayout* hlayout = new QHBoxLayout(); axesSublayout->addLayout(hlayout); FloatParameterUI* startPUI = new FloatParameterUI(this, PROPERTY_FIELD(BinAndReduceModifier::_propertyAxisRangeStart)); FloatParameterUI* endPUI = new FloatParameterUI(this, PROPERTY_FIELD(BinAndReduceModifier::_propertyAxisRangeEnd)); hlayout->addWidget(new QLabel(tr("From:"))); hlayout->addLayout(startPUI->createFieldLayout()); hlayout->addSpacing(12); hlayout->addWidget(new QLabel(tr("To:"))); hlayout->addLayout(endPUI->createFieldLayout()); startPUI->setEnabled(false); endPUI->setEnabled(false); connect(rangeUI->checkBox(), &QCheckBox::toggled, startPUI, &FloatParameterUI::setEnabled); connect(rangeUI->checkBox(), &QCheckBox::toggled, endPUI, &FloatParameterUI::setEnabled); // Status label. layout->addSpacing(6); layout->addWidget(statusLabel()); connect(this, &BinAndReduceModifierEditor::contentsChanged, this, &BinAndReduceModifierEditor::updateWidgets); }
/****************************************************************************** * Sets up the UI widgets of the editor. ******************************************************************************/ void SliceModifierEditor::createUI(const RolloutInsertionParameters& rolloutParams) { // Create a rollout. QWidget* rollout = createRollout(tr("Slice"), rolloutParams, "particles.modifiers.slice.html"); // Create the rollout contents. QVBoxLayout* layout = new QVBoxLayout(rollout); layout->setContentsMargins(4,4,4,4); layout->setSpacing(4); QGridLayout* gridlayout = new QGridLayout(); gridlayout->setContentsMargins(0,0,0,0); gridlayout->setColumnStretch(1, 1); // Distance parameter. FloatParameterUI* distancePUI = new FloatParameterUI(this, PROPERTY_FIELD(SliceModifier::_distanceCtrl)); gridlayout->addWidget(distancePUI->label(), 0, 0); gridlayout->addLayout(distancePUI->createFieldLayout(), 0, 1); // Normal parameter. for(int i = 0; i < 3; i++) { Vector3ParameterUI* normalPUI = new Vector3ParameterUI(this, PROPERTY_FIELD(SliceModifier::_normalCtrl), i); normalPUI->label()->setTextFormat(Qt::RichText); normalPUI->label()->setTextInteractionFlags(Qt::LinksAccessibleByMouse); normalPUI->label()->setText(QStringLiteral("<a href=\"%1\">%2</a>").arg(i).arg(normalPUI->label()->text())); connect(normalPUI->label(), &QLabel::linkActivated, this, &SliceModifierEditor::onXYZNormal); gridlayout->addWidget(normalPUI->label(), i+1, 0); gridlayout->addLayout(normalPUI->createFieldLayout(), i+1, 1); } // Slice width parameter. FloatParameterUI* widthPUI = new FloatParameterUI(this, PROPERTY_FIELD(SliceModifier::_widthCtrl)); gridlayout->addWidget(widthPUI->label(), 4, 0); gridlayout->addLayout(widthPUI->createFieldLayout(), 4, 1); widthPUI->setMinValue(0); layout->addLayout(gridlayout); layout->addSpacing(8); // Invert parameter. BooleanParameterUI* invertPUI = new BooleanParameterUI(this, PROPERTY_FIELD(SliceModifier::_inverse)); layout->addWidget(invertPUI->checkBox()); // Create selection parameter. BooleanParameterUI* createSelectionPUI = new BooleanParameterUI(this, PROPERTY_FIELD(SliceModifier::_createSelection)); layout->addWidget(createSelectionPUI->checkBox()); // Apply to selection only parameter. BooleanParameterUI* applyToSelectionPUI = new BooleanParameterUI(this, PROPERTY_FIELD(SliceModifier::_applyToSelection)); layout->addWidget(applyToSelectionPUI->checkBox()); layout->addSpacing(8); QPushButton* centerPlaneBtn = new QPushButton(tr("Move plane to simulation box center"), rollout); connect(centerPlaneBtn, &QPushButton::clicked, this, &SliceModifierEditor::onCenterOfBox); layout->addWidget(centerPlaneBtn); // Add buttons for view alignment functions. QPushButton* alignViewToPlaneBtn = new QPushButton(tr("Align view direction to plane normal"), rollout); connect(alignViewToPlaneBtn, &QPushButton::clicked, this, &SliceModifierEditor::onAlignViewToPlane); layout->addWidget(alignViewToPlaneBtn); QPushButton* alignPlaneToViewBtn = new QPushButton(tr("Align plane normal to view direction"), rollout); connect(alignPlaneToViewBtn, &QPushButton::clicked, this, &SliceModifierEditor::onAlignPlaneToView); layout->addWidget(alignPlaneToViewBtn); _pickParticlePlaneInputMode = new PickParticlePlaneInputMode(this); _pickParticlePlaneInputModeAction = new ViewportModeAction(mainWindow(), tr("Pick three particles"), this, _pickParticlePlaneInputMode); layout->addWidget(_pickParticlePlaneInputModeAction->createPushButton()); // Deactivate input mode when editor is reset. connect(this, &PropertiesEditor::contentsReplaced, _pickParticlePlaneInputModeAction, &ViewportModeAction::deactivateMode); // Status label. layout->addSpacing(12); layout->addWidget(statusLabel()); }