Commit e2ffebde authored by finetjul's avatar finetjul
Browse files

ENH: Propagate renaming that occured in CTK: ctkSliderSpinBoxWidget->ctkSliderWidget

git-svn-id: http://svn.slicer.org/Slicer4/trunk@14487 3bd1e089-480b-0410-8dfb-8563597acbee
parent 5d419e67
......@@ -19,8 +19,8 @@
#include "qSlicerCLIModuleFactoryHelper.h"
//-----------------------------------------------------------------------------
qSlicerCLIExecutableModuleFactoryItem::qSlicerCLIExecutableModuleFactoryItem(const QString& itemKey,
const QString& itemPath):Superclass(itemKey),Path(itemPath)
qSlicerCLIExecutableModuleFactoryItem::qSlicerCLIExecutableModuleFactoryItem(
const QString& itemPath):Superclass(),Path(itemPath)
{
}
......@@ -31,7 +31,7 @@ bool qSlicerCLIExecutableModuleFactoryItem::load()
}
//-----------------------------------------------------------------------------
QString qSlicerCLIExecutableModuleFactoryItem::path()
QString qSlicerCLIExecutableModuleFactoryItem::path()const
{
return this->Path;
}
......@@ -65,6 +65,13 @@ void qSlicerCLIExecutableModuleFactory::registerItems()
}
//-----------------------------------------------------------------------------
ctkAbstractFactoryItem<qSlicerAbstractCoreModule>* qSlicerCLIExecutableModuleFactory
::createFactoryPluginItem(const QFileInfo& plugin)const
{
return new qSlicerCLIExecutableModuleFactoryItem(plugin.filePath());
}
//-----------------------------------------------------------------------------
// QString qSlicerCLIExecutableModuleFactory::objectNameToKey(const QString& objectName)
// {
......
......@@ -27,7 +27,7 @@ class qSlicerCLIExecutableModuleFactoryItem : public ctkAbstractFactoryItem<qSli
{
public:
typedef ctkAbstractFactoryItem<qSlicerAbstractCoreModule> Superclass;
explicit qSlicerCLIExecutableModuleFactoryItem(const QString& itemKey, const QString& itemPath);
explicit qSlicerCLIExecutableModuleFactoryItem(const QString& itemPath);
virtual ~qSlicerCLIExecutableModuleFactoryItem(){}
///
......@@ -35,7 +35,7 @@ public:
///
/// Return path associated with the executable module
QString path();
QString path()const;
protected:
virtual qSlicerAbstractCoreModule* instanciator();
......@@ -50,12 +50,12 @@ class qSlicerCLIExecutableModuleFactoryPrivate;
//-----------------------------------------------------------------------------
class Q_SLICER_BASE_QTCLI_EXPORT qSlicerCLIExecutableModuleFactory :
public ctkAbstractPluginFactory<qSlicerAbstractCoreModule,qSlicerCLIExecutableModuleFactoryItem>
public ctkAbstractPluginFactory<qSlicerAbstractCoreModule>
{
public:
typedef ctkAbstractPluginFactory<qSlicerAbstractCoreModule,
qSlicerCLIExecutableModuleFactoryItem> Superclass;
typedef ctkAbstractPluginFactory<qSlicerAbstractCoreModule> Superclass;
qSlicerCLIExecutableModuleFactory();
virtual ~qSlicerCLIExecutableModuleFactory(){}
......@@ -63,7 +63,7 @@ public:
virtual void registerItems();
///
// virtual QString fileNameToKey(const QString& fileName);
/// virtual QString fileNameToKey(const QString& fileName);
/// Extract module name given \a executableName
/// For example:
......@@ -71,6 +71,9 @@ public:
/// Threshold -> threshold
static QString extractModuleName(const QString& executableName);
protected:
virtual ctkAbstractFactoryItem<qSlicerAbstractCoreModule>* createFactoryPluginItem(
const QFileInfo& plugin)const;
private:
CTK_DECLARE_PRIVATE(qSlicerCLIExecutableModuleFactory);
};
......
......@@ -23,8 +23,11 @@
#include "qSlicerUtils.h"
//-----------------------------------------------------------------------------
qSlicerCLILoadableModuleFactoryItem::qSlicerCLILoadableModuleFactoryItem(const QString& itemKey,
const QString& itemPath):Superclass(itemKey, itemPath){}
qSlicerCLILoadableModuleFactoryItem::qSlicerCLILoadableModuleFactoryItem(
const QString& itemPath)
:Superclass(itemPath)
{
}
//-----------------------------------------------------------------------------
qSlicerAbstractCoreModule* qSlicerCLILoadableModuleFactoryItem::instanciator()
......@@ -32,7 +35,8 @@ qSlicerAbstractCoreModule* qSlicerCLILoadableModuleFactoryItem::instanciator()
qSlicerCLILoadableModule * module = new qSlicerCLILoadableModule();
// Resolves symbol
char* xmlDescription = (char*)this->symbolAddress("XMLModuleDescription");
char* xmlDescription = reinterpret_cast<char*>(
this->symbolAddress("XMLModuleDescription"));
// Retrieve
//if (!xmlDescription) { xmlDescription = xmlFunction ? (*xmlFunction)() : 0; }
......@@ -49,7 +53,8 @@ qSlicerAbstractCoreModule* qSlicerCLILoadableModuleFactoryItem::instanciator()
// Resolves symbol
qSlicerCLILoadableModule::ModuleEntryPointType moduleEntryPoint =
(qSlicerCLILoadableModule::ModuleEntryPointType)this->symbolAddress("ModuleEntryPoint");
reinterpret_cast<qSlicerCLILoadableModule::ModuleEntryPointType>(
this->symbolAddress("ModuleEntryPoint"));
if (!moduleEntryPoint)
{
......@@ -70,21 +75,9 @@ qSlicerAbstractCoreModule* qSlicerCLILoadableModuleFactoryItem::instanciator()
return module;
}
//-----------------------------------------------------------------------------
class qSlicerCLILoadableModuleFactoryPrivate:public ctkPrivate<qSlicerCLILoadableModuleFactory>
{
public:
CTK_DECLARE_PUBLIC(qSlicerCLILoadableModuleFactory);
qSlicerCLILoadableModuleFactoryPrivate()
{
}
};
//-----------------------------------------------------------------------------
qSlicerCLILoadableModuleFactory::qSlicerCLILoadableModuleFactory():Superclass()
{
CTK_INIT_PRIVATE(qSlicerCLILoadableModuleFactory);
// Set the list of required symbols for CmdLineLoadableModule,
// if one of these symbols can't be resolved, the library won't be registered.
QStringList cmdLineModuleSymbols;
......@@ -122,19 +115,22 @@ void qSlicerCLILoadableModuleFactory::registerItems()
fileInfo = QFileInfo(fileInfo.symLinkTarget());
}
// Skip if current file isn't a library
if (!QLibrary::isLibrary(fileInfo.fileName())) { continue; }
if (!QLibrary::isLibrary(fileInfo.fileName()))
{
continue;
}
if (this->verbose())
{
qDebug() << "Attempt to register command line module:" << fileInfo.fileName();
}
QString libraryName;
if (!this->registerLibrary(fileInfo, libraryName))
QString key = this->fileNameToKey(fileInfo.filePath());
if (!this->registerLibrary(key, fileInfo))
{
if (this->verbose())
{
qWarning() << "Failed to register module: " << libraryName;
qWarning() << "Failed to register module: " << key;
}
continue;
}
......@@ -143,9 +139,16 @@ void qSlicerCLILoadableModuleFactory::registerItems()
}
//-----------------------------------------------------------------------------
QString qSlicerCLILoadableModuleFactory::fileNameToKey(const QString& objectName)
ctkFactoryLibraryItem<qSlicerAbstractCoreModule>* qSlicerCLILoadableModuleFactory::
createFactoryLibraryItem(const QFileInfo& libraryFile)const
{
return new qSlicerCLILoadableModuleFactoryItem(libraryFile.filePath());
}
//-----------------------------------------------------------------------------
QString qSlicerCLILoadableModuleFactory::fileNameToKey(const QString& objectName)const
{
return Self::extractModuleName(objectName);
return qSlicerCLILoadableModuleFactory::extractModuleName(objectName);
}
//-----------------------------------------------------------------------------
......
......@@ -29,7 +29,7 @@ public:
// Convenient typedef
typedef ctkFactoryLibraryItem<qSlicerAbstractCoreModule> Superclass;
explicit qSlicerCLILoadableModuleFactoryItem(const QString& itemKey, const QString& itemPath);
explicit qSlicerCLILoadableModuleFactoryItem(const QString& itemPath);
virtual ~qSlicerCLILoadableModuleFactoryItem(){}
protected:
......@@ -40,33 +40,28 @@ protected:
virtual qSlicerAbstractCoreModule* instanciator();
};
//-----------------------------------------------------------------------------
class qSlicerCLILoadableModuleFactoryPrivate;
//-----------------------------------------------------------------------------
class Q_SLICER_BASE_QTCLI_EXPORT qSlicerCLILoadableModuleFactory :
public ctkAbstractLibraryFactory<qSlicerAbstractCoreModule,qSlicerCLILoadableModuleFactoryItem>
public ctkAbstractLibraryFactory<qSlicerAbstractCoreModule>
{
public:
typedef ctkAbstractLibraryFactory<qSlicerAbstractCoreModule,
qSlicerCLILoadableModuleFactoryItem> Superclass;
typedef ctkAbstractLibraryFactory<qSlicerAbstractCoreModule> Superclass;
qSlicerCLILoadableModuleFactory();
virtual ~qSlicerCLILoadableModuleFactory(){}
///
/// Reimplemented to scan the directory of the command line modules
virtual void registerItems();
///
virtual QString fileNameToKey(const QString& fileName);
QString fileNameToKey(const QString& fileName)const;
///
/// Extract module name given \a libraryName
/// See qSlicerUtils::extractModuleNameFromLibraryName
/// \sa qSlicerUtils::extractModuleNameFromLibraryName
static QString extractModuleName(const QString& libraryName);
private:
CTK_DECLARE_PRIVATE(qSlicerCLILoadableModuleFactory);
protected:
virtual ctkFactoryLibraryItem<qSlicerAbstractCoreModule>* createFactoryLibraryItem(
const QFileInfo& libraryFile)const;
};
#endif
......@@ -83,7 +83,7 @@ QStringList qSlicerLoadableModuleFactoryPrivate::modulePaths() const
// qSlicerLoadableModuleFactory Methods
//-----------------------------------------------------------------------------
qSlicerLoadableModuleFactory::qSlicerLoadableModuleFactory():Superclass()
qSlicerLoadableModuleFactory::qSlicerLoadableModuleFactory()
{
CTK_INIT_PRIVATE(qSlicerLoadableModuleFactory);
}
......@@ -130,7 +130,7 @@ void qSlicerLoadableModuleFactory::registerItems()
}
QString libraryName;
if (!this->registerLibrary(fileInfo, libraryName))
if (!this->registerLibrary(libraryName, fileInfo))
{
if (this->verbose())
{
......
......@@ -32,7 +32,6 @@ public:
typedef ctkAbstractPluginFactory<qSlicerAbstractCoreModule> Superclass;
qSlicerLoadableModuleFactory();
virtual ~qSlicerLoadableModuleFactory(){}
///
virtual void registerItems();
......@@ -45,7 +44,6 @@ public:
/// \sa qSlicerUtils::extractModuleNameFromLibraryName
static QString extractModuleName(const QString& libraryName);
private:
CTK_DECLARE_PRIVATE(qSlicerLoadableModuleFactory);
};
......
......@@ -247,7 +247,7 @@
</widget>
</item>
<item>
<widget class="ctkSliderSpinBoxWidget" name="SliceOffsetSlider"/>
<widget class="ctkSliderWidget" name="SliceOffsetSlider"/>
</item>
</layout>
</item>
......@@ -258,9 +258,9 @@
</widget>
<customwidgets>
<customwidget>
<class>ctkSliderSpinBoxWidget</class>
<class>ctkSliderWidget</class>
<extends>QWidget</extends>
<header>ctkSliderSpinBoxWidget.h</header>
<header>ctkSliderWidget.h</header>
</customwidget>
<customwidget>
<class>qMRMLNodeComboBox</class>
......
......@@ -232,13 +232,13 @@
<container>1</container>
</customwidget>
<customwidget>
<class>ctkSliderSpinBoxWidget</class>
<class>ctkSliderWidget</class>
<extends>QWidget</extends>
<header>ctkSliderSpinBoxWidget.h</header>
<header>ctkSliderWidget.h</header>
</customwidget>
<customwidget>
<class>qMRMLLinearTransformSlider</class>
<extends>ctkSliderSpinBoxWidget</extends>
<extends>ctkSliderWidget</extends>
<header>qMRMLLinearTransformSlider.h</header>
<container>1</container>
</customwidget>
......
......@@ -2,7 +2,7 @@
#define __qMRMLLinearTransformSlider_h
// CTK includes
#include <ctkSliderSpinBoxWidget.h>
#include <ctkSliderWidget.h>
#include <ctkPimpl.h>
#include <ctkVTKObject.h>
......@@ -12,7 +12,7 @@ class vtkMRMLLinearTransformNode;
class vtkMatrix4x4;
class qMRMLLinearTransformSliderPrivate;
class QMRML_WIDGETS_EXPORT qMRMLLinearTransformSlider : public ctkSliderSpinBoxWidget
class QMRML_WIDGETS_EXPORT qMRMLLinearTransformSlider : public ctkSliderWidget
{
Q_OBJECT
QVTK_OBJECT
......@@ -23,7 +23,7 @@ class QMRML_WIDGETS_EXPORT qMRMLLinearTransformSlider : public ctkSliderSpinBoxW
public:
/// Constructors
typedef ctkSliderSpinBoxWidget Superclass;
typedef ctkSliderWidget Superclass;
explicit qMRMLLinearTransformSlider(QWidget* parent);
virtual ~qMRMLLinearTransformSlider(){}
......
......@@ -13,7 +13,7 @@
// CTK includes
#include <ctkDoubleSlider.h>
#include <ctkLogger.h>
#include <ctkSliderSpinBoxWidget.h>
#include <ctkSliderWidget.h>
// qMRML includes
#include "qMRMLSlicesControllerToolBar.h"
......@@ -64,7 +64,7 @@ public:
vtkMRMLScene* MRMLScene;
vtkSmartPointer<vtkCollection> MRMLSliceLogics;
ctkSliderSpinBoxWidget* LabelOpacitySlider;
ctkSliderWidget* LabelOpacitySlider;
QToolButton* LabelOpacityToggleButton;
double LastLabelOpacity;
ctkDoubleSlider* ForegroundOpacitySlider;
......@@ -127,7 +127,7 @@ void qMRMLSlicesControllerToolBarPrivate::setupUi(QWidget* widget)
QWidget* labelOpacityWidget = new QWidget(p);
QHBoxLayout* labelOpacityLayout = new QHBoxLayout(labelOpacityWidget);
labelOpacityLayout->setContentsMargins(0,0,0,0);
this->LabelOpacitySlider = new ctkSliderSpinBoxWidget(p);
this->LabelOpacitySlider = new ctkSliderWidget(p);
this->LabelOpacitySlider->setRange(0., 1.);
this->LabelOpacitySlider->setValue(1.);
this->LabelOpacitySlider->setSingleStep(0.05);
......
......@@ -106,7 +106,7 @@
</widget>
</item>
<item>
<widget class="ctkSliderSpinBoxWidget" name="textScaleSliderSpinBoxWidget">
<widget class="ctkSliderWidget" name="textScaleSliderSpinBoxWidget">
<property name="maximum">
<double>40.000000000000000</double>
</property>
......@@ -187,7 +187,7 @@
</widget>
</item>
<item row="1" column="1">
<widget class="ctkSliderSpinBoxWidget" name="pointOpacitySliderSpinBoxWidget">
<widget class="ctkSliderWidget" name="pointOpacitySliderSpinBoxWidget">
<property name="maximum">
<double>1.000000000000000</double>
</property>
......@@ -197,24 +197,24 @@
</widget>
</item>
<item row="2" column="1">
<widget class="ctkSliderSpinBoxWidget" name="pointAmbientSliderSpinBoxWidget">
<widget class="ctkSliderWidget" name="pointAmbientSliderSpinBoxWidget">
<property name="maximum">
<double>10.000000000000000</double>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="ctkSliderSpinBoxWidget" name="pointDiffuseSliderSpinBoxWidget">
<widget class="ctkSliderWidget" name="pointDiffuseSliderSpinBoxWidget">
<property name="maximum">
<double>10.000000000000000</double>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="ctkSliderSpinBoxWidget" name="pointSpecularSliderSpinBoxWidget"/>
<widget class="ctkSliderWidget" name="pointSpecularSliderSpinBoxWidget"/>
</item>
<item row="0" column="1">
<widget class="ctkSliderSpinBoxWidget" name="pointSizeSliderSpinBoxWidget"/>
<widget class="ctkSliderWidget" name="pointSizeSliderSpinBoxWidget"/>
</item>
</layout>
</item>
......@@ -265,7 +265,7 @@
</widget>
</item>
<item row="0" column="1">
<widget class="ctkSliderSpinBoxWidget" name="lineWidthSliderSpinBoxWidget">
<widget class="ctkSliderWidget" name="lineWidthSliderSpinBoxWidget">
<property name="singleStep">
<double>0.100000000000000</double>
</property>
......@@ -279,7 +279,7 @@
</widget>
</item>
<item row="1" column="1">
<widget class="ctkSliderSpinBoxWidget" name="lineOpacitySliderSpinBoxWidget">
<widget class="ctkSliderWidget" name="lineOpacitySliderSpinBoxWidget">
<property name="maximum">
<double>1.000000000000000</double>
</property>
......@@ -296,7 +296,7 @@
</widget>
</item>
<item row="2" column="1">
<widget class="ctkSliderSpinBoxWidget" name="lineAmbientSliderSpinBoxWidget">
<widget class="ctkSliderWidget" name="lineAmbientSliderSpinBoxWidget">
<property name="maximum">
<double>10.000000000000000</double>
</property>
......@@ -310,7 +310,7 @@
</widget>
</item>
<item row="3" column="1">
<widget class="ctkSliderSpinBoxWidget" name="lineDiffuseSliderSpinBoxWidget">
<widget class="ctkSliderWidget" name="lineDiffuseSliderSpinBoxWidget">
<property name="maximum">
<double>10.000000000000000</double>
</property>
......@@ -324,7 +324,7 @@
</widget>
</item>
<item row="4" column="1">
<widget class="ctkSliderSpinBoxWidget" name="lineSpecularSliderSpinBoxWidget">
<widget class="ctkSliderWidget" name="lineSpecularSliderSpinBoxWidget">
<property name="maximum">
<double>10.000000000000000</double>
</property>
......@@ -493,9 +493,9 @@
<header>ctkColorPickerButton.h</header>
</customwidget>
<customwidget>
<class>ctkSliderSpinBoxWidget</class>
<class>ctkSliderWidget</class>
<extends>QWidget</extends>
<header>ctkSliderSpinBoxWidget.h</header>
<header>ctkSliderWidget.h</header>
</customwidget>
</customwidgets>
<resources>
......
......@@ -120,7 +120,7 @@
</widget>
</item>
<item row="5" column="1">
<widget class="ctkSliderSpinBoxWidget" name="StoppingValueSpinBoxLabel">
<widget class="ctkSliderWidget" name="StoppingValueSpinBoxLabel">
<property name="maximum">
<double>1.000000000000000</double>
</property>
......@@ -144,7 +144,7 @@
</widget>
</item>
<item row="6" column="1">
<widget class="ctkSliderSpinBoxWidget" name="StoppingCurvatureSpinBoxLabel">
<widget class="ctkSliderWidget" name="StoppingCurvatureSpinBoxLabel">
<property name="minimum">
<double>0.100000000000000</double>
</property>
......@@ -167,7 +167,7 @@
</widget>
</item>
<item row="7" column="1">
<widget class="ctkSliderSpinBoxWidget" name="IntegrationStepSpinBoxLabel">
<widget class="ctkSliderWidget" name="IntegrationStepSpinBoxLabel">
<property name="maximum">
<double>10.000000000000000</double>
</property>
......@@ -187,7 +187,7 @@
</widget>
</item>
<item row="8" column="1">
<widget class="ctkSliderSpinBoxWidget" name="MinimumPathSpinBoxLabel">
<widget class="ctkSliderWidget" name="MinimumPathSpinBoxLabel">
<property name="maximum">
<double>200.000000000000000</double>
</property>
......@@ -207,7 +207,7 @@
</widget>
</item>
<item row="9" column="1">
<widget class="ctkSliderSpinBoxWidget" name="FiducialRegionSpinBoxLabel">
<widget class="ctkSliderWidget" name="FiducialRegionSpinBoxLabel">
<property name="maximum">
<double>10.000000000000000</double>
</property>
......@@ -227,7 +227,7 @@
</widget>
</item>
<item row="10" column="1">
<widget class="ctkSliderSpinBoxWidget" name="FiducialStepSpinBoxLabel">
<widget class="ctkSliderWidget" name="FiducialStepSpinBoxLabel">
<property name="minimum">
<double>1.000000000000000</double>
</property>
......@@ -306,9 +306,9 @@
<header>ctkAddRemoveComboBox.h</header>
</customwidget>
<customwidget>
<class>ctkSliderSpinBoxWidget</class>
<class>ctkSliderWidget</class>
<extends>QWidget</extends>
<header>ctkSliderSpinBoxWidget.h</header>
<header>ctkSliderWidget.h</header>
</customwidget>
<customwidget>
<class>qMRMLNodeComboBox</class>
......
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