diff --git a/crlcore/etc/common/display.conf b/crlcore/etc/common/display.conf index ca855467..59a0ee07 100644 --- a/crlcore/etc/common/display.conf +++ b/crlcore/etc/common/display.conf @@ -315,13 +315,13 @@ stylesTable = \ # Group: Active Layers. , (Group , 'Active Layers') - , (Drawing, 'nWell' , { 'color':'Tan' , 'pattern':'antipoids2.32', 'border':1, 'threshold':1.50*scale }) - , (Drawing, 'pWell' , { 'color':'LightYellow', 'pattern':'antipoids2.32', 'border':1, 'threshold':1.50*scale }) - , (Drawing, 'nImplant', { 'color':'LawnGreen' , 'pattern':'diffusion.32' , 'border':0, 'threshold':1.50*scale }) - , (Drawing, 'pImplant', { 'color':'Yellow' , 'pattern':'diffusion.32' , 'border':0, 'threshold':1.50*scale }) - , (Drawing, 'active' , { 'color':'White' , 'pattern':'active.32' , 'border':0, 'threshold':1.50*scale }) - , (Drawing, 'poly' , { 'color':'Red' , 'pattern':'antipoids2.32', 'border':1, 'threshold':1.50*scale }) - , (Drawing, 'poly2' , { 'color':poly2Color , 'pattern':'antipoids2.32', 'border':1, 'threshold':1.50*scale }) + , (Drawing, 'nWell' , { 'color':'Tan' , 'pattern':'antipoids2.32', 'border':1, 'threshold':0.02*scale }) + , (Drawing, 'pWell' , { 'color':'LightYellow', 'pattern':'antipoids2.32', 'border':1, 'threshold':0.02*scale }) + , (Drawing, 'nImplant', { 'color':'LawnGreen' , 'pattern':'diffusion.32' , 'border':0, 'threshold':0.02*scale }) + , (Drawing, 'pImplant', { 'color':'Yellow' , 'pattern':'diffusion.32' , 'border':0, 'threshold':0.02*scale }) + , (Drawing, 'active' , { 'color':'White' , 'pattern':'active.32' , 'border':0, 'threshold':0.02*scale }) + , (Drawing, 'poly' , { 'color':'Red' , 'pattern':'antipoids2.32', 'border':1, 'threshold':0.02*scale }) + , (Drawing, 'poly2' , { 'color':poly2Color , 'pattern':'antipoids2.32', 'border':1, 'threshold':0.02*scale }) # Group: Routing Layers. , (Group , 'Routing Layers') @@ -335,12 +335,12 @@ stylesTable = \ # Group: Cuts (VIA holes) , (Group , 'Cuts (VIA holes)') - , (Drawing, 'cut0', { 'color':'Blue' , 'pattern':'poids2.8' , 'border':2, 'threshold':1.50*scale }) - , (Drawing, 'cut1', { 'color':'Aqua' , 'pattern':'antipoids2.8', 'border':2, 'threshold':0.80*scale }) - , (Drawing, 'cut2', { 'color':'LightPink', 'pattern':'poids2.8' , 'border':2, 'threshold':0.80*scale }) - , (Drawing, 'cut3', { 'color':'Green' , 'pattern':'antipoids2.8', 'border':2, 'threshold':0.80*scale }) - , (Drawing, 'cut4', { 'color':'Yellow' , 'pattern':'poids2.8' , 'border':2, 'threshold':0.80*scale }) - , (Drawing, 'cut5', { 'color':'Violet' , 'pattern':'antipoids2.8', 'border':2, 'threshold':0.80*scale }) + , (Drawing, 'cut0', { 'color':'Blue' , 'pattern':'poids2.8' , 'border':2, 'threshold':0.02*scale }) + , (Drawing, 'cut1', { 'color':'Aqua' , 'pattern':'antipoids2.8', 'border':2, 'threshold':0.02*scale }) + , (Drawing, 'cut2', { 'color':'LightPink', 'pattern':'poids2.8' , 'border':2, 'threshold':0.02*scale }) + , (Drawing, 'cut3', { 'color':'Green' , 'pattern':'antipoids2.8', 'border':2, 'threshold':0.02*scale }) + , (Drawing, 'cut4', { 'color':'Yellow' , 'pattern':'poids2.8' , 'border':2, 'threshold':0.02*scale }) + , (Drawing, 'cut5', { 'color':'Violet' , 'pattern':'antipoids2.8', 'border':2, 'threshold':0.02*scale }) # Group: MIM6. , (Group , 'MIM6') diff --git a/hurricane/src/viewer/CellPrinter.cpp b/hurricane/src/viewer/CellPrinter.cpp index a5b55cfd..5a6c4c08 100644 --- a/hurricane/src/viewer/CellPrinter.cpp +++ b/hurricane/src/viewer/CellPrinter.cpp @@ -284,11 +284,12 @@ namespace Hurricane { void CellPrinter::toPdf ( QPrinter* printer, bool imageOnly ) { + int screenResolution = resolution(); + if (printer == NULL) return; if (_cellWidget->getCell() == NULL) return; _printer = printer; - //_printer->setResolution ( resolution() ); _printer->setResolution ( 150 ); _printer->setPageMargins( 0.0, 0.0, 0.0, 0.0, QPrinter::DevicePixel ); @@ -311,7 +312,7 @@ namespace Hurricane { // Compute the delta size between CellPrinter and CellWidget. //cerr << "Printer/Screen settings:" << endl; //cerr << " Paper size: " << _printer->paperSize() << endl; - //cerr << " Resolution (DPI): " << _printer->resolution() << " (screen:" << resolution() << ")" << endl; + //cerr << " Resolution (DPI): " << _printer->resolution() << " (screen:" << screenResolution << ")" << endl; //cerr << " (paperw,paperh) = (" << _paperWidth << "," << _paperHeight << ")" << endl; //cerr << " CellPrinter: " << geometry().width() << "x" << geometry().height() << endl; //cerr << " CellWidget: " << _cellWidget->geometry().width() << "x" << _cellWidget->geometry().height() << endl; @@ -331,20 +332,17 @@ namespace Hurricane { Box visibleArea = _screenCellWidget->getVisibleArea(); if ( visibleArea.contains(_screenCellWidget->getCell()->getAbutmentBox()) ) { - //cerr << "fit to AB" << endl; setFitOnAbutmentBox( true ); _cellWidget->fitToContents(); } else { - //cerr << "reframe" << endl; _cellWidget->reframe( _screenCellWidget->getVisibleArea() ); } //cerr << " After resize CellWidget: " << _cellWidget->geometry().width() << "x" << _cellWidget->geometry().height() << endl; //cerr << " VisibleArea(printer): " << _cellWidget->getVisibleArea() << endl; //cerr << " VisibleArea(screen): " << _screenCellWidget->getVisibleArea() << endl; - + // //cerr << " (xpaper,ypaper) = (" << _xpaper << "," << _ypaper << ")" << endl; - //cerr << " (w,h) = (" << w << "," << h << ")" << endl; //cerr << " (dw,dh) = (" << _drawingWidth << "," << _drawingHeight << ")" << endl; CellWidget::PainterCb_t cb = boost::bind( &CellPrinter::pageDecorate, this, _1 ); diff --git a/hurricane/src/viewer/CellWidget.cpp b/hurricane/src/viewer/CellWidget.cpp index 20b107e0..ce5038ea 100644 --- a/hurricane/src/viewer/CellWidget.cpp +++ b/hurricane/src/viewer/CellWidget.cpp @@ -992,6 +992,10 @@ namespace Hurricane { clone->setRubberShape ( getRubberShape() ); clone->setTopLeft ( getTopLeft() ); + for ( SelectorCriterion* criterion : _selection.getCriterions() ) { + clone->_selection.add( criterion->clone() ); + } + return clone; } @@ -2476,6 +2480,7 @@ namespace Hurricane { _drawingQuery .setStartLevel( _state->getStartLevel() ); _drawingQuery .setStopLevel ( _state->getStopLevel() ); _textDrawingQuery.setCell ( getCell() ); + _state->getSelection().revalidate(); reframe(); _state->setHistoryEnable( true ); @@ -2795,4 +2800,14 @@ namespace Hurricane { } + string CellWidget::_getString () const + { + string s = "getName()) + "\" "; + else s += "[NULL] "; + s += getString( (void*)this ) + ">"; + return s; + } + + } // End of Hurricane namespace. diff --git a/hurricane/src/viewer/Selector.cpp b/hurricane/src/viewer/Selector.cpp index 12880122..a40c5ce9 100644 --- a/hurricane/src/viewer/Selector.cpp +++ b/hurricane/src/viewer/Selector.cpp @@ -1,16 +1,8 @@ - - -// -*- C++ -*- // // This file is part of the Hurricane Software. // Copyright (c) BULL S.A. 2000-2016, All Rights Reserved // -// =================================================================== -// -// $Id$ -// -// x-----------------------------------------------------------------x -// | | +// +-----------------------------------------------------------------+ // | H U R R I C A N E | // | V L S I B a c k e n d D a t a - B a s e | // | | @@ -18,10 +10,7 @@ // | E-mail : Jean-Paul.Chaput@lip6.fr | // | =============================================================== | // | C++ Module : "./Selector.cpp" | -// | *************************************************************** | -// | U p d a t e s | -// | | -// x-----------------------------------------------------------------x +// +-----------------------------------------------------------------+ #include "hurricane/Error.h" diff --git a/hurricane/src/viewer/SelectorCriterion.cpp b/hurricane/src/viewer/SelectorCriterion.cpp index f98b0453..129918cd 100644 --- a/hurricane/src/viewer/SelectorCriterion.cpp +++ b/hurricane/src/viewer/SelectorCriterion.cpp @@ -1,15 +1,9 @@ - // -*- C++ -*- // // This file is part of the Coriolis Software. // Copyright (c) UPMC/LIP6 2008-2016, All Rights Reserved // -// =================================================================== -// -// $Id$ -// -// x-----------------------------------------------------------------x -// | | +// +-----------------------------------------------------------------+ // | C O R I O L I S | // | V L S I B a c k e n d D a t a - B a s e | // | | @@ -17,10 +11,7 @@ // | E-mail : Jean-Paul.Chaput@asim.lip6.fr | // | =============================================================== | // | C++ Header : "./SelectorCriterion.cpp" | -// | *************************************************************** | -// | U p d a t e s | -// | | -// x-----------------------------------------------------------------x +// +-----------------------------------------------------------------+ #include "hurricane/viewer/CellWidget.h" @@ -64,6 +55,10 @@ namespace Hurricane { { } + NetSelectorCriterion* NetSelectorCriterion::clone () const + { return new NetSelectorCriterion(_net); } + + const Net* NetSelectorCriterion::getNet () const { return _net; } @@ -116,6 +111,10 @@ namespace Hurricane { { } + AreaSelectorCriterion* AreaSelectorCriterion::clone () const + { return new AreaSelectorCriterion(_area); } + + const Box& AreaSelectorCriterion::getArea () const { return _area; } diff --git a/hurricane/src/viewer/hurricane/viewer/CellWidget.h b/hurricane/src/viewer/hurricane/viewer/CellWidget.h index 4e9e92f9..a56fc81c 100644 --- a/hurricane/src/viewer/hurricane/viewer/CellWidget.h +++ b/hurricane/src/viewer/hurricane/viewer/CellWidget.h @@ -305,6 +305,7 @@ namespace Hurricane { void _goUp ( int dy ); void _goDown ( int dy ); void _refresh (); + std::string _getString () const; private: class Spot { @@ -523,16 +524,18 @@ namespace Hurricane { private: class SelectorCriterions { public: - SelectorCriterions (); - ~SelectorCriterions (); - inline void setCellWidget ( CellWidget* ); - SelectorCriterion* add ( const Net* net ); - SelectorCriterion* add ( Box area ); - bool remove ( const Net* net ); - void clear (); - void invalidate (); - void revalidate (); - inline size_t size () const; + SelectorCriterions (); + ~SelectorCriterions (); + inline void setCellWidget ( CellWidget* ); + inline const vector& getCriterions () const; + SelectorCriterion* add ( const Net* net ); + SelectorCriterion* add ( Box area ); + inline SelectorCriterion* add ( SelectorCriterion* ); + bool remove ( const Net* net ); + void clear (); + void invalidate (); + void revalidate (); + inline size_t size () const; private: CellWidget* _cellWidget; vector _criterions; @@ -885,6 +888,17 @@ namespace Hurricane { { return _criterions.size(); } + inline const vector& CellWidget::SelectorCriterions::getCriterions () const + { return _criterions; } + + + inline SelectorCriterion* CellWidget::SelectorCriterions::add ( SelectorCriterion* criterion ) + { + _criterions.push_back( criterion ); + return _criterions.back(); + } + + inline CellWidget::State::ScaleEntry::ScaleEntry ( float scale, const Point& topLeft ) : _scale(scale), _topLeft(topLeft) { } @@ -1424,4 +1438,8 @@ namespace Hurricane { } // End of Hurricane namespace. -#endif // __HURRICANE_CELL_WIDGET__ +GETSTRING_POINTER_SUPPORT(Hurricane::CellWidget); +IOSTREAM_POINTER_SUPPORT(Hurricane::CellWidget); + + +#endif // HURRICANE_CELL_WIDGET diff --git a/hurricane/src/viewer/hurricane/viewer/Selector.h b/hurricane/src/viewer/hurricane/viewer/Selector.h index 416ceece..aff97b91 100644 --- a/hurricane/src/viewer/hurricane/viewer/Selector.h +++ b/hurricane/src/viewer/hurricane/viewer/Selector.h @@ -1,31 +1,21 @@ - - // -*- C++ -*- // // This file is part of the Hurricane Software. // Copyright (c) BULL S.A. 2000-2016, All Rights Reserved // -// =================================================================== -// -// $Id$ -// -// x-----------------------------------------------------------------x -// | | +// +-----------------------------------------------------------------+ // | H U R R I C A N E | // | V L S I B a c k e n d D a t a - B a s e | // | | // | Author : Remy Escassut | // | E-mail : Jean-Paul.Chaput@lip6.fr | // | =============================================================== | -// | C++ Header : "./Selector.h" | -// | *************************************************************** | -// | U p d a t e s | -// | | -// x-----------------------------------------------------------------x +// | C++ Header : "./hurricane/viewer/Selector.h" | +// +-----------------------------------------------------------------+ -#ifndef __HURRICANE_SELECTOR__ -#define __HURRICANE_SELECTOR__ +#ifndef HURRICANE_SELECTOR_H +#define HURRICANE_SELECTOR_H #include "hurricane/Property.h" #include "hurricane/Selectors.h" @@ -80,7 +70,6 @@ namespace Hurricane { typedef set SelectorSet; -} // End of Hurricane namespace. +} // Hurricane namespace. - -#endif +#endif // HURRICANE_SELECTOR_H diff --git a/hurricane/src/viewer/hurricane/viewer/SelectorCriterion.h b/hurricane/src/viewer/hurricane/viewer/SelectorCriterion.h index 5282d72d..01d3a223 100644 --- a/hurricane/src/viewer/hurricane/viewer/SelectorCriterion.h +++ b/hurricane/src/viewer/hurricane/viewer/SelectorCriterion.h @@ -1,59 +1,49 @@ - // -*- C++ -*- // // This file is part of the Coriolis Software. // Copyright (c) UPMC/LIP6 2008-2016, All Rights Reserved // -// =================================================================== -// -// $Id$ -// -// x-----------------------------------------------------------------x -// | | +// +-----------------------------------------------------------------+ // | C O R I O L I S | // | V L S I B a c k e n d D a t a - B a s e | // | | // | Author : Jean-Paul CHAPUT | // | E-mail : Jean-Paul.Chaput@asim.lip6.fr | // | =============================================================== | -// | C++ Header : "./SelectorCriterion.h" | -// | *************************************************************** | -// | U p d a t e s | -// | | -// x-----------------------------------------------------------------x +// | C++ Header : "./hurricane/viewer/SelectorCriterion.h" | +// +-----------------------------------------------------------------+ -#ifndef __HURRICANE_SELECTOR_CRITERION__ -#define __HURRICANE_SELECTOR_CRITERION__ +#ifndef HURRICANE_SELECTOR_CRITERION_H +#define HURRICANE_SELECTOR_CRITERION_H - -#include -#include "hurricane/Commons.h" -#include "hurricane/Name.h" +#include +#include "hurricane/Commons.h" +#include "hurricane/Name.h" namespace Hurricane { - using std::string; class CellWidget; class SelectorCriterion { public: - inline SelectorCriterion (); - virtual ~SelectorCriterion (); - virtual bool isValid ( CellWidget* ) const = 0; - inline bool isEnabled () const; - virtual const Net* getNet () const; - virtual const Box& getArea () const; - inline void enable (); - inline void disable (); - virtual void doSelection ( CellWidget* ) = 0; - virtual void undoSelection ( CellWidget* ); - virtual Record* _getRecord () const = 0; - virtual string _getString () const = 0; - virtual string _getTypeName () const = 0; + inline SelectorCriterion (); + virtual ~SelectorCriterion (); + virtual SelectorCriterion* clone () const = 0; + virtual bool isValid ( CellWidget* ) const = 0; + inline bool isEnabled () const; + virtual const Net* getNet () const; + virtual const Box& getArea () const; + inline void enable (); + inline void disable (); + virtual void doSelection ( CellWidget* ) = 0; + virtual void undoSelection ( CellWidget* ); + virtual Record* _getRecord () const = 0; + virtual string _getString () const = 0; + virtual string _getTypeName () const = 0; private: bool _isEnabled; }; @@ -67,15 +57,16 @@ namespace Hurricane { class NetSelectorCriterion : public SelectorCriterion { public: - NetSelectorCriterion ( const Net* ); - virtual ~NetSelectorCriterion (); - virtual const Net* getNet () const; - virtual bool isValid ( CellWidget* ) const; - virtual void doSelection ( CellWidget* ); - virtual void undoSelection ( CellWidget* ); - virtual Record* _getRecord () const; - virtual string _getString () const; - virtual string _getTypeName () const; + NetSelectorCriterion ( const Net* ); + virtual ~NetSelectorCriterion (); + virtual NetSelectorCriterion* clone () const; + virtual const Net* getNet () const; + virtual bool isValid ( CellWidget* ) const; + virtual void doSelection ( CellWidget* ); + virtual void undoSelection ( CellWidget* ); + virtual Record* _getRecord () const; + virtual string _getString () const; + virtual string _getTypeName () const; protected: const Net* _net; const Name _name; @@ -84,23 +75,23 @@ namespace Hurricane { class AreaSelectorCriterion : public SelectorCriterion { public: - AreaSelectorCriterion ( const Box& ); - virtual ~AreaSelectorCriterion (); - virtual const Box& getArea () const; - virtual bool isValid ( CellWidget* ) const; - virtual void doSelection ( CellWidget* ); - virtual Record* _getRecord () const; - virtual string _getString () const; - virtual string _getTypeName () const; + AreaSelectorCriterion ( const Box& ); + virtual ~AreaSelectorCriterion (); + virtual AreaSelectorCriterion* clone () const; + virtual const Box& getArea () const; + virtual bool isValid ( CellWidget* ) const; + virtual void doSelection ( CellWidget* ); + virtual Record* _getRecord () const; + virtual string _getString () const; + virtual string _getTypeName () const; protected: const Box _area; }; -} +} // Hurricane namespace. INSPECTOR_P_SUPPORT(Hurricane::SelectorCriterion); - -#endif // __HURRICANE_SELECTOR_CRITERION__ +#endif // HURRICANE_SELECTOR_CRITERION_H