Display selection when drawing on printing devices.

* Bug: In Hurricane::CellWidget, when setting up a state of a CellWidget,
    the selection was not copied. Now copy the SelectorCriterion (clone).
* New: In Hurricane::SelectorCriterion, add a clone() method.
* Change: In CRL Core, in etc/common/display.conf, for the Printer.Coriolis
    style, lower the thresold of display for the substrate layers so they
    are shown even in small zoom mode.
This commit is contained in:
Jean-Paul Chaput 2017-03-15 14:37:32 +01:00
parent cf449945fc
commit 00ea8f0205
8 changed files with 123 additions and 124 deletions

View File

@ -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')

View File

@ -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 );

View File

@ -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 = "<CellWidget ";
if (getCell()) s += "\"" + getString(getCell()->getName()) + "\" ";
else s += "[NULL] ";
s += getString( (void*)this ) + ">";
return s;
}
} // End of Hurricane namespace.

View File

@ -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"

View File

@ -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; }

View File

@ -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<SelectorCriterion*>& 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<SelectorCriterion*> _criterions;
@ -885,6 +888,17 @@ namespace Hurricane {
{ return _criterions.size(); }
inline const vector<SelectorCriterion*>& 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

View File

@ -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<Selector*,SelectorLess> SelectorSet;
} // End of Hurricane namespace.
} // Hurricane namespace.
#endif
#endif // HURRICANE_SELECTOR_H

View File

@ -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 <string>
#include "hurricane/Commons.h"
#include "hurricane/Name.h"
#include <string>
#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