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
26b16d63
Commit
26b16d63
authored
Mar 11, 2011
by
Sebastian Eichelbaum
Browse files
[CHANGE] - colormapper now properly updates the texture name.
parent
6886e7d7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
3 deletions
+15
-3
src/gui/qt4/controlPanel/WQtColormapper.cpp
src/gui/qt4/controlPanel/WQtColormapper.cpp
+8
-2
src/gui/qt4/controlPanel/WQtColormapper.h
src/gui/qt4/controlPanel/WQtColormapper.h
+7
-1
No files found.
src/gui/qt4/controlPanel/WQtColormapper.cpp
View file @
26b16d63
...
...
@@ -103,7 +103,7 @@ WQtColormapper::~WQtColormapper()
m_sortConnection
.
disconnect
();
}
WQtColormapper
::
WQtTextureListItem
::
WQtTextureListItem
(
const
osg
::
ref_ptr
<
WGETexture3D
>
texture
,
QListWidget
*
parent
)
:
WQtColormapper
::
WQtTextureListItem
::
WQtTextureListItem
(
const
osg
::
ref_ptr
<
WGETexture3D
>
texture
,
WQtColormapper
*
cmapper
,
QListWidget
*
parent
)
:
QListWidgetItem
(
QString
::
fromStdString
(
texture
->
name
()
->
get
()
),
parent
),
m_texture
(
texture
)
{
...
...
@@ -113,10 +113,16 @@ WQtColormapper::WQtTextureListItem::WQtTextureListItem( const osg::ref_ptr< WGET
{
setText
(
QString
::
fromStdString
(
names
.
back
()
)
);
}
// we need to know the name of the texture
m_nameConnection
=
m_texture
->
name
()
->
getUpdateCondition
()
->
subscribeSignal
(
boost
::
bind
(
&
WQtColormapper
::
pushUpdateEvent
,
cmapper
)
);
}
WQtColormapper
::
WQtTextureListItem
::~
WQtTextureListItem
()
{
m_nameConnection
.
disconnect
();
}
const
osg
::
ref_ptr
<
WGETexture3D
>
WQtColormapper
::
WQtTextureListItem
::
getTexture
()
const
...
...
@@ -160,7 +166,7 @@ void WQtColormapper::update()
m_textureListWidget
->
clear
();
for
(
WGEColormapping
::
TextureConstIterator
iter
=
r
->
get
().
begin
();
iter
!=
r
->
get
().
end
();
++
iter
)
{
WQtTextureListItem
*
item
=
new
WQtTextureListItem
(
*
iter
);
WQtTextureListItem
*
item
=
new
WQtTextureListItem
(
*
iter
,
this
,
m_textureListWidget
);
m_textureListWidget
->
addItem
(
item
);
// the list widget removes the item (and frees the reference to the texture pointer).
// is the item the texture that has been selected previously?
...
...
src/gui/qt4/controlPanel/WQtColormapper.h
View file @
26b16d63
...
...
@@ -137,8 +137,9 @@ private:
*
* \param texture the texture to handle with this item
* \param parent parent widget
* \param cmapper the colormapper widget managing updates for this item.
*/
WQtTextureListItem
(
const
osg
::
ref_ptr
<
WGETexture3D
>
texture
,
QListWidget
*
parent
=
0
);
WQtTextureListItem
(
const
osg
::
ref_ptr
<
WGETexture3D
>
texture
,
WQtColormapper
*
cmapper
,
QListWidget
*
parent
=
0
);
/**
* Destructor.
...
...
@@ -157,6 +158,11 @@ private:
* The texture that gets handled
*/
const
osg
::
ref_ptr
<
WGETexture3D
>
m_texture
;
/**
* Connection for the texture's name property
*/
boost
::
signals2
::
connection
m_nameConnection
;
};
private
slots
:
...
...
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