Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VTK
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Erik Palmer
VTK
Commits
74540cc3
Commit
74540cc3
authored
7 years ago
by
Neal Siekierski
Browse files
Options
Downloads
Patches
Plain Diff
Remove related legacy code in vtkSmartVolumeMapper
parent
8de89d86
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Rendering/VolumeOpenGL/vtkSmartVolumeMapper.cxx
+0
-114
0 additions, 114 deletions
Rendering/VolumeOpenGL/vtkSmartVolumeMapper.cxx
Rendering/VolumeOpenGL/vtkSmartVolumeMapper.h
+0
-6
0 additions, 6 deletions
Rendering/VolumeOpenGL/vtkSmartVolumeMapper.h
with
0 additions
and
120 deletions
Rendering/VolumeOpenGL/vtkSmartVolumeMapper.cxx
+
0
−
114
View file @
74540cc3
...
...
@@ -28,7 +28,6 @@
#include
"vtkRenderWindow.h"
#include
"vtkVolume.h"
#include
"vtkVolumeProperty.h"
#include
"vtkVolumeTextureMapper3D.h"
#include
"vtkSmartPointer.h"
#include
<cassert>
...
...
@@ -63,9 +62,6 @@ vtkSmartVolumeMapper::vtkSmartVolumeMapper()
this
->
MaxMemoryInBytes
=
this
->
GPUMapper
->
GetMaxMemoryInBytes
();
this
->
MaxMemoryFraction
=
this
->
GPUMapper
->
GetMaxMemoryFraction
();
#if !defined(VTK_LEGACY_REMOVE)
this
->
TextureMapper
=
vtkVolumeTextureMapper3D
::
New
();
#endif // VTK_LEGACY_REMOVE
this
->
GPULowResMapper
=
vtkGPUVolumeRayCastMapper
::
New
();
// If the render window has a desired update rate of at least 1 frame
...
...
@@ -102,19 +98,6 @@ vtkSmartVolumeMapper::vtkSmartVolumeMapper()
this
->
RayCastMapper
->
AddObserver
(
vtkCommand
::
VolumeMapperComputeGradientsEndEvent
,
cb
);
this
->
RayCastMapper
->
AddObserver
(
vtkCommand
::
VolumeMapperComputeGradientsProgressEvent
,
cb
);
// And the texture mapper's events
#if !defined(VTK_LEGACY_REMOVE)
this
->
TextureMapper
->
AddObserver
(
vtkCommand
::
StartEvent
,
cb
);
this
->
TextureMapper
->
AddObserver
(
vtkCommand
::
EndEvent
,
cb
);
this
->
TextureMapper
->
AddObserver
(
vtkCommand
::
ProgressEvent
,
cb
);
this
->
TextureMapper
->
AddObserver
(
vtkCommand
::
VolumeMapperRenderStartEvent
,
cb
);
this
->
TextureMapper
->
AddObserver
(
vtkCommand
::
VolumeMapperRenderEndEvent
,
cb
);
this
->
TextureMapper
->
AddObserver
(
vtkCommand
::
VolumeMapperRenderProgressEvent
,
cb
);
this
->
TextureMapper
->
AddObserver
(
vtkCommand
::
VolumeMapperComputeGradientsStartEvent
,
cb
);
this
->
TextureMapper
->
AddObserver
(
vtkCommand
::
VolumeMapperComputeGradientsEndEvent
,
cb
);
this
->
TextureMapper
->
AddObserver
(
vtkCommand
::
VolumeMapperComputeGradientsProgressEvent
,
cb
);
#endif // VTK_LEGACY_REMOVE
// And the GPU mapper's events
// Commented out because too many events are being forwwarded
// put back in after that is fixed
...
...
@@ -158,13 +141,6 @@ vtkSmartVolumeMapper::~vtkSmartVolumeMapper()
this
->
GPULowResMapper
->
Delete
();
this
->
GPULowResMapper
=
0
;
}
#if !defined(VTK_LEGACY_REMOVE)
if
(
this
->
TextureMapper
)
{
this
->
TextureMapper
->
Delete
();
this
->
TextureMapper
=
0
;
}
#endif // VTK_LEGACY_REMOVE
if
(
this
->
GPUResampleFilter
)
{
this
->
GPUResampleFilter
->
Delete
();
...
...
@@ -197,11 +173,6 @@ void vtkSmartVolumeMapper::Render( vtkRenderer *ren, vtkVolume *vol )
case
vtkSmartVolumeMapper
::
RayCastRenderMode
:
this
->
RayCastMapper
->
Render
(
ren
,
vol
);
break
;
#if !defined(VTK_LEGACY_REMOVE)
case
vtkSmartVolumeMapper
::
TextureRenderMode
:
this
->
TextureMapper
->
Render
(
ren
,
vol
);
break
;
#endif // VTK_LEGACY_REMOVE
case
vtkSmartVolumeMapper
::
GPURenderMode
:
if
(
this
->
LowResGPUNecessary
)
{
...
...
@@ -296,21 +267,6 @@ void vtkSmartVolumeMapper::Initialize(vtkRenderer *ren, vtkVolume *vol)
vtkRenderWindow
*
win
=
ren
->
GetRenderWindow
();
win
->
MakeCurrent
();
#if !defined(VTK_LEGACY_REMOVE)
// Have to give the texture mapper its input or else it won't report that
// it is supported. Texture mapper only supported for composite blend
if
(
this
->
GetBlendMode
()
!=
vtkVolumeMapper
::
COMPOSITE_BLEND
)
{
this
->
TextureSupported
=
0
;
}
else
{
this
->
ConnectMapperInput
(
this
->
TextureMapper
);
this
->
TextureSupported
=
this
->
TextureMapper
->
IsRenderSupported
(
vol
->
GetProperty
(),
ren
);
}
#endif // VTK_LEGACY_REMOVE
this
->
GPUSupported
=
this
->
GPUMapper
->
IsRenderSupported
(
win
,
vol
->
GetProperty
());
this
->
Initialized
=
1
;
...
...
@@ -364,16 +320,6 @@ void vtkSmartVolumeMapper::ComputeRenderMode(vtkRenderer *ren, vtkVolume *vol)
}
break
;
#if !defined(VTK_LEGACY_REMOVE)
// Requested 3D texture - OK as long as it is supported
case
vtkSmartVolumeMapper
::
TextureRenderMode
:
if
(
this
->
TextureSupported
)
{
this
->
CurrentRenderMode
=
vtkSmartVolumeMapper
::
TextureRenderMode
;
}
break
;
#endif // VTK_LEGACY_REMOVE
// Requested GPU - OK as long as it is supported
case
vtkSmartVolumeMapper
::
GPURenderMode
:
if
(
this
->
GPUSupported
)
...
...
@@ -398,37 +344,12 @@ void vtkSmartVolumeMapper::ComputeRenderMode(vtkRenderer *ren, vtkVolume *vol)
{
this
->
CurrentRenderMode
=
vtkSmartVolumeMapper
::
GPURenderMode
;
}
#if !defined(VTK_LEGACY_REMOVE)
// If this is interactive, try for texture mapping
else
if
(
win
->
GetDesiredUpdateRate
()
>=
this
->
InteractiveUpdateRate
&&
this
->
TextureSupported
)
{
this
->
CurrentRenderMode
=
vtkSmartVolumeMapper
::
TextureRenderMode
;
}
#endif // VTK_LEGACY_REMOVE
else
if
(
this
->
RayCastSupported
)
{
this
->
CurrentRenderMode
=
vtkSmartVolumeMapper
::
RayCastRenderMode
;
}
break
;
#if !defined(VTK_LEGACY_REMOVE)
// Requested the texture mapping / ray cast combo. If texture
// mapping is supported and this is an interactive render, then
// use it. Otherwise use ray casting.
case
vtkSmartVolumeMapper
::
RayCastAndTextureRenderMode
:
if
(
this
->
TextureSupported
&&
(
win
->
GetDesiredUpdateRate
()
>=
this
->
InteractiveUpdateRate
))
{
this
->
CurrentRenderMode
=
vtkSmartVolumeMapper
::
TextureRenderMode
;
}
else
if
(
this
->
RayCastSupported
)
{
this
->
CurrentRenderMode
=
vtkSmartVolumeMapper
::
RayCastRenderMode
;
}
break
;
#endif // VTK_LEGACY_REMOVE
// This should never happen since the SetRequestedRenderMode
// protects against invalid states
default
:
...
...
@@ -461,38 +382,6 @@ void vtkSmartVolumeMapper::ComputeRenderMode(vtkRenderer *ren, vtkVolume *vol)
this
->
RayCastMapper
->
SetFinalColorLevel
(
this
->
FinalColorLevel
);
break
;
#if !defined(VTK_LEGACY_REMOVE)
// We are rendering with the vtkVolumeTextureMapper3D
case
vtkSmartVolumeMapper
::
TextureRenderMode
:
if
(
this
->
ArrayAccessMode
==
VTK_GET_ARRAY_BY_NAME
)
{
this
->
TextureMapper
->
SelectScalarArray
(
this
->
ArrayName
);
}
else
if
(
this
->
ArrayAccessMode
==
VTK_GET_ARRAY_BY_ID
)
{
this
->
TextureMapper
->
SelectScalarArray
(
this
->
ArrayId
);
}
this
->
TextureMapper
->
SetScalarMode
(
this
->
GetScalarMode
());
this
->
ConnectMapperInput
(
this
->
TextureMapper
);
if
(
this
->
RequestedRenderMode
==
vtkSmartVolumeMapper
::
DefaultRenderMode
||
this
->
RequestedRenderMode
==
vtkSmartVolumeMapper
::
RayCastAndTextureRenderMode
)
{
this
->
TextureMapper
->
SetSampleDistance
(
static_cast
<
float
>
((
spacing
[
0
]
+
spacing
[
1
]
+
spacing
[
2
]
)
/
2.0
)
);
}
else
{
this
->
TextureMapper
->
SetSampleDistance
(
static_cast
<
float
>
((
spacing
[
0
]
+
spacing
[
1
]
+
spacing
[
2
]
)
/
6.0
)
);
}
this
->
TextureMapper
->
SetClippingPlanes
(
this
->
GetClippingPlanes
());
this
->
TextureMapper
->
SetCropping
(
this
->
GetCropping
());
this
->
TextureMapper
->
SetCroppingRegionPlanes
(
this
->
GetCroppingRegionPlanes
());
this
->
TextureMapper
->
SetCroppingRegionFlags
(
this
->
GetCroppingRegionFlags
());
// TextureMapper does not support FinalColor Window/Level.
break
;
#endif // VTK_LEGACY_REMOVE
// We are rendering with the vtkGPUVolumeRayCastMapper
case
vtkSmartVolumeMapper
::
GPURenderMode
:
if
(
this
->
ArrayAccessMode
==
VTK_GET_ARRAY_BY_NAME
)
...
...
@@ -682,9 +571,6 @@ void vtkSmartVolumeMapper::SetRequestedRenderModeToRayCast()
void
vtkSmartVolumeMapper
::
ReleaseGraphicsResources
(
vtkWindow
*
w
)
{
this
->
RayCastMapper
->
ReleaseGraphicsResources
(
w
);
#if !defined(VTK_LEGACY_REMOVE)
this
->
TextureMapper
->
ReleaseGraphicsResources
(
w
);
#endif // VTK_LEGACY_REMOVE
this
->
GPUMapper
->
ReleaseGraphicsResources
(
w
);
this
->
GPULowResMapper
->
ReleaseGraphicsResources
(
w
);
...
...
This diff is collapsed.
Click to expand it.
Rendering/VolumeOpenGL/vtkSmartVolumeMapper.h
+
0
−
6
View file @
74540cc3
...
...
@@ -114,9 +114,6 @@ class vtkOSPRayVolumeInterface;
class
vtkRenderWindow
;
class
vtkVolume
;
class
vtkVolumeProperty
;
#if !defined(VTK_LEGACY_REMOVE)
class
vtkVolumeTextureMapper3D
;
#endif // VTK_LEGACY_REMOVE
class
VTKRENDERINGVOLUMEOPENGL_EXPORT
vtkSmartVolumeMapper
:
public
vtkVolumeMapper
{
...
...
@@ -372,9 +369,6 @@ protected:
vtkGPUVolumeRayCastMapper
*
GPULowResMapper
;
vtkGPUVolumeRayCastMapper
*
GPUMapper
;
vtkFixedPointVolumeRayCastMapper
*
RayCastMapper
;
#if !defined(VTK_LEGACY_REMOVE)
vtkVolumeTextureMapper3D
*
TextureMapper
;
#endif // VTK_LEGACY_REMOVE
// We need to keep track of the blend mode we had when we initialized
// because we need to reinitialize (and recheck hardware support) if
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment