Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
VTK
VTK
Commits
75c1a33e
Commit
75c1a33e
authored
Dec 01, 2014
by
Aashish Chaudhary
Committed by
Code Review
Dec 01, 2014
Browse files
Options
Browse Files
Download
Plain Diff
Merge topic 'volume_update_test' into master
740f0188
Fix crash when running VolumeUpdate test
parents
40c6ad1d
740f0188
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
9 deletions
+12
-9
Rendering/Volume/Testing/Cxx/TestGPURayCastVolumeUpdate.cxx
Rendering/Volume/Testing/Cxx/TestGPURayCastVolumeUpdate.cxx
+11
-9
Rendering/Volume/Testing/Data/Baseline/TestGPURayCastVolumeUpdate_1.png.md5
...esting/Data/Baseline/TestGPURayCastVolumeUpdate_1.png.md5
+1
-0
No files found.
Rendering/Volume/Testing/Cxx/TestGPURayCastVolumeUpdate.cxx
View file @
75c1a33e
...
...
@@ -1211,16 +1211,19 @@ int TestGPURayCastVolumeUpdate(int argc, char *argv[])
vtkNew
<
vtkRenderWindow
>
renWin
;
renWin
->
SetMultiSamples
(
0
);
vtkNew
<
vtkRenderer
>
ren
;
renWin
->
AddRenderer
(
ren
.
GetPointer
());
renWin
->
SetSize
(
400
,
400
);
ren
->
SetBackground
(
0.2
,
0.2
,
0.5
);
vtkNew
<
vtkRenderWindowInteractor
>
iren
;
iren
->
SetRenderWindow
(
renWin
.
GetPointer
());
vtkNew
<
vtkInteractorStyleTrackballCamera
>
style
;
iren
->
SetInteractorStyle
(
style
.
GetPointer
());
renWin
->
Render
();
// make sure we have an OpenGL context.
vtkNew
<
vtkRenderer
>
ren
;
ren
->
SetBackground
(
0.2
,
0.2
,
0.5
);
renWin
->
AddRenderer
(
ren
.
GetPointer
());
vtkNew
<
vtkPiecewiseFunction
>
scalarOpacity
;
scalarOpacity
->
AddPoint
(
50
,
0.0
);
scalarOpacity
->
AddPoint
(
75
,
1.0
);
...
...
@@ -1230,12 +1233,12 @@ int TestGPURayCastVolumeUpdate(int argc, char *argv[])
volumeProperty
->
SetInterpolationType
(
VTK_LINEAR_INTERPOLATION
);
volumeProperty
->
SetScalarOpacity
(
scalarOpacity
.
GetPointer
());
vtkSmartPointer
<
vtkColorTransferFunction
>
colorTransferFunction
=
volumeProperty
->
GetRGBTransferFunction
(
0
);
vtkNew
<
vtkColorTransferFunction
>
colorTransferFunction
;
colorTransferFunction
->
RemoveAllPoints
();
colorTransferFunction
->
AddRGBPoint
(
scalarRange
[
0
],
0.6
,
0.4
,
0.1
);
volumeProperty
->
SetColor
(
colorTransferFunction
.
GetPointer
());
vtk
SmartPointer
<
vtkVolume
>
volume
=
vtkSmartPointer
<
vtkVolume
>::
New
()
;
vtk
New
<
vtkVolume
>
volume
;
volume
->
SetMapper
(
volumeMapper
.
GetPointer
());
volume
->
SetProperty
(
volumeProperty
.
GetPointer
());
...
...
@@ -1252,8 +1255,9 @@ int TestGPURayCastVolumeUpdate(int argc, char *argv[])
center
[
1
]
=
origin
[
1
]
+
spacing
[
1
]
*
dims
[
1
]
/
2.0
;
center
[
2
]
=
origin
[
2
]
+
spacing
[
2
]
*
dims
[
2
]
/
2.0
;
ren
->
AddV
iewProp
(
volume
.
GetPointer
());
ren
->
AddV
olume
(
volume
.
GetPointer
());
ren
->
AddActor
(
outlineActor
.
GetPointer
());
ren
->
ResetCamera
();
int
valid
=
volumeMapper
->
IsRenderSupported
(
renWin
.
GetPointer
(),
volumeProperty
.
GetPointer
());
...
...
@@ -1262,7 +1266,6 @@ int TestGPURayCastVolumeUpdate(int argc, char *argv[])
if
(
valid
)
{
renWin
->
Render
();
ren
->
ResetCamera
();
vtkNew
<
vtkRTAnalyticSource
>
wavelet
;
wavelet
->
SetWholeExtent
(
-
127
,
128
,
...
...
@@ -1273,7 +1276,6 @@ int TestGPURayCastVolumeUpdate(int argc, char *argv[])
volumeMapper
->
SetInputConnection
(
wavelet
->
GetOutputPort
());
outlineFilter
->
UpdateWholeExtent
();
ren
->
ResetCamera
();
renWin
->
Render
();
iren
->
Initialize
();
retVal
=
!
(
vtkTesting
::
InteractorEventLoop
(
argc
,
argv
,
...
...
Rendering/Volume/Testing/Data/Baseline/TestGPURayCastVolumeUpdate_1.png.md5
0 → 100644
View file @
75c1a33e
d2ccc09d634b94865e6e9606d96c364b
Write
Preview
Markdown
is supported
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