* ./hurricane/src/hurricane:
- Change: In RoutingPad, uses my C++ style. Normalize constructors calls. Allow to select (trough flags) the way the "best component" is choosen. Currently: Biggest Area or Lowest Layer or Highest Layer. * ./hurricane/src/viewer: - New: In DisplayStyle, darkening is now expressed as a ratio over the HSV components of a color. Introduce a new DisplayStyle::HSVr type. Allow a more readable darkening effect. All object modicated accordingly. - Change: In NetlistWidget, the "Net" section now correctly dimension itself on the widest net name. Must suppress all the size Hints in the header & data models.
This commit is contained in:
parent
3d28803fed
commit
f7721dd754
|
@ -215,7 +215,7 @@ void Cell::flattenNets(bool buildRings)
|
||||||
}
|
}
|
||||||
|
|
||||||
forEach ( Occurrence, iplugOccurrence, hyperNet.getLeafPlugOccurrences() ) {
|
forEach ( Occurrence, iplugOccurrence, hyperNet.getLeafPlugOccurrences() ) {
|
||||||
currentRP = createRoutingPad ( net, *iplugOccurrence );
|
currentRP = RoutingPad::create ( net, *iplugOccurrence, RoutingPad::BiggestArea );
|
||||||
currentRP->materialize ();
|
currentRP->materialize ();
|
||||||
if ( buildRings ) {
|
if ( buildRings ) {
|
||||||
if ( previousRP ) {
|
if ( previousRP ) {
|
||||||
|
@ -233,7 +233,7 @@ void Cell::flattenNets(bool buildRings)
|
||||||
forEach ( Component*, icomponent, net->getComponents() ) {
|
forEach ( Component*, icomponent, net->getComponents() ) {
|
||||||
Pin* pin = dynamic_cast<Pin*>( *icomponent );
|
Pin* pin = dynamic_cast<Pin*>( *icomponent );
|
||||||
if ( pin ) {
|
if ( pin ) {
|
||||||
currentRP = createRoutingPad ( pin );
|
currentRP = RoutingPad::create ( pin );
|
||||||
if ( buildRings ) {
|
if ( buildRings ) {
|
||||||
if ( previousRP ) {
|
if ( previousRP ) {
|
||||||
currentRP->getBodyHook()->attach ( previousRP->getBodyHook() );
|
currentRP->getBodyHook()->attach ( previousRP->getBodyHook() );
|
||||||
|
|
|
@ -145,7 +145,7 @@ size_t DeepNet::_createRoutingPads ( bool buildRings )
|
||||||
for_each_occurrence ( plugOccurrence, hyperNet.getLeafPlugOccurrences() ) {
|
for_each_occurrence ( plugOccurrence, hyperNet.getLeafPlugOccurrences() ) {
|
||||||
nbRoutingPads++;
|
nbRoutingPads++;
|
||||||
|
|
||||||
currentRP = createRoutingPad ( this, plugOccurrence );
|
currentRP = RoutingPad::create ( this, plugOccurrence, RoutingPad::BiggestArea );
|
||||||
if ( buildRings ) {
|
if ( buildRings ) {
|
||||||
if ( previousRP ) {
|
if ( previousRP ) {
|
||||||
currentRP->getBodyHook()->attach ( previousRP->getBodyHook() );
|
currentRP->getBodyHook()->attach ( previousRP->getBodyHook() );
|
||||||
|
|
|
@ -1,23 +1,43 @@
|
||||||
// ****************************************************************************************************
|
|
||||||
// File: ./RoutingPad.cpp
|
// -*- C++ -*-
|
||||||
// Authors: H.Clement, M.Sroka
|
//
|
||||||
// Copyright (c) BULL S.A. 2000-2009, All Rights Reserved
|
// Copyright (c) BULL S.A. 2000-2010, All Rights Reserved
|
||||||
//
|
//
|
||||||
// This file is part of Hurricane.
|
// This file is part of Hurricane.
|
||||||
//
|
//
|
||||||
// Hurricane is free software: you can redistribute it and/or modify it under the terms of the GNU
|
// Hurricane is free software: you can redistribute it and/or modify
|
||||||
// Lesser General Public License as published by the Free Software Foundation, either version 3 of the
|
// it under the terms of the GNU Lesser General Public License as
|
||||||
|
// published by the Free Software Foundation, either version 3 of the
|
||||||
// License, or (at your option) any later version.
|
// License, or (at your option) any later version.
|
||||||
//
|
//
|
||||||
// Hurricane is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
|
// Hurricane is distributed in the hope that it will be useful, but
|
||||||
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU
|
// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-
|
||||||
|
// TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU
|
||||||
// General Public License for more details.
|
// General Public License for more details.
|
||||||
//
|
//
|
||||||
// You should have received a copy of the Lesser GNU General Public License along with Hurricane. If
|
// You should have received a copy of the Lesser GNU General Public
|
||||||
// not, see <http://www.gnu.org/licenses/>.
|
// License along with Hurricane. If not, see
|
||||||
// ****************************************************************************************************
|
// <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
// ===================================================================
|
||||||
|
//
|
||||||
|
// $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 |
|
||||||
|
// | |
|
||||||
|
// | Authors : Hugo Clement & Marek Sroka |
|
||||||
|
// | E-mail : Jean-Paul.Chaput@lip6.fr |
|
||||||
|
// | =============================================================== |
|
||||||
|
// | C++ Header : "./RoutingPad.h" |
|
||||||
|
// | *************************************************************** |
|
||||||
|
// | U p d a t e s |
|
||||||
|
// | |
|
||||||
|
// x-----------------------------------------------------------------x
|
||||||
|
|
||||||
|
|
||||||
#include "hurricane/RoutingPad.h"
|
|
||||||
#include "hurricane/Net.h"
|
#include "hurricane/Net.h"
|
||||||
#include "hurricane/NetExternalComponents.h"
|
#include "hurricane/NetExternalComponents.h"
|
||||||
#include "hurricane/Layer.h"
|
#include "hurricane/Layer.h"
|
||||||
|
@ -29,36 +49,29 @@
|
||||||
#include "hurricane/Cell.h"
|
#include "hurricane/Cell.h"
|
||||||
#include "hurricane/Instance.h"
|
#include "hurricane/Instance.h"
|
||||||
#include "hurricane/Error.h"
|
#include "hurricane/Error.h"
|
||||||
|
#include "hurricane/RoutingPad.h"
|
||||||
|
|
||||||
|
|
||||||
namespace Hurricane {
|
namespace Hurricane {
|
||||||
|
|
||||||
// ****************************************************************************************************
|
|
||||||
// RoutingPad implementation
|
|
||||||
// ****************************************************************************************************
|
|
||||||
|
|
||||||
RoutingPad::RoutingPad(Net* net, const Point& p, Occurrence occurrence )
|
RoutingPad::RoutingPad ( Net* net, const Point& p, Occurrence occurrence )
|
||||||
// **********************************************************************************
|
: Inherit (net)
|
||||||
: Inherit(net),
|
, _x (p.getX())
|
||||||
_x(p.getX()),
|
, _y (p.getY())
|
||||||
_y(p.getY()),
|
, _occurrence(occurrence)
|
||||||
_occurrence(occurrence)
|
{ }
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
RoutingPad* RoutingPad::create(Net* net, Occurrence occurrence)
|
RoutingPad* RoutingPad::create ( Net* net, Occurrence occurrence, unsigned int flags )
|
||||||
// ***********************************************************
|
{
|
||||||
{
|
if ( not net ) throw Error ("Can't create RoutingPad : NULL net");
|
||||||
if (!net)
|
if ( not occurrence.isValid() ) throw Error ("Can't create RoutingPag : Invalid occurrence");
|
||||||
throw Error ("Can't create RoutingPad : NULL net");
|
|
||||||
if (!occurrence.isValid())
|
|
||||||
throw Error ("Can't create RoutingPag : Invalid occurrence");
|
|
||||||
|
|
||||||
//TODO Gerer une contruction avec un composant externe, mais ce n'est pas prioritaire
|
|
||||||
Plug* plug = NULL;
|
Plug* plug = NULL;
|
||||||
Pin* pin = NULL;
|
Pin* pin = NULL;
|
||||||
Contact* contact = NULL;
|
Contact* contact = NULL;
|
||||||
Point position;
|
Point position;
|
||||||
|
|
||||||
if ( (plug = dynamic_cast<Plug*>(occurrence.getEntity()) ) ) {
|
if ( (plug = dynamic_cast<Plug*>(occurrence.getEntity()) ) ) {
|
||||||
position = occurrence.getPath().getTransformation().getPoint( plug->getPosition() );
|
position = occurrence.getPath().getTransformation().getPoint( plug->getPosition() );
|
||||||
|
@ -68,236 +81,203 @@ RoutingPad* RoutingPad::create(Net* net, Occurrence occurrence)
|
||||||
position = occurrence.getPath().getTransformation().getPoint( contact->getPosition() );
|
position = occurrence.getPath().getTransformation().getPoint( contact->getPosition() );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !plug && !pin && !contact )
|
if ( (not plug) and (not pin) and (not contact) )
|
||||||
throw Error ("Can't create RoutingPad : plug or pin occurrence *required*");
|
throw Error ("Can't create RoutingPad : Plug Pin, or Contact Occurrence *required*");
|
||||||
|
|
||||||
RoutingPad* routingPad = new RoutingPad(net, position, occurrence);
|
RoutingPad* routingPad = new RoutingPad(net, position, occurrence);
|
||||||
|
|
||||||
routingPad->_postCreate();
|
routingPad->_postCreate();
|
||||||
|
|
||||||
|
if ( plug and (flags & ComponentSelection) ) routingPad->setOnBestComponent(flags);
|
||||||
|
|
||||||
return routingPad;
|
return routingPad;
|
||||||
}
|
|
||||||
|
|
||||||
void RoutingPad::_postCreate()
|
|
||||||
// ****************************
|
|
||||||
{
|
|
||||||
Inherit::_postCreate();
|
|
||||||
|
|
||||||
if (!_occurrence.getPath().isEmpty())
|
|
||||||
_occurrence.getMasterCell()->_addSlaveEntity(_occurrence.getEntity(),this);
|
|
||||||
}
|
|
||||||
|
|
||||||
DbU::Unit RoutingPad::getX() const
|
|
||||||
// ***********************
|
|
||||||
{
|
|
||||||
return _x;
|
|
||||||
}
|
|
||||||
|
|
||||||
DbU::Unit RoutingPad::getY() const
|
|
||||||
// ***********************
|
|
||||||
{
|
|
||||||
return _y;
|
|
||||||
}
|
|
||||||
|
|
||||||
Box RoutingPad::getBoundingBox() const
|
|
||||||
// ********************************
|
|
||||||
{
|
|
||||||
Component* component = _getEntityAsComponent();
|
|
||||||
if ( component ) {
|
|
||||||
return _occurrence.getPath().getTransformation().getBox ( component->getBoundingBox() );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return Box(getPosition());
|
|
||||||
}
|
|
||||||
|
|
||||||
Box RoutingPad::getBoundingBox(const BasicLayer* basicLayer) const
|
void RoutingPad::_postCreate ()
|
||||||
// ******************************************************
|
{
|
||||||
{
|
Inherit::_postCreate();
|
||||||
Component* component = _getEntityAsComponent();
|
|
||||||
if ( component )
|
|
||||||
return _occurrence.getPath().getTransformation().getBox ( component->getBoundingBox(basicLayer) );
|
|
||||||
|
|
||||||
return Box(getPosition());
|
if ( not _occurrence.getPath().isEmpty() )
|
||||||
}
|
_occurrence.getMasterCell()->_addSlaveEntity(_occurrence.getEntity(),this);
|
||||||
|
}
|
||||||
const Layer* RoutingPad::getLayer() const
|
|
||||||
// ******************************************************
|
|
||||||
{
|
|
||||||
Component* component = _getEntityAsComponent();
|
|
||||||
if ( component ) return component->getLayer ();
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
Point RoutingPad::getSourcePosition() const
|
|
||||||
// ****************************************
|
|
||||||
{
|
|
||||||
Segment* segment = _getEntityAsSegment();
|
|
||||||
if ( segment )
|
|
||||||
return _occurrence.getPath().getTransformation().getPoint ( segment->getSourcePosition() );
|
|
||||||
|
|
||||||
return getPosition();
|
|
||||||
}
|
|
||||||
|
|
||||||
Point RoutingPad::getTargetPosition() const
|
|
||||||
// ****************************************
|
|
||||||
{
|
|
||||||
Segment* segment = _getEntityAsSegment();
|
|
||||||
if ( segment )
|
|
||||||
return _occurrence.getPath().getTransformation().getPoint ( segment->getTargetPosition() );
|
|
||||||
|
|
||||||
return getPosition();
|
|
||||||
}
|
|
||||||
|
|
||||||
DbU::Unit RoutingPad::getSourceX() const
|
|
||||||
// ********************************
|
|
||||||
{
|
|
||||||
return getSourcePosition().getX();
|
|
||||||
}
|
|
||||||
|
|
||||||
DbU::Unit RoutingPad::getSourceY() const
|
|
||||||
// ********************************
|
|
||||||
{
|
|
||||||
return getSourcePosition().getY();
|
|
||||||
}
|
|
||||||
|
|
||||||
DbU::Unit RoutingPad::getTargetX() const
|
|
||||||
// ********************************
|
|
||||||
{
|
|
||||||
return getTargetPosition().getX();
|
|
||||||
}
|
|
||||||
|
|
||||||
DbU::Unit RoutingPad::getTargetY() const
|
|
||||||
// ********************************
|
|
||||||
{
|
|
||||||
return getTargetPosition().getY();
|
|
||||||
}
|
|
||||||
|
|
||||||
Point RoutingPad::getCenter() const
|
|
||||||
// ****************************************
|
|
||||||
{
|
|
||||||
Segment* segment = _getEntityAsSegment();
|
|
||||||
if ( segment )
|
|
||||||
return _occurrence.getPath().getTransformation().getPoint ( segment->getCenter() );
|
|
||||||
|
|
||||||
return getPosition();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void RoutingPad::translate(const DbU::Unit& dx, const DbU::Unit& dy)
|
RoutingPad* RoutingPad::create ( Pin* pin )
|
||||||
// ****************************************************
|
{
|
||||||
{
|
Occurrence pinOccurrence ( pin, Path() );
|
||||||
if ((dx != 0) || (dy != 0)) {
|
|
||||||
invalidate(true);
|
#if 0
|
||||||
_x += dx;
|
forEach ( RoutingPad*, irp, pin->getNet()->getRoutingPads() ) {
|
||||||
_y += dy;
|
if ( (*irp)->getOccurrence() == pinOccurrence )
|
||||||
|
return (*irp);
|
||||||
}
|
}
|
||||||
}
|
#endif
|
||||||
|
|
||||||
void RoutingPad::setX(const DbU::Unit& x)
|
return RoutingPad::create ( pin->getNet(), pinOccurrence );
|
||||||
// ******************************
|
}
|
||||||
{
|
|
||||||
setPosition(x, getY());
|
|
||||||
}
|
|
||||||
|
|
||||||
void RoutingPad::setY(const DbU::Unit& y)
|
|
||||||
// ******************************
|
|
||||||
{
|
|
||||||
setPosition(getX(), y);
|
|
||||||
}
|
|
||||||
|
|
||||||
void RoutingPad::setPosition(const DbU::Unit& x, const DbU::Unit& y)
|
DbU::Unit RoutingPad::getX () const { return _x; }
|
||||||
// ****************************************************
|
DbU::Unit RoutingPad::getY () const { return _y; }
|
||||||
{
|
DbU::Unit RoutingPad::getSourceX () const { return getSourcePosition().getX(); }
|
||||||
setOffset(x, y);
|
DbU::Unit RoutingPad::getSourceY () const { return getSourcePosition().getY(); }
|
||||||
}
|
DbU::Unit RoutingPad::getTargetX () const { return getTargetPosition().getX(); }
|
||||||
|
DbU::Unit RoutingPad::getTargetY () const { return getTargetPosition().getY(); }
|
||||||
|
|
||||||
void RoutingPad::setPosition(const Point& position)
|
|
||||||
// *********************************************
|
|
||||||
{
|
|
||||||
setPosition(position.getX(), position.getY());
|
|
||||||
}
|
|
||||||
|
|
||||||
void RoutingPad::setOffset(const DbU::Unit& x, const DbU::Unit& y)
|
Box RoutingPad::getBoundingBox () const
|
||||||
// ****************************************************
|
{
|
||||||
{
|
Component* component = _getEntityAsComponent();
|
||||||
|
if ( component )
|
||||||
|
return _occurrence.getPath().getTransformation().getBox ( component->getBoundingBox() );
|
||||||
|
|
||||||
|
return Box(getPosition());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Box RoutingPad::getBoundingBox ( const BasicLayer* basicLayer ) const
|
||||||
|
{
|
||||||
|
Component* component = _getEntityAsComponent();
|
||||||
|
if ( component )
|
||||||
|
return _occurrence.getPath().getTransformation().getBox ( component->getBoundingBox(basicLayer) );
|
||||||
|
|
||||||
|
return Box(getPosition());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const Layer* RoutingPad::getLayer () const
|
||||||
|
{
|
||||||
|
Component* component = _getEntityAsComponent();
|
||||||
|
if ( component ) return component->getLayer ();
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Point RoutingPad::getSourcePosition () const
|
||||||
|
{
|
||||||
|
Segment* segment = _getEntityAsSegment();
|
||||||
|
if ( segment )
|
||||||
|
return _occurrence.getPath().getTransformation().getPoint ( segment->getSourcePosition() );
|
||||||
|
|
||||||
|
return getPosition();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Point RoutingPad::getTargetPosition() const
|
||||||
|
{
|
||||||
|
Segment* segment = _getEntityAsSegment();
|
||||||
|
if ( segment )
|
||||||
|
return _occurrence.getPath().getTransformation().getPoint ( segment->getTargetPosition() );
|
||||||
|
|
||||||
|
return getPosition();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Point RoutingPad::getCenter() const
|
||||||
|
{
|
||||||
|
Segment* segment = _getEntityAsSegment();
|
||||||
|
if ( segment )
|
||||||
|
return _occurrence.getPath().getTransformation().getPoint ( segment->getCenter() );
|
||||||
|
|
||||||
|
return getPosition();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void RoutingPad::translate(const DbU::Unit& dx, const DbU::Unit& dy)
|
||||||
|
{
|
||||||
|
if ( (dx != 0) or (dy != 0) ) {
|
||||||
|
invalidate(true);
|
||||||
|
_x += dx;
|
||||||
|
_y += dy;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void RoutingPad::setX ( const DbU::Unit& x ) { setPosition(x, getY()); }
|
||||||
|
void RoutingPad::setY ( const DbU::Unit& y ) { setPosition(getX(), y); }
|
||||||
|
void RoutingPad::setPosition ( const DbU::Unit& x, const DbU::Unit& y ) { setOffset(x, y); }
|
||||||
|
void RoutingPad::setPosition ( const Point& position) { setPosition(position.getX(), position.getY()); }
|
||||||
|
|
||||||
|
|
||||||
|
void RoutingPad::setOffset ( const DbU::Unit& x, const DbU::Unit& y )
|
||||||
|
{
|
||||||
invalidate(true);
|
invalidate(true);
|
||||||
_x = x;
|
_x = x;
|
||||||
_y = y;
|
_y = y;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RoutingPad::_preDestroy()
|
|
||||||
// ***********************
|
|
||||||
{
|
|
||||||
// trace << "entering RoutingPad::preDestroy: " << this << endl;
|
|
||||||
// trace_in();
|
|
||||||
|
|
||||||
|
|
||||||
if (!_occurrence.getPath().isEmpty())
|
void RoutingPad::_preDestroy ()
|
||||||
_occurrence.getMasterCell()->_removeSlaveEntity(_occurrence.getEntity(),this);
|
{
|
||||||
Inherit::_preDestroy();
|
// trace << "entering RoutingPad::preDestroy: " << this << endl;
|
||||||
|
// trace_in();
|
||||||
|
|
||||||
// trace << "exiting RoutingPad::preDestroy:" << endl;
|
if ( not _occurrence.getPath().isEmpty() )
|
||||||
// trace_out();
|
_occurrence.getMasterCell()->_removeSlaveEntity(_occurrence.getEntity(),this);
|
||||||
}
|
Inherit::_preDestroy();
|
||||||
|
|
||||||
string RoutingPad::_getString() const
|
// trace << "exiting RoutingPad::preDestroy:" << endl;
|
||||||
// *******************************
|
// trace_out();
|
||||||
{
|
}
|
||||||
|
|
||||||
|
|
||||||
|
string RoutingPad::_getString () const
|
||||||
|
{
|
||||||
string s = Inherit::_getString();
|
string s = Inherit::_getString();
|
||||||
s.insert(s.length() - 1, " [" + DbU::getValueString(getX()));
|
s.insert(s.length() - 1, " [" + DbU::getValueString(getX()));
|
||||||
s.insert(s.length() - 1, " " + DbU::getValueString(getY()));
|
s.insert(s.length() - 1, " " + DbU::getValueString(getY()));
|
||||||
s.insert(s.length() - 1, "] ");
|
s.insert(s.length() - 1, "] ");
|
||||||
s.insert(s.length() - 1, getString(_occurrence));
|
s.insert(s.length() - 1, getString(_occurrence));
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
Record* RoutingPad::_getRecord() const
|
|
||||||
// **************************
|
Record* RoutingPad::_getRecord () const
|
||||||
{
|
{
|
||||||
Record* record = Inherit::_getRecord();
|
Record* record = Inherit::_getRecord();
|
||||||
if (record) {
|
if ( record ) {
|
||||||
record->add(getSlot("X", &_x));
|
record->add(getSlot("_x" , &_x ));
|
||||||
record->add(getSlot("Y", &_y));
|
record->add(getSlot("_y" , &_y ));
|
||||||
record->add(getSlot("Occurrence",_occurrence));
|
record->add(getSlot("_occurrence",_occurrence));
|
||||||
}
|
}
|
||||||
return record;
|
return record;
|
||||||
}
|
}
|
||||||
|
|
||||||
Component* RoutingPad::_getEntityAsComponent () const
|
|
||||||
// ***************************************************
|
|
||||||
{
|
|
||||||
if ( _occurrence.isValid() )
|
|
||||||
return dynamic_cast<Component*>( _occurrence.getEntity() );
|
|
||||||
|
|
||||||
return NULL;
|
Component* RoutingPad::_getEntityAsComponent () const
|
||||||
}
|
{
|
||||||
|
if ( _occurrence.isValid() )
|
||||||
|
return dynamic_cast<Component*>( _occurrence.getEntity() );
|
||||||
|
|
||||||
Segment* RoutingPad::_getEntityAsSegment () const
|
return NULL;
|
||||||
// ***********************************************
|
}
|
||||||
{
|
|
||||||
if ( _occurrence.isValid() )
|
|
||||||
return dynamic_cast<Segment*>( _occurrence.getEntity() );
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
void RoutingPad::setExternalComponent(Component* component)
|
Segment* RoutingPad::_getEntityAsSegment () const
|
||||||
// ********************************************************
|
{
|
||||||
{
|
if ( _occurrence.isValid() )
|
||||||
if (isMaterialized()) invalidate(false);
|
return dynamic_cast<Segment*>( _occurrence.getEntity() );
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void RoutingPad::setExternalComponent ( Component* component )
|
||||||
|
{
|
||||||
|
if ( isMaterialized() ) invalidate(false);
|
||||||
|
|
||||||
Occurrence plugOccurrence = getPlugOccurrence();
|
Occurrence plugOccurrence = getPlugOccurrence();
|
||||||
Plug* plug= static_cast<Plug*>(plugOccurrence.getEntity());
|
Plug* plug = static_cast<Plug*>(plugOccurrence.getEntity());
|
||||||
if (plug->getMasterNet() != component->getNet())
|
if ( plug->getMasterNet() != component->getNet() )
|
||||||
throw Error("Cannot Set External Component to Routing Pad : Inconsistant Net");
|
throw Error("Cannot Set External Component to Routing Pad : Inconsistant Net");
|
||||||
|
|
||||||
_occurrence.getMasterCell()->_removeSlaveEntity(_occurrence.getEntity(),this);
|
_occurrence.getMasterCell()->_removeSlaveEntity(_occurrence.getEntity(),this);
|
||||||
_occurrence = Occurrence(component,Path(plugOccurrence.getPath(),plug->getInstance()));
|
_occurrence = Occurrence(component,Path(plugOccurrence.getPath(),plug->getInstance()));
|
||||||
|
|
||||||
Point position = _occurrence.getPath().getTransformation().getPoint ( component->getPosition() );
|
Point position = _occurrence.getPath().getTransformation().getPoint ( component->getPosition() );
|
||||||
|
|
||||||
Horizontal* horizontal = dynamic_cast<Horizontal*>(component);
|
Horizontal* horizontal = dynamic_cast<Horizontal*>(component);
|
||||||
|
|
||||||
if ( horizontal ) {
|
if ( horizontal ) {
|
||||||
setX ( 0 );
|
setX ( 0 );
|
||||||
setY ( position.getY() );
|
setY ( position.getY() );
|
||||||
|
@ -312,85 +292,76 @@ void RoutingPad::setExternalComponent(Component* component)
|
||||||
|
|
||||||
_occurrence.getMasterCell()->_addSlaveEntity(_occurrence.getEntity(),this);
|
_occurrence.getMasterCell()->_addSlaveEntity(_occurrence.getEntity(),this);
|
||||||
|
|
||||||
if (!isMaterialized()) {
|
if (!isMaterialized()) materialize();
|
||||||
materialize();
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Occurrence RoutingPad::getPlugOccurrence()
|
Occurrence RoutingPad::getPlugOccurrence ()
|
||||||
// ***************************************
|
{
|
||||||
{
|
|
||||||
if (dynamic_cast<Plug*>(_occurrence.getEntity()))
|
if (dynamic_cast<Plug*>(_occurrence.getEntity()))
|
||||||
return _occurrence;
|
return _occurrence;
|
||||||
Component* component= static_cast<Component*>(_occurrence.getEntity());
|
|
||||||
Net* net=component->getNet();
|
Component* component = static_cast<Component*>(_occurrence.getEntity());
|
||||||
Path path=_occurrence.getPath();
|
Net* net = component->getNet();
|
||||||
if (path.isEmpty())
|
Path path = _occurrence.getPath();
|
||||||
throw Error("Empty Path => not in an instance");
|
|
||||||
Instance* instance=path.getTailInstance();
|
if ( path.isEmpty() )
|
||||||
Plug* plug=instance->getPlug(net);
|
throw Error("Empty Path => not in an instance");
|
||||||
|
|
||||||
|
Instance* instance = path.getTailInstance();
|
||||||
|
Plug* plug = instance->getPlug(net);
|
||||||
|
|
||||||
return Occurrence(plug,path.getHeadPath());
|
return Occurrence(plug,path.getHeadPath());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void RoutingPad::restorePlugOccurrence()
|
void RoutingPad::restorePlugOccurrence ()
|
||||||
// *************************************
|
{
|
||||||
{
|
|
||||||
if (isMaterialized()) unmaterialize();
|
if (isMaterialized()) unmaterialize();
|
||||||
|
|
||||||
_occurrence=getPlugOccurrence();
|
_occurrence=getPlugOccurrence();
|
||||||
setPosition ( _occurrence.getPath().getTransformation().getPoint
|
setPosition ( _occurrence.getPath().getTransformation().getPoint
|
||||||
( dynamic_cast<Component*>(_occurrence.getEntity())->getPosition() ) );
|
( dynamic_cast<Component*>(_occurrence.getEntity())->getPosition() ) );
|
||||||
}
|
|
||||||
|
|
||||||
RoutingPad* createRoutingPad ( Net* net, Occurrence plugOccurrence )
|
|
||||||
// *****************************************************************
|
|
||||||
{
|
|
||||||
Component* bestComponent = NULL;
|
|
||||||
Plug* plug = static_cast<Plug*>(plugOccurrence.getEntity());
|
|
||||||
|
|
||||||
for_each_component (component, NetExternalComponents::get(plug->getMasterNet()) ) {
|
|
||||||
if ( !bestComponent ) { bestComponent = component; continue; }
|
|
||||||
if ( /* IsOnTop(component->getLayer(),bestComponent->getLayer())
|
|
||||||
||*/ ( getArea(component) > getArea(bestComponent) ) ) {
|
|
||||||
bestComponent = component;
|
|
||||||
}
|
|
||||||
end_for
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( !bestComponent ) {
|
|
||||||
string message = "CreateRoutingPad(): Cannot find external component of ";
|
|
||||||
message += getString(plug->getMasterNet()) + " in ";
|
|
||||||
message += getString(plug->getInstance()) + ".\n" ;
|
|
||||||
throw Error ( message );
|
|
||||||
}
|
|
||||||
|
|
||||||
RoutingPad* rp = RoutingPad::create ( net, plugOccurrence );
|
|
||||||
rp->setExternalComponent ( bestComponent );
|
|
||||||
|
|
||||||
return rp;
|
|
||||||
}
|
|
||||||
|
|
||||||
RoutingPad* createRoutingPad ( Pin* pin )
|
|
||||||
// **************************************
|
|
||||||
{
|
|
||||||
Occurrence pinOccurrence ( pin, Path() );
|
|
||||||
|
|
||||||
# if 0
|
|
||||||
for_each_routing_pad ( routingPad, pin->getNet()->getRoutingPads() ) {
|
|
||||||
if ( routingPad->getOccurrence() == pinOccurrence )
|
|
||||||
return routingPad;
|
|
||||||
end_for
|
|
||||||
}
|
}
|
||||||
# endif
|
|
||||||
|
|
||||||
return RoutingPad::create ( pin->getNet(), pinOccurrence );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
} // End of Hurricane namespace.
|
Component* RoutingPad::setOnBestComponent ( unsigned int flags )
|
||||||
|
{
|
||||||
|
restorePlugOccurrence ();
|
||||||
|
|
||||||
// ****************************************************************************************************
|
Component* bestComponent = NULL;
|
||||||
// Copyright (c) BULL S.A. 2000-2009, All Rights Reserved
|
Plug* plug = static_cast<Plug*>(_occurrence.getEntity());
|
||||||
// ****************************************************************************************************
|
|
||||||
|
forEach ( Component*, icomponent, NetExternalComponents::get(plug->getMasterNet()) ) {
|
||||||
|
if ( not bestComponent ) { bestComponent = *icomponent; continue; }
|
||||||
|
|
||||||
|
switch ( flags & ComponentSelection ) {
|
||||||
|
case LowestLayer:
|
||||||
|
if ( icomponent->getLayer()->below(bestComponent->getLayer()) )
|
||||||
|
bestComponent = *icomponent;
|
||||||
|
break;
|
||||||
|
case HighestLayer:
|
||||||
|
if ( icomponent->getLayer()->above(bestComponent->getLayer()) )
|
||||||
|
bestComponent = *icomponent;
|
||||||
|
break;
|
||||||
|
case BiggestArea:
|
||||||
|
default:
|
||||||
|
if ( getArea(*icomponent) > getArea(bestComponent) )
|
||||||
|
bestComponent = *icomponent;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( not bestComponent )
|
||||||
|
throw Error ( "RoutingPad::_getBestComponent(): No external components for\n"
|
||||||
|
" %s of %s."
|
||||||
|
,getString(plug->getMasterNet()).c_str()
|
||||||
|
,getString(plug->getInstance ()).c_str() );
|
||||||
|
|
||||||
|
setExternalComponent ( bestComponent );
|
||||||
|
|
||||||
|
return bestComponent;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} // End of Hurricane namespace.
|
||||||
|
|
|
@ -1,113 +1,110 @@
|
||||||
// ****************************************************************************************************
|
|
||||||
// File: ./hurricane/RoutingPad.h
|
// -*- C++ -*-
|
||||||
// Authors: H.Clement, M.Sroka
|
//
|
||||||
// Copyright (c) BULL S.A. 2000-2009, All Rights Reserved
|
// Copyright (c) BULL S.A. 2000-2010, All Rights Reserved
|
||||||
//
|
//
|
||||||
// This file is part of Hurricane.
|
// This file is part of Hurricane.
|
||||||
//
|
//
|
||||||
// Hurricane is free software: you can redistribute it and/or modify it under the terms of the GNU
|
// Hurricane is free software: you can redistribute it and/or modify
|
||||||
// Lesser General Public License as published by the Free Software Foundation, either version 3 of the
|
// it under the terms of the GNU Lesser General Public License as
|
||||||
|
// published by the Free Software Foundation, either version 3 of the
|
||||||
// License, or (at your option) any later version.
|
// License, or (at your option) any later version.
|
||||||
//
|
//
|
||||||
// Hurricane is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
|
// Hurricane is distributed in the hope that it will be useful, but
|
||||||
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU
|
// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-
|
||||||
|
// TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU
|
||||||
// General Public License for more details.
|
// General Public License for more details.
|
||||||
//
|
//
|
||||||
// You should have received a copy of the Lesser GNU General Public License along with Hurricane. If
|
// You should have received a copy of the Lesser GNU General Public
|
||||||
// not, see <http://www.gnu.org/licenses/>.
|
// License along with Hurricane. If not, see
|
||||||
// ****************************************************************************************************
|
// <http://www.gnu.org/licenses/>.
|
||||||
|
//
|
||||||
|
// ===================================================================
|
||||||
|
//
|
||||||
|
// $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 |
|
||||||
|
// | |
|
||||||
|
// | Authors : Hugo Clement & Marek Sroka |
|
||||||
|
// | E-mail : Jean-Paul.Chaput@lip6.fr |
|
||||||
|
// | =============================================================== |
|
||||||
|
// | C++ Header : "./hurricane/RegularLayer.h" |
|
||||||
|
// | *************************************************************** |
|
||||||
|
// | U p d a t e s |
|
||||||
|
// | |
|
||||||
|
// x-----------------------------------------------------------------x
|
||||||
|
|
||||||
#ifndef HURRICANE_ROUTINGPAD
|
|
||||||
#define HURRICANE_ROUTINGPAD
|
#ifndef __HURRICANE_ROUTINGPAD__
|
||||||
|
#define __HURRICANE_ROUTINGPAD__
|
||||||
|
|
||||||
#include "hurricane/Component.h"
|
#include "hurricane/Component.h"
|
||||||
#include "hurricane/Occurrence.h"
|
#include "hurricane/Occurrence.h"
|
||||||
#include "hurricane/Pin.h"
|
#include "hurricane/Pin.h"
|
||||||
|
|
||||||
|
|
||||||
namespace Hurricane {
|
namespace Hurricane {
|
||||||
|
|
||||||
|
class Segment;
|
||||||
class Segment;
|
|
||||||
|
|
||||||
|
|
||||||
// ****************************************************************************************************
|
class RoutingPad : public Component {
|
||||||
// RoutingPad declaration
|
public:
|
||||||
// ****************************************************************************************************
|
typedef Component Inherit;
|
||||||
|
enum Flags { BiggestArea =0x1
|
||||||
class RoutingPad : public Component {
|
, HighestLayer =0x2
|
||||||
// *****************************
|
, LowestLayer =0x4
|
||||||
|
, ComponentSelection=BiggestArea|HighestLayer|LowestLayer
|
||||||
// Types
|
};
|
||||||
// *****
|
public:
|
||||||
|
static RoutingPad* create ( Net*, Occurrence, unsigned int flags=0 );
|
||||||
public: typedef Component Inherit;
|
static RoutingPad* create ( Pin* );
|
||||||
|
public:
|
||||||
|
// Accessors.
|
||||||
// Attributes
|
virtual DbU::Unit getX () const;
|
||||||
// **********
|
virtual DbU::Unit getY () const;
|
||||||
|
virtual Box getBoundingBox () const;
|
||||||
private: DbU::Unit _x;
|
virtual const Layer* getLayer () const;
|
||||||
private: DbU::Unit _y;
|
virtual Box getBoundingBox ( const BasicLayer* ) const;
|
||||||
private: Occurrence _occurrence;
|
virtual Point getCenter () const;
|
||||||
|
inline Occurrence getOccurrence () const { return _occurrence; };
|
||||||
|
Occurrence getPlugOccurrence ();
|
||||||
|
Point getSourcePosition () const;
|
||||||
// Constructors
|
Point getTargetPosition () const;
|
||||||
// ************
|
DbU::Unit getSourceX () const;
|
||||||
|
DbU::Unit getSourceY () const;
|
||||||
protected: RoutingPad(Net* net, const Point& p, Occurrence occurrence = Occurrence());
|
DbU::Unit getTargetX () const;
|
||||||
public: static RoutingPad* create(Net* net, Occurrence occurrence);
|
DbU::Unit getTargetY () const;
|
||||||
|
// Mutators.
|
||||||
// Accessors
|
virtual void translate ( const DbU::Unit& dx, const DbU::Unit& dy );
|
||||||
// *********
|
void setX ( const DbU::Unit& );
|
||||||
|
void setY ( const DbU::Unit& );
|
||||||
//public: virtual Hooks getHooks() const;
|
void setPosition ( const DbU::Unit& x, const DbU::Unit& y );
|
||||||
public: virtual DbU::Unit getX() const;
|
void setPosition ( const Point& position );
|
||||||
public: virtual DbU::Unit getY() const;
|
void setOffset ( const DbU::Unit& dx, const DbU::Unit& dy );
|
||||||
public: virtual Box getBoundingBox() const;
|
void setExternalComponent ( Component* );
|
||||||
public: virtual const Layer* getLayer() const;
|
Component* setOnBestComponent ( unsigned int flags );
|
||||||
public: virtual Box getBoundingBox(const BasicLayer* basicLayer) const;
|
void restorePlugOccurrence ();
|
||||||
public: virtual Point getCenter() const;
|
// Miscellaeous.
|
||||||
public: Occurrence getOccurrence() const { return _occurrence; };
|
Component* _getEntityAsComponent () const;
|
||||||
public: Occurrence getPlugOccurrence();
|
Segment* _getEntityAsSegment () const;
|
||||||
public: Point getSourcePosition() const;
|
virtual std::string _getTypeName () const {return _TName("RoutingPad");};
|
||||||
public: Point getTargetPosition() const;
|
virtual std::string _getString () const;
|
||||||
public: DbU::Unit getSourceX() const;
|
virtual Record* _getRecord () const;
|
||||||
public: DbU::Unit getSourceY() const;
|
protected:
|
||||||
public: DbU::Unit getTargetX() const;
|
virtual void _postCreate ();
|
||||||
public: DbU::Unit getTargetY() const;
|
virtual void _preDestroy ();
|
||||||
|
private:
|
||||||
// Updators
|
RoutingPad ( Net*, const Point&, Occurrence occurrence=Occurrence() );
|
||||||
// ********
|
private:
|
||||||
|
// Attributes.
|
||||||
public: virtual void translate(const DbU::Unit& dx, const DbU::Unit& dy);
|
DbU::Unit _x;
|
||||||
|
DbU::Unit _y;
|
||||||
public: void setX(const DbU::Unit& x);
|
Occurrence _occurrence;
|
||||||
public: void setY(const DbU::Unit& y);
|
};
|
||||||
public: void setPosition(const DbU::Unit& x, const DbU::Unit& y);
|
|
||||||
public: void setPosition(const Point& position);
|
|
||||||
public: void setOffset(const DbU::Unit& x, const DbU::Unit& y);
|
|
||||||
public: void setExternalComponent(Component* component);
|
|
||||||
public: void restorePlugOccurrence();
|
|
||||||
|
|
||||||
// Others
|
|
||||||
// ******
|
|
||||||
|
|
||||||
protected: virtual void _postCreate();
|
|
||||||
protected: virtual void _preDestroy();
|
|
||||||
|
|
||||||
public: virtual string _getTypeName() const {return _TName("RoutingPad");};
|
|
||||||
public: virtual string _getString() const;
|
|
||||||
public: virtual Record* _getRecord() const;
|
|
||||||
|
|
||||||
public: Component* _getEntityAsComponent () const;
|
|
||||||
public: Segment* _getEntityAsSegment () const;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
RoutingPad* createRoutingPad ( Net* net, Occurrence plugOccurrence );
|
|
||||||
RoutingPad* createRoutingPad ( Pin* pin );
|
|
||||||
|
|
||||||
|
|
||||||
} // End of Hurricane namespace.
|
} // End of Hurricane namespace.
|
||||||
|
@ -115,8 +112,4 @@ RoutingPad* createRoutingPad ( Pin* pin );
|
||||||
|
|
||||||
INSPECTOR_P_SUPPORT(Hurricane::RoutingPad);
|
INSPECTOR_P_SUPPORT(Hurricane::RoutingPad);
|
||||||
|
|
||||||
#endif // HURRICANE_ROUTINGPAD
|
#endif // __HURRICANE_ROUTINGPAD__
|
||||||
|
|
||||||
// ****************************************************************************************************
|
|
||||||
// Copyright (c) BULL S.A. 2000-2009, All Rights Reserved
|
|
||||||
// ****************************************************************************************************
|
|
||||||
|
|
|
@ -1160,7 +1160,7 @@ namespace Hurricane {
|
||||||
, _drawingPlanes (QSize(_initialSide+2*_stripWidth,_initialSide+2*_stripWidth),this)
|
, _drawingPlanes (QSize(_initialSide+2*_stripWidth,_initialSide+2*_stripWidth),this)
|
||||||
, _drawingQuery (this)
|
, _drawingQuery (this)
|
||||||
, _textDrawingQuery (this)
|
, _textDrawingQuery (this)
|
||||||
, _darkening (100)
|
, _darkening (DisplayStyle::HSVr())
|
||||||
, _mousePosition (0,0)
|
, _mousePosition (0,0)
|
||||||
, _spot (this)
|
, _spot (this)
|
||||||
, _state (new State(NULL))
|
, _state (new State(NULL))
|
||||||
|
@ -1384,7 +1384,7 @@ namespace Hurricane {
|
||||||
_drawingPlanes.painter().setClipRect ( redrawArea );
|
_drawingPlanes.painter().setClipRect ( redrawArea );
|
||||||
_drawingPlanes.painter().eraseRect ( redrawArea );
|
_drawingPlanes.painter().eraseRect ( redrawArea );
|
||||||
|
|
||||||
setDarkening ( (_state->showSelection()) ? Graphics::getDarkening() : 100 );
|
setDarkening ( (_state->showSelection()) ? Graphics::getDarkening() : DisplayStyle::HSVr() );
|
||||||
|
|
||||||
if ( getCell() ) {
|
if ( getCell() ) {
|
||||||
|
|
||||||
|
|
|
@ -68,12 +68,12 @@ namespace Hurricane {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QBrush ColorScale::getBrush ( size_t i, int darkening ) const
|
QBrush ColorScale::getBrush ( size_t i, const DisplayStyle::HSVr& darkening ) const
|
||||||
{
|
{
|
||||||
assert ( _brush[i] != NULL );
|
assert ( _brush[i] != NULL );
|
||||||
|
|
||||||
QBrush brush ( *_brush[i] );
|
QBrush brush ( *_brush[i] );
|
||||||
brush.setColor ( _color[i]->darker(darkening) );
|
brush.setColor ( DisplayStyle::darken(*_color[i],darkening) );
|
||||||
return brush;
|
return brush;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -215,7 +215,7 @@ namespace Hurricane {
|
||||||
|
|
||||||
void TabNetlist::setSyncNetlist ( bool state )
|
void TabNetlist::setSyncNetlist ( bool state )
|
||||||
{
|
{
|
||||||
if ( state && getCellWidget() ) {
|
if ( state and getCellWidget() ) {
|
||||||
_netlistBrowser->setCell<SimpleNetInformations> ( getCellWidget()->getCell() );
|
_netlistBrowser->setCell<SimpleNetInformations> ( getCellWidget()->getCell() );
|
||||||
} else {
|
} else {
|
||||||
_netlistBrowser->setCell<SimpleNetInformations> ( NULL );
|
_netlistBrowser->setCell<SimpleNetInformations> ( NULL );
|
||||||
|
@ -225,9 +225,9 @@ namespace Hurricane {
|
||||||
|
|
||||||
void TabNetlist::setSyncSelection ( bool state )
|
void TabNetlist::setSyncSelection ( bool state )
|
||||||
{
|
{
|
||||||
if ( state && getCellWidget() && _syncNetlist->isChecked() ) {
|
if ( state and getCellWidget() and _syncNetlist->isChecked() ) {
|
||||||
_cwCumulativeSelection = getCellWidget()->cumulativeSelection();
|
_cwCumulativeSelection = getCellWidget()->cumulativeSelection();
|
||||||
if ( !_cwCumulativeSelection ) {
|
if ( not _cwCumulativeSelection ) {
|
||||||
getCellWidget()->openRefreshSession ();
|
getCellWidget()->openRefreshSession ();
|
||||||
getCellWidget()->unselectAll ();
|
getCellWidget()->unselectAll ();
|
||||||
getCellWidget()->closeRefreshSession ();
|
getCellWidget()->closeRefreshSession ();
|
||||||
|
|
|
@ -32,16 +32,7 @@
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
QColor modifySaturation ( const QColor& color, int darkening )
|
using namespace Hurricane;
|
||||||
{
|
|
||||||
QColor hsvColor = color.toHsv();
|
|
||||||
if ( darkening != 100 ) {
|
|
||||||
qreal darkSat = color.saturationF();
|
|
||||||
qreal darkValue = color.valueF();
|
|
||||||
hsvColor.setHsvF ( color.hueF(), darkSat/3.0, darkValue/2.5 );
|
|
||||||
}
|
|
||||||
return hsvColor;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
} // End of anonymous namespace.
|
} // End of anonymous namespace.
|
||||||
|
@ -135,34 +126,34 @@ namespace Hurricane {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QColor DrawingStyle::getColor ( int darkening ) const
|
QColor DrawingStyle::getColor ( const DisplayStyle::HSVr& darkening ) const
|
||||||
{
|
{
|
||||||
assert ( _color != NULL );
|
assert ( _color != NULL );
|
||||||
|
|
||||||
//return _color->darker ( darkening );
|
//return _color->darker ( darkening );
|
||||||
return modifySaturation(*_color,darkening);
|
return DisplayStyle::darken(*_color,darkening);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QPen DrawingStyle::getPen ( int darkening ) const
|
QPen DrawingStyle::getPen ( const DisplayStyle::HSVr& darkening ) const
|
||||||
{
|
{
|
||||||
assert ( _pen != NULL );
|
assert ( _pen != NULL );
|
||||||
|
|
||||||
QPen pen ( *_pen );
|
QPen pen ( *_pen );
|
||||||
//pen.setColor ( _color->darker(darkening) );
|
//pen.setColor ( _color->darker(darkening) );
|
||||||
pen.setColor ( modifySaturation(*_color,darkening) );
|
pen.setColor ( DisplayStyle::darken(*_color,darkening) );
|
||||||
|
|
||||||
return pen;
|
return pen;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QBrush DrawingStyle::getBrush ( int darkening ) const
|
QBrush DrawingStyle::getBrush ( const DisplayStyle::HSVr& darkening ) const
|
||||||
{
|
{
|
||||||
assert ( _brush != NULL );
|
assert ( _brush != NULL );
|
||||||
|
|
||||||
QBrush brush ( *_brush );
|
QBrush brush ( *_brush );
|
||||||
//brush.setColor ( _color->darker(darkening) );
|
//brush.setColor ( _color->darker(darkening) );
|
||||||
brush.setColor ( modifySaturation(*_color,darkening) );
|
brush.setColor ( DisplayStyle::darken(*_color,darkening) );
|
||||||
return brush;
|
return brush;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -273,11 +264,29 @@ namespace Hurricane {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QColor DisplayStyle::darken ( const QColor& color, const DisplayStyle::HSVr& darkening )
|
||||||
|
{
|
||||||
|
QColor hsvColor = color.toHsv();
|
||||||
|
if ( not darkening.isId() ) {
|
||||||
|
qreal darkHue = color.hueF();
|
||||||
|
qreal darkSat = color.saturationF();
|
||||||
|
qreal darkValue = color.valueF();
|
||||||
|
|
||||||
|
//hsvColor.setHsvF ( darkHue/darkening.getHue(), darkSat/3.0, darkValue/2.5 );
|
||||||
|
hsvColor.setHsvF ( darkHue /darkening.getHue()
|
||||||
|
, darkSat /darkening.getSaturation()
|
||||||
|
, darkValue/darkening.getValue()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return hsvColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
DisplayStyle::DisplayStyle ( const Name& name )
|
DisplayStyle::DisplayStyle ( const Name& name )
|
||||||
: _name(name)
|
: _name(name)
|
||||||
, _description("<No Description>")
|
, _description("<No Description>")
|
||||||
, _groups()
|
, _groups()
|
||||||
, _darkening(200)
|
, _darkening(1.0,3.0,2.5)
|
||||||
{
|
{
|
||||||
addDrawingStyle ( Viewer, Fallback , "FFFFFFFFFFFFFFFF", 0, 0, 0, 1, 1.0 );
|
addDrawingStyle ( Viewer, Fallback , "FFFFFFFFFFFFFFFF", 0, 0, 0, 1, 1.0 );
|
||||||
addDrawingStyle ( Viewer, Background , "FFFFFFFFFFFFFFFF", 50, 50, 50, 1, 1.0 );
|
addDrawingStyle ( Viewer, Background , "FFFFFFFFFFFFFFFF", 50, 50, 50, 1, 1.0 );
|
||||||
|
@ -333,19 +342,19 @@ namespace Hurricane {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QColor DisplayStyle::getColor ( const Name& key, int darkening ) const
|
QColor DisplayStyle::getColor ( const Name& key, const DisplayStyle::HSVr& darkening ) const
|
||||||
{
|
{
|
||||||
return find(key)->getColor(darkening);
|
return find(key)->getColor(darkening);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QPen DisplayStyle::getPen ( const Name& key, int darkening ) const
|
QPen DisplayStyle::getPen ( const Name& key, const DisplayStyle::HSVr& darkening ) const
|
||||||
{
|
{
|
||||||
return find(key)->getPen(darkening);
|
return find(key)->getPen(darkening);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QBrush DisplayStyle::getBrush ( const Name& key, int darkening ) const
|
QBrush DisplayStyle::getBrush ( const Name& key, const DisplayStyle::HSVr& darkening ) const
|
||||||
{
|
{
|
||||||
return find(key)->getBrush(darkening);
|
return find(key)->getBrush(darkening);
|
||||||
}
|
}
|
||||||
|
@ -403,10 +412,18 @@ namespace Hurricane {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DisplayStyle::setDarkening ( int darkening )
|
void DisplayStyle::setDarkening ( const DisplayStyle::HSVr& darkening )
|
||||||
{
|
{
|
||||||
if ( darkening <= 0 ) {
|
if ( darkening.getHue() < 0.1 ) {
|
||||||
cerr << "[ERROR] Invalid darkening factor: " << darkening << "." << endl;
|
cerr << "[ERROR] Invalid hue darkening factor: " << darkening.getHue() << "." << endl;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ( darkening.getSaturation() < 0.1 ) {
|
||||||
|
cerr << "[ERROR] Invalid saturation darkening factor: " << darkening.getSaturation() << "." << endl;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ( darkening.getValue() < 0.1 ) {
|
||||||
|
cerr << "[ERROR] Invalid value darkening factor: " << darkening.getValue() << "." << endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -255,19 +255,19 @@ namespace Hurricane {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QColor Graphics::getColor ( const Name& key, int darkening )
|
QColor Graphics::getColor ( const Name& key, const DisplayStyle::HSVr& darkening )
|
||||||
{
|
{
|
||||||
return getGraphics()->_getColor ( key, darkening );
|
return getGraphics()->_getColor ( key, darkening );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QPen Graphics::getPen ( const Name& key, int darkening )
|
QPen Graphics::getPen ( const Name& key, const DisplayStyle::HSVr& darkening )
|
||||||
{
|
{
|
||||||
return getGraphics()->_getPen ( key, darkening );
|
return getGraphics()->_getPen ( key, darkening );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QBrush Graphics::getBrush ( const Name& key, int darkening )
|
QBrush Graphics::getBrush ( const Name& key, const DisplayStyle::HSVr& darkening )
|
||||||
{
|
{
|
||||||
return getGraphics()->_getBrush ( key, darkening );
|
return getGraphics()->_getBrush ( key, darkening );
|
||||||
}
|
}
|
||||||
|
@ -285,7 +285,7 @@ namespace Hurricane {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int Graphics::getDarkening ()
|
const DisplayStyle::HSVr& Graphics::getDarkening ()
|
||||||
{
|
{
|
||||||
return getGraphics()->_getDarkening ();
|
return getGraphics()->_getDarkening ();
|
||||||
}
|
}
|
||||||
|
@ -297,6 +297,12 @@ namespace Hurricane {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QColor Graphics::darken ( const QColor& color )
|
||||||
|
{
|
||||||
|
return DisplayStyle::darken ( color, getDarkening() );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const TextTranslator& Graphics::getHtmlTranslator ()
|
const TextTranslator& Graphics::getHtmlTranslator ()
|
||||||
{
|
{
|
||||||
return getGraphics()->_getHtmlTranslator();
|
return getGraphics()->_getHtmlTranslator();
|
||||||
|
|
|
@ -55,13 +55,6 @@ namespace Hurricane {
|
||||||
static QFont nameFont = Graphics::getFixedFont ( QFont::Bold );
|
static QFont nameFont = Graphics::getFixedFont ( QFont::Bold );
|
||||||
static QFont valueFont = Graphics::getFixedFont ( QFont::Normal, true );
|
static QFont valueFont = Graphics::getFixedFont ( QFont::Normal, true );
|
||||||
|
|
||||||
if ( role == Qt::SizeHintRole ) {
|
|
||||||
switch (index.column()) {
|
|
||||||
case 0: return 200;
|
|
||||||
default: return -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( role == Qt::FontRole ) {
|
if ( role == Qt::FontRole ) {
|
||||||
if ( index.row() == 0 ) return QVariant();
|
if ( index.row() == 0 ) return QVariant();
|
||||||
switch (index.column()) {
|
switch (index.column()) {
|
||||||
|
@ -71,7 +64,7 @@ namespace Hurricane {
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !index.isValid() ) return QVariant ();
|
if ( not index.isValid() ) return QVariant ();
|
||||||
|
|
||||||
if ( role == Qt::DisplayRole ) {
|
if ( role == Qt::DisplayRole ) {
|
||||||
int row = index.row ();
|
int row = index.row ();
|
||||||
|
|
|
@ -80,7 +80,6 @@ namespace Hurricane {
|
||||||
|
|
||||||
QHeaderView* horizontalHeader = _view->horizontalHeader ();
|
QHeaderView* horizontalHeader = _view->horizontalHeader ();
|
||||||
horizontalHeader->setStretchLastSection ( true );
|
horizontalHeader->setStretchLastSection ( true );
|
||||||
horizontalHeader->setMinimumSectionSize ( 200 );
|
|
||||||
|
|
||||||
QHeaderView* verticalHeader = _view->verticalHeader ();
|
QHeaderView* verticalHeader = _view->verticalHeader ();
|
||||||
verticalHeader->setVisible ( false );
|
verticalHeader->setVisible ( false );
|
||||||
|
|
|
@ -124,197 +124,197 @@ namespace Hurricane {
|
||||||
};
|
};
|
||||||
public:
|
public:
|
||||||
// Constructor & Destructor.
|
// Constructor & Destructor.
|
||||||
CellWidget ( QWidget* parent=NULL );
|
CellWidget ( QWidget* parent=NULL );
|
||||||
virtual ~CellWidget ();
|
virtual ~CellWidget ();
|
||||||
// Accessors.
|
// Accessors.
|
||||||
// MapView* getMapView () { return _mapView; };
|
// MapView* getMapView () { return _mapView; };
|
||||||
void setCell ( Cell* );
|
void setCell ( Cell* );
|
||||||
inline Cell* getCell () const;
|
inline Cell* getCell () const;
|
||||||
inline shared_ptr<State>& getState ();
|
inline shared_ptr<State>& getState ();
|
||||||
inline PaletteWidget* getPalette ();
|
inline PaletteWidget* getPalette ();
|
||||||
inline Occurrences getOccurrencesUnder ( const QRect& ) const;
|
inline Occurrences getOccurrencesUnder ( const QRect& ) const;
|
||||||
Occurrences getOccurrencesUnder ( const Box& ) const;
|
Occurrences getOccurrencesUnder ( const Box& ) const;
|
||||||
inline SelectorSet& getSelectorSet ();
|
inline SelectorSet& getSelectorSet ();
|
||||||
inline RulerSet& getRulerSet ();
|
inline RulerSet& getRulerSet ();
|
||||||
inline RubberShape getRubberShape () const;
|
inline RubberShape getRubberShape () const;
|
||||||
inline int getStartLevel () const;
|
inline int getStartLevel () const;
|
||||||
inline int getStopLevel () const;
|
inline int getStopLevel () const;
|
||||||
inline Query::Mask getQueryFilter () const ;
|
inline Query::Mask getQueryFilter () const ;
|
||||||
void bindToPalette ( PaletteWidget* );
|
void bindToPalette ( PaletteWidget* );
|
||||||
void detachFromPalette ();
|
void detachFromPalette ();
|
||||||
void bindCommand ( Command* );
|
void bindCommand ( Command* );
|
||||||
void unbindCommand ( Command* );
|
void unbindCommand ( Command* );
|
||||||
inline void setActiveCommand ( Command* );
|
inline void setActiveCommand ( Command* );
|
||||||
inline Command* getActiveCommand () const;
|
inline Command* getActiveCommand () const;
|
||||||
inline void resetActiveCommand ();
|
inline void resetActiveCommand ();
|
||||||
inline void setCursorStep ( DbU::Unit );
|
inline void setCursorStep ( DbU::Unit );
|
||||||
inline void setRealSnapGridStep ( DbU::Unit step );
|
inline void setRealSnapGridStep ( DbU::Unit step );
|
||||||
inline unsigned int getDbuMode () const;
|
inline unsigned int getDbuMode () const;
|
||||||
inline bool gridMode () const;
|
inline bool gridMode () const;
|
||||||
inline bool symbolicMode () const;
|
inline bool symbolicMode () const;
|
||||||
inline bool physicalMode () const;
|
inline bool physicalMode () const;
|
||||||
inline DbU::UnitPower getUnitPower () const;
|
inline DbU::UnitPower getUnitPower () const;
|
||||||
inline bool showBoundaries () const;
|
inline bool showBoundaries () const;
|
||||||
inline bool showSelection () const;
|
inline bool showSelection () const;
|
||||||
inline bool cumulativeSelection () const;
|
inline bool cumulativeSelection () const;
|
||||||
inline void setDbuMode ( int );
|
inline void setDbuMode ( int );
|
||||||
inline void setUnitPower ( DbU::UnitPower );
|
inline void setUnitPower ( DbU::UnitPower );
|
||||||
inline void setRubberShape ( RubberShape );
|
inline void setRubberShape ( RubberShape );
|
||||||
inline void setStartLevel ( int );
|
inline void setStartLevel ( int );
|
||||||
inline void setStopLevel ( int );
|
inline void setStopLevel ( int );
|
||||||
inline void setQueryFilter ( Query::Mask );
|
inline void setQueryFilter ( Query::Mask );
|
||||||
inline bool timeout ( const char*, const Timer&, double timeout, bool& timedout ) const;
|
inline bool timeout ( const char*, const Timer&, double timeout, bool& timedout ) const;
|
||||||
// Painter control & Hurricane objects drawing primitives.
|
// Painter control & Hurricane objects drawing primitives.
|
||||||
inline void setEnableRedrawInterrupt ( bool );
|
inline void setEnableRedrawInterrupt ( bool );
|
||||||
inline void addDrawExtensionGo ( const Name&, InitExtensionGo_t*, DrawExtensionGo_t* );
|
inline void addDrawExtensionGo ( const Name&, InitExtensionGo_t*, DrawExtensionGo_t* );
|
||||||
inline QPainter& getPainter ( size_t plane=PlaneId::Working );
|
inline QPainter& getPainter ( size_t plane=PlaneId::Working );
|
||||||
inline int getDarkening () const;
|
inline const DisplayStyle::HSVr& getDarkening () const;
|
||||||
inline void copyToPrinter ( QPrinter*, bool imageOnly = false );
|
inline void copyToPrinter ( QPrinter*, bool imageOnly = false );
|
||||||
inline void copyToImage ( QImage*, bool noScale = false );
|
inline void copyToImage ( QImage*, bool noScale = false );
|
||||||
inline const float& getScale () const;
|
inline const float& getScale () const;
|
||||||
inline const QPoint& getMousePosition () const;
|
inline const QPoint& getMousePosition () const;
|
||||||
inline void updateMousePosition ();
|
inline void updateMousePosition ();
|
||||||
void setLayerVisible ( const Name& layer, bool visible );
|
void setLayerVisible ( const Name& layer, bool visible );
|
||||||
bool isDrawable ( const Name& );
|
bool isDrawable ( const Name& );
|
||||||
bool isDrawableLayer ( const Name& );
|
bool isDrawableLayer ( const Name& );
|
||||||
bool isDrawableExtension ( const Name& );
|
bool isDrawableExtension ( const Name& );
|
||||||
bool isSelectable ( const Name& ) const;
|
bool isSelectable ( const Name& ) const;
|
||||||
bool isSelectable ( const Layer* ) const;
|
bool isSelectable ( const Layer* ) const;
|
||||||
inline void setDarkening ( int );
|
inline void setDarkening ( const DisplayStyle::HSVr& );
|
||||||
inline void setPen ( const QPen& , size_t plane=PlaneId::Working );
|
inline void setPen ( const QPen& , size_t plane=PlaneId::Working );
|
||||||
void drawBox ( DbU::Unit, DbU::Unit, DbU::Unit, DbU::Unit );
|
void drawBox ( DbU::Unit, DbU::Unit, DbU::Unit, DbU::Unit );
|
||||||
void drawBox ( const Box& );
|
void drawBox ( const Box& );
|
||||||
void drawLine ( DbU::Unit, DbU::Unit, DbU::Unit, DbU::Unit, bool mode=true );
|
void drawLine ( DbU::Unit, DbU::Unit, DbU::Unit, DbU::Unit, bool mode=true );
|
||||||
void drawLine ( const Point&, const Point&, bool mode=true );
|
void drawLine ( const Point&, const Point&, bool mode=true );
|
||||||
void drawText ( const Point&, const char*, unsigned int flags=0, int angle=0 );
|
void drawText ( const Point&, const char*, unsigned int flags=0, int angle=0 );
|
||||||
void drawGrid ( QRect );
|
void drawGrid ( QRect );
|
||||||
void drawSpot ();
|
void drawSpot ();
|
||||||
void drawRuler ( shared_ptr<Ruler> );
|
void drawRuler ( shared_ptr<Ruler> );
|
||||||
void drawRulers ( QRect );
|
void drawRulers ( QRect );
|
||||||
void drawDisplayText ( const QRect& , const char*, unsigned int flags=0 );
|
void drawDisplayText ( const QRect& , const char*, unsigned int flags=0 );
|
||||||
void drawDisplayText ( const QPoint&, const char*, unsigned int flags=0, int angle=0 );
|
void drawDisplayText ( const QPoint&, const char*, unsigned int flags=0, int angle=0 );
|
||||||
void drawScreenPolygon ( const QPoint*, int count, size_t plane=PlaneId::Working );
|
void drawScreenPolygon ( const QPoint*, int count, size_t plane=PlaneId::Working );
|
||||||
void drawScreenLine ( const QPoint&, const QPoint&, size_t plane=PlaneId::Working, bool mode=true );
|
void drawScreenLine ( const QPoint&, const QPoint&, size_t plane=PlaneId::Working, bool mode=true );
|
||||||
void drawScreenRect ( const QPoint&, const QPoint&, size_t plane=PlaneId::Working );
|
void drawScreenRect ( const QPoint&, const QPoint&, size_t plane=PlaneId::Working );
|
||||||
void drawScreenRect ( const QRect& , size_t plane=PlaneId::Working );
|
void drawScreenRect ( const QRect& , size_t plane=PlaneId::Working );
|
||||||
void drawScreenPolyline ( const QPoint*, int, int, size_t plane=PlaneId::Working );
|
void drawScreenPolyline ( const QPoint*, int, int, size_t plane=PlaneId::Working );
|
||||||
// Geometric conversions.
|
// Geometric conversions.
|
||||||
inline DbU::Unit toDbu ( float ) const;
|
inline DbU::Unit toDbu ( float ) const;
|
||||||
QRect dbuToDisplayRect ( DbU::Unit x1, DbU::Unit y1, DbU::Unit x2, DbU::Unit y2, bool usePoint=true ) const;
|
QRect dbuToDisplayRect ( DbU::Unit x1, DbU::Unit y1, DbU::Unit x2, DbU::Unit y2, bool usePoint=true ) const;
|
||||||
QRect dbuToDisplayRect ( const Box& box , bool usePoint=true ) const;
|
QRect dbuToDisplayRect ( const Box& box , bool usePoint=true ) const;
|
||||||
QPoint dbuToDisplayPoint ( DbU::Unit x, DbU::Unit y ) const;
|
QPoint dbuToDisplayPoint ( DbU::Unit x, DbU::Unit y ) const;
|
||||||
QPoint dbuToDisplayPoint ( const Point& point ) const;
|
QPoint dbuToDisplayPoint ( const Point& point ) const;
|
||||||
inline int dbuToDisplayX ( DbU::Unit x ) const;
|
inline int dbuToDisplayX ( DbU::Unit x ) const;
|
||||||
inline int dbuToDisplayY ( DbU::Unit y ) const;
|
inline int dbuToDisplayY ( DbU::Unit y ) const;
|
||||||
inline int dbuToDisplayLength ( DbU::Unit length ) const;
|
inline int dbuToDisplayLength ( DbU::Unit length ) const;
|
||||||
inline int dbuToScreenX ( DbU::Unit x ) const;
|
inline int dbuToScreenX ( DbU::Unit x ) const;
|
||||||
inline int dbuToScreenY ( DbU::Unit y ) const;
|
inline int dbuToScreenY ( DbU::Unit y ) const;
|
||||||
QPoint dbuToScreenPoint ( DbU::Unit x, DbU::Unit y ) const;
|
QPoint dbuToScreenPoint ( DbU::Unit x, DbU::Unit y ) const;
|
||||||
inline QPoint dbuToScreenPoint ( const Point& point ) const;
|
inline QPoint dbuToScreenPoint ( const Point& point ) const;
|
||||||
inline DbU::Unit displayToDbuX ( int x ) const;
|
inline DbU::Unit displayToDbuX ( int x ) const;
|
||||||
inline DbU::Unit displayToDbuY ( int y ) const;
|
inline DbU::Unit displayToDbuY ( int y ) const;
|
||||||
inline DbU::Unit displayToDbuLength ( int length ) const;
|
inline DbU::Unit displayToDbuLength ( int length ) const;
|
||||||
inline Box displayToDbuBox ( const QRect& rect ) const;
|
inline Box displayToDbuBox ( const QRect& rect ) const;
|
||||||
inline DbU::Unit screenToDbuX ( int x ) const;
|
inline DbU::Unit screenToDbuX ( int x ) const;
|
||||||
inline DbU::Unit screenToDbuY ( int y ) const;
|
inline DbU::Unit screenToDbuY ( int y ) const;
|
||||||
inline Point screenToDbuPoint ( const QPoint& point ) const;
|
inline Point screenToDbuPoint ( const QPoint& point ) const;
|
||||||
inline Box screenToDbuBox ( const QRect& rect ) const;
|
inline Box screenToDbuBox ( const QRect& rect ) const;
|
||||||
inline Box& pixelInflate ( Box&, int pixels ) const;
|
inline Box& pixelInflate ( Box&, int pixels ) const;
|
||||||
inline Point getTopLeft () const;
|
inline Point getTopLeft () const;
|
||||||
inline Box getVisibleArea () const;
|
inline Box getVisibleArea () const;
|
||||||
Box computeVisibleArea ( float scale ) const;
|
Box computeVisibleArea ( float scale ) const;
|
||||||
Box computeVisibleArea ( float scale, const Point& topLeft ) const;
|
Box computeVisibleArea ( float scale, const Point& topLeft ) const;
|
||||||
Box computeVisibleArea ( const Box&, float& scale ) const;
|
Box computeVisibleArea ( const Box&, float& scale ) const;
|
||||||
inline DbU::Unit cursorStep () const;
|
inline DbU::Unit cursorStep () const;
|
||||||
inline bool _underDetailedGridThreshold() const;
|
inline bool _underDetailedGridThreshold() const;
|
||||||
inline DbU::Unit _snapGridStep () const;
|
inline DbU::Unit _snapGridStep () const;
|
||||||
inline DbU::Unit _onSnapGrid ( DbU::Unit ) const;
|
inline DbU::Unit _onSnapGrid ( DbU::Unit ) const;
|
||||||
inline Point _onSnapGrid ( const Point& ) const;
|
inline Point _onSnapGrid ( const Point& ) const;
|
||||||
inline DbU::Unit _onCursorGrid ( DbU::Unit ) const;
|
inline DbU::Unit _onCursorGrid ( DbU::Unit ) const;
|
||||||
inline Point _onCursorGrid ( const Point& ) const;
|
inline Point _onCursorGrid ( const Point& ) const;
|
||||||
// Qt QWidget Functions Overloads.
|
// Qt QWidget Functions Overloads.
|
||||||
void pushCursor ( Qt::CursorShape cursor );
|
void pushCursor ( Qt::CursorShape cursor );
|
||||||
void popCursor ();
|
void popCursor ();
|
||||||
virtual QSize minimumSizeHint () const;
|
virtual QSize minimumSizeHint () const;
|
||||||
virtual void showEvent ( QShowEvent* );
|
virtual void showEvent ( QShowEvent* );
|
||||||
virtual void paintEvent ( QPaintEvent* );
|
virtual void paintEvent ( QPaintEvent* );
|
||||||
virtual void resizeEvent ( QResizeEvent* );
|
virtual void resizeEvent ( QResizeEvent* );
|
||||||
virtual void wheelEvent ( QWheelEvent* );
|
virtual void wheelEvent ( QWheelEvent* );
|
||||||
virtual void keyPressEvent ( QKeyEvent* );
|
virtual void keyPressEvent ( QKeyEvent* );
|
||||||
virtual void keyReleaseEvent ( QKeyEvent* );
|
virtual void keyReleaseEvent ( QKeyEvent* );
|
||||||
virtual void mouseMoveEvent ( QMouseEvent* );
|
virtual void mouseMoveEvent ( QMouseEvent* );
|
||||||
virtual void mousePressEvent ( QMouseEvent* );
|
virtual void mousePressEvent ( QMouseEvent* );
|
||||||
virtual void mouseReleaseEvent ( QMouseEvent* );
|
virtual void mouseReleaseEvent ( QMouseEvent* );
|
||||||
signals:
|
signals:
|
||||||
void cellChanged ( Cell* );
|
void cellChanged ( Cell* );
|
||||||
void cellPreModificated ();
|
void cellPreModificated ();
|
||||||
void cellPostModificated ();
|
void cellPostModificated ();
|
||||||
void stateChanged ( shared_ptr<CellWidget::State>& );
|
void stateChanged ( shared_ptr<CellWidget::State>& );
|
||||||
void styleChanged ();
|
void styleChanged ();
|
||||||
void queryFilterChanged ();
|
void queryFilterChanged ();
|
||||||
void dbuModeChanged ( unsigned int mode, DbU::UnitPower );
|
void dbuModeChanged ( unsigned int mode, DbU::UnitPower );
|
||||||
void updatePalette ( Cell* );
|
void updatePalette ( Cell* );
|
||||||
void mousePositionChanged ( const Point& position );
|
void mousePositionChanged ( const Point& position );
|
||||||
void selectionModeChanged ();
|
void selectionModeChanged ();
|
||||||
void selectionChanged ( const SelectorSet& );
|
void selectionChanged ( const SelectorSet& );
|
||||||
void selectionToggled ( Occurrence );
|
void selectionToggled ( Occurrence );
|
||||||
void showBoundariesToggled ( bool );
|
void showBoundariesToggled ( bool );
|
||||||
public slots:
|
public slots:
|
||||||
// Qt QWidget Slots Overload & CellWidget Specifics.
|
// Qt QWidget Slots Overload & CellWidget Specifics.
|
||||||
void setState ( shared_ptr<CellWidget::State>& );
|
void setState ( shared_ptr<CellWidget::State>& );
|
||||||
inline void openRefreshSession ();
|
inline void openRefreshSession ();
|
||||||
inline void closeRefreshSession ();
|
inline void closeRefreshSession ();
|
||||||
inline DrawingPlanes& getDrawingPlanes ();
|
inline DrawingPlanes& getDrawingPlanes ();
|
||||||
inline QPoint& getOffsetVA ();
|
inline QPoint& getOffsetVA ();
|
||||||
// void select ( const Net* );
|
// void select ( const Net* );
|
||||||
void select ( Occurrence );
|
void select ( Occurrence );
|
||||||
bool isSelected ( Occurrence );
|
bool isSelected ( Occurrence );
|
||||||
void selectOccurrencesUnder ( Box selectArea );
|
void selectOccurrencesUnder ( Box selectArea );
|
||||||
// void unselect ( const Net* );
|
// void unselect ( const Net* );
|
||||||
void unselect ( Occurrence );
|
void unselect ( Occurrence );
|
||||||
void unselectAll ();
|
void unselectAll ();
|
||||||
void toggleSelection ( Occurrence );
|
void toggleSelection ( Occurrence );
|
||||||
void setShowSelection ( bool state );
|
void setShowSelection ( bool state );
|
||||||
void setCumulativeSelection ( bool state );
|
void setCumulativeSelection ( bool state );
|
||||||
// void _select ( const Net* );
|
// void _select ( const Net* );
|
||||||
// void _unselect ( const Net* );
|
// void _unselect ( const Net* );
|
||||||
// void _selectOccurrencesUnder ( Box selectArea );
|
// void _selectOccurrencesUnder ( Box selectArea );
|
||||||
void _unselectAll ();
|
void _unselectAll ();
|
||||||
inline void addRuler ( const Point&, const Point& );
|
inline void addRuler ( const Point&, const Point& );
|
||||||
inline void addRuler ( shared_ptr<Ruler> );
|
inline void addRuler ( shared_ptr<Ruler> );
|
||||||
inline void clearRulers ();
|
inline void clearRulers ();
|
||||||
void changeQueryFilter ();
|
void changeQueryFilter ();
|
||||||
void rubberChange ();
|
void rubberChange ();
|
||||||
void changeDbuMode ( unsigned int mode, DbU::UnitPower );
|
void changeDbuMode ( unsigned int mode, DbU::UnitPower );
|
||||||
void setStyle ( int id );
|
void setStyle ( int id );
|
||||||
void updatePalette ();
|
void updatePalette ();
|
||||||
void cellPreModificate ();
|
void cellPreModificate ();
|
||||||
void cellPostModificate ();
|
void cellPostModificate ();
|
||||||
inline void refresh ();
|
inline void refresh ();
|
||||||
void _redraw ( QRect redrawArea );
|
void _redraw ( QRect redrawArea );
|
||||||
inline void redrawSelection ();
|
inline void redrawSelection ();
|
||||||
void redrawSelection ( QRect redrawArea );
|
void redrawSelection ( QRect redrawArea );
|
||||||
void goLeft ( int dx = 0 );
|
void goLeft ( int dx = 0 );
|
||||||
void goRight ( int dx = 0 );
|
void goRight ( int dx = 0 );
|
||||||
void goUp ( int dy = 0 );
|
void goUp ( int dy = 0 );
|
||||||
void goDown ( int dy = 0 );
|
void goDown ( int dy = 0 );
|
||||||
void fitToContents ( bool historyEnable=true );
|
void fitToContents ( bool historyEnable=true );
|
||||||
void fitToNet ( const Net*, bool historyEnable=true );
|
void fitToNet ( const Net*, bool historyEnable=true );
|
||||||
void setScale ( float );
|
void setScale ( float );
|
||||||
void scaleHistoryUp ();
|
void scaleHistoryUp ();
|
||||||
void scaleHistoryDown ();
|
void scaleHistoryDown ();
|
||||||
// void setGridMode ();
|
// void setGridMode ();
|
||||||
// void setSymbolicMode ();
|
// void setSymbolicMode ();
|
||||||
// void setPhysicalMode ( DbU::UnitPower );
|
// void setPhysicalMode ( DbU::UnitPower );
|
||||||
void setShowBoundaries ( bool state );
|
void setShowBoundaries ( bool state );
|
||||||
void reframe ();
|
void reframe ();
|
||||||
void reframe ( const Box& box, bool historyEnable=true );
|
void reframe ( const Box& box, bool historyEnable=true );
|
||||||
void displayReframe ();
|
void displayReframe ();
|
||||||
void _goLeft ( int dx );
|
void _goLeft ( int dx );
|
||||||
void _goRight ( int dx );
|
void _goRight ( int dx );
|
||||||
void _goUp ( int dy );
|
void _goUp ( int dy );
|
||||||
void _goDown ( int dy );
|
void _goDown ( int dy );
|
||||||
void _refresh ();
|
void _refresh ();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
class Spot {
|
class Spot {
|
||||||
|
@ -650,7 +650,7 @@ namespace Hurricane {
|
||||||
DrawingPlanes _drawingPlanes;
|
DrawingPlanes _drawingPlanes;
|
||||||
DrawingQuery _drawingQuery;
|
DrawingQuery _drawingQuery;
|
||||||
TextDrawingQuery _textDrawingQuery;
|
TextDrawingQuery _textDrawingQuery;
|
||||||
int _darkening;
|
DisplayStyle::HSVr _darkening;
|
||||||
QPoint _mousePosition;
|
QPoint _mousePosition;
|
||||||
Spot _spot;
|
Spot _spot;
|
||||||
shared_ptr<State> _state;
|
shared_ptr<State> _state;
|
||||||
|
@ -1335,7 +1335,7 @@ namespace Hurricane {
|
||||||
{ return _drawingPlanes.painter(plane); }
|
{ return _drawingPlanes.painter(plane); }
|
||||||
|
|
||||||
|
|
||||||
inline int CellWidget::getDarkening () const
|
inline const DisplayStyle::HSVr& CellWidget::getDarkening () const
|
||||||
{ return _darkening; }
|
{ return _darkening; }
|
||||||
|
|
||||||
|
|
||||||
|
@ -1389,7 +1389,7 @@ namespace Hurricane {
|
||||||
{ _drawingPlanes.painter(plane).setPen(pen); }
|
{ _drawingPlanes.painter(plane).setPen(pen); }
|
||||||
|
|
||||||
|
|
||||||
inline void CellWidget::setDarkening ( int darkening )
|
inline void CellWidget::setDarkening ( const DisplayStyle::HSVr& darkening )
|
||||||
{ _darkening = darkening; }
|
{ _darkening = darkening; }
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
#include <QColor>
|
#include <QColor>
|
||||||
#include <QBrush>
|
#include <QBrush>
|
||||||
#include "hurricane/Name.h"
|
#include "hurricane/Name.h"
|
||||||
|
#include "hurricane/viewer/DisplayStyle.h"
|
||||||
|
|
||||||
|
|
||||||
namespace Hurricane {
|
namespace Hurricane {
|
||||||
|
@ -53,7 +54,7 @@ namespace Hurricane {
|
||||||
// Accessors.
|
// Accessors.
|
||||||
void qtAllocate ();
|
void qtAllocate ();
|
||||||
inline const Name& getName () const;
|
inline const Name& getName () const;
|
||||||
QBrush getBrush ( size_t , int darkening ) const;
|
QBrush getBrush ( size_t, const DisplayStyle::HSVr& darkening ) const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Internal - Attributes.
|
// Internal - Attributes.
|
||||||
|
|
|
@ -29,78 +29,17 @@
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
#include <QColor>
|
#include <QColor>
|
||||||
#include <QPen>
|
#include <QPen>
|
||||||
#include <QBrush>
|
#include <QBrush>
|
||||||
|
|
||||||
#include "hurricane/Commons.h"
|
#include "hurricane/Commons.h"
|
||||||
#include "hurricane/Name.h"
|
#include "hurricane/Name.h"
|
||||||
|
|
||||||
#include "hurricane/viewer/ScreenUtilities.h"
|
#include "hurricane/viewer/ScreenUtilities.h"
|
||||||
|
|
||||||
|
|
||||||
namespace Hurricane {
|
namespace Hurricane {
|
||||||
|
|
||||||
|
class DrawingStyle;
|
||||||
class DrawingStyle {
|
|
||||||
|
|
||||||
public:
|
|
||||||
// Constructors & Destructors.
|
|
||||||
static DrawingStyle* create ( const Name& name
|
|
||||||
, const string& pattern ="FFFFFFFFFFFFFFFF"
|
|
||||||
, int red =0
|
|
||||||
, int green =0
|
|
||||||
, 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;
|
|
||||||
QPen getPen ( int darkening ) const;
|
|
||||||
QBrush getBrush ( int darkening ) const;
|
|
||||||
inline float getThreshold () const;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
// Internal - Attributes.
|
|
||||||
const Name _name;
|
|
||||||
int _red;
|
|
||||||
int _green;
|
|
||||||
int _blue;
|
|
||||||
int _borderWidth;
|
|
||||||
string _pattern;
|
|
||||||
QColor *_color;
|
|
||||||
QPen *_pen;
|
|
||||||
QBrush *_brush;
|
|
||||||
float _threshold;
|
|
||||||
bool _goMatched;
|
|
||||||
size_t _refcount;
|
|
||||||
|
|
||||||
// Internal - Constructors & Destructors.
|
|
||||||
DrawingStyle ( const Name& name
|
|
||||||
, const string& pattern
|
|
||||||
, int red
|
|
||||||
, int green
|
|
||||||
, int blue
|
|
||||||
, int borderWidth
|
|
||||||
, float threshold
|
|
||||||
, bool goMatched
|
|
||||||
);
|
|
||||||
DrawingStyle ( const DrawingStyle& );
|
|
||||||
~DrawingStyle ();
|
|
||||||
DrawingStyle& operator= ( const DrawingStyle& );
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class DrawingGroup {
|
class DrawingGroup {
|
||||||
|
@ -142,6 +81,22 @@ namespace Hurricane {
|
||||||
|
|
||||||
|
|
||||||
class DisplayStyle {
|
class DisplayStyle {
|
||||||
|
public:
|
||||||
|
class HSVr {
|
||||||
|
public:
|
||||||
|
inline HSVr ( float hue=1.0, float saturation=1.0, float value=1.0 );
|
||||||
|
inline bool isId () const;
|
||||||
|
inline float getHue () const;
|
||||||
|
inline float getSaturation () const;
|
||||||
|
inline float getValue () const;
|
||||||
|
inline void setHue ( float );
|
||||||
|
inline void setSaturation ( float );
|
||||||
|
inline void setValue ( float );
|
||||||
|
private:
|
||||||
|
float _hue;
|
||||||
|
float _saturation;
|
||||||
|
float _value;
|
||||||
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Static Members.
|
// Static Members.
|
||||||
|
@ -166,6 +121,7 @@ namespace Hurricane {
|
||||||
static const Name Undef;
|
static const Name Undef;
|
||||||
static const Name UnmatchedGroup;
|
static const Name UnmatchedGroup;
|
||||||
|
|
||||||
|
static QColor darken ( const QColor& color, const DisplayStyle::HSVr& darkening );
|
||||||
// Constructor & Destructor.
|
// Constructor & Destructor.
|
||||||
DisplayStyle ( const Name& name );
|
DisplayStyle ( const Name& name );
|
||||||
~DisplayStyle ();
|
~DisplayStyle ();
|
||||||
|
@ -173,12 +129,12 @@ namespace Hurricane {
|
||||||
// Accessors.
|
// Accessors.
|
||||||
const Name& getName () const;
|
const Name& getName () const;
|
||||||
inline const string& getDescription () const;
|
inline const string& getDescription () const;
|
||||||
inline int getDarkening () const;
|
inline const HSVr& getDarkening () const;
|
||||||
const Name& getGroup ( const Name& key ) const;
|
const Name& getGroup ( const Name& key ) const;
|
||||||
const string& getPattern ( const Name& key ) const;
|
const string& getPattern ( const Name& key ) const;
|
||||||
QColor getColor ( const Name& key, int darkening ) const;
|
QColor getColor ( const Name& key, const HSVr& ) const;
|
||||||
QPen getPen ( const Name& key, int darkening ) const;
|
QPen getPen ( const Name& key, const HSVr& ) const;
|
||||||
QBrush getBrush ( const Name& key, int darkening ) const;
|
QBrush getBrush ( const Name& key, const HSVr& ) const;
|
||||||
float getThreshold ( const Name& key ) const;
|
float getThreshold ( const Name& key ) const;
|
||||||
inline const vector<DrawingGroup*>& getDrawingGroups () const;
|
inline const vector<DrawingGroup*>& getDrawingGroups () const;
|
||||||
DrawingStyle* find ( const Name& key ) const;
|
DrawingStyle* find ( const Name& key ) const;
|
||||||
|
@ -188,7 +144,7 @@ namespace Hurricane {
|
||||||
inline void setDescription ( const string& description );
|
inline void setDescription ( const string& description );
|
||||||
inline void setDescription ( const char* description );
|
inline void setDescription ( const char* description );
|
||||||
void inheritFrom ( const DisplayStyle* base );
|
void inheritFrom ( const DisplayStyle* base );
|
||||||
void setDarkening ( int darkening );
|
void setDarkening ( const HSVr& );
|
||||||
void addDrawingStyle ( const Name& groupKey
|
void addDrawingStyle ( const Name& groupKey
|
||||||
, const Name& key
|
, const Name& key
|
||||||
, const string& pattern
|
, const string& pattern
|
||||||
|
@ -205,7 +161,7 @@ namespace Hurricane {
|
||||||
const Name _name;
|
const Name _name;
|
||||||
string _description;
|
string _description;
|
||||||
vector<DrawingGroup*> _groups;
|
vector<DrawingGroup*> _groups;
|
||||||
int _darkening;
|
HSVr _darkening;
|
||||||
|
|
||||||
// Internals - Methods.
|
// Internals - Methods.
|
||||||
void findOrCreate ( const Name& groupKey
|
void findOrCreate ( const Name& groupKey
|
||||||
|
@ -218,6 +174,63 @@ namespace Hurricane {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class DrawingStyle {
|
||||||
|
public:
|
||||||
|
// Constructors & Destructors.
|
||||||
|
static DrawingStyle* create ( const Name& name
|
||||||
|
, const string& pattern ="FFFFFFFFFFFFFFFF"
|
||||||
|
, int red =0
|
||||||
|
, int green =0
|
||||||
|
, int blue =0
|
||||||
|
, int borderWidth=0
|
||||||
|
, float threshold =1.0
|
||||||
|
, bool goMatched =true
|
||||||
|
);
|
||||||
|
DrawingStyle* link ();
|
||||||
|
size_t unlink ();
|
||||||
|
public:
|
||||||
|
// Accessors.
|
||||||
|
void qtAllocate ();
|
||||||
|
inline bool isGoMatched () const;
|
||||||
|
inline const Name& getName () const;
|
||||||
|
inline const string& getPattern () const;
|
||||||
|
QColor getColor ( const DisplayStyle::HSVr& ) const;
|
||||||
|
QPen getPen ( const DisplayStyle::HSVr& ) const;
|
||||||
|
QBrush getBrush ( const DisplayStyle::HSVr& ) const;
|
||||||
|
inline float getThreshold () const;
|
||||||
|
private:
|
||||||
|
// Internal - Attributes.
|
||||||
|
const Name _name;
|
||||||
|
int _red;
|
||||||
|
int _green;
|
||||||
|
int _blue;
|
||||||
|
int _borderWidth;
|
||||||
|
string _pattern;
|
||||||
|
QColor *_color;
|
||||||
|
QPen *_pen;
|
||||||
|
QBrush *_brush;
|
||||||
|
float _threshold;
|
||||||
|
bool _goMatched;
|
||||||
|
size_t _refcount;
|
||||||
|
private:
|
||||||
|
// Internal - Constructors & Destructors.
|
||||||
|
DrawingStyle ( const Name& name
|
||||||
|
, const string& pattern
|
||||||
|
, int red
|
||||||
|
, int green
|
||||||
|
, int blue
|
||||||
|
, int borderWidth
|
||||||
|
, float threshold
|
||||||
|
, bool goMatched
|
||||||
|
);
|
||||||
|
DrawingStyle ( const DrawingStyle& );
|
||||||
|
~DrawingStyle ();
|
||||||
|
DrawingStyle& operator= ( const DrawingStyle& );
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Functions.
|
// Functions.
|
||||||
|
@ -231,11 +244,22 @@ namespace Hurricane {
|
||||||
|
|
||||||
inline const Name& DisplayStyle::getName () const { return _name; }
|
inline const Name& DisplayStyle::getName () const { return _name; }
|
||||||
inline const vector<DrawingGroup*>& DisplayStyle::getDrawingGroups () const { return _groups; }
|
inline const vector<DrawingGroup*>& DisplayStyle::getDrawingGroups () const { return _groups; }
|
||||||
inline int DisplayStyle::getDarkening () const { return _darkening; }
|
inline const DisplayStyle::HSVr& DisplayStyle::getDarkening () const { return _darkening; }
|
||||||
inline const string& DisplayStyle::getDescription () const { return _description; }
|
inline const string& DisplayStyle::getDescription () const { return _description; }
|
||||||
inline void DisplayStyle::setDescription ( const string& description ) { _description = description; }
|
inline void DisplayStyle::setDescription ( const string& description ) { _description = description; }
|
||||||
inline void DisplayStyle::setDescription ( const char* description ) { _description = description; }
|
inline void DisplayStyle::setDescription ( const char* description ) { _description = description; }
|
||||||
|
|
||||||
|
inline DisplayStyle::HSVr::HSVr ( float hue, float saturation, float value )
|
||||||
|
: _hue(hue), _saturation(saturation), _value(value) { }
|
||||||
|
|
||||||
|
inline bool DisplayStyle::HSVr::isId () const { return (_hue==1.0) and (_saturation==1.0) and (_value==1.0); }
|
||||||
|
inline float DisplayStyle::HSVr::getHue () const { return _hue; }
|
||||||
|
inline float DisplayStyle::HSVr::getSaturation () const { return _saturation; }
|
||||||
|
inline float DisplayStyle::HSVr::getValue () const { return _value; }
|
||||||
|
inline void DisplayStyle::HSVr::setHue ( float hue ) { _hue=hue; }
|
||||||
|
inline void DisplayStyle::HSVr::setSaturation ( float saturation ) { _saturation=saturation; }
|
||||||
|
inline void DisplayStyle::HSVr::setValue ( float value ) { _value=value; }
|
||||||
|
|
||||||
|
|
||||||
} // End of Hurricane namespace.
|
} // End of Hurricane namespace.
|
||||||
|
|
||||||
|
|
|
@ -60,13 +60,14 @@ namespace Hurricane {
|
||||||
static const QFont getFixedFont ( int weight=QFont::Normal, bool italic=false, bool underline=false, int scale=0 );
|
static const QFont getFixedFont ( int weight=QFont::Normal, bool italic=false, bool underline=false, int scale=0 );
|
||||||
static const QFont getNormalFont ( bool bold=false, bool italic=false, bool underline=false );
|
static const QFont getNormalFont ( bool bold=false, bool italic=false, bool underline=false );
|
||||||
static const Name& getGroup ( const Name& key );
|
static const Name& getGroup ( const Name& key );
|
||||||
static QColor getColor ( const Name& key, int darkening=100 );
|
static QColor getColor ( const Name& key, const DisplayStyle::HSVr& darkening=DisplayStyle::HSVr() );
|
||||||
static QPen getPen ( const Name& key, int darkening=100 );
|
static QPen getPen ( const Name& key, const DisplayStyle::HSVr& darkening=DisplayStyle::HSVr() );
|
||||||
static QBrush getBrush ( const Name& key, int darkening=100 );
|
static QBrush getBrush ( const Name& key, const DisplayStyle::HSVr& darkening=DisplayStyle::HSVr() );
|
||||||
static const string& getPattern ( const Name& key );
|
static const string& getPattern ( const Name& key );
|
||||||
static float getThreshold ( const Name& key );
|
static float getThreshold ( const Name& key );
|
||||||
static int getDarkening ();
|
static const DisplayStyle::HSVr& getDarkening ();
|
||||||
static const ColorScale& getColorScale ( ColorScale::ScaleType );
|
static const ColorScale& getColorScale ( ColorScale::ScaleType );
|
||||||
|
static QColor darken ( const QColor& );
|
||||||
static const TextTranslator& getHtmlTranslator();
|
static const TextTranslator& getHtmlTranslator();
|
||||||
static string toHtml ( const string& );
|
static string toHtml ( const string& );
|
||||||
static bool breakpointStopCb ( const string& message );
|
static bool breakpointStopCb ( const string& message );
|
||||||
|
@ -106,12 +107,12 @@ namespace Hurricane {
|
||||||
DisplayStyle* _getStyle () const;
|
DisplayStyle* _getStyle () const;
|
||||||
inline const vector<DisplayStyle*>& _getStyles () const;
|
inline const vector<DisplayStyle*>& _getStyles () const;
|
||||||
inline const Name& _getGroup ( const Name& key ) const;
|
inline const Name& _getGroup ( const Name& key ) const;
|
||||||
inline QColor _getColor ( const Name& key, int darkening ) const;
|
inline QColor _getColor ( const Name& key, const DisplayStyle::HSVr& darkening ) const;
|
||||||
inline QPen _getPen ( const Name& key, int darkening ) const;
|
inline QPen _getPen ( const Name& key, const DisplayStyle::HSVr& darkening ) const;
|
||||||
inline QBrush _getBrush ( const Name& key, int darkening ) const;
|
inline QBrush _getBrush ( const Name& key, const DisplayStyle::HSVr& darkening ) const;
|
||||||
inline const string& _getPattern ( const Name& key ) const;
|
inline const string& _getPattern ( const Name& key ) const;
|
||||||
inline float _getThreshold ( const Name& key ) const;
|
inline float _getThreshold ( const Name& key ) const;
|
||||||
inline int _getDarkening () const;
|
inline const DisplayStyle::HSVr& _getDarkening () const;
|
||||||
inline const ColorScale& _getColorScale ( ColorScale::ScaleType ) const;
|
inline const ColorScale& _getColorScale ( ColorScale::ScaleType ) const;
|
||||||
inline void _enable ();
|
inline void _enable ();
|
||||||
inline const TextTranslator& _getHtmlTranslator () const;
|
inline const TextTranslator& _getHtmlTranslator () const;
|
||||||
|
@ -122,13 +123,13 @@ namespace Hurricane {
|
||||||
inline const Name& Graphics::_getGroup ( const Name& name ) const
|
inline const Name& Graphics::_getGroup ( const Name& name ) const
|
||||||
{ return _active->getGroup(name); }
|
{ return _active->getGroup(name); }
|
||||||
|
|
||||||
inline QColor Graphics::_getColor ( const Name& name, int darkening ) const
|
inline QColor Graphics::_getColor ( const Name& name, const DisplayStyle::HSVr& darkening ) const
|
||||||
{ return _active->getColor(name,darkening); }
|
{ return _active->getColor(name,darkening); }
|
||||||
|
|
||||||
inline QPen Graphics::_getPen ( const Name& name, int darkening ) const
|
inline QPen Graphics::_getPen ( const Name& name, const DisplayStyle::HSVr& darkening ) const
|
||||||
{ return _active->getPen(name,darkening); }
|
{ return _active->getPen(name,darkening); }
|
||||||
|
|
||||||
inline QBrush Graphics::_getBrush ( const Name& name, int darkening ) const
|
inline QBrush Graphics::_getBrush ( const Name& name, const DisplayStyle::HSVr& darkening ) const
|
||||||
{ return _active->getBrush(name,darkening); }
|
{ return _active->getBrush(name,darkening); }
|
||||||
|
|
||||||
inline const string& Graphics::_getPattern ( const Name& name ) const
|
inline const string& Graphics::_getPattern ( const Name& name ) const
|
||||||
|
@ -137,7 +138,7 @@ namespace Hurricane {
|
||||||
inline float Graphics::_getThreshold ( const Name& name ) const
|
inline float Graphics::_getThreshold ( const Name& name ) const
|
||||||
{ return _active->getThreshold(name); }
|
{ return _active->getThreshold(name); }
|
||||||
|
|
||||||
inline int Graphics::_getDarkening () const
|
inline const DisplayStyle::HSVr& Graphics::_getDarkening () const
|
||||||
{ return _active->getDarkening(); }
|
{ return _active->getDarkening(); }
|
||||||
|
|
||||||
inline const ColorScale& Graphics::_getColorScale ( ColorScale::ScaleType id ) const
|
inline const ColorScale& Graphics::_getColorScale ( ColorScale::ScaleType id ) const
|
||||||
|
|
Loading…
Reference in New Issue