Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CAMP
campvis-public
Commits
d41fc3ab
Commit
d41fc3ab
authored
Mar 03, 2014
by
Christian Schulte zu Berge
Browse files
fixed further cppcheck issues + MSVC12 warning
parent
a7c1e91a
Changes
6
Hide whitespace changes
Inline
Side-by-side
ext/tgt/filesystem.cpp
View file @
d41fc3ab
...
...
@@ -1233,7 +1233,6 @@ std::vector<std::string> FileSystem::listSubDirectories(const std::string& direc
WIN32_FIND_DATA
findFileData
=
{
0
};
HANDLE
hFind
=
0
;
std
::
stack
<
std
::
string
>
stackDirs
;
std
::
string
dir
(
converted
+
"
\\
*"
);
hFind
=
FindFirstFile
(
dir
.
c_str
(),
&
findFileData
);
...
...
ext/tgt/gpucapabilities.cpp
View file @
d41fc3ab
...
...
@@ -380,6 +380,9 @@ void GpuCapabilities::detectOS() {
ZeroMemory
(
&
osvi
,
sizeof
(
OSVERSIONINFOEX
));
osvi
.
dwOSVersionInfoSize
=
sizeof
(
OSVERSIONINFOEX
);
#pragma warning(push)
#pragma warning(disable:4996) // newer MSVC versions report GetVersionEx() to be deprecated, however the alternative is so poor design, I refuse to implement it... http://msdn.microsoft.com/en-us/library/windows/desktop/dn302074.aspx
if
(
!
GetVersionEx
((
OSVERSIONINFO
*
)
&
osvi
))
{
oss
<<
"unknown: GetVersionEx() failed"
;
}
...
...
@@ -418,6 +421,7 @@ void GpuCapabilities::detectOS() {
}
oss
<<
" (build "
<<
osvi
.
dwBuildNumber
<<
")"
;
osVersionString_
=
oss
.
str
();
#pragma warning(pop)
#else // WIN32 -> must be UNIX/POSIX
osVersion_
=
OS_POSIX
;
...
...
modules/io/processors/csvdimagereader.cpp
View file @
d41fc3ab
...
...
@@ -63,7 +63,6 @@ namespace campvis {
tfp
.
parse
<
TextFileParser
::
ItemSeparatorLines
>
();
// init optional parameters with sane default values
size_t
dimensionality
=
3
;
tgt
::
svec3
size
;
WeaklyTypedPointer
::
BaseType
pt
;
...
...
@@ -104,6 +103,7 @@ namespace campvis {
// dimensionality and size
if
(
tfp
.
hasKey
(
"CsvFileBaseName"
))
{
size_t
dimensionality
=
3
;
ImageData
*
image
=
new
ImageData
(
dimensionality
,
size
,
1
);
ImageRepresentationLocal
*
rep
=
0
;
size_t
index
=
0
;
...
...
modules/io/processors/vtkimagereader.cpp
View file @
d41fc3ab
...
...
@@ -74,6 +74,7 @@ namespace campvis {
throw
tgt
::
FileException
(
"Could not open file "
+
p_url
.
getValue
()
+
" for reading."
,
p_url
.
getValue
());
std
::
string
curLine
=
getTrimmedLine
(
file
);
// cppcheck-suppress stlIfStrFind
if
(
curLine
.
find
(
"# vtk DataFile Version"
)
!=
0
)
throw
tgt
::
FileException
(
"Unknown identifier in vtk file."
,
p_url
.
getValue
());
...
...
modules/registration/pipelines/nloptregistration.cpp
View file @
d41fc3ab
...
...
@@ -155,9 +155,9 @@ namespace campvis {
stepSize
[
5
]
=
p_rotationStepSize
.
getValue
();
_opt
->
set_initial_step
(
stepSize
);
double
minf
;
nlopt
::
result
result
=
nlopt
::
SUCCESS
;
try
{
double
minf
;
result
=
_opt
->
optimize
(
x
,
minf
);
}
catch
(
std
::
exception
&
e
)
{
...
...
modules/registration/processors/similaritymeasure.cpp
View file @
d41fc3ab
...
...
@@ -228,15 +228,11 @@ namespace campvis {
if
(
similarities
.
size
()
>=
3
&&
similarities2
.
size
()
>=
3
)
{
float
countRCP
=
1.
f
/
similarities
[
0
];
float
meanFixed
=
similarities
[
1
]
*
countRCP
;
float
meanMoving
=
similarities
[
2
]
*
countRCP
;
float
varFixed
=
(
similarities2
[
1
]
-
(
similarities
[
2
]
*
similarities
[
2
])
*
countRCP
)
*
countRCP
;
float
_varMoving
=
(
similarities2
[
0
]
-
(
similarities
[
1
]
*
similarities
[
1
])
*
countRCP
)
*
countRCP
;
float
correlation
=
0.0
f
;
if
(
varFixed
>
0.0
f
&&
_varMoving
>
0.0
f
)
{
correlation
=
(
similarities2
[
2
]
-
(
similarities
[
1
]
*
similarities
[
2
])
*
countRCP
)
*
countRCP
;
if
(
varFixed
>
0.0
f
&&
_varMoving
>
0.0
f
)
{
float
correlation
=
(
similarities2
[
2
]
-
(
similarities
[
1
]
*
similarities
[
2
])
*
countRCP
)
*
countRCP
;
toReturn
=
correlation
/
sqrt
(
varFixed
*
_varMoving
);
}
}
...
...
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