Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
mantidproject
mantid
Commits
318e44b9
Commit
318e44b9
authored
Feb 17, 2016
by
Tom Perkins
Browse files
Refactoring some in-and-out functions in MantidWidgets
re #15286
parent
5e8c6cdb
Changes
7
Hide whitespace changes
Inline
Side-by-side
Framework/DataObjects/src/MDHistoWorkspace.cpp
View file @
318e44b9
...
...
@@ -609,7 +609,7 @@ MDHistoWorkspace::getLineData(const Mantid::Kernel::VMD &start,
line
.
x
.
push_back
(
length
);
line
.
y
.
push_back
(
std
::
numeric_limits
<
signal_t
>::
quiet_NaN
());
line
.
e
.
push_back
(
std
::
numeric_limits
<
signal_t
>::
quiet_NaN
());
return
;
return
line
;
}
else
{
// Get the first point
std
::
set
<
coord_t
>::
iterator
it
;
...
...
MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/InstrumentView/Shape2DCollection.h
View file @
318e44b9
...
...
@@ -73,7 +73,7 @@ namespace MantidQt
// is a point in real space masked by any of the shapes
bool
isMasked
(
double
x
,
double
y
)
const
;
// collect all screen pixels that are masked by the shapes
void
getMaskedPixels
(
QList
<
QPoint
>
&
p
ixels
)
const
;
QList
<
QPoint
>
getMaskedP
ixels
(
)
const
;
// set the bounding rect of the current shape such that its real rect is given by the argument
void
setCurrentBoundingRectReal
(
const
QRectF
&
rect
);
...
...
MantidQt/MantidWidgets/inc/MantidQtMantidWidgets/RenameParDialog.h
View file @
318e44b9
...
...
@@ -23,7 +23,7 @@ namespace MantidQt
RenameParDialog
(
const
std
::
vector
<
std
::
string
>&
old_params
,
const
std
::
vector
<
std
::
string
>&
new_params
,
QWidget
*
parent
=
NULL
);
void
setOutput
(
std
::
vector
<
std
::
string
>
&
out
)
const
;
std
::
vector
<
std
::
string
>
setOutput
()
const
;
protected
slots
:
void
uniqueIndexedNames
(
bool
);
void
doNotRename
(
bool
);
...
...
MantidQt/MantidWidgets/src/InstrumentView/Projection3D.cpp
View file @
318e44b9
...
...
@@ -273,8 +273,7 @@ namespace MantidQt
m_instrActor
->
cacheDetPos
();
// find the layer of visible detectors
QList
<
QPoint
>
pixels
;
m_maskShapes
.
getMaskedPixels
(
pixels
);
QList
<
QPoint
>
pixels
=
m_maskShapes
.
getMaskedPixels
();
double
zmin
=
1.0
;
double
zmax
=
0.0
;
QSet
<
int
>
ids
;
...
...
MantidQt/MantidWidgets/src/InstrumentView/Shape2DCollection.cpp
View file @
318e44b9
...
...
@@ -702,9 +702,8 @@ namespace MantidQt
return
false
;
}
void
Shape2DCollection
::
getMaskedPixels
(
QList
<
QPoint
>&
pixels
)
const
{
pixels
.
clear
();
QList
<
QPoint
>
Shape2DCollection
::
getMaskedPixels
()
const
{
QList
<
QPoint
>
pixels
;
QTransform
inv
=
m_transform
.
inverted
();
for
(
int
i
=
m_viewport
.
left
();
i
<=
m_viewport
.
right
();
++
i
)
{
...
...
@@ -721,6 +720,7 @@ namespace MantidQt
}
}
}
return
pixels
;
}
/**
...
...
MantidQt/MantidWidgets/src/RenameParDialog.cpp
View file @
318e44b9
...
...
@@ -96,16 +96,17 @@ QString RenameParDialog::makeUniqueIndexedName(const QString& name)
/**
* Output the new names to a vector
* @
param out :: Reference to a vector for output
* @
returns :: new names in a vector
*/
void
RenameParDialog
::
setOutput
(
std
::
vector
<
std
::
string
>&
out
)
const
std
::
vector
<
std
::
string
>
RenameParDialog
::
setOutput
()
const
{
out
.
clear
()
;
std
::
vector
<
std
::
string
>
out
;
QAbstractItemModel
*
model
=
m_uiForm
.
tableWidget
->
model
();
for
(
int
row
=
0
;
row
<
m_uiForm
.
tableWidget
->
rowCount
();
++
row
)
{
out
.
push_back
(
model
->
data
(
model
->
index
(
row
,
1
)).
toString
().
toStdString
());
}
return
out
;
}
void
RenameParDialog
::
uniqueIndexedNames
(
bool
ok
)
...
...
MantidQt/MantidWidgets/src/UserFunctionDialog.cpp
View file @
318e44b9
...
...
@@ -244,8 +244,7 @@ void UserFunctionDialog::checkParameters(QString& expr)
RenameParDialog
dlg
(
all
,
common
);
if
(
dlg
.
exec
()
==
QDialog
::
Accepted
)
{
std
::
vector
<
std
::
string
>
vars_new
;
dlg
.
setOutput
(
vars_new
);
auto
vars_new
=
dlg
.
setOutput
();
std
::
vector
<
std
::
string
>::
const_iterator
v_old
=
common
.
begin
();
std
::
vector
<
std
::
string
>::
const_iterator
v_new
=
vars_new
.
begin
();
for
(;
v_old
!=
common
.
end
();
++
v_old
,
++
v_new
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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