Commit c0f467dc authored by saubatn's avatar saubatn
Browse files

FIXED Axial picking bug (which I was unable to reproduce). Add...

FIXED Axial picking bug (which I was unable to reproduce). Add PropertyExplorer public selecting tab methods. Remove status bar message when picking, display ImageComponent selection tab in the property explorer instead.

git-svn-id: svn+ssh://scm.forge.imag.fr/var/lib/gforge/chroot/scmrepos/svn/camitk/trunk/camitk@1572 ec899d31-69d1-42ba-9299-647d76f65fb3
parent 5ce4f05d
......@@ -31,6 +31,7 @@
// -- Core stuff
#include "Application.h"
#include "InteractiveViewer.h"
#include <PropertyExplorer.h>
#include "Log.h"
#include "MeshComponent.h"
#include "Property.h"
......@@ -536,20 +537,7 @@ void ImageComponent::pixelPicked(double x, double y, double z, SingleImageCompon
child->setSlice(x, y, z);
}
}
QString pickMessage = "Value: " + QString::number(originalImageData->GetScalarComponentAsDouble(i, j, k, 0)).rightJustified(5,' ') + " ";
pickMessage += "Voxel( " + QString::number(i).rightJustified(3,' ') + ", "
+ QString::number(j).rightJustified(3,' ') + ", "
+ QString::number(k).rightJustified(3,' ') + ") ";
pickMessage += "Img coords: (" + QString::number(x, 'f', 2).rightJustified(3,' ') + ", "
+ QString::number(y, 'f', 2).rightJustified(3,' ') + ", "
+ QString::number(z, 'f', 2).rightJustified(3,' ') + ") ";
pickMessage += "World Coords: (" + QString::number(wx, 'f', 2).rightJustified(3,' ') + ", "
+ QString::number(wy, 'f', 2).rightJustified(3,' ') + ", "
+ QString::number(wz, 'f', 2).rightJustified(3,' ') + ") ";
// Show picked pixel data in the bottom left of the window
Application::showStatusBarMessage(pickMessage);
// Show picked pixel data in Selection property tab
model->setData(model->index(0, 1), originalImageData->GetScalarComponentAsDouble(i, j, k, 0));
......@@ -563,14 +551,10 @@ void ImageComponent::pixelPicked(double x, double y, double z, SingleImageCompon
model->setData(model->index(8, 1), wy);
model->setData(model->index(9, 1), wz);
selectionView->setModel(model);
// Display the selection tab in the property explorer
PropertyExplorer::getInstance()->selectWidget(selectionView);
/*
Application::showStatusBarMessage("Pixel (" + QString::number(currentPixelPicked[0]).rightJustified(3,' ') + ","
+ QString::number(currentPixelPicked[1]).rightJustified(3,' ') + ","
+ QString::number(currentPixelPicked[2]).rightJustified(3,' ') + "), "
+ "value: " + QString::number(originalImageData->GetScalarComponentAsDouble(currentPixelPicked[0], currentPixelPicked[1], currentPixelPicked[2], 0)));
*/
}
// -------------------- getNumberOfColors --------------------
......
......@@ -283,11 +283,11 @@ private:
//@endcond
/// tab displaying data selected point
QTableView* selectionView;
/// Tab displaying data selected point in the property explorer
QTableView* selectionView;
// model to display data
QStandardItemModel *model;
/// Model to display data
QStandardItemModel *model;
};
......
......@@ -197,5 +197,29 @@ void PropertyExplorer::clear() {
currentComponent = NULL;
}
// ---------------- selectWidget ----------------
void PropertyExplorer::selectWidget(QWidget* widget)
{
// get the last component tab widgets
QWidget * customWidget;
for (unsigned int i=0; i < this->tabWidget->count(); i++)
{
customWidget = this->tabWidget->widget(i);
if (customWidget && (customWidget == widget))
{
this->tabWidget->setCurrentWidget(widget);
return;
}
}
}
// ---------------- selectIndex ----------------
void PropertyExplorer::selectIndex(unsigned int index)
{
if ((index >= 0) && (index < this->tabWidget->count()))
this->tabWidget->setCurrentIndex(index);
}
}
......@@ -39,6 +39,7 @@
// -- QT stuff classes
class QTabWidget;
class QPushButton;
class QWidget;
namespace camitk {
......@@ -94,7 +95,7 @@ public:
/// destructor
virtual ~PropertyExplorer();
/// returns the unique instance of ActionViewer
/// returns the unique instance of the PropertyExplorer
static PropertyExplorer* getInstance();
///@}
......@@ -124,6 +125,22 @@ public:
void setViewMode(ObjectController::ViewMode);
///@}
///@name Tab selection management
///@{
/// Select the tab containing the given widget in the PropertyExplorer.
/// @param widget the PropertyExplorer's widget of the tab to select.
/// @note the widget must have been previously added to the PropertyExplorer.
void selectWidget(QWidget* widget);
/// Select the tab of the given index in the PropertyExplorer.
/// @param index the index of the tab to display.
/// @note 0 <= index < currentComponent->getNumberOfPropertyWidget() else nothing is done
void selectIndex(unsigned int index);
///@}
private:
/// the widgets
......
Supports Markdown
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