Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Andrew Bauer
VTK
Commits
0e2ee9d5
Commit
0e2ee9d5
authored
Dec 20, 1995
by
Ken Martin
Browse files
fixed a number of bugs
parent
14027265
Changes
1
Show whitespace changes
Inline
Side-by-side
src/vtkVolumeRenderer.cc
View file @
0e2ee9d5
...
@@ -134,7 +134,7 @@ void vtkVolumeRenderer::Render(vtkRenderer *ren)
...
@@ -134,7 +134,7 @@ void vtkVolumeRenderer::Render(vtkRenderer *ren)
}
}
}
}
// composite the rays and write the result
// composite the rays and write the result
yoffset
=
(
size
[
1
]
-
y
-
1
)
*
size
[
0
];
yoffset
=
y
*
size
[
0
];
this
->
Composite
(
rays
,
steps
,
i
,
resultColor
);
this
->
Composite
(
rays
,
steps
,
i
,
resultColor
);
this
->
Image
[(
yoffset
+
x
)
*
3
]
=
this
->
Image
[(
yoffset
+
x
)
*
3
]
=
(
unsigned
char
)(
resultColor
[
0
]
*
resultColor
[
3
]
/
255.0
+
(
unsigned
char
)(
resultColor
[
0
]
*
resultColor
[
3
]
/
255.0
+
...
@@ -192,33 +192,33 @@ void vtkVolumeRenderer::CalcRayValues(vtkRenderer *ren, float Vecs[6][3],
...
@@ -192,33 +192,33 @@ void vtkVolumeRenderer::CalcRayValues(vtkRenderer *ren, float Vecs[6][3],
bounds
=
aVolume
->
GetBounds
();
bounds
=
aVolume
->
GetBounds
();
if
((
bounds
[
0
]
-
position
[
0
])
*
VPN
[
0
]
<
(
bounds
[
1
]
-
position
[
0
])
*
VPN
[
0
])
if
((
bounds
[
0
]
-
position
[
0
])
*
VPN
[
0
]
<
(
bounds
[
1
]
-
position
[
0
])
*
VPN
[
0
])
{
{
xmax
=
(
bounds
[
0
]
-
position
[
0
])
*
VPN
[
0
];
xmax
=
-
1.0
*
(
bounds
[
0
]
-
position
[
0
])
*
VPN
[
0
];
xmin
=
(
bounds
[
1
]
-
position
[
0
])
*
VPN
[
0
];
xmin
=
-
1.0
*
(
bounds
[
1
]
-
position
[
0
])
*
VPN
[
0
];
}
}
else
else
{
{
xmin
=
(
bounds
[
0
]
-
position
[
0
])
*
VPN
[
0
];
xmin
=
-
1.0
*
(
bounds
[
0
]
-
position
[
0
])
*
VPN
[
0
];
xmax
=
(
bounds
[
1
]
-
position
[
0
])
*
VPN
[
0
];
xmax
=
-
1.0
*
(
bounds
[
1
]
-
position
[
0
])
*
VPN
[
0
];
}
}
if
((
bounds
[
2
]
-
position
[
1
])
*
VPN
[
1
]
<
(
bounds
[
3
]
-
position
[
1
])
*
VPN
[
1
])
if
((
bounds
[
2
]
-
position
[
1
])
*
VPN
[
1
]
<
(
bounds
[
3
]
-
position
[
1
])
*
VPN
[
1
])
{
{
ymax
=
(
bounds
[
2
]
-
position
[
1
])
*
VPN
[
1
];
ymax
=
-
1.0
*
(
bounds
[
2
]
-
position
[
1
])
*
VPN
[
1
];
ymin
=
(
bounds
[
3
]
-
position
[
1
])
*
VPN
[
1
];
ymin
=
-
1.0
*
(
bounds
[
3
]
-
position
[
1
])
*
VPN
[
1
];
}
}
else
else
{
{
ymin
=
(
bounds
[
2
]
-
position
[
1
])
*
VPN
[
1
];
ymin
=
-
1.0
*
(
bounds
[
2
]
-
position
[
1
])
*
VPN
[
1
];
ymax
=
(
bounds
[
3
]
-
position
[
1
])
*
VPN
[
1
];
ymax
=
-
1.0
*
(
bounds
[
3
]
-
position
[
1
])
*
VPN
[
1
];
}
}
if
((
bounds
[
4
]
-
position
[
2
])
*
VPN
[
2
]
<
(
bounds
[
5
]
-
position
[
2
])
*
VPN
[
2
])
if
((
bounds
[
4
]
-
position
[
2
])
*
VPN
[
2
]
<
(
bounds
[
5
]
-
position
[
2
])
*
VPN
[
2
])
{
{
zmax
=
(
bounds
[
4
]
-
position
[
2
])
*
VPN
[
2
];
zmax
=
-
1.0
*
(
bounds
[
4
]
-
position
[
2
])
*
VPN
[
2
];
zmin
=
(
bounds
[
5
]
-
position
[
2
])
*
VPN
[
2
];
zmin
=
-
1.0
*
(
bounds
[
5
]
-
position
[
2
])
*
VPN
[
2
];
}
}
else
else
{
{
zmin
=
(
bounds
[
4
]
-
position
[
2
])
*
VPN
[
2
];
zmin
=
-
1.0
*
(
bounds
[
4
]
-
position
[
2
])
*
VPN
[
2
];
zmax
=
(
bounds
[
5
]
-
position
[
2
])
*
VPN
[
2
];
zmax
=
-
1.0
*
(
bounds
[
5
]
-
position
[
2
])
*
VPN
[
2
];
}
}
if
((
xmax
+
ymax
+
zmax
)
>
maxz
)
if
((
xmax
+
ymax
+
zmax
)
>
maxz
)
{
{
...
@@ -257,7 +257,7 @@ void vtkVolumeRenderer::CalcRayValues(vtkRenderer *ren, float Vecs[6][3],
...
@@ -257,7 +257,7 @@ void vtkVolumeRenderer::CalcRayValues(vtkRenderer *ren, float Vecs[6][3],
// calc the z val for front clipping plane
// calc the z val for front clipping plane
for
(
i
=
0
;
i
<
3
;
i
++
)
for
(
i
=
0
;
i
<
3
;
i
++
)
{
{
cameraFP
[
i
]
=
position
[
i
]
+
minz
*
VPN
[
i
];
cameraFP
[
i
]
=
position
[
i
]
-
minz
*
VPN
[
i
];
}
}
cameraFP
[
3
]
=
1.0
;
cameraFP
[
3
]
=
1.0
;
ren
->
SetWorldPoint
(
cameraFP
);
ren
->
SetWorldPoint
(
cameraFP
);
...
@@ -266,7 +266,7 @@ void vtkVolumeRenderer::CalcRayValues(vtkRenderer *ren, float Vecs[6][3],
...
@@ -266,7 +266,7 @@ void vtkVolumeRenderer::CalcRayValues(vtkRenderer *ren, float Vecs[6][3],
for
(
i
=
0
;
i
<
3
;
i
++
)
for
(
i
=
0
;
i
<
3
;
i
++
)
{
{
cameraFP
[
i
]
=
position
[
i
]
+
maxz
*
VPN
[
i
];
cameraFP
[
i
]
=
position
[
i
]
-
maxz
*
VPN
[
i
];
}
}
cameraFP
[
3
]
=
1.0
;
cameraFP
[
3
]
=
1.0
;
ren
->
SetWorldPoint
(
cameraFP
);
ren
->
SetWorldPoint
(
cameraFP
);
...
...
Write
Preview
Supports
Markdown
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