Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
CamiTK
CamiTK Community Edition
Commits
ff5883b8
Commit
ff5883b8
authored
Jul 09, 2018
by
Emmanuel Promayon
Browse files
UPDATED modernize use nullptr instead of NULL
parent
f2ce04d0
Changes
185
Hide whitespace changes
Inline
Side-by-side
imaging/components/itkimage/ItkImageComponentExtension.cpp
View file @
ff5883b8
...
...
@@ -67,7 +67,7 @@ QStringList ItkImageComponentExtension::getFileExtensions() const {
// --------------- open -------------------
Component
*
ItkImageComponentExtension
::
open
(
const
QString
&
fileName
)
throw
(
AbortException
)
{
ItkImageComponent
*
res
=
NULL
;
ItkImageComponent
*
res
=
nullptr
;
try
{
res
=
new
ItkImageComponent
(
fileName
);
}
...
...
modeling/actions/mml/GenerateModel.cpp
View file @
ff5883b8
...
...
@@ -76,7 +76,7 @@ Action::ApplyStatus GenerateModel::apply() {
QString
originalFilename
=
targetMesh
->
getFileName
();
if
(
originalFilename
.
isEmpty
()
)
{
// ask the user
originalFilename
=
QFileDialog
::
getSaveFileName
(
NULL
,
"Generate Model"
,
""
,
"ModelingML (*.mml)"
);
originalFilename
=
QFileDialog
::
getSaveFileName
(
nullptr
,
"Generate Model"
,
""
,
"ModelingML (*.mml)"
);
if
(
originalFilename
.
isNull
()
)
{
QApplication
::
restoreOverrideCursor
();
CAMITK_WARNING
(
tr
(
"Filename required. Action Aborted."
))
...
...
modeling/actions/pml/PMLExplorerWidget.cpp
View file @
ff5883b8
...
...
@@ -65,17 +65,17 @@ PMLExplorerWidget::PMLExplorerWidget ( PMLComponent* comp ) : QWidget() {
QObject
::
connect
(
ui
->
addButton
,
SIGNAL
(
clicked
()
),
this
,
SLOT
(
createNewProperty
()
)
);
QObject
::
connect
(
ui
->
showAtomGlyphCB
,
SIGNAL
(
toggled
(
bool
)
),
this
,
SLOT
(
showAtomGlyphToggled
(
bool
)
)
);
physicalModelItem
=
NULL
;
atomsItem
=
NULL
;
exclusiveComponentItem
=
NULL
;
informativeComponentItem
=
NULL
;
physicalModelItem
=
nullptr
;
atomsItem
=
nullptr
;
exclusiveComponentItem
=
nullptr
;
informativeComponentItem
=
nullptr
;
init
(
comp
);
}
// --------------- Destructor -------------------
PMLExplorerWidget
::~
PMLExplorerWidget
()
{
delete
objectController
;
objectController
=
NULL
;
objectController
=
nullptr
;
foreach
(
QObject
*
o
,
widgetPropertiesMap
)
{
delete
o
;
...
...
@@ -91,7 +91,7 @@ void PMLExplorerWidget::buildPhysicalModelTreeWidgetItem() {
// This can't take time on big PML file
QApplication
::
setOverrideCursor
(
Qt
::
WaitCursor
);
editedItem
=
NULL
;
editedItem
=
nullptr
;
// create the main PhysicalModel node
physicalModelItem
=
new
QTreeWidgetItem
(
ui
->
treeWidget
);
...
...
@@ -255,7 +255,7 @@ void PMLExplorerWidget::selectItems() {
// --------------- updateTarget -------------------
void
PMLExplorerWidget
::
updateTarget
(
PMLComponent
*
comp
)
{
editedItem
=
NULL
;
editedItem
=
nullptr
;
objectController
->
setObject
(
NULL
);
// Disconnect the selection changed signal, avoiding
// vicious bugs (Qt slots thread may call signal method while
...
...
@@ -277,10 +277,10 @@ void PMLExplorerWidget::updateTarget ( PMLComponent* comp ) {
// Clear the tree content (remove items and delete them)
ui
->
treeWidget
->
clear
();
physicalModelItem
=
NULL
;
atomsItem
=
NULL
;
exclusiveComponentItem
=
NULL
;
informativeComponentItem
=
NULL
;
physicalModelItem
=
nullptr
;
atomsItem
=
nullptr
;
exclusiveComponentItem
=
nullptr
;
informativeComponentItem
=
nullptr
;
init
(
comp
);
}
...
...
@@ -360,7 +360,7 @@ void PMLExplorerWidget::updateProperty ( QTreeWidgetItem* item ) {
itemProperties
=
pmlComponent
;
}
else
{
editedItem
=
NULL
;
editedItem
=
nullptr
;
}
}
// update the ObjectController
...
...
@@ -371,7 +371,7 @@ void PMLExplorerWidget::updateProperty ( QTreeWidgetItem* item ) {
// --------------- createNewProperty -------------------
void
PMLExplorerWidget
::
createNewProperty
()
{
if
(
editedItem
!=
NULL
)
{
if
(
editedItem
!=
nullptr
)
{
QDialog
*
newPropertyDialog
=
new
QDialog
(
this
);
Ui
::
ui_AddNewPropertyWidget
addNewPropertyUI
;
addNewPropertyUI
.
setupUi
(
newPropertyDialog
);
...
...
modeling/components/mmlcomponent/MMLComponent.cpp
View file @
ff5883b8
...
...
@@ -101,12 +101,12 @@ MMLComponent::MMLComponent(const QString& fileName) throw(AbortException) : Comp
else
{
if
(
display
)
{
delete
display
;
display
=
NULL
;
display
=
nullptr
;
}
if
(
mmlGUI
)
{
delete
mmlGUI
;
mmlGUI
=
NULL
;
mmlGUI
=
nullptr
;
}
throw
AbortException
(
"Cannot open "
+
myFileName
.
toStdString
()
+
"
\n
The given simulator is probably not supported"
);
}
...
...
@@ -120,17 +120,17 @@ MMLComponent::MMLComponent(const QString& fileName) throw(AbortException) : Comp
MMLComponent
::~
MMLComponent
()
{
if
(
pmlComponent
)
{
delete
pmlComponent
;
pmlComponent
=
NULL
;
pmlComponent
=
nullptr
;
}
if
(
display
)
{
delete
display
;
display
=
NULL
;
display
=
nullptr
;
}
if
(
mmlGUI
)
{
delete
mmlGUI
;
mmlGUI
=
NULL
;
mmlGUI
=
nullptr
;
}
}
...
...
@@ -168,7 +168,7 @@ MMLDisplay* MMLComponent::getDisplay() {
void
MMLComponent
::
connectPml
()
{
removeChild
(
pmlComponent
);
delete
pmlComponent
;
pmlComponent
=
NULL
;
pmlComponent
=
nullptr
;
deleteChildren
();
refreshInterfaceNode
();
// this gives the ownership of pml pointer to the PML Component, use takePml() not getPml()
...
...
modeling/components/mmlcomponent/MMLDisplay.cpp
View file @
ff5883b8
...
...
@@ -53,7 +53,7 @@ MMLDisplay::MMLDisplay( MMLComponent* mmlManager ): QObject() {
connect
(
qobj
,
SIGNAL
(
changed
()
),
this
,
SLOT
(
updateDisplay
()
)
);
connect
(
qobj2
,
SIGNAL
(
monitorsChanged
()
),
this
,
SLOT
(
updateMonitorsTable
()
)
);
connect
(
qobj
,
SIGNAL
(
reconnectPml
()
),
this
,
SLOT
(
connectPml
()
)
);
monitorDisplay
=
NULL
;
monitorDisplay
=
nullptr
;
// add two column in monitors table for displaying monitors
QTableWidget
*
table
=
mmlManager
->
getMonitoringGuiManager
()
->
getDialog
()
->
getMonitorsTableWidget
();
...
...
@@ -156,7 +156,7 @@ Monitor* MMLDisplay::getDisplayedMonitor() {
return
mmlManager
->
getMonitoringGuiManager
()
->
getMonitoringManager
()
->
getMonitor
(
i
);
}
}
return
NULL
;
return
nullptr
;
}
// -------------------- getDisplayedMonitorLine ---------------------
...
...
modeling/components/mmlcomponent/MMLMonitorDisplayFactory.cpp
View file @
ff5883b8
...
...
@@ -25,7 +25,7 @@
#include "MMLMonitorDisplayFactory.h"
MMLMonitorDisplayFactory
*
MMLMonitorDisplayFactory
::
instance
=
NULL
;
MMLMonitorDisplayFactory
*
MMLMonitorDisplayFactory
::
instance
=
nullptr
;
MMLMonitorDisplayFactory
::
MMLMonitorDisplayFactory
()
{}
...
...
@@ -38,7 +38,7 @@ bool MMLMonitorDisplayFactory::isRegistered(std::string id) {
MMLMonitorDisplay
*
MMLMonitorDisplayFactory
::
createMonitorDisplay
(
std
::
string
id
,
Monitor
*
monitor
,
MMLComponent
*
manager
)
{
std
::
map
<
std
::
string
,
CreateMonitorDisplayFunctionPointer
>::
iterator
iter
=
mapObjectCreator
.
find
(
id
);
if
(
iter
==
mapObjectCreator
.
end
())
{
return
NULL
;
return
nullptr
;
}
return
((
*
iter
).
second
)(
monitor
,
manager
);
}
...
...
modeling/components/mmlcomponent/MMLMonitorDisplays/Statistics.cpp
View file @
ff5883b8
...
...
@@ -46,7 +46,7 @@ Statistics::Statistics(Monitor* monitor, MMLComponent* manager): MMLMonitorDispl
item
->
setText
((
"Statistics"
));
t
->
setHorizontalHeaderItem
(
j
,
item
);
table
=
new
QTableWidget
;
table
->
setEditTriggers
(
0
);
table
->
setEditTriggers
(
nullptr
);
t
->
setCellWidget
(
line
,
j
,
table
);
}
...
...
modeling/components/mmlcomponent/MMLMonitorDisplays/Tabular.cpp
View file @
ff5883b8
...
...
@@ -47,7 +47,7 @@ Tabular::Tabular(Monitor* monitor, MMLComponent* manager): MMLMonitorDisplay(mon
item
->
setText
((
"Tabular"
));
t
->
setHorizontalHeaderItem
(
j
,
item
);
table
=
new
QTableWidget
;
table
->
setEditTriggers
(
0
);
table
->
setEditTriggers
(
nullptr
);
t
->
setCellWidget
(
line
,
j
,
table
);
table
->
installEventFilter
(
this
);
}
...
...
@@ -55,7 +55,7 @@ Tabular::Tabular(Monitor* monitor, MMLComponent* manager): MMLMonitorDisplay(mon
Tabular
::~
Tabular
()
{
if
(
table
)
{
delete
table
;
table
=
NULL
;
table
=
nullptr
;
}
}
...
...
modeling/components/pmlcomponent/PMLComponent.cpp
View file @
ff5883b8
...
...
@@ -95,7 +95,7 @@ PMLComponent::~PMLComponent() {
atomPointIdMap
.
clear
();
delete
physicalModel
;
physicalModel
=
NULL
;
physicalModel
=
nullptr
;
}
//-------------------- init -------------------
...
...
@@ -575,7 +575,7 @@ int PMLComponent::addSelection(const QString& name, int fieldType, int contentTy
//------------------------ getPixmap ---------------------
#include "physicalmodel_20x20.xpm"
QPixmap
*
PMLComponent
::
myPixmap
=
NULL
;
QPixmap
*
PMLComponent
::
myPixmap
=
nullptr
;
QPixmap
PMLComponent
::
getIcon
()
{
if
(
!
myPixmap
)
{
myPixmap
=
new
QPixmap
(
physicalmodel_20x20
);
...
...
modeling/libraries/lml/Load.cpp
View file @
ff5883b8
...
...
@@ -37,7 +37,7 @@
//--------- static factory -------------
Load
*
Load
::
LoadFactory
(
std
::
string
type
)
{
Load
*
newOne
=
NULL
;
Load
*
newOne
=
nullptr
;
// instanciate depending on the load type
if
(
type
==
"Translation"
)
{
...
...
@@ -259,7 +259,7 @@ ValueEvent* Load::getValueEvent(const unsigned int i) const {
return
eventList
[
i
];
}
else
{
return
NULL
;
return
nullptr
;
}
}
...
...
modeling/libraries/lml/Loads.cpp
View file @
ff5883b8
...
...
@@ -251,7 +251,7 @@ Load* Loads::getLoad (const unsigned int i) const {
return
loads
[
i
];
}
else
{
return
NULL
;
return
nullptr
;
}
}
...
...
modeling/libraries/mml/monitoring/AndMultipleCriterion.h
View file @
ff5883b8
...
...
@@ -47,7 +47,7 @@ public:
* constructor
* @param m the xsdcxx generated MultipleCriterion
*/
AndMultipleCriterion
(
mml
::
MultipleCriteria
*
m
,
MonitoringManager
*
monitoringManager
,
MultipleCriterion
*
parent
=
NULL
);
AndMultipleCriterion
(
mml
::
MultipleCriteria
*
m
,
MonitoringManager
*
monitoringManager
,
MultipleCriterion
*
parent
=
nullptr
);
/// destructor
~
AndMultipleCriterion
()
override
;
...
...
modeling/libraries/mml/monitoring/Criterion.cpp
View file @
ff5883b8
...
...
@@ -67,7 +67,7 @@ void Criterion::write() {
// -------------------- getChild --------------------
StoppingCriterion
*
Criterion
::
getChild
(
const
unsigned
int
i
)
{
return
NULL
;
return
nullptr
;
}
// -------------------- getNumberOfChildren --------------------
...
...
modeling/libraries/mml/monitoring/Criterion.h
View file @
ff5883b8
...
...
@@ -50,7 +50,7 @@ public:
* constructor
*@param c the xsdcxx generated criterion
*/
Criterion
(
mml
::
Criteria
*
c
,
MonitoringManager
*
monitoringManager
,
MultipleCriterion
*
parent
=
NULL
);
Criterion
(
mml
::
Criteria
*
c
,
MonitoringManager
*
monitoringManager
,
MultipleCriterion
*
parent
=
nullptr
);
/// destructor
~
Criterion
()
override
;
...
...
modeling/libraries/mml/monitoring/CriterionFactory.h
View file @
ff5883b8
...
...
@@ -48,7 +48,7 @@ public:
~
CriterionFactory
();
/// create a criterion according to the xsdcxx object criterion
static
Criterion
*
createCriterion
(
mml
::
Criteria
*
c
,
MonitoringManager
*
monitoringManager
,
MultipleCriterion
*
parent
=
NULL
);
static
Criterion
*
createCriterion
(
mml
::
Criteria
*
c
,
MonitoringManager
*
monitoringManager
,
MultipleCriterion
*
parent
=
nullptr
);
private:
/// constructor
...
...
modeling/libraries/mml/monitoring/Force.h
View file @
ff5883b8
...
...
@@ -45,7 +45,7 @@ public:
* constructor
*@param c the xsdcxx generated Force criterion
*/
ForceCriterion
(
mml
::
Force
*
c
,
MonitoringManager
*
monitoringManager
,
MultipleCriterion
*
parent
=
NULL
);
ForceCriterion
(
mml
::
Force
*
c
,
MonitoringManager
*
monitoringManager
,
MultipleCriterion
*
parent
=
nullptr
);
/// destructor
~
ForceCriterion
()
override
;
...
...
modeling/libraries/mml/monitoring/InteractiveMonitoringManager.cpp
View file @
ff5883b8
...
...
@@ -43,7 +43,7 @@ InteractiveMonitoringManager::InteractiveMonitoringManager(const char* mml): Mon
stop
=
StoppingCriterionFactory
::
createStoppingCriterion
(
s
,
this
);
}
else
{
stop
=
NULL
;
stop
=
nullptr
;
}
}
...
...
modeling/libraries/mml/monitoring/KineticEnergy.h
View file @
ff5883b8
...
...
@@ -44,7 +44,7 @@ public:
* constructor
*@param c the xsdcxx generated KineticEnergy criterion
*/
kineticEnergy
(
mml
::
KineticEnergy
*
c
,
MonitoringManager
*
monitoringManager
,
MultipleCriterion
*
parent
=
NULL
);
kineticEnergy
(
mml
::
KineticEnergy
*
c
,
MonitoringManager
*
monitoringManager
,
MultipleCriterion
*
parent
=
nullptr
);
/// destructor
~
kineticEnergy
()
override
;
...
...
modeling/libraries/mml/monitoring/MonitoringManagerFactory.cpp
View file @
ff5883b8
...
...
@@ -57,5 +57,5 @@ MonitoringManager* MonitoringManagerFactory::createManager(const char* mml) {
else
{
std
::
cerr
<<
"MonitoringManagerFactory: Simulator "
<<
sim
<<
" not registered"
<<
std
::
endl
;
}
return
NULL
;
return
nullptr
;
}
modeling/libraries/mml/monitoring/MultipleCriterion.cpp
View file @
ff5883b8
...
...
@@ -65,7 +65,7 @@ StoppingCriterion* MultipleCriterion::getChild(const unsigned int i) {
return
criterias
[
i
];
}
else
{
return
NULL
;
return
nullptr
;
}
}
...
...
Prev
1
2
3
4
5
…
10
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment