Skip to content

Commit

Permalink
COMP: update to Qt5/VTK8
Browse files Browse the repository at this point in the history
  • Loading branch information
Punzo committed Sep 19, 2017
1 parent d8e223d commit f3a2fc2
Show file tree
Hide file tree
Showing 35 changed files with 188 additions and 225 deletions.
4 changes: 3 additions & 1 deletion AstroModeling/qSlicerAstroModelingModule.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,15 @@
#include <vtkSlicerAstroVolumeLogic.h>
#include <vtkSlicerAstroModelingLogic.h>


// AstroModeling includes
#include "qSlicerAstroModelingModule.h"
#include "qSlicerAstroModelingModuleWidget.h"

//-----------------------------------------------------------------------------
#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
#include <QtPlugin>
Q_EXPORT_PLUGIN2(qSlicerAstroModelingModule, qSlicerAstroModelingModule);
#endif

//-----------------------------------------------------------------------------
/// \ingroup Slicer_QtModules_AstroModeling
Expand Down
3 changes: 3 additions & 0 deletions AstroModeling/qSlicerAstroModelingModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ class Q_SLICER_QTMODULES_ASTROMODELING_EXPORT qSlicerAstroModelingModule :
public qSlicerLoadableModule
{
Q_OBJECT
#ifdef Slicer_HAVE_QT5
Q_PLUGIN_METADATA(IID "org.slicer.modules.loadable.qSlicerLoadableModule/1.0");
#endif
Q_INTERFACES(qSlicerLoadableModule);

public:
Expand Down
8 changes: 6 additions & 2 deletions AstroModeling/qSlicerAstroModelingModuleWidget.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ void qSlicerAstroModelingModuleWidgetPrivate::init()


MRMLTableView = new qMRMLTableView(OutputCollapsibleButton);
MRMLTableView->setObjectName(QString::fromUtf8("MRMLTableView"));
MRMLTableView->setObjectName(QLatin1String("MRMLTableView"));
QSizePolicy sizePolicy1(QSizePolicy::Expanding, QSizePolicy::Expanding);
sizePolicy1.setHeightForWidth(MRMLTableView->sizePolicy().hasHeightForWidth());
MRMLTableView->setSizePolicy(sizePolicy1);
Expand All @@ -324,7 +324,7 @@ void qSlicerAstroModelingModuleWidgetPrivate::init()
gridLayout_3->addWidget(MRMLTableView, 2, 0, 1, 1);

CalculatePushButton = new QPushButton(OutputCollapsibleButton);
CalculatePushButton->setObjectName(QString::fromUtf8("CalculatePushButton"));
CalculatePushButton->setObjectName(QLatin1String("CalculatePushButton"));
CalculatePushButton->setMinimumSize(QSize(0, 35));
CalculatePushButton->setEnabled(false);
CalculatePushButton->setText("Calculate and Visualize Model");
Expand Down Expand Up @@ -1009,7 +1009,11 @@ void qSlicerAstroModelingModuleWidget::setMRMLAstroModelingParametersNode(vtkMRM

d->MRMLTableView->setMRMLTableNode(d->parametersNode->GetParamsTableNode());
d->MRMLTableView->resizeColumnsToContents();
#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
d->MRMLTableView->horizontalHeader()->setResizeMode(QHeaderView::ResizeToContents);
#else
d->MRMLTableView->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
#endif

this->qvtkReconnect(d->parametersNode->GetParamsTableNode(), vtkCommand::ModifiedEvent,
this, SLOT(onParamsTableNodeModified(vtkObject*)));
Expand Down
4 changes: 3 additions & 1 deletion AstroMomentMaps/qSlicerAstroMomentMapsModule.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,15 @@
#include <vtkSlicerAstroVolumeLogic.h>
#include <vtkSlicerAstroMomentMapsLogic.h>


// AstroMomentMaps includes
#include "qSlicerAstroMomentMapsModule.h"
#include "qSlicerAstroMomentMapsModuleWidget.h"

//-----------------------------------------------------------------------------
#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
#include <QtPlugin>
Q_EXPORT_PLUGIN2(qSlicerAstroMomentMapsModule, qSlicerAstroMomentMapsModule);
#endif

//-----------------------------------------------------------------------------
/// \ingroup Slicer_QtModules_AstroMomentMaps
Expand Down
3 changes: 3 additions & 0 deletions AstroMomentMaps/qSlicerAstroMomentMapsModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ class Q_SLICER_QTMODULES_ASTROMOMENTMAPS_EXPORT qSlicerAstroMomentMapsModule :
public qSlicerLoadableModule
{
Q_OBJECT
#ifdef Slicer_HAVE_QT5
Q_PLUGIN_METADATA(IID "org.slicer.modules.loadable.qSlicerLoadableModule/1.0");
#endif
Q_INTERFACES(qSlicerLoadableModule);

public:
Expand Down
3 changes: 3 additions & 0 deletions AstroSmoothing/qSlicerAstroSmoothingModule.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@
#include "qSlicerAstroSmoothingModuleWidget.h"

//-----------------------------------------------------------------------------
#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
#include <QtPlugin>
Q_EXPORT_PLUGIN2(qSlicerAstroSmoothingModule, qSlicerAstroSmoothingModule);
#endif

//-----------------------------------------------------------------------------
/// \ingroup Slicer_QtModules_AstroSmoothing
Expand Down
3 changes: 3 additions & 0 deletions AstroSmoothing/qSlicerAstroSmoothingModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ class Q_SLICER_QTMODULES_ASTROSMOOTHING_EXPORT qSlicerAstroSmoothingModule :
public qSlicerLoadableModule
{
Q_OBJECT
#ifdef Slicer_HAVE_QT5
Q_PLUGIN_METADATA(IID "org.slicer.modules.loadable.qSlicerLoadableModule/1.0");
#endif
Q_INTERFACES(qSlicerLoadableModule);

public:
Expand Down
1 change: 0 additions & 1 deletion AstroVolume/MRML/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ SlicerMacroBuildModuleMRML(
TARGET_LIBRARIES ${module_mrml_target_libraries}
)


# --------------------------------------------------------------------------
# Set INCLUDE_DIRS variable
# --------------------------------------------------------------------------
Expand Down
12 changes: 6 additions & 6 deletions AstroVolume/MRML/vtkMRMLAstroLabelMapVolumeDisplayNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,25 +43,25 @@ class VTK_MRML_ASTRO_EXPORT vtkMRMLAstroLabelMapVolumeDisplayNode : public vtkMR
public:
static vtkMRMLAstroLabelMapVolumeDisplayNode *New();
vtkTypeMacro(vtkMRMLAstroLabelMapVolumeDisplayNode,vtkMRMLLabelMapVolumeDisplayNode);
void PrintSelf(ostream& os, vtkIndent indent);
void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;

virtual vtkMRMLNode* CreateNodeInstance();
virtual vtkMRMLNode* CreateNodeInstance() VTK_OVERRIDE;

///
/// Set node attributes
virtual void ReadXMLAttributes( const char** atts);
virtual void ReadXMLAttributes( const char** atts) VTK_OVERRIDE;

///
/// Write this node's information to a MRML file in XML format.
virtual void WriteXML(ostream& of, int indent);
virtual void WriteXML(ostream& of, int indent) VTK_OVERRIDE;

///
/// Copy the node's attributes to this object
virtual void Copy(vtkMRMLNode *node);
virtual void Copy(vtkMRMLNode *node) VTK_OVERRIDE;

///
/// Get node XML tag name (like Volume, Model)
virtual const char* GetNodeTagName() {return "AstroLabelMapVolumeDisplay";};
virtual const char* GetNodeTagName() VTK_OVERRIDE {return "AstroLabelMapVolumeDisplay";};

///
/// Set/Get the CoordinateSystem.
Expand Down
16 changes: 8 additions & 8 deletions AstroVolume/MRML/vtkMRMLAstroLabelMapVolumeNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,37 +38,37 @@ class VTK_MRML_ASTRO_EXPORT vtkMRMLAstroLabelMapVolumeNode : public vtkMRMLLabel
public:
static vtkMRMLAstroLabelMapVolumeNode *New();
vtkTypeMacro(vtkMRMLAstroLabelMapVolumeNode,vtkMRMLLabelMapVolumeNode);
void PrintSelf(ostream& os, vtkIndent indent);
void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;

virtual vtkMRMLNode* CreateNodeInstance();
virtual vtkMRMLNode* CreateNodeInstance() VTK_OVERRIDE;

///
/// Set node attributes
virtual void ReadXMLAttributes( const char** atts);
virtual void ReadXMLAttributes( const char** atts) VTK_OVERRIDE;

///
/// Write this node's information to a MRML file in XML format.
virtual void WriteXML(ostream& of, int indent);
virtual void WriteXML(ostream& of, int indent) VTK_OVERRIDE;

///
/// Copy the node's attributes to this object
virtual void Copy(vtkMRMLNode *node);
virtual void Copy(vtkMRMLNode *node) VTK_OVERRIDE;

///
/// Get node XML tag name (like Volume, Model)
virtual const char* GetNodeTagName() {return "AstroLabelMapVolume";};
virtual const char* GetNodeTagName() VTK_OVERRIDE {return "AstroLabelMapVolume";};

///
/// Create and observe default display node
virtual void CreateDefaultDisplayNodes();
virtual void CreateDefaultDisplayNodes() VTK_OVERRIDE;

///
/// Make a 'None' volume node with blank image data
static void CreateNoneNode(vtkMRMLScene *scene);

///
/// Create and observe default Storage node
virtual vtkMRMLStorageNode* CreateDefaultStorageNode();
virtual vtkMRMLStorageNode* CreateDefaultStorageNode() VTK_OVERRIDE;

///
/// Get AstroVolume display node
Expand Down
12 changes: 6 additions & 6 deletions AstroVolume/MRML/vtkMRMLAstroModelingParametersNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,25 +43,25 @@ class VTK_MRML_ASTRO_EXPORT vtkMRMLAstroModelingParametersNode : public vtkMRMLN

static vtkMRMLAstroModelingParametersNode *New();
vtkTypeMacro(vtkMRMLAstroModelingParametersNode,vtkMRMLNode);
void PrintSelf(ostream& os, vtkIndent indent);
void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;

virtual vtkMRMLNode* CreateNodeInstance();
virtual vtkMRMLNode* CreateNodeInstance() VTK_OVERRIDE;

// Description:
// Set node attributes
virtual void ReadXMLAttributes( const char** atts);
virtual void ReadXMLAttributes(const char** atts) VTK_OVERRIDE;

// Description:
// Write this node's information to a MRML file in XML format.
virtual void WriteXML(ostream& of, int indent);
virtual void WriteXML(ostream& of, int indent) VTK_OVERRIDE;

// Description:
// Copy the node's attributes to this object
virtual void Copy(vtkMRMLNode *node);
virtual void Copy(vtkMRMLNode *node) VTK_OVERRIDE;

// Description:
// Get node XML tag name (like Volume, Model)
virtual const char* GetNodeTagName() {return "AstroModelingParameters";};
virtual const char* GetNodeTagName() VTK_OVERRIDE {return "AstroModelingParameters";};

vtkSetStringMacro(InputVolumeNodeID);
vtkGetStringMacro(InputVolumeNodeID);
Expand Down
13 changes: 6 additions & 7 deletions AstroVolume/MRML/vtkMRMLAstroMomentMapsParametersNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,25 +35,25 @@ class VTK_MRML_ASTRO_EXPORT vtkMRMLAstroMomentMapsParametersNode : public vtkMRM

static vtkMRMLAstroMomentMapsParametersNode *New();
vtkTypeMacro(vtkMRMLAstroMomentMapsParametersNode,vtkMRMLNode);
void PrintSelf(ostream& os, vtkIndent indent);
void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;

virtual vtkMRMLNode* CreateNodeInstance();
virtual vtkMRMLNode* CreateNodeInstance() VTK_OVERRIDE;

// Description:
// Set node attributes
virtual void ReadXMLAttributes( const char** atts);
virtual void ReadXMLAttributes( const char** atts) VTK_OVERRIDE;

// Description:
// Write this node's information to a MRML file in XML format.
virtual void WriteXML(ostream& of, int indent);
virtual void WriteXML(ostream& of, int indent) VTK_OVERRIDE;

// Description:
// Copy the node's attributes to this object
virtual void Copy(vtkMRMLNode *node);
virtual void Copy(vtkMRMLNode *node) VTK_OVERRIDE;

// Description:
// Get node XML tag name (like Volume, Model)
virtual const char* GetNodeTagName() {return "AstroMomentMapsParameters";};
virtual const char* GetNodeTagName() VTK_OVERRIDE {return "AstroMomentMapsParameters";};

vtkSetStringMacro(InputVolumeNodeID);
vtkGetStringMacro(InputVolumeNodeID);
Expand Down Expand Up @@ -131,7 +131,6 @@ class VTK_MRML_ASTRO_EXPORT vtkMRMLAstroMomentMapsParametersNode : public vtkMRM
int OutputSerial;

int Status;

};

#endif
12 changes: 6 additions & 6 deletions AstroVolume/MRML/vtkMRMLAstroSmoothingParametersNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,25 +35,25 @@ class VTK_MRML_ASTRO_EXPORT vtkMRMLAstroSmoothingParametersNode : public vtkMRML

static vtkMRMLAstroSmoothingParametersNode *New();
vtkTypeMacro(vtkMRMLAstroSmoothingParametersNode,vtkMRMLNode);
void PrintSelf(ostream& os, vtkIndent indent);
void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;

virtual vtkMRMLNode* CreateNodeInstance();
virtual vtkMRMLNode* CreateNodeInstance() VTK_OVERRIDE;

// Description:
// Set node attributes
virtual void ReadXMLAttributes( const char** atts);
virtual void ReadXMLAttributes( const char** atts) VTK_OVERRIDE;

// Description:
// Write this node's information to a MRML file in XML format.
virtual void WriteXML(ostream& of, int indent);
virtual void WriteXML(ostream& of, int indent) VTK_OVERRIDE;

// Description:
// Copy the node's attributes to this object
virtual void Copy(vtkMRMLNode *node);
virtual void Copy(vtkMRMLNode *node) VTK_OVERRIDE;

// Description:
// Get node XML tag name (like Volume, Model)
virtual const char* GetNodeTagName() {return "AstroSmoothingParameters";};
virtual const char* GetNodeTagName() VTK_OVERRIDE {return "AstroSmoothingParameters";};

vtkSetMacro(ParameterX,double);
vtkGetMacro(ParameterX,double);
Expand Down
4 changes: 2 additions & 2 deletions AstroVolume/MRML/vtkMRMLAstroTwoDAxesDisplayableManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ class VTK_MRML_ASTRO_EXPORT vtkMRMLAstroTwoDAxesDisplayableManager
virtual ~vtkMRMLAstroTwoDAxesDisplayableManager();

/// Observe the View node and initialize the renderer accordingly.
virtual void Create();
virtual void Create() VTK_OVERRIDE;

/// Called each time the view node is modified.
/// Internally update the renderer from the view node.
/// \sa UpdateFromMRMLViewNode()
virtual void OnMRMLDisplayableNodeModifiedEvent(vtkObject* caller);
virtual void OnMRMLDisplayableNodeModifiedEvent(vtkObject* caller) VTK_OVERRIDE;

/// Update the renderer from the view node properties.
void UpdateFromViewNode();
Expand Down
6 changes: 3 additions & 3 deletions AstroVolume/MRML/vtkMRMLAstroVolumeDisplayNode.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1509,7 +1509,7 @@ std::string vtkMRMLAstroVolumeDisplayNode::GetDisplayStringFromValueX(const doub
if (selectionNode)
{
vtkMRMLUnitNode* unitNode = selectionNode->GetUnitNode(this->SpaceQuantities->GetValue(0));
return vtkMRMLAstroVolumeDisplayNode::GetDisplayStringFromValue(world, unitNode);
return this->GetDisplayStringFromValue(world, unitNode);
}
return "";
}
Expand All @@ -1522,7 +1522,7 @@ std::string vtkMRMLAstroVolumeDisplayNode::GetDisplayStringFromValueY(const doub
if (selectionNode)
{
vtkMRMLUnitNode* unitNode = selectionNode->GetUnitNode(this->SpaceQuantities->GetValue(1));
return vtkMRMLAstroVolumeDisplayNode::GetDisplayStringFromValue(world, unitNode);
return this->GetDisplayStringFromValue(world, unitNode);
}
return "";
}
Expand All @@ -1535,7 +1535,7 @@ std::string vtkMRMLAstroVolumeDisplayNode::GetDisplayStringFromValueZ(const doub
if (selectionNode)
{
vtkMRMLUnitNode* unitNode = selectionNode->GetUnitNode(this->SpaceQuantities->GetValue(2));
return vtkMRMLAstroVolumeDisplayNode::GetDisplayStringFromValue(world, unitNode);
return this->AddVelocityInfoToDisplayStringZ(this->GetDisplayStringFromValue(world, unitNode));
}
return "";
}
Expand Down
12 changes: 6 additions & 6 deletions AstroVolume/MRML/vtkMRMLAstroVolumeDisplayNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,25 +40,25 @@ class VTK_MRML_ASTRO_EXPORT vtkMRMLAstroVolumeDisplayNode : public vtkMRMLScalar
public:
static vtkMRMLAstroVolumeDisplayNode *New();
vtkTypeMacro(vtkMRMLAstroVolumeDisplayNode,vtkMRMLScalarVolumeDisplayNode);
void PrintSelf(ostream& os, vtkIndent indent);
void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;

virtual vtkMRMLNode* CreateNodeInstance();
virtual vtkMRMLNode* CreateNodeInstance() VTK_OVERRIDE;

///
/// Set node attributes
virtual void ReadXMLAttributes( const char** atts);
virtual void ReadXMLAttributes( const char** atts) VTK_OVERRIDE;

///
/// Write this node's information to a MRML file in XML format.
virtual void WriteXML(ostream& of, int indent);
virtual void WriteXML(ostream& of, int indent) VTK_OVERRIDE;

///
/// Copy the node's attributes to this object
virtual void Copy(vtkMRMLNode *node);
virtual void Copy(vtkMRMLNode *node) VTK_OVERRIDE;

///
/// Get node XML tag name (like Volume, Model)
virtual const char* GetNodeTagName() {return "AstroVolumeDisplay";};
virtual const char* GetNodeTagName() VTK_OVERRIDE {return "AstroVolumeDisplay";};

///
/// Set/Get the CoordinateSystem.
Expand Down

0 comments on commit f3a2fc2

Please sign in to comment.