Skip to content

Commit

Permalink
Merge topic 'fix-multi-block-issues'
Browse files Browse the repository at this point in the history
ebf184d Fix bug when setting color for multi-block data sets
ddb0cdf Add 'Show All Blocks' button to context-menu
  • Loading branch information
utkarshayachit authored and kwrobot committed May 24, 2013
2 parents c80f93f + ebf184d commit 6f72060
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 1 deletion.
20 changes: 19 additions & 1 deletion Qt/ApplicationComponents/pqPipelineContextMenuBehavior.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,11 @@ void pqPipelineContextMenuBehavior::buildMenu(pqDataRepresentation* repr,
this->connect(showOnlyBlockAction, SIGNAL(triggered()),
this, SLOT(showOnlyBlock()));

QAction *showAllBlocksAction =
this->Menu->addAction("Show All Blocks");
this->connect(showAllBlocksAction, SIGNAL(triggered()),
this, SLOT(showAllBlocks()));

QAction *unsetVisibilityAction =
this->Menu->addAction(QString("Unset Block %1")
.arg(multipleBlocks ? "Visibilities" : "Visibility"));
Expand Down Expand Up @@ -491,6 +496,16 @@ void pqPipelineContextMenuBehavior::showOnlyBlock()
}
}

//-----------------------------------------------------------------------------
void pqPipelineContextMenuBehavior::showAllBlocks()
{
pqMultiBlockInspectorPanel *panel = getMultiBlockInspectorPanel();
if (panel)
{
panel->showAllBlocks();
}
}

//-----------------------------------------------------------------------------
void pqPipelineContextMenuBehavior::unsetBlockVisibility()
{
Expand Down Expand Up @@ -520,7 +535,10 @@ void pqPipelineContextMenuBehavior::setBlockColor()
if (panel)
{
QColor color = QColorDialog::getColor(Qt::gray);
panel->setBlockColor(this->PickedBlocks, color);
if(color.isValid())
{
panel->setBlockColor(this->PickedBlocks, color);
}
}
}

Expand Down
3 changes: 3 additions & 0 deletions Qt/ApplicationComponents/pqPipelineContextMenuBehavior.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ protected slots:
/// signal will contain the block index in its data().
void showOnlyBlock();

/// called to show all blocks.
void showAllBlocks();

/// called to unset the visibility flag for the block. after this call the
/// block will inherit the visibility from its parent. the action which
/// emits the signal will contain the block index in its data()
Expand Down
9 changes: 9 additions & 0 deletions Qt/Components/pqMultiBlockInspectorPanel.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,15 @@ void pqMultiBlockInspectorPanel::showOnlyBlock(unsigned int index)
this->showOnlyBlocks(indices);
}

//-----------------------------------------------------------------------------
void pqMultiBlockInspectorPanel::showAllBlocks()
{
this->BlockVisibilites.clear();
this->BlockVisibilites[0] = true; // show root block
this->updateBlockVisibilities();
this->Representation->renderViewEventually();
}

//-----------------------------------------------------------------------------
void pqMultiBlockInspectorPanel::showOnlyBlocks(
const QList<unsigned int>& indices)
Expand Down
1 change: 1 addition & 0 deletions Qt/Components/pqMultiBlockInspectorPanel.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public slots:

void showOnlyBlock(unsigned int index);
void showOnlyBlocks(const QList<unsigned int>& indices);
void showAllBlocks();

private slots:
void treeWidgetCustomContextMenuRequested(const QPoint &pos);
Expand Down

0 comments on commit 6f72060

Please sign in to comment.