diff --git a/hurricane/src/hviewer/CellWidget.cpp b/hurricane/src/hviewer/CellWidget.cpp index 39c9808e..19b89295 100644 --- a/hurricane/src/hviewer/CellWidget.cpp +++ b/hurricane/src/hviewer/CellWidget.cpp @@ -1329,6 +1329,13 @@ namespace Hurricane { } + void CellWidget::setLayerVisible ( const Name& layer, bool visible ) + { + if ( !_palette ) return; + _palette->setItemVisible ( layer, visible ); + } + + bool CellWidget::isDrawable ( const Name& name ) { PaletteItem* item = (_palette) ? _palette->find(name) : NULL; diff --git a/hurricane/src/hviewer/PaletteWidget.cpp b/hurricane/src/hviewer/PaletteWidget.cpp index ff5fae6a..97124f1d 100644 --- a/hurricane/src/hviewer/PaletteWidget.cpp +++ b/hurricane/src/hviewer/PaletteWidget.cpp @@ -377,6 +377,16 @@ namespace Hurricane { } + void PaletteWidget::setItemVisible ( const Name& name, bool visible ) + { + PaletteItem* item = find ( name ); + if ( item ) { + item->setItemVisible ( visible ); + emit paletteChanged(); + } + } + + void PaletteWidget::changeStyle () { PaletteItems::iterator iitem = _layerItems.begin(); diff --git a/hurricane/src/hviewer/hurricane/viewer/CellWidget.h b/hurricane/src/hviewer/hurricane/viewer/CellWidget.h index d734d751..826be6e6 100644 --- a/hurricane/src/hviewer/hurricane/viewer/CellWidget.h +++ b/hurricane/src/hviewer/hurricane/viewer/CellWidget.h @@ -146,6 +146,7 @@ namespace Hurricane { inline void copyToPrinter ( QPrinter* ); inline const float& getScale () const; inline const QPoint& getMousePosition () const; + void setLayerVisible ( const Name& layer, bool visible ); bool isDrawable ( const Name& ); bool isDrawableLayer ( const Name& ); bool isDrawableExtension ( const Name& ); diff --git a/hurricane/src/hviewer/hurricane/viewer/PaletteWidget.h b/hurricane/src/hviewer/hurricane/viewer/PaletteWidget.h index f70a3afc..f7d89787 100644 --- a/hurricane/src/hviewer/hurricane/viewer/PaletteWidget.h +++ b/hurricane/src/hviewer/hurricane/viewer/PaletteWidget.h @@ -69,6 +69,7 @@ namespace Hurricane { void showAll (); void hideAll (); void changeStyle (); + void setItemVisible ( const Name& name, bool visible ); protected: PaletteItems _layerItems;