Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OpenWalnut
OpenWalnut Core
Commits
e6944d71
Commit
e6944d71
authored
Jan 28, 2010
by
Alexander Wiebel
Browse files
[FIX] used names instead of numbers and added else case
parent
7f63731f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
src/dataHandler/WDataTexture3D.cpp
src/dataHandler/WDataTexture3D.cpp
+10
-5
No files found.
src/dataHandler/WDataTexture3D.cpp
View file @
e6944d71
...
...
@@ -28,6 +28,8 @@
#include "WDataTexture3D.h"
#include "../common/WLogger.h"
WDataTexture3D
::
WDataTexture3D
(
boost
::
shared_ptr
<
WValueSetBase
>
valueSet
,
boost
::
shared_ptr
<
WGrid
>
grid
)
:
m_alpha
(
1.0
),
m_threshold
(
0.0
),
...
...
@@ -200,26 +202,29 @@ void WDataTexture3D::createTexture()
{
osg
::
ref_ptr
<
osg
::
Image
>
ima
;
if
(
m_valueSet
->
getDataType
()
==
2
)
if
(
m_valueSet
->
getDataType
()
==
W_DT_UINT8
)
{
std
::
cout
<<
"W_DT_UINT8"
<<
std
::
endl
;
boost
::
shared_ptr
<
WValueSet
<
unsigned
char
>
>
vs
=
boost
::
shared_dynamic_cast
<
WValueSet
<
unsigned
char
>
>
(
m_valueSet
);
unsigned
char
*
source
=
const_cast
<
unsigned
char
*
>
(
vs
->
rawData
()
);
ima
=
createTexture3D
(
source
,
m_valueSet
->
dimension
()
);
}
else
if
(
m_valueSet
->
getDataType
()
==
4
)
else
if
(
m_valueSet
->
getDataType
()
==
W_DT_INT16
)
{
std
::
cout
<<
"W_DT_INT16"
<<
std
::
endl
;
boost
::
shared_ptr
<
WValueSet
<
int16_t
>
>
vs
=
boost
::
shared_dynamic_cast
<
WValueSet
<
int16_t
>
>
(
m_valueSet
);
int16_t
*
source
=
const_cast
<
int16_t
*
>
(
vs
->
rawData
()
);
ima
=
createTexture3D
(
source
,
m_valueSet
->
dimension
()
);
}
else
if
(
m_valueSet
->
getDataType
()
==
16
)
else
if
(
m_valueSet
->
getDataType
()
==
W_DT_FLOAT
)
{
std
::
cout
<<
"W_DT_FLOAT"
<<
std
::
endl
;
boost
::
shared_ptr
<
WValueSet
<
float
>
>
vs
=
boost
::
shared_dynamic_cast
<
WValueSet
<
float
>
>
(
m_valueSet
);
float
*
source
=
const_cast
<
float
*
>
(
vs
->
rawData
()
);
ima
=
createTexture3D
(
source
,
m_valueSet
->
dimension
()
);
}
else
wlog
::
error
(
"WDataTexture3D"
)
<<
"COnversion of this data type to texture not supported yet."
;
m_texture
=
osg
::
ref_ptr
<
osg
::
Texture3D
>
(
new
osg
::
Texture3D
);
m_texture
->
setFilter
(
osg
::
Texture3D
::
MIN_FILTER
,
osg
::
Texture3D
::
LINEAR
);
...
...
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