From 85b246eb1641778389a45a67789647347d8bcfdd Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Tue, 22 Jun 2010 20:37:28 +0000 Subject: [PATCH] * ./hurricane/src/viewer: - Change: In DisplayStyle, new attribute "goMatched" to tell if the style is associated to a given Go and therefore should be displayed in the Layer table. --- hurricane/src/viewer/DisplayStyle.cpp | 36 +++++++++++-------- hurricane/src/viewer/PaletteWidget.cpp | 3 +- .../viewer/hurricane/viewer/DisplayStyle.h | 21 +++++++---- 3 files changed, 36 insertions(+), 24 deletions(-) diff --git a/hurricane/src/viewer/DisplayStyle.cpp b/hurricane/src/viewer/DisplayStyle.cpp index 8efce484..01f2c2f9 100644 --- a/hurricane/src/viewer/DisplayStyle.cpp +++ b/hurricane/src/viewer/DisplayStyle.cpp @@ -2,7 +2,7 @@ // -*- C++ -*- // // This file is part of the Coriolis Software. -// Copyright (c) UPMC/LIP6 2008-2008, All Rights Reserved +// Copyright (c) UPMC/LIP6 2008-2010, All Rights Reserved // // =================================================================== // @@ -65,17 +65,20 @@ namespace Hurricane { , int blue , int borderWidth , float threshold - ) : _name(name) - , _red(red) - , _green(green) - , _blue(blue) - , _borderWidth(borderWidth) - , _pattern(pattern) - , _color(NULL) - , _pen(NULL) - , _brush(NULL) - , _threshold(threshold) - , _refcount(1) + , bool goMatched + ) + : _name (name) + , _red (red) + , _green (green) + , _blue (blue) + , _borderWidth(borderWidth) + , _pattern (pattern) + , _color (NULL) + , _pen (NULL) + , _brush (NULL) + , _threshold (threshold) + , _goMatched (goMatched) + , _refcount (1) { } @@ -88,9 +91,10 @@ namespace Hurricane { , int blue , int borderWidth , float threshold + , bool goMatched ) { - DrawingStyle* style = new DrawingStyle ( name, pattern, red, green, blue, borderWidth, threshold ); + DrawingStyle* style = new DrawingStyle ( name, pattern, red, green, blue, borderWidth, threshold, goMatched ); //if ( Graphics::isEnabled() ) // style->qtAllocate (); @@ -234,6 +238,7 @@ namespace Hurricane { , int blue , int borderWidth , float threshold + , bool goMatched ) { size_t i = findIndex ( key ); @@ -245,7 +250,7 @@ namespace Hurricane { } return _drawingStyles[i] = - DrawingStyle::create ( key, pattern, red, green, blue, borderWidth, threshold ); + DrawingStyle::create ( key, pattern, red, green, blue, borderWidth, threshold, goMatched ); } @@ -398,12 +403,13 @@ namespace Hurricane { , int blue , int borderWidth , float threshold + , bool goMatched ) { size_t gi; findOrCreate ( groupKey, gi ); - _groups[gi]->addDrawingStyle ( key, pattern, red, green, blue, borderWidth, threshold ); + _groups[gi]->addDrawingStyle ( key, pattern, red, green, blue, borderWidth, threshold, goMatched ); } diff --git a/hurricane/src/viewer/PaletteWidget.cpp b/hurricane/src/viewer/PaletteWidget.cpp index 9b9166bb..584c2bf4 100644 --- a/hurricane/src/viewer/PaletteWidget.cpp +++ b/hurricane/src/viewer/PaletteWidget.cpp @@ -244,12 +244,11 @@ namespace Hurricane { gridBuffer.addSection ( _createGroupItem(groups[gi]->getName()), Qt::AlignHCenter ); for ( size_t si=0 ; siisGoMatched() ) continue; if ( styles[si]->getName() == DisplayStyle::Foreground ) continue; if ( styles[si]->getName() == DisplayStyle::Background ) continue; - if ( styles[si]->getName() == DisplayStyle::Foreground ) continue; if ( styles[si]->getName() == DisplayStyle::SelectionDraw ) continue; if ( styles[si]->getName() == DisplayStyle::SelectionFill ) continue; - if ( styles[si]->getName() == DisplayStyle::Foreground ) continue; PaletteNamedItem* item = _createNamedItem ( styles[si]->getName() ); gridBuffer.addWidget ( item ); diff --git a/hurricane/src/viewer/hurricane/viewer/DisplayStyle.h b/hurricane/src/viewer/hurricane/viewer/DisplayStyle.h index 71479519..6ed7c8d0 100644 --- a/hurricane/src/viewer/hurricane/viewer/DisplayStyle.h +++ b/hurricane/src/viewer/hurricane/viewer/DisplayStyle.h @@ -2,7 +2,7 @@ // -*- C++ -*- // // This file is part of the Coriolis Software. -// Copyright (c) UPMC/LIP6 2008-2008, All Rights Reserved +// Copyright (c) UPMC/LIP6 2008-2010, All Rights Reserved // // =================================================================== // @@ -54,12 +54,14 @@ namespace Hurricane { , int blue =0 , int borderWidth=0 , float threshold =1.0 + , bool goMatched =true ); DrawingStyle* link (); size_t unlink (); // Accessors. void qtAllocate (); + inline bool isGoMatched () const; inline const Name& getName () const; inline const string& getPattern () const; QColor getColor ( int darkening ) const; @@ -79,16 +81,18 @@ namespace Hurricane { QPen *_pen; QBrush *_brush; float _threshold; + bool _goMatched; size_t _refcount; // Internal - Constructors & Destructors. DrawingStyle ( const Name& name - , const string& pattern ="FFFFFFFFFFFFFFFF" - , int red =0 - , int green =0 - , int blue =0 - , int borderWidth=0 - , float threshold =1.0 + , const string& pattern + , int red + , int green + , int blue + , int borderWidth + , float threshold + , bool goMatched ); DrawingStyle ( const DrawingStyle& ); ~DrawingStyle (); @@ -120,6 +124,7 @@ namespace Hurricane { , int blue , int borderWidth , float threshold + , bool goMatched ); protected: @@ -192,6 +197,7 @@ namespace Hurricane { , int blue , int borderWidth , float threshold + , bool goMatched =true ); protected: @@ -215,6 +221,7 @@ namespace Hurricane { // Functions. + inline bool DrawingStyle::isGoMatched () const { return _goMatched; } inline const Name& DrawingStyle::getName () const { return _name; } inline const string& DrawingStyle::getPattern () const { return _pattern; } inline float DrawingStyle::getThreshold () const { return _threshold; }