Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
9.2.2023: Due to updates GitLab will be unavailable for some minutes between 9:00 and 11:00.
Open sidebar
CAMP
campvis-public
Commits
f211c483
Commit
f211c483
authored
Jan 05, 2014
by
Christian Schulte zu Berge
Browse files
cleaned up AbstractTransferFunction class
parent
eb40f70e
Changes
2
Hide whitespace changes
Inline
Side-by-side
core/classification/abstracttransferfunction.cpp
View file @
f211c483
...
...
@@ -59,7 +59,6 @@ namespace campvis {
tgtAssert
(
shader
!=
0
,
"Shader must not be 0."
);
{
// TODO: lock here or in createTexture?
tbb
::
mutex
::
scoped_lock
lock
(
_localMutex
);
if
(
_texture
==
0
||
_dirtyTexture
)
{
shader
->
deactivate
();
...
...
@@ -88,16 +87,7 @@ namespace campvis {
shader
->
setIgnoreUniformLocationError
(
tmp
);
}
void
AbstractTransferFunction
::
uploadTexture
()
{
{
tbb
::
mutex
::
scoped_lock
lock
(
_localMutex
);
if
(
_texture
==
0
||
_dirtyTexture
)
{
createTexture
();
}
}
}
void
AbstractTransferFunction
::
setIntensityDomain
(
const
tgt
::
vec2
&
newDomain
)
{
tgtAssert
(
newDomain
.
x
<=
newDomain
.
y
,
"Intensity domain is not a valid interval."
);
{
...
...
@@ -113,7 +103,6 @@ namespace campvis {
}
const
tgt
::
Texture
*
AbstractTransferFunction
::
getTexture
()
{
// TODO: lock here or in createTexture?
{
tbb
::
mutex
::
scoped_lock
lock
(
_localMutex
);
if
(
_texture
==
0
||
_dirtyTexture
)
{
...
...
core/classification/abstracttransferfunction.h
View file @
f211c483
...
...
@@ -55,8 +55,6 @@ namespace campvis {
* b) All OpenGL-related methods must be called by a thread with a valid and locked OpenGL
* context. Even though other internals might be changed meanwhile, this ensures that
* the OpenGL stuff (e.g. the texture) stays valid for this time.
*
* \todo Check thread-safety, the private local lock is probably not the best design.
*/
class
AbstractTransferFunction
{
public:
...
...
@@ -101,12 +99,6 @@ namespace campvis {
*/
void
bind
(
tgt
::
Shader
*
shader
,
const
tgt
::
TextureUnit
&
texUnit
,
const
std
::
string
&
transFuncUniform
=
"_transferFunction"
,
const
std
::
string
&
transFuncParamsUniform
=
"_transferFunctionParams"
);
/**
* Creates the OpenGL texture.
* \note Calling thread must have a valid OpenGL context.
*/
void
uploadTexture
();
/**
* Sets the intensity domain where the transfer function is mapped to during classification.
* \param newDomain new intensity domain
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment