Commit 8d865a07 authored by Emmanuel Promayon's avatar Emmanuel Promayon

FIXED code cleaning

parent 78d67341
...@@ -145,13 +145,13 @@ void MeshComponent::init() { ...@@ -145,13 +145,13 @@ void MeshComponent::init() {
// build the selection widget // build the selection widget
auto* hbox = new QVBoxLayout(selectionWidget); auto* hbox = new QVBoxLayout(selectionWidget);
auto* selectionToolBar = new QToolBar(selectionWidget); auto* selectionToolbar = new QToolBar(selectionWidget);
selectionToolBar->addAction(removeSelections); selectionToolbar->addAction(removeSelections);
selectionToolBar->addAction(mergeSelection); selectionToolbar->addAction(mergeSelection);
selectionToolBar->addAction(inspectSelection); selectionToolbar->addAction(inspectSelection);
selectionToolBar->addWidget(insertionPolicyBox); selectionToolbar->addWidget(insertionPolicyBox);
hbox->addWidget(selectionView); hbox->addWidget(selectionView);
hbox->addWidget(selectionToolBar); hbox->addWidget(selectionToolbar);
selectionWidget->setLayout(hbox); selectionWidget->setLayout(hbox);
// data widget // data widget
...@@ -200,13 +200,13 @@ void MeshComponent::init() { ...@@ -200,13 +200,13 @@ void MeshComponent::init() {
// build the data widget // build the data widget
auto* dataBox = new QVBoxLayout(dataWidget); auto* dataBox = new QVBoxLayout(dataWidget);
auto* dataToolBar = new QToolBar(dataWidget); auto* dataToolbar = new QToolBar(dataWidget);
dataToolBar->addAction(removeData); dataToolbar->addAction(removeData);
dataToolBar->addAction(inspectData); dataToolbar->addAction(inspectData);
dataToolBar->addWidget(displayTypePolicyBox); dataToolbar->addWidget(displayTypePolicyBox);
dataToolBar->addWidget(vectorRepresentationPolicyBox); dataToolbar->addWidget(vectorRepresentationPolicyBox);
dataBox->addWidget(dataView); dataBox->addWidget(dataView);
dataBox->addWidget(dataToolBar); dataBox->addWidget(dataToolbar);
dataWidget->setLayout(dataBox); dataWidget->setLayout(dataBox);
} }
......
...@@ -206,7 +206,7 @@ InteractiveViewer::InteractiveViewer(QString& name, ViewerType type) : Viewer(na ...@@ -206,7 +206,7 @@ InteractiveViewer::InteractiveViewer(QString& name, ViewerType type) : Viewer(na
//-- create the slice slider if needed //-- create the slice slider if needed
viewerMenu = nullptr; viewerMenu = nullptr;
viewerToolBar = nullptr; viewerToolbar = nullptr;
screenshotActionMenu = nullptr; screenshotActionMenu = nullptr;
displayedTopLevelComponents = 0; displayedTopLevelComponents = 0;
...@@ -214,14 +214,12 @@ InteractiveViewer::InteractiveViewer(QString& name, ViewerType type) : Viewer(na ...@@ -214,14 +214,12 @@ InteractiveViewer::InteractiveViewer(QString& name, ViewerType type) : Viewer(na
pickingEffectIsSelecting = true; // default effect pickingEffectIsSelecting = true; // default effect
isPicking = false; // by default, viewer is not picking isPicking = false; // by default, viewer is not picking
if (myType == SLICE_VIEWER) if (myType == SLICE_VIEWER) {
// by default, the 2D scenes are set to pick slice pixels // by default, the 2D scenes are set to pick slice pixels
{
initPicking(InteractiveViewer::PIXEL_PICKING); initPicking(InteractiveViewer::PIXEL_PICKING);
} }
else else {
// no picking // no picking
{
initPicking(InteractiveViewer::NO_PICKING); initPicking(InteractiveViewer::NO_PICKING);
} }
...@@ -246,8 +244,8 @@ InteractiveViewer::~InteractiveViewer() { ...@@ -246,8 +244,8 @@ InteractiveViewer::~InteractiveViewer() {
delete viewerMenu; delete viewerMenu;
viewerMenu = nullptr; viewerMenu = nullptr;
delete viewerToolBar; delete viewerToolbar;
viewerToolBar = nullptr; viewerToolbar = nullptr;
delete frame; delete frame;
frame = nullptr; frame = nullptr;
...@@ -474,9 +472,7 @@ QWidget* InteractiveViewer::getWidget(QWidget* parent) { ...@@ -474,9 +472,7 @@ QWidget* InteractiveViewer::getWidget(QWidget* parent) {
else { else {
if (frame->parentWidget() != parent) { if (frame->parentWidget() != parent) {
bool isVisible = frame->isVisible(); bool isVisible = frame->isVisible();
//frame->parentWidget()->layout()->removeWidget(frame);
frame->setParent(parent); frame->setParent(parent);
//parent->layout()->addWidget(frame);
frame->setVisible(isVisible); frame->setVisible(isVisible);
} }
} }
...@@ -763,37 +759,36 @@ QMenu* InteractiveViewer::getMenu() { ...@@ -763,37 +759,36 @@ QMenu* InteractiveViewer::getMenu() {
// ---------------------- getToolBar ---------------------------- // ---------------------- getToolBar ----------------------------
QToolBar* InteractiveViewer::getToolBar() { QToolBar* InteractiveViewer::getToolBar() {
if (frame && !viewerToolBar) { if (frame && !viewerToolbar) {
if (myType == GEOMETRY_VIEWER) { if (myType == GEOMETRY_VIEWER) {
viewerToolBar = new QToolBar(objectName() + " ToolBar"); viewerToolbar = new QToolBar(objectName() + " Toolbar");
// ensure object name is set for saving the state // ensure object name is set for saving the state
viewerToolBar->setObjectName(objectName() + " ToolBar"); viewerToolbar->setObjectName(objectName() + " Toolbar");
viewerToolBar->addAction(pickPointAction); viewerToolbar->addAction(pickPointAction);
viewerToolBar->addAction(pickCellAction); viewerToolbar->addAction(pickCellAction);
viewerToolBar->addAction(pickPointRegionAction); viewerToolbar->addAction(pickPointRegionAction);
viewerToolBar->addAction(pickCellRegionAction); viewerToolbar->addAction(pickCellRegionAction);
viewerToolBar->addSeparator(); viewerToolbar->addSeparator();
viewerToolBar->addAction(surfaceAction); viewerToolbar->addAction(surfaceAction);
viewerToolBar->addAction(wireframeAction); viewerToolbar->addAction(wireframeAction);
viewerToolBar->addAction(pointsAction); viewerToolbar->addAction(pointsAction);
if (colorAction) { if (colorAction) {
viewerToolBar->addAction(colorAction); viewerToolbar->addAction(colorAction);
} }
viewerToolBar->addAction(glyphAction); viewerToolbar->addAction(glyphAction);
viewerToolBar->addAction(toggleLabelAction); viewerToolbar->addAction(toggleLabelAction);
viewerToolBar->addSeparator();
viewerToolBar->addAction(toggleAxesAction); viewerToolbar->addSeparator();
viewerToolBar->addAction(screenshotAction); viewerToolbar->addAction(toggleAxesAction);
viewerToolbar->addAction(screenshotAction);
viewerToolBar->addSeparator(); viewerToolbar->addSeparator();
viewerToolBar->addAction(scalarDataColorAction); viewerToolbar->addAction(scalarDataColorAction);
} }
/* if (myType == SLICE_VIEWER) { /* if (myType == SLICE_VIEWER) {
viewerToolBar->addAction(toggleOrientationDecorationsAction); viewerToolBar->addAction(toggleOrientationDecorationsAction);
...@@ -801,7 +796,7 @@ QToolBar* InteractiveViewer::getToolBar() { ...@@ -801,7 +796,7 @@ QToolBar* InteractiveViewer::getToolBar() {
*/ */
} }
return viewerToolBar; return viewerToolbar;
} }
// ---------------------- initActions ---------------------------- // ---------------------- initActions ----------------------------
...@@ -854,7 +849,7 @@ void InteractiveViewer::initActions() { ...@@ -854,7 +849,7 @@ void InteractiveViewer::initActions() {
scalarDataModel = new MeshDataFilterModel(MeshComponent::POINTS | MeshComponent::CELLS, MeshComponent::SCALARS, this); scalarDataModel = new MeshDataFilterModel(MeshComponent::POINTS | MeshComponent::CELLS, MeshComponent::SCALARS, this);
// combo box for viewing the scalar data model // combo box for viewing the scalar data model
scalarDataComboBox = new QComboBox(viewerToolBar); scalarDataComboBox = new QComboBox(viewerToolbar);
scalarDataComboBox->setModel(scalarDataModel); scalarDataComboBox->setModel(scalarDataModel);
scalarDataComboBox->setMinimumWidth(150); scalarDataComboBox->setMinimumWidth(150);
......
...@@ -436,7 +436,7 @@ protected: ...@@ -436,7 +436,7 @@ protected:
QMenu* viewerMenu; QMenu* viewerMenu;
/// the QToolBar for the InteractiveViewer /// the QToolBar for the InteractiveViewer
QToolBar* viewerToolBar; QToolBar* viewerToolbar;
/// the ComboBox for mesh scalar data /// the ComboBox for mesh scalar data
QComboBox* scalarDataComboBox; QComboBox* scalarDataComboBox;
......
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