diff --git a/hurricane/src/hurricane/DataBase.cpp b/hurricane/src/hurricane/DataBase.cpp index 64e9c818..abbbadde 100644 --- a/hurricane/src/hurricane/DataBase.cpp +++ b/hurricane/src/hurricane/DataBase.cpp @@ -53,8 +53,6 @@ void DataBase::_postCreate() void DataBase::_preDestroy() // ************************ { - cerr << "DataBase::_preDestroy()" << endl; - UpdateSession::open(); Inherit::_preDestroy(); diff --git a/hurricane/src/hurricane/NetExternalComponents.cpp b/hurricane/src/hurricane/NetExternalComponents.cpp index 5657019f..9d57d378 100644 --- a/hurricane/src/hurricane/NetExternalComponents.cpp +++ b/hurricane/src/hurricane/NetExternalComponents.cpp @@ -1,23 +1,41 @@ -// **************************************************************************************************** -// -// This file is part of the Tsunami Project. -// Copyright (c) 2001-2004 Laboratoire LIP6 - Departement ASIM -// Universite Pierre et Marie Curie. -// -// File: NetExternalComponents.cpp -// Author: C. Alexandre -// **************************************************************************************************** + +// -*- C++ -*- +// +// This file is part of the Coriolis Software. +// Copyright (c) UPMC/LIP6 2008-2009, All Rights Reserved +// +// =================================================================== +// +// $Id$ +// +// x-----------------------------------------------------------------x +// | | +// | C O R I O L I S | +// | Alliance / Hurricane Interface | +// | | +// | Author : Christophe Alexandre | +// | E-mail : Christophe.Alexandre@asim.lip6.fr | +// | =============================================================== | +// | C++ Module : "./NetExternalComponents.cpp" | +// | *************************************************************** | +// | U p d a t e s | +// | | +// x-----------------------------------------------------------------x + #include "hurricane/Error.h" #include "hurricane/Net.h" - #include "hurricane/NetExternalComponents.h" + namespace Hurricane { + const Name NetExternalComponents::_name = "ExternalComponentsRelation"; - StandardRelation* NetExternalComponents::getRelation(const Net* net) { + + StandardRelation* NetExternalComponents::getRelation ( const Net* net ) + { Property* property = net->getProperty(_name); if (!property) { return NULL; @@ -27,28 +45,42 @@ namespace Hurricane { throw Error("Bad Property type: Must be a Standard Relation"); return relation; } -} + } -Components NetExternalComponents::get(const Net* net) { + + Components NetExternalComponents::get ( const Net* net ) + { if (!net->isExternal()) - throw Error("Impossible to retrieve external components on non external net " - + net->getName()._getString()); + throw Error("Impossible to retrieve external components on non external net " + + net->getName()._getString()); StandardRelation* externalComponentsRelation = getRelation(net); if (!externalComponentsRelation) - return Components(); + return Components(); return externalComponentsRelation->getSlaveOwners().getSubSet(); -} + } -void NetExternalComponents::setExternal(Component* component) { + + void NetExternalComponents::setExternal ( Component* component ) + { Net* net = component->getNet(); if (!net->isExternal()) - throw Error("Impossible to set as external a component member of non external net " - + net->getName()._getString()); + throw Error("Impossible to set as external a component member of non external net " + + net->getName()._getString()); StandardRelation* externalComponentsRelation = getRelation(net); if (!externalComponentsRelation) - externalComponentsRelation = StandardRelation::create(net, _name); + externalComponentsRelation = StandardRelation::create(net, _name); component->put(externalComponentsRelation); -} + } + + + bool NetExternalComponents::isExternal ( Component* component ) + { + Net* net = component->getNet(); + if (!net->isExternal()) return false; + + return getRelation(net) != NULL; + } + } // End of Hurricane namespace. diff --git a/hurricane/src/hurricane/hurricane/NetExternalComponents.h b/hurricane/src/hurricane/hurricane/NetExternalComponents.h index 63e5197b..af5f7664 100644 --- a/hurricane/src/hurricane/hurricane/NetExternalComponents.h +++ b/hurricane/src/hurricane/hurricane/NetExternalComponents.h @@ -1,31 +1,51 @@ -// **************************************************************************************************** -// -// This file is part of the Tsunami Project. -// Copyright (c) 2001-2004 Laboratoire LIP6 - Departement ASIM -// Universite Pierre et Marie Curie. -// -// File: NetExternalComponents.h -// Authors: C. Alexandre -// **************************************************************************************************** -#ifndef HURRICANE_NET_EXTERNAL_COMPONENTS -#define HURRICANE_NET_EXTERNAL_COMPONENTS +// -*- C++ -*- +// +// This file is part of the Coriolis Software. +// Copyright (c) UPMC/LIP6 2008-2009, All Rights Reserved +// +// =================================================================== +// +// $Id$ +// +// x-----------------------------------------------------------------x +// | | +// | C O R I O L I S | +// | Alliance / Hurricane Interface | +// | | +// | Author : Christophe Alexandre | +// | E-mail : Christophe.Alexandre@asim.lip6.fr | +// | =============================================================== | +// | C++ Header : "./NetExternalComponents.h" | +// | *************************************************************** | +// | U p d a t e s | +// | | +// x-----------------------------------------------------------------x + + +#ifndef __HURRICANE_NET_EXTERNAL_COMPONENTS__ +#define __HURRICANE_NET_EXTERNAL_COMPONENTS__ + +#include "hurricane/Component.h" +#include "hurricane/Relation.h" -#include "hurricane/Component.h" -#include "hurricane/Relation.h" namespace Hurricane { + class NetExternalComponents { public: static Components get ( const Net* ); static void setExternal ( Component* ); + static bool isExternal ( Component* ); protected: static StandardRelation* getRelation ( const Net* ); private: static const Name _name; }; + } // End of Hurricane namespace. -#endif // HURRICANE_NET_EXTERNAL_COMPONENTS + +#endif // __HURRICANE_NET_EXTERNAL_COMPONENTS__ diff --git a/hurricane/src/hviewer/CellWidget.cpp b/hurricane/src/hviewer/CellWidget.cpp index 54f60a76..7190f42c 100644 --- a/hurricane/src/hviewer/CellWidget.cpp +++ b/hurricane/src/hviewer/CellWidget.cpp @@ -533,8 +533,8 @@ namespace Hurricane { yimage = 100; } - cerr << "sy: " << sy << " offsetVA.ry(): " << _cellWidget->getOffsetVA().ry() << endl; - cerr << "w: " << w << " h:" << h << endl; + //cerr << "sy: " << sy << " offsetVA.ry(): " << _cellWidget->getOffsetVA().ry() << endl; + //cerr << "w: " << w << " h:" << h << endl; if ( _cellWidget->showSelection() ) _painters[PlaneId::Printer].drawPixmap @@ -1000,8 +1000,6 @@ namespace Hurricane { CellWidget::~CellWidget () { - cerr << "CellWidget::~CellWidget()" << endl; - unselectAll (); for ( size_t i=0 ; i<_commands.size() ; i++ )