Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CAMP
campvis-public
Commits
96165933
Commit
96165933
authored
Feb 03, 2014
by
Christian Schulte zu Berge
Browse files
* Introducing TFGeometry1D::createRamp() factory method
* fixed shader (de)activation in AbstractTransferFunction::bind()
parent
7d1be057
Changes
3
Hide whitespace changes
Inline
Side-by-side
core/classification/abstracttransferfunction.cpp
View file @
96165933
...
...
@@ -61,9 +61,14 @@ namespace campvis {
{
tbb
::
mutex
::
scoped_lock
lock
(
_localMutex
);
if
(
_texture
==
0
||
_dirtyTexture
)
{
shader
->
deactivate
();
createTexture
();
shader
->
activate
();
if
(
shader
->
isActivated
())
{
shader
->
deactivate
();
createTexture
();
shader
->
activate
();
}
else
{
createTexture
();
}
}
}
...
...
core/classification/tfgeometry1d.cpp
View file @
96165933
...
...
@@ -107,6 +107,9 @@ namespace campvis {
return
new
TFGeometry1D
(
keyPoints
);
}
TFGeometry1D
*
TFGeometry1D
::
crateRamp
(
const
tgt
::
vec2
&
interval
,
const
tgt
::
col4
&
color
)
{
return
createQuad
(
interval
,
tgt
::
col4
(
color
.
xyz
(),
0
),
tgt
::
col4
(
color
.
xyz
(),
255
));
}
TFGeometry1D
*
TFGeometry1D
::
createDivergingColorMap
(
const
tgt
::
vec2
&
interval
,
const
tgt
::
col4
&
leftColor
,
const
tgt
::
col4
&
rightColor
,
float
bias
/*= 0.5f*/
)
{
tgtAssert
(
interval
.
x
>=
0.
f
&&
interval
.
y
<=
1.
f
,
"Interval out of bounds, must be in [0, 1]."
);
...
...
core/classification/tfgeometry1d.h
View file @
96165933
...
...
@@ -103,6 +103,15 @@ namespace campvis {
* \return A TFGeometry1D modelling a quad with two KeyPoints.
*/
static
TFGeometry1D
*
createQuad
(
const
tgt
::
vec2
&
interval
,
const
tgt
::
col4
&
leftColor
,
const
tgt
::
col4
&
rightColor
);
/**
* Creates a ramp geometry for the given interval.
* A quad geometry consists of two KeyPoints, the left one having 0 opacity, the right one with full opacity.
* \param interval Interval the geometry resides in, must be in [0, 1].
* \param color Color for ramp
* \return A TFGeometry1D modelling a ramp with two KeyPoints.
*/
static
TFGeometry1D
*
crateRamp
(
const
tgt
::
vec2
&
interval
,
const
tgt
::
col4
&
color
);
/**
* Creates a diverging color map of two diverging colors blending over white.
...
...
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