Commit d6aee926 authored by Emmanuel Promayon's avatar Emmanuel Promayon
Browse files

UPDATED stage 2: CamiTK open-source build OK

parent 790bcfa9
......@@ -72,7 +72,7 @@ Action::ApplyStatus OpenAction::apply() {
filter += QString ("All known files (*.") + ExtensionManager::getFileExtensions().join(" *.") + ");;";
// add the extension of loaded and valid plugins
foreach(ComponentExtension * ext, ExtensionManager::getComponentExtensions().values().toSet()) {
foreach(ComponentExtension * ext, ExtensionManager::getComponentExtensionsList()) {
filter += ext->getName() + " (*." + ext->getFileExtensions().join(" *.") + ");;";
}
......
......@@ -126,15 +126,14 @@ Action::ApplyStatus OpenFile::apply() {
// --------------- selectFile -------------------
void OpenFile::selectFile() {
// filter: extension of known file format
// filter: extension of known file format, example: (*.xml *.vtk *.wrl)
QString filter;
QString allKnownFiles; //example: (*.xml *.vtk *.wrl)
// first item = all known files
filter += QString ("All known files (*.") + ExtensionManager::getFileExtensions().join(" *.") + ");;";
// add the extension of loaded and valid plugins
foreach(ComponentExtension * ext, ExtensionManager::getComponentExtensions().values().toSet()) {
foreach(ComponentExtension * ext, ExtensionManager::getComponentExtensionsList()) {
filter += ext->getName() + " (*." + ext->getFileExtensions().join(" *.") + ");;";
}
......
......@@ -91,7 +91,7 @@ Action::ApplyStatus SaveAsAction::apply() {
const ImageComponent* compAsImg = dynamic_cast<const ImageComponent*> ( comp );
if (compAsImg) {
foreach (ComponentExtension * pl, ExtensionManager::getComponentExtensions().values().toSet()) {
foreach (ComponentExtension * pl, ExtensionManager::getComponentExtensionsList()) {
const ImageComponentExtension* imageExt = dynamic_cast<const ImageComponentExtension*> (pl);
if (imageExt) {
......@@ -109,7 +109,7 @@ Action::ApplyStatus SaveAsAction::apply() {
const MeshComponent* compAsMesh = dynamic_cast<const MeshComponent*> ( comp );
if (compAsMesh) {
foreach (ComponentExtension * pl, ExtensionManager::getComponentExtensions().values().toSet()) {
foreach (ComponentExtension * pl, ExtensionManager::getComponentExtensionsList()) {
const ComponentExtension* meshExt = dynamic_cast<const MeshComponentExtension*> (pl);
if (meshExt) {
......
......@@ -32,7 +32,7 @@
using namespace camitk;
//-------------------------- Constructor ---------------------
PickedPixelMap::PickedPixelMap (ImageComponent* imageComp) {
PickedPixelMap::PickedPixelMap(ImageComponent* imageComp) {
image = imageComp;
pixelIndexList = new QList<QVector3D>();
coordIndexList = new QList<QVector3D>();
......@@ -109,7 +109,7 @@ QList<QVector3D>* PickedPixelMap::getRealWorldList() {
}
//-------------- modifyPixel -----------------------------------
void PickedPixelMap::modifyPixel (int index) {
void PickedPixelMap::modifyPixel(int index) {
if ((index >= 0) && (index < pixelIndexList->size())) {
// get the last picked pixel index
int i, j, k;
......@@ -141,9 +141,9 @@ void PickedPixelMap::modifyPixel (int index) {
}
//------------------ removePixel ----------------------------
void PickedPixelMap::removePixel (int index) {
void PickedPixelMap::removePixel(int index) {
if (index >= 0 && index < pixelIndexList->size()) {
pixelIndexList->removeAt (index);
pixelIndexList->removeAt(index);
coordIndexList->removeAt(index);
realCoordList->removeAt(index);
pixelValueList->removeAt(index);
......@@ -151,9 +151,9 @@ void PickedPixelMap::removePixel (int index) {
}
//------------------ savePixelList ---------------------
void PickedPixelMap::savePixelList (QString fileName) {
void PickedPixelMap::savePixelList(QString fileName) {
//-- prepare filename (add .csv if needed)
QFileInfo fileNameInfo (fileName);
QFileInfo fileNameInfo(fileName);
if (fileNameInfo.suffix() != "csv") {
fileName += ".csv";
......@@ -166,7 +166,7 @@ void PickedPixelMap::savePixelList (QString fileName) {
// open the file to write
char separator = ',';
myFile.open (fileName.toStdString().c_str());
myFile.open(fileName.toStdString().c_str());
myFile << "index" << separator << "i" << separator << "j" << separator << "k" << separator << "x" << separator << "y" << separator << "z" << separator << "rx" << separator << "ry" << separator << "rz" << separator << "val" << endl;
if (pixelIndexList != NULL) {
......@@ -198,7 +198,8 @@ void PickedPixelMap::savePixelList (QString fileName) {
myFile.close();
}
void PickedPixelMap::openPixelList (QString fileName) {
//----------------- openPixelList -------------------
void PickedPixelMap::openPixelList(QString fileName) {
// Read the input file
QFile file(fileName);
......@@ -225,7 +226,7 @@ void PickedPixelMap::openPixelList (QString fileName) {
QStringList liste = line.split(",");
QString s = liste.at(0);
if ( (s != QString("index")) && (liste.size() == 11)) {
if ((s != QString("index")) && (liste.size() == 11)) {
s = liste.at(1);
i = s.toInt();
s = liste.at(2);
......@@ -249,7 +250,7 @@ void PickedPixelMap::openPixelList (QString fileName) {
//insert the new points in the list
int whereToInsert = pixelIndexList->size();
pixelIndexList->insert (whereToInsert, QVector3D(i, j, k));
pixelIndexList->insert(whereToInsert, QVector3D(i, j, k));
coordIndexList->insert(whereToInsert, QVector3D(x, y, z));
realCoordList->insert(whereToInsert, QVector3D(rx, ry, rz));
pixelValueList->insert(whereToInsert, val);
......@@ -272,13 +273,3 @@ void PickedPixelMap::resetPixelList() {
pixelValueList->clear();
}
//----------------- changePixelIndexList -------------------
void PickedPixelMap::changePixelIndexList(QList<QVector3D>* liste) {
resetPixelList();
}
//----------------- changePixelIndexListFromRealCoordinates -------------------
void PickedPixelMap::changePixelIndexListFromRealCoordinates(QList<QVector3D>* listeOfRealCoords) {
resetPixelList();
}
......@@ -78,7 +78,7 @@ ImpMainWindow::ImpMainWindow() : MainWindow( "imp" ) {
addDockViewer(Qt::LeftDockWidgetArea, Explorer::getInstance());
addDockViewer(Qt::LeftDockWidgetArea, FrameExplorer::getInstance());
addDockViewer(Qt::LeftDockWidgetArea, PropertyExplorer::getInstance());
addDockViewer(Qt::RightDockWidgetArea, ActionViewer::getActionViewer());
addDockViewer(Qt::RightDockWidgetArea, ActionViewer::getInstance());
//Merge Explorer and FrameExplorer viewers in one layout
QDockWidget* dockWidgetExplorer = dockWidgetMap.value(Explorer::getInstance(), NULL);
......@@ -88,8 +88,8 @@ ImpMainWindow::ImpMainWindow() : MainWindow( "imp" ) {
dockWidgetExplorer->raise();
}
showViewer(ActionViewer::getActionViewer(), false);
ActionViewer::getActionViewer()->setSearchPanelVisible(true);
showViewer(ActionViewer::getInstance(), false);
ActionViewer::getInstance()->setSearchPanelVisible(true);
showStatusBar(true);
}
......@@ -140,7 +140,7 @@ void ImpMainWindow::setCentralViewer ( Viewer* theViewer ) {
void ImpMainWindow::initActions() {
//-- Check for action applications
ActionExtension* applicationActionExtension = NULL;
QListIterator<ActionExtension*> it(ExtensionManager::getActionExtensions().values());
QListIterator<ActionExtension*> it(ExtensionManager::getActionExtensionsList());
while (it.hasNext() && applicationActionExtension == NULL) {
ActionExtension* current = it.next();
if (current->getName() == "Application Level Action Extension") {
......@@ -401,7 +401,7 @@ void ImpMainWindow::resetWindows() {
addDockWidget(Qt::LeftDockWidgetArea, it.value() );
it.value()->show();
}
else if (it.value()->widget() == ActionViewer::getActionViewer()->getWidget()) {
else if (it.value()->widget() == ActionViewer::getInstance()->getWidget()) {
removeDockWidget(it.value());
addDockWidget(Qt::RightDockWidgetArea, it.value());
it.value()->show();
......
......@@ -102,7 +102,7 @@ void MyAppMainWindow::updateActionStates() {
if ( nrOfSelectedItems > 0 ) {
Component* comp = Application::getSelectedComponents().last();
if (comp) {
QMenu* compActionsMenu = comp->getActionAndPopupMenu();
QMenu* compActionsMenu = comp->getActionMenu();
if (compActionsMenu) {
actionMenu->addActions(compActionsMenu->actions());
actionMenu->setEnabled ( true );
......
......@@ -53,8 +53,8 @@ int main ( int argc, char* argv[] ) {
//ExtensionManager::loadActionExtension(actionsDir.absoluteFilePath("libapplication.so"));
// open an image volume
ComponentExtension* cp = ExtensionManager::getComponentExtensions().value("mha");
Component* comp = cp->open(QFileInfo(Core::getTestDataDir() + "/brain.mha").absoluteFilePath());
ComponentExtension* cp = ExtensionManager::getComponentExtension("mha");
cp->open(QFileInfo(Core::getTestDataDir() + "/brain.mha").absoluteFilePath());
return app.exec();
}
......
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