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
79af80a3
Commit
79af80a3
authored
Feb 26, 2010
by
Alexander Wiebel
Browse files
[STYLE] changed some todos from seralph to schurade, otherwise ralph will
not find them
parent
c3a7ae8d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
6 deletions
+22
-6
src/dataHandler/WDataSet.h
src/dataHandler/WDataSet.h
+1
-1
src/dataHandler/WDataTexture3D.cpp
src/dataHandler/WDataTexture3D.cpp
+21
-5
No files found.
src/dataHandler/WDataSet.h
View file @
79af80a3
...
...
@@ -73,7 +73,7 @@ public:
*
* \return true if usable as texture.
*/
// TODO(s
eralph
): pure virtual? Are WDataSet instances useful?
// TODO(s
churade
): pure virtual? Are WDataSet instances useful?
virtual
bool
isTexture
()
const
;
/**
...
...
src/dataHandler/WDataTexture3D.cpp
View file @
79af80a3
...
...
@@ -135,16 +135,19 @@ osg::ref_ptr< osg::Image > WDataTexture3D::createTexture3D( unsigned char* sourc
data
[
i
]
=
source
[
i
];
}
}
else
{
// TODO(schurade): throw exception if components!=1 or 3
wlog
::
error
(
"WDataTexture3D"
)
<<
"Did not handle ( components != 1 || components != 3 )."
;
}
return
ima
;
// TODO(seralph): throw exception if components!=1 or 3
}
osg
::
ref_ptr
<
osg
::
Image
>
WDataTexture3D
::
createTexture3D
(
int16_t
*
source
,
int
components
)
{
osg
::
ref_ptr
<
osg
::
Image
>
ima
=
new
osg
::
Image
;
// TODO(seralph): throw exception if components!=1 or 3
if
(
components
==
1
)
if
(
components
==
1
)
{
int
nSize
=
m_grid
->
getNbCoordsX
()
*
m_grid
->
getNbCoordsY
()
*
m_grid
->
getNbCoordsZ
();
...
...
@@ -201,13 +204,18 @@ osg::ref_ptr< osg::Image > WDataTexture3D::createTexture3D( int16_t* source, int
data
[
i
]
=
charSource
[
i
];
}
}
else
{
// TODO(schurade): throw exception if components!=1
wlog
::
error
(
"WDataTexture3D"
)
<<
"Did not handle ( components != 1 )."
;
}
return
ima
;
}
osg
::
ref_ptr
<
osg
::
Image
>
WDataTexture3D
::
createTexture3D
(
float
*
source
,
int
components
)
{
osg
::
ref_ptr
<
osg
::
Image
>
ima
=
new
osg
::
Image
;
// TODO(s
eralph
): throw exception if texture generation failed
osg
::
ref_ptr
<
osg
::
Image
>
ima
=
new
osg
::
Image
;
// TODO(s
churade
): throw exception if texture generation failed
if
(
components
==
1
)
{
ima
->
allocateImage
(
m_grid
->
getNbCoordsX
(),
m_grid
->
getNbCoordsY
(),
m_grid
->
getNbCoordsZ
(),
GL_LUMINANCE
,
GL_FLOAT
);
...
...
@@ -221,6 +229,11 @@ osg::ref_ptr< osg::Image > WDataTexture3D::createTexture3D( float* source, int c
data
[
i
]
=
charSource
[
i
];
}
}
else
{
// TODO(schurade): throw exception if components!=1
wlog
::
error
(
"WDataTexture3D"
)
<<
"Did not handle ( components != 1 )."
;
}
return
ima
;
}
...
...
@@ -232,18 +245,21 @@ void WDataTexture3D::createTexture()
if
(
m_valueSet
->
getDataType
()
==
W_DT_UINT8
)
{
wlog
::
debug
(
"WDataTexture3D"
)
<<
"Handling W_DT_UINT8"
;
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
()
==
W_DT_INT16
)
{
wlog
::
debug
(
"WDataTexture3D"
)
<<
"Handling W_DT_INT16"
;
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
()
==
W_DT_FLOAT
)
{
wlog
::
debug
(
"WDataTexture3D"
)
<<
"Handling W_DT_FLOAT"
;
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
()
);
...
...
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