Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
VTK
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Scott Wittenburg
VTK
Commits
fb7a3909
Commit
fb7a3909
authored
Feb 21, 2016
by
Sean McBride
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed many 'redundantAssignment' cppcheck warnings
parent
6eedef44
Changes
38
Hide whitespace changes
Inline
Side-by-side
Showing
38 changed files
with
74 additions
and
103 deletions
+74
-103
CMake/VTKcppcheckSuppressions.txt
CMake/VTKcppcheckSuppressions.txt
+6
-0
Charts/Core/vtkAxis.cxx
Charts/Core/vtkAxis.cxx
+2
-3
Common/DataModel/Testing/Cxx/TestAMRBox.cxx
Common/DataModel/Testing/Cxx/TestAMRBox.cxx
+1
-2
Common/DataModel/Testing/Cxx/TestDispatchers.cxx
Common/DataModel/Testing/Cxx/TestDispatchers.cxx
+1
-0
Common/DataModel/Testing/Cxx/TestStaticCellLinks.cxx
Common/DataModel/Testing/Cxx/TestStaticCellLinks.cxx
+2
-6
Common/DataModel/vtkIncrementalOctreePointLocator.cxx
Common/DataModel/vtkIncrementalOctreePointLocator.cxx
+2
-4
Common/DataModel/vtkPolygon.cxx
Common/DataModel/vtkPolygon.cxx
+0
-4
Common/System/vtkTimerLog.cxx
Common/System/vtkTimerLog.cxx
+3
-3
Domains/Chemistry/vtkSimpleBondPerceiver.cxx
Domains/Chemistry/vtkSimpleBondPerceiver.cxx
+2
-7
Examples/AMR/Cxx/Generate2DAMRDataSetWithPulse.cxx
Examples/AMR/Cxx/Generate2DAMRDataSetWithPulse.cxx
+2
-4
Examples/AMR/Cxx/Generate3DAMRDataSetWithPulse.cxx
Examples/AMR/Cxx/Generate3DAMRDataSetWithPulse.cxx
+2
-4
Examples/GUI/Qt/GraphicsView/OpenGLScene.cpp
Examples/GUI/Qt/GraphicsView/OpenGLScene.cpp
+6
-6
Filters/Extraction/Testing/Cxx/TestExtractRectilinearGrid.cxx
...ers/Extraction/Testing/Cxx/TestExtractRectilinearGrid.cxx
+1
-2
Filters/Extraction/vtkExtractSelection.cxx
Filters/Extraction/vtkExtractSelection.cxx
+0
-1
Filters/Extraction/vtkProbeSelectedLocations.cxx
Filters/Extraction/vtkProbeSelectedLocations.cxx
+0
-1
Filters/General/Testing/Cxx/TestQuadraturePoints.cxx
Filters/General/Testing/Cxx/TestQuadraturePoints.cxx
+3
-3
Filters/Geometry/Testing/Cxx/TestStructuredGridConnectivity.cxx
...s/Geometry/Testing/Cxx/TestStructuredGridConnectivity.cxx
+1
-2
Filters/ParallelGeometry/Testing/Cxx/TestPUnstructuredGridConnectivity.cxx
...eometry/Testing/Cxx/TestPUnstructuredGridConnectivity.cxx
+1
-2
Filters/ParallelMPI/Testing/Cxx/TestImplicitConnectivity.cxx
Filters/ParallelMPI/Testing/Cxx/TestImplicitConnectivity.cxx
+1
-2
Filters/StatisticsGnuR/vtkRInterface.cxx
Filters/StatisticsGnuR/vtkRInterface.cxx
+4
-4
IO/Export/vtkX3DExporter.cxx
IO/Export/vtkX3DExporter.cxx
+0
-1
IO/GDAL/vtkGDALRasterReader.cxx
IO/GDAL/vtkGDALRasterReader.cxx
+11
-2
IO/Geometry/Testing/Cxx/TestIncrementalOctreePointLocator.cxx
...eometry/Testing/Cxx/TestIncrementalOctreePointLocator.cxx
+1
-1
IO/Geometry/vtkCGMWriter.cxx
IO/Geometry/vtkCGMWriter.cxx
+3
-4
IO/Geometry/vtkTecplotReader.cxx
IO/Geometry/vtkTecplotReader.cxx
+1
-2
IO/Import/vtkOBJImporterInternals.h
IO/Import/vtkOBJImporterInternals.h
+3
-2
IO/Infovis/vtkXMLTreeReader.cxx
IO/Infovis/vtkXMLTreeReader.cxx
+1
-2
IO/MINC/vtkMINCImageReader.cxx
IO/MINC/vtkMINCImageReader.cxx
+1
-2
IO/XML/Testing/Cxx/TestHyperOctreeIO.cxx
IO/XML/Testing/Cxx/TestHyperOctreeIO.cxx
+2
-2
Infovis/Layout/vtkPerturbCoincidentVertices.cxx
Infovis/Layout/vtkPerturbCoincidentVertices.cxx
+1
-4
Rendering/Core/vtkPropAssembly.cxx
Rendering/Core/vtkPropAssembly.cxx
+2
-4
Rendering/OpenGL/Testing/Cxx/TestFBOImplementation.cxx
Rendering/OpenGL/Testing/Cxx/TestFBOImplementation.cxx
+1
-2
Rendering/OpenGL/vtkScalarsToColorsPainter.cxx
Rendering/OpenGL/vtkScalarsToColorsPainter.cxx
+0
-1
Rendering/ParallelLIC/vtkParallelTimer.cxx
Rendering/ParallelLIC/vtkParallelTimer.cxx
+2
-4
Rendering/Qt/vtkQtTreeRingLabelMapper.cxx
Rendering/Qt/vtkQtTreeRingLabelMapper.cxx
+2
-3
Rendering/VolumeOpenGL2/vtkOpenGLGPUVolumeRayCastMapper.cxx
Rendering/VolumeOpenGL2/vtkOpenGLGPUVolumeRayCastMapper.cxx
+1
-3
Web/WebGLExporter/vtkWebGLWidget.cxx
Web/WebGLExporter/vtkWebGLWidget.cxx
+1
-2
Wrapping/Tools/vtkWrapJava.c
Wrapping/Tools/vtkWrapJava.c
+1
-2
No files found.
CMake/VTKcppcheckSuppressions.txt
View file @
fb7a3909
...
...
@@ -78,6 +78,12 @@ nullPointerRedundantCheck:Filters/General/vtkMultiThreshold.cxx
oppositeInnerCondition:Rendering/VolumeOpenGL/vtkOpenGLVolumeTextureMapper3D.cxx
pointerPositive:Common/DataModel/vtkUnstructuredGridCellIterator.cxx
redundantAssignInSwitch:Wrapping/Tools/vtkWrapPythonOverload.c
redundantAssignment:Filters/General/vtkApproximatingSubdivisionFilter.cxx
redundantAssignment:Filters/General/vtkInterpolatingSubdivisionFilter.cxx
redundantAssignment:Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx
redundantAssignment:Rendering/OpenGL2/vtkRenderbuffer.cxx
redundantAssignment:Rendering/OpenGL2/vtkTextureObject.cxx
redundantAssignment:Rendering/VolumeOpenGL2/vtkOpenGLGPUVolumeRayCastMapper.cxx
stlIfStrFind:Infovis/Core/vtkPipelineGraphSource.cxx
unassignedVariable:Common/Transforms/vtkHomogeneousTransform.cxx
unassignedVariable:Filters/Core/vtkFlyingEdges3D.cxx
...
...
Charts/Core/vtkAxis.cxx
View file @
fb7a3909
...
...
@@ -1667,17 +1667,16 @@ double vtkAxis::LogScaleTickMark(double number,
bool
&
niceValue
,
int
&
order
)
{
double
result
(
0.0
);
niceValue
=
false
;
// We need to retrive the order of our number.
order
=
static_cast
<
int
>
(
floor
(
log10
(
number
)));
// We retrive the basis of our number depending on roundUp and return it as
// result.
number
=
number
*
pow
(
10.0
,
static_cast
<
double
>
(
order
*
(
-
1
)));
result
=
roundUp
?
ceil
(
number
)
:
floor
(
number
);
double
result
=
roundUp
?
ceil
(
number
)
:
floor
(
number
);
// If result is 1.0, 2.0 or 5.0 we mark the result as "nice value".
niceValue
=
false
;
if
(
result
==
1.0
||
result
==
2.0
||
result
==
5.0
)
{
niceValue
=
true
;
...
...
Common/DataModel/Testing/Cxx/TestAMRBox.cxx
View file @
fb7a3909
...
...
@@ -251,11 +251,10 @@ int TestAMRBoxIntersection()
// Save the initial
A0
=
A
;
bool
doesIntersect
=
false
;
B
=
A
;
B
.
Shrink
(
2
);
doesIntersect
=
A
.
Intersect
(
B
);
bool
doesIntersect
=
A
.
Intersect
(
B
);
if
(
!
doesIntersect
||
(
A
!=
B
)
)
{
std
::
cerr
<<
"ERROR: Intersecting a fully encompassing box failed!
\n
"
;
...
...
Common/DataModel/Testing/Cxx/TestDispatchers.cxx
View file @
fb7a3909
...
...
@@ -255,6 +255,7 @@ bool TestMixedDispatch()
int
result
=
dispatcher
.
Go
(
as
<
vtkDataArray
>
(
doubleArray
.
GetPointer
()));
result
=
dispatcher
.
Go
(
intArray
.
GetPointer
());
test_expression
(
result
==
2
,
"unexpected"
);
result
=
dispatcher
.
Go
(
doubleArray
.
GetPointer
());
test_expression
(
result
==
3
,
"statefull functor failed with int and double"
);
...
...
Common/DataModel/Testing/Cxx/TestStaticCellLinks.cxx
View file @
fb7a3909
...
...
@@ -99,9 +99,7 @@ int TestStaticCellLinks( int, char *[] )
extract
->
Update
();
// Grab the output, build links on unstructured grid
vtkSmartPointer
<
vtkUnstructuredGrid
>
ugrid
=
vtkSmartPointer
<
vtkUnstructuredGrid
>::
New
();
ugrid
=
extract
->
GetOutput
();
vtkSmartPointer
<
vtkUnstructuredGrid
>
ugrid
=
extract
->
GetOutput
();
vtkStaticCellLinksTemplate
<
int
>
slinks
;
slinks
.
BuildLinks
(
ugrid
);
...
...
@@ -157,9 +155,7 @@ int TestStaticCellLinks( int, char *[] )
ss
->
SetPhiResolution
(
10
);
ss
->
Update
();
vtkSmartPointer
<
vtkPolyData
>
pdata
=
vtkSmartPointer
<
vtkPolyData
>::
New
();
pdata
=
ss
->
GetOutput
();
vtkSmartPointer
<
vtkPolyData
>
pdata
=
ss
->
GetOutput
();
slinks
.
Initialize
();
//reuse
slinks
.
BuildLinks
(
pdata
);
...
...
Common/DataModel/vtkIncrementalOctreePointLocator.cxx
View file @
fb7a3909
...
...
@@ -254,11 +254,9 @@ vtkIdType vtkIncrementalOctreePointLocator::FindClosestInsertedPoint
double
miniDist2
=
this
->
OctreeMaxDimSize
*
this
->
OctreeMaxDimSize
*
4.0
;
double
elseDist2
;
// inter-node search
vtkIdType
elsePntId
;
// inter-node search
vtkIdType
pointIndx
=
-
1
;
vtkIncrementalOctreeNode
*
pLeafNode
=
NULL
;
pLeafNode
=
this
->
GetLeafContainer
(
this
->
OctreeRootNode
,
x
);
pointIndx
=
this
->
FindClosestPointInLeafNode
(
pLeafNode
,
x
,
&
miniDist2
);
vtkIncrementalOctreeNode
*
pLeafNode
=
this
->
GetLeafContainer
(
this
->
OctreeRootNode
,
x
);
vtkIdType
pointIndx
=
this
->
FindClosestPointInLeafNode
(
pLeafNode
,
x
,
&
miniDist2
);
if
(
miniDist2
>
0.0
)
{
...
...
Common/DataModel/vtkPolygon.cxx
View file @
fb7a3909
...
...
@@ -568,10 +568,6 @@ int vtkPolygon::ParameterizePolygon(double *p0, double *p10, double& l10,
{
p
[
j
]
=
x1
[
j
]
-
p0
[
j
];
}
#ifdef BAD_WITH_NODEBUG
s
=
vtkMath
::
Dot
(
p
,
p10
)
/
l10
;
t
=
vtkMath
::
Dot
(
p
,
p20
)
/
l20
;
#endif
s
=
(
p
[
0
]
*
p10
[
0
]
+
p
[
1
]
*
p10
[
1
]
+
p
[
2
]
*
p10
[
2
])
/
l10
;
t
=
(
p
[
0
]
*
p20
[
0
]
+
p
[
1
]
*
p20
[
1
]
+
p
[
2
]
*
p20
[
2
])
/
l20
;
sbounds
[
0
]
=
(
s
<
sbounds
[
0
]
?
s
:
sbounds
[
0
]);
...
...
Common/System/vtkTimerLog.cxx
View file @
fb7a3909
...
...
@@ -556,11 +556,11 @@ double vtkTimerLog::GetUniversalTime()
//----------------------------------------------------------------------------
double
vtkTimerLog
::
GetCPUTime
()
{
double
currentCPUTime
=
1.0
;
#ifndef _WIN32_WCE
currentCPUTime
=
static_cast
<
double
>
(
clock
())
/
static_cast
<
double
>
(
CLOCKS_PER_SEC
);
return
static_cast
<
double
>
(
clock
())
/
static_cast
<
double
>
(
CLOCKS_PER_SEC
);
#else
return
1.0
;
#endif
return
currentCPUTime
;
}
//----------------------------------------------------------------------------
...
...
Domains/Chemistry/vtkSimpleBondPerceiver.cxx
View file @
fb7a3909
...
...
@@ -69,13 +69,8 @@ int vtkSimpleBondPerceiver::RequestData(
output
->
ShallowCopyAttributes
(
input
);
// Get pointers to data
vtkSmartPointer
<
vtkUnsignedShortArray
>
numArr
=
vtkSmartPointer
<
vtkUnsignedShortArray
>::
New
();
vtkSmartPointer
<
vtkPoints
>
posArr
=
vtkSmartPointer
<
vtkPoints
>::
New
();
posArr
=
output
->
GetAtomicPositionArray
();
numArr
=
output
->
GetAtomicNumberArray
();
vtkSmartPointer
<
vtkPoints
>
posArr
=
output
->
GetAtomicPositionArray
();
vtkSmartPointer
<
vtkUnsignedShortArray
>
numArr
=
output
->
GetAtomicNumberArray
();
// Cache atomic radii
vtkNew
<
vtkPeriodicTable
>
pTab
;
...
...
Examples/AMR/Cxx/Generate2DAMRDataSetWithPulse.cxx
View file @
fb7a3909
...
...
@@ -141,15 +141,13 @@ vtkOverlappingAMR* GetAMRDataSet()
double
h
[
3
];
int
ndim
[
3
];
int
blockId
=
-
1
;
int
level
=
-
1
;
// Root Block -- Block 0,0
ndim
[
0
]
=
6
;
ndim
[
1
]
=
5
;
ndim
[
2
]
=
1
;
h
[
0
]
=
h
[
1
]
=
h
[
2
]
=
1.0
;
blockId
=
0
;
level
=
0
;
int
blockId
=
0
;
int
level
=
0
;
vtkUniformGrid
*
root
=
AMRCommon
::
GetGrid
(
origin
,
h
,
ndim
);
vtkAMRBox
box
(
origin
,
ndim
,
h
,
data
->
GetOrigin
(),
data
->
GetGridDescription
());
AttachPulseToGrid
(
root
);
...
...
Examples/AMR/Cxx/Generate3DAMRDataSetWithPulse.cxx
View file @
fb7a3909
...
...
@@ -138,15 +138,13 @@ vtkOverlappingAMR* GetAMRDataSet()
double
origin
[
3
];
double
h
[
3
];
int
ndim
[
3
];
int
blockId
=
-
1
;
int
level
=
-
1
;
// Root Block -- Block 0
ndim
[
0
]
=
6
;
ndim
[
1
]
=
ndim
[
2
]
=
5
;
h
[
0
]
=
h
[
1
]
=
h
[
2
]
=
1.0
;
origin
[
0
]
=
origin
[
1
]
=
origin
[
2
]
=
-
2.0
;
blockId
=
0
;
level
=
0
;
int
blockId
=
0
;
int
level
=
0
;
vtkUniformGrid
*
root
=
AMRCommon
::
GetGrid
(
origin
,
h
,
ndim
);
vtkAMRBox
box
(
origin
,
ndim
,
h
,
data
->
GetOrigin
(),
data
->
GetGridDescription
());
AttachPulseToGrid
(
root
);
...
...
Examples/GUI/Qt/GraphicsView/OpenGLScene.cpp
View file @
fb7a3909
...
...
@@ -107,12 +107,12 @@ OpenGLScene::OpenGLScene(QGLContext* ctx, QObject* p)
trans
->
addAnimation
(
new
QBoolAnimation
(
1.0
,
mTreeRingView
,
"enabled"
));
// enable at end of transition
// non animated transitions
trans
=
state1
->
addTransition
(
this
,
SIGNAL
(
enterState4
()),
state4
);
trans
=
state2
->
addTransition
(
this
,
SIGNAL
(
enterState4
()),
state4
);
trans
=
state3
->
addTransition
(
this
,
SIGNAL
(
enterState4
()),
state4
);
trans
=
state4
->
addTransition
(
this
,
SIGNAL
(
enterState1
()),
state1
);
trans
=
state4
->
addTransition
(
this
,
SIGNAL
(
enterState2
()),
state2
);
trans
=
state4
->
addTransition
(
this
,
SIGNAL
(
enterState3
()),
state3
);
state1
->
addTransition
(
this
,
SIGNAL
(
enterState4
()),
state4
);
state2
->
addTransition
(
this
,
SIGNAL
(
enterState4
()),
state4
);
state3
->
addTransition
(
this
,
SIGNAL
(
enterState4
()),
state4
);
state4
->
addTransition
(
this
,
SIGNAL
(
enterState1
()),
state1
);
state4
->
addTransition
(
this
,
SIGNAL
(
enterState2
()),
state2
);
state4
->
addTransition
(
this
,
SIGNAL
(
enterState3
()),
state3
);
machine
.
start
();
...
...
Filters/Extraction/Testing/Cxx/TestExtractRectilinearGrid.cxx
View file @
fb7a3909
...
...
@@ -34,8 +34,7 @@
double
exponential_distribution
(
const
int
i
,
const
double
beta
)
{
double
xi
=
0.0
;
xi
=
(
(
exp
(
i
*
beta
)
-
1
)
/
(
exp
(
beta
)
-
1
)
);
double
xi
=
(
(
exp
(
i
*
beta
)
-
1
)
/
(
exp
(
beta
)
-
1
)
);
return
(
xi
);
}
...
...
Filters/Extraction/vtkExtractSelection.cxx
View file @
fb7a3909
...
...
@@ -380,7 +380,6 @@ vtkDataObject* vtkExtractSelection::RequestDataFromBlock(
tp
->
SetOutput
(
tempSel
);
subFilter
->
SetInputConnection
(
1
,
tp
->
GetOutputPort
());
tp
->
Delete
();
tp
=
0
;
vtkDataObject
*
inputCopy
=
input
->
NewInstance
();
inputCopy
->
ShallowCopy
(
input
);
...
...
Filters/Extraction/vtkProbeSelectedLocations.cxx
View file @
fb7a3909
...
...
@@ -129,7 +129,6 @@ int vtkProbeSelectedLocations::RequestData(vtkInformation *vtkNotUsed(request),
subFilter
->
SetInputConnection
(
1
,
tp
->
GetOutputPort
());
inputClone
->
Delete
();
tp
->
Delete
();
tp
=
0
;
tp
=
vtkTrivialProducer
::
New
();
tp
->
SetOutput
(
tempInput
);
...
...
Filters/General/Testing/Cxx/TestQuadraturePoints.cxx
View file @
fb7a3909
...
...
@@ -213,7 +213,7 @@ int TestQuadraturePoints(int argc,char *argv[])
camera
->
Elevation
(
95.0
);
camera
->
SetViewUp
(
0.0
,
0.0
,
1.0
);
camera
->
Azimuth
(
180.0
);
camera
=
0
;
// Setup upper right pane.
vtkSmartPointer
<
vtkRenderer
>
ren1
=
vtkSmartPointer
<
vtkRenderer
>::
New
();
ren1
->
SetViewport
(
0.5
,
0.5
,
1.0
,
1.0
);
...
...
@@ -228,7 +228,7 @@ int TestQuadraturePoints(int argc,char *argv[])
camera
->
OrthogonalizeViewUp
();
camera
->
Elevation
(
-
10.0
);
camera
->
Azimuth
(
55.0
);
camera
=
0
;
// Setup lower right pane.
vtkSmartPointer
<
vtkRenderer
>
ren2
=
vtkSmartPointer
<
vtkRenderer
>::
New
();
ren2
->
SetViewport
(
0.5
,
0.0
,
1.0
,
0.5
);
...
...
@@ -236,7 +236,7 @@ int TestQuadraturePoints(int argc,char *argv[])
ren2
->
SetBackground
(
0.328125
,
0.347656
,
0.425781
);
ren2
->
AddActor
(
surfaceActor
);
ren2
->
ResetCamera
();
camera
=
0
;
// If interactive mode then we show wireframes for
// reference.
if
(
testHelper
->
IsInteractiveModeSpecified
())
...
...
Filters/Geometry/Testing/Cxx/TestStructuredGridConnectivity.cxx
View file @
fb7a3909
...
...
@@ -708,8 +708,7 @@ bool CompareFieldsForGrid( vtkUniformGrid *grid )
grid
->
GetCellData
()
->
GetArray
(
"EXPECTED-CellXYZ"
)
);
assert
(
"pre: expectedCellData is NULL"
&&
(
expectedCellData
!=
NULL
)
);
bool
status
=
true
;
status
=
CheckArrays
(
computedCellData
,
expectedCellData
);
bool
status
=
CheckArrays
(
computedCellData
,
expectedCellData
);
if
(
!
status
)
{
return
status
;
...
...
Filters/ParallelGeometry/Testing/Cxx/TestPUnstructuredGridConnectivity.cxx
View file @
fb7a3909
...
...
@@ -41,7 +41,6 @@
int
TestPUnstructuredGridConnectivity
(
int
argc
,
char
*
argv
[])
{
int
rc
=
0
;
double
ellapsed
=
0.0
;
vtkTimerLog
*
timer
=
vtkTimerLog
::
New
();
// STEP 0: Initialize
...
...
@@ -64,7 +63,7 @@ int TestPUnstructuredGridConnectivity(int argc, char* argv[])
timer
->
StartTimer
();
ghostGen
->
BuildGhostZoneConnectivity
();
timer
->
StopTimer
();
ellapsed
=
timer
->
GetElapsedTime
();
double
ellapsed
=
timer
->
GetElapsedTime
();
vtkMPIUtilities
::
Printf
(
cntrl
,
"[DONE]
\n
"
);
// get some performance statistics
...
...
Filters/ParallelMPI/Testing/Cxx/TestImplicitConnectivity.cxx
View file @
fb7a3909
...
...
@@ -219,8 +219,7 @@ vtkMultiBlockDataSet* GetDataSet(
//------------------------------------------------------------------------------
double
exponential_distribution
(
const
int
i
,
const
double
beta
)
{
double
xi
=
0.0
;
xi
=
(
(
exp
(
i
*
beta
)
-
1
)
/
(
exp
(
beta
)
-
1
)
);
double
xi
=
(
(
exp
(
i
*
beta
)
-
1
)
/
(
exp
(
beta
)
-
1
)
);
return
(
xi
);
}
...
...
Filters/StatisticsGnuR/vtkRInterface.cxx
View file @
fb7a3909
...
...
@@ -119,14 +119,14 @@ public:
#endif
ParseStatus
status
;
SEXP
cmdSexp
,
cmdexpr
=
R_NilValue
;
int
error
;
SEXP
cmdSexp
;
PROTECT
(
cmdSexp
=
allocVector
(
STRSXP
,
1
));
SET_STRING_ELT
(
cmdSexp
,
0
,
mkChar
(
rcommand
.
c_str
()));
cmdexpr
=
PROTECT
(
R_ParseVector
(
cmdSexp
,
-
1
,
&
status
,
R_NilValue
));
SEXP
cmdexpr
=
PROTECT
(
R_ParseVector
(
cmdSexp
,
-
1
,
&
status
,
R_NilValue
));
for
(
int
i
=
0
;
i
<
length
(
cmdexpr
);
i
++
)
{
R_tryEval
(
VECTOR_ELT
(
cmdexpr
,
i
),
NULL
,
&
error
);
...
...
@@ -227,15 +227,15 @@ int vtkRInterface::EvalRscript(const char *string, bool showRoutput)
{
ParseStatus
status
;
SEXP
cmdSexp
,
cmdexpr
=
R_NilValue
;
SEXP
ans
;
int
i
;
int
error
;
SEXP
cmdSexp
;
PROTECT
(
cmdSexp
=
allocVector
(
STRSXP
,
1
));
SET_STRING_ELT
(
cmdSexp
,
0
,
mkChar
(
string
));
cmdexpr
=
PROTECT
(
R_ParseVector
(
cmdSexp
,
-
1
,
&
status
,
R_NilValue
));
SEXP
cmdexpr
=
PROTECT
(
R_ParseVector
(
cmdSexp
,
-
1
,
&
status
,
R_NilValue
));
switch
(
status
)
{
case
PARSE_OK
:
...
...
IO/Export/vtkX3DExporter.cxx
View file @
fb7a3909
...
...
@@ -637,7 +637,6 @@ void vtkX3DExporter::WriteATextActor2D(vtkActor2D *anTextActor2D,
ta
=
static_cast
<
vtkTextActor
*>
(
anTextActor2D
);
tp
=
ta
->
GetTextProperty
();
ds
=
NULL
;
ds
=
ta
->
GetInput
();
if
(
ds
==
NULL
)
...
...
IO/GDAL/vtkGDALRasterReader.cxx
View file @
fb7a3909
...
...
@@ -357,21 +357,25 @@ void vtkGDALRasterReader::vtkGDALRasterReaderInternal::GenericReadData()
static_cast
<
void
*>
(
reinterpret_cast
<
GByte
*>
(
&
rawUniformGridData
[
0
])
+
0
*
bandSpace
),
destWidth
,
destHeight
,
this
->
TargetDataType
,
pixelSpace
,
lineSpace
);
assert
(
err
==
CE_None
);
err
=
greenBand
->
RasterIO
(
GF_Read
,
windowX
,
windowY
,
windowWidth
,
windowHeight
,
static_cast
<
void
*>
(
reinterpret_cast
<
GByte
*>
(
&
rawUniformGridData
[
0
])
+
1
*
bandSpace
),
destWidth
,
destHeight
,
this
->
TargetDataType
,
pixelSpace
,
lineSpace
);
assert
(
err
==
CE_None
);
err
=
blueBand
->
RasterIO
(
GF_Read
,
windowX
,
windowY
,
windowWidth
,
windowHeight
,
static_cast
<
void
*>
(
reinterpret_cast
<
GByte
*>
(
&
rawUniformGridData
[
0
])
+
2
*
bandSpace
),
destWidth
,
destHeight
,
this
->
TargetDataType
,
pixelSpace
,
lineSpace
);
assert
(
err
==
CE_None
);
err
=
alphaBand
->
RasterIO
(
GF_Read
,
windowX
,
windowY
,
windowWidth
,
windowHeight
,
static_cast
<
void
*>
(
reinterpret_cast
<
GByte
*>
(
&
rawUniformGridData
[
0
])
+
3
*
bandSpace
),
destWidth
,
destHeight
,
this
->
TargetDataType
,
pixelSpace
,
lineSpace
);
assert
(
err
==
CE_None
);
}
else
{
...
...
@@ -383,14 +387,17 @@ void vtkGDALRasterReader::vtkGDALRasterReaderInternal::GenericReadData()
static_cast
<
void
*>
(
reinterpret_cast
<
GByte
*>
(
&
rawUniformGridData
[
0
])
+
0
*
bandSpace
),
destWidth
,
destHeight
,
this
->
TargetDataType
,
0
,
0
);
assert
(
err
==
CE_None
);
err
=
greenBand
->
RasterIO
(
GF_Read
,
windowX
,
windowY
,
windowWidth
,
windowHeight
,
static_cast
<
void
*>
(
reinterpret_cast
<
GByte
*>
(
&
rawUniformGridData
[
0
])
+
1
*
bandSpace
),
destWidth
,
destHeight
,
this
->
TargetDataType
,
0
,
0
);
assert
(
err
==
CE_None
);
err
=
blueBand
->
RasterIO
(
GF_Read
,
windowX
,
windowY
,
windowWidth
,
windowHeight
,
static_cast
<
void
*>
(
reinterpret_cast
<
GByte
*>
(
&
rawUniformGridData
[
0
])
+
2
*
bandSpace
),
destWidth
,
destHeight
,
this
->
TargetDataType
,
0
,
0
);
assert
(
err
==
CE_None
);
}
}
else
if
(
greyBand
)
...
...
@@ -406,11 +413,13 @@ void vtkGDALRasterReader::vtkGDALRasterReaderInternal::GenericReadData()
static_cast
<
void
*>
(
reinterpret_cast
<
GByte
*>
(
&
rawUniformGridData
[
0
])
+
0
*
bandSpace
),
destWidth
,
destHeight
,
this
->
TargetDataType
,
pixelSpace
,
lineSpace
);
assert
(
err
==
CE_None
);
err
=
alphaBand
->
RasterIO
(
GF_Read
,
windowX
,
windowY
,
windowWidth
,
windowHeight
,
static_cast
<
void
*>
(
reinterpret_cast
<
GByte
*>
(
&
rawUniformGridData
[
0
])
+
1
*
bandSpace
),
destWidth
,
destHeight
,
this
->
TargetDataType
,
pixelSpace
,
lineSpace
);
assert
(
err
==
CE_None
);
}
else
{
...
...
@@ -422,6 +431,7 @@ void vtkGDALRasterReader::vtkGDALRasterReaderInternal::GenericReadData()
static_cast
<
void
*>
(
reinterpret_cast
<
GByte
*>
(
&
rawUniformGridData
[
0
])
+
0
*
bandSpace
),
destWidth
,
destHeight
,
this
->
TargetDataType
,
pixelSpace
,
lineSpace
);
assert
(
err
==
CE_None
);
}
}
else
...
...
@@ -429,8 +439,7 @@ void vtkGDALRasterReader::vtkGDALRasterReaderInternal::GenericReadData()
std
::
cerr
<<
"Unknown raster band type
\n
"
;
return
;
}
((
void
)
err
);
//unused
assert
(
err
==
CE_None
);
(
void
)
err
;
//unused
const
double
*
d
=
GetGeoCornerPoints
();
double
geoSpacing
[]
=
{(
d
[
4
]
-
d
[
0
])
/
this
->
Reader
->
RasterDimensions
[
0
],
...
...
IO/Geometry/Testing/Cxx/TestIncrementalOctreePointLocator.cxx
View file @
fb7a3909
...
...
@@ -147,7 +147,7 @@ int TestIncrementalOctreePointLocator( int argc, char * argv[] )
(
argc
,
argv
,
"Data/post.vtk"
);
ugReader
=
vtkUnstructuredGridReader
::
New
();
ugReader
->
SetFileName
(
fileName
);
delete
[]
fileName
;
fileName
=
NULL
;
delete
[]
fileName
;
ugReader
->
Update
();
unstruct
=
ugReader
->
GetOutput
();
dataPnts
=
unstruct
->
GetPoints
();
...
...
IO/Geometry/vtkCGMWriter.cxx
View file @
fb7a3909
...
...
@@ -3001,14 +3001,13 @@ static int cgmImageColorAllocate(cgmImagePtr im, int r, int g, int b)
#ifdef VTK_NOT_DEFINED
static
int
cgmImageColor16
(
cgmImagePtr
im
)
{
int
si
,
ei
,
li
;
si
=
cgmImageAddColorIndex
(
im
,
255
,
255
,
255
);
int
si
=
cgmImageAddColorIndex
(
im
,
255
,
255
,
255
);
if
(
si
==
-
1
)
{
return
0
;
}
li
=
-
1
;
ei
=
si
;
ei
=
cgmImageAddColorIndex
(
im
,
0
,
0
,
0
);
int
li
=
-
1
;
int
ei
=
cgmImageAddColorIndex
(
im
,
0
,
0
,
0
);
if
(
ei
!=
-
1
)
{
li
=
ei
;
...
...
IO/Geometry/vtkTecplotReader.cxx
View file @
fb7a3909
...
...
@@ -1307,7 +1307,6 @@ void vtkTecplotReader::GetDataArraysList()
int
guessedYid
=
-
1
;
int
guessedZid
=
-
1
;
bool
tokenReady
=
false
;
std
::
string
theTpToken
=
""
;
std
::
string
noSpaceTok
=
""
;
this
->
Variables
.
clear
();
...
...
@@ -1315,7 +1314,7 @@ void vtkTecplotReader::GetDataArraysList()
this
->
Internal
->
Init
();
this
->
Internal
->
ASCIIStream
.
open
(
this
->
FileName
);
theTpToken
=
this
->
Internal
->
GetNextToken
();
std
::
string
theTpToken
=
this
->
Internal
->
GetNextToken
();
while
(
!
this
->
Internal
->
NextCharEOF
)
{
...
...
IO/Import/vtkOBJImporterInternals.h
View file @
fb7a3909
...
...
@@ -81,9 +81,10 @@ public:
TexturePath
=
std
::
string
(
arg
);
if
(
TexturePath
.
empty
())
return
;
char
sep
=
'/'
;
#if defined(_WIN32)
sep
=
'\\'
;
const
char
sep
=
'\\'
;
#else
const
char
sep
=
'/'
;
#endif
if
(
TexturePath
.
at
(
TexturePath
.
size
()
-
1
)
!=
sep
)
TexturePath
+=
sep
;
...
...
IO/Infovis/vtkXMLTreeReader.cxx
View file @
fb7a3909
...
...
@@ -108,8 +108,7 @@ static void vtkXMLTreeReaderProcessElement(vtkMutableDirectedGraph *tree,
continue
;
}
vtkIdType
vertex
=
-
1
;
vertex
=
tree
->
AddVertex
();
vtkIdType
vertex
=
tree
->
AddVertex
();
if
(
parent
!=
-
1
)
{
tree
->
AddEdge
(
parent
,
vertex
);
...
...
IO/MINC/vtkMINCImageReader.cxx
View file @
fb7a3909
...
...
@@ -190,9 +190,8 @@ int vtkMINCImageReader::CanReadFile(const char* fname)
// Do a more thorough check of the image:version attribute, since
// there are lots of NetCDF files out there that aren't minc files.
int
status
=
NC_NOERR
;
int
ncid
=
0
;
status
=
nc_open
(
fname
,
0
,
&
ncid
);
int
status
=
nc_open
(
fname
,
0
,
&
ncid
);
if
(
status
!=
NC_NOERR
)
{
return
0
;
...
...
IO/XML/Testing/Cxx/TestHyperOctreeIO.cxx
View file @
fb7a3909
...
...
@@ -344,14 +344,14 @@ int TestHyperOctreeIO(int argc, char* argv[])
cam
->
Azimuth
(
180
);
renWin
->
Render
();
int
retVal
=
1
;
#ifdef HYPEROCTREEIO_STANDALONE
int
retVal
=
1
;
if
(
interactive
)
{
iren
->
Start
();
}
#else
retVal
=
vtkRegressionTestImage
(
renWin
);
int
retVal
=
vtkRegressionTestImage
(
renWin
);
if
(
retVal
==
vtkRegressionTester
::
DO_INTERACTOR
)
{
iren
->
Start
();
...
...
Infovis/Layout/vtkPerturbCoincidentVertices.cxx
View file @
fb7a3909
...
...
@@ -153,12 +153,9 @@ void vtkPerturbCoincidentVertices::SpiralPerturbation(vtkGraph *input, vtkGraph
double
spiralPoint
[
3
];
double
point
[
3
];
//double distance = sqrt(vtkMath::Distance2BetweenPoints(point1, point2));
double
scale
=
1.0
;
//scale = (distance * 1.4)/numPoints;
// use the smallest metric to scale the spiral vertices.
scale
=
shortestEdge
<
averageDistance
?
shortestEdge
/
4
:
averageDistance
/
4
;
double
scale
=
shortestEdge
<
averageDistance
?
shortestEdge
/
4
:
averageDistance
/
4
;
vtkSmartPointer
<
vtkPoints
>
offsets
=
vtkSmartPointer
<
vtkPoints
>::
New
();
coincidentPoints
->
InitTraversal
();
...
...
Rendering/Core/vtkPropAssembly.cxx
View file @
fb7a3909
...
...
@@ -171,12 +171,11 @@ int vtkPropAssembly::RenderOpaqueGeometry(vtkViewport *ren)
vtkAssemblyPath
*
path
;
double
fraction
;
int
renderedSomething
=
0
;
double
numberOfItems
=
0.0
;
// Make sure the paths are up-to-date
this
->
UpdatePaths
();
numberOfItems
=
static_cast
<
double
>
(
this
->
Parts
->
GetNumberOfItems
());
double
numberOfItems
=
static_cast
<
double
>
(
this
->
Parts
->
GetNumberOfItems
());
fraction
=
numberOfItems
>=
1.0
?
this
->
AllocatedRenderTime
/
numberOfItems
:
this
->
AllocatedRenderTime
;
...
...
@@ -204,12 +203,11 @@ int vtkPropAssembly::RenderOverlay(vtkViewport *ren)
vtkAssemblyPath
*
path
;
double
fraction
;
int
renderedSomething
=
0
;
double
numberOfItems
=
0.0
;
// Make sure the paths are up-to-date
this
->
UpdatePaths
();
numberOfItems
=
static_cast
<
double
>
(
this
->
Parts
->
GetNumberOfItems
());
double
numberOfItems
=
static_cast
<
double
>
(
this
->
Parts
->
GetNumberOfItems
());
fraction
=
numberOfItems
>=
1.0
?
this
->
AllocatedRenderTime
/
numberOfItems
:
this
->
AllocatedRenderTime
;
...
...
Rendering/OpenGL/Testing/Cxx/TestFBOImplementation.cxx
View file @
fb7a3909
...
...
@@ -2196,9 +2196,8 @@ int main(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
// extensions returned by the driver.
// clean glError
GLenum
errorCode
=
glGetError
();
glTexImage2D
(
GL_TEXTURE_2D
,
0
,
GL_RGBA16
,
64
,
64
,
0
,
GL_RGBA
,
GL_FLOAT
,
NULL
);
errorCode
=
glGetError
();
GLenum
errorCode
=
glGetError
();
if
(
errorCode
!=
GL_NO_ERROR
)
{
cout
<<
"Loading a power-of-two texture failed with the following error:"
...
...
Rendering/OpenGL/vtkScalarsToColorsPainter.cxx
View file @
fb7a3909
...
...
@@ -627,7 +627,6 @@ void vtkScalarsToColorsPainter::MapScalars(vtkDataSet* output,
}
// Get rid of old colors.
colors
=
0
;
orig_alpha
=
lut
->
GetAlpha
();
lut
->
SetAlpha
(
alpha
);
colors
=
lut
->
MapScalars
(
abstractScalars
,
this
->
ColorMode
,
arraycomponent
);
...
...
Rendering/ParallelLIC/vtkParallelTimer.cxx
View file @
fb7a3909
...
...
@@ -510,10 +510,9 @@ void vtkParallelTimer::StartEvent(const char *event)
cerr
<<
"=====vtkParallelTimer::StartEvent"
<<
endl
;
#endif
double
walls
=
0.0
;
timeval
wallt
;
gettimeofday
(
&
wallt
,
0x0
);
walls
=
static_cast
<
double
>
(
wallt
.
tv_sec
)
double
walls
=
static_cast
<
double
>
(
wallt
.
tv_sec
)
+
static_cast
<
double
>
(
wallt
.
tv_usec
)
/
1.0E6
;
#if vtkParallelTimerDEBUG < 0
...
...
@@ -544,10 +543,9 @@ void vtkParallelTimer::EndEvent(const char *event)
cerr
<<
"=====vtkParallelTimer::EndEvent"
<<
endl
;
#endif
double
walle
=
0.0
;
timeval
wallt
;
gettimeofday
(
&
wallt
,
0x0
);
walle
=
static_cast
<
double
>
(
wallt
.
tv_sec
)
double
walle
=
static_cast
<
double
>
(
wallt
.
tv_sec
)
+
static_cast
<
double
>
(
wallt
.
tv_usec
)
/
1.0E6
;
#if vtkParallelTimerDEBUG > 0
...
...
Rendering/Qt/vtkQtTreeRingLabelMapper.cxx
View file @
fb7a3909