* ./hurricane/src/hviewer :
- New feature : support for highlighted selection with decent refresh time. To active selection mode, use the 's' key or the "View" menu. - New feature : HNetlist to browse a Cell's Netlist. HNetlist can be used with any NetInformations derived class, allowing the user to enrich the HNetlist displayed fields. For an example, have a look at SimpleNetlistWidget. - Added proper licence header to all file.
This commit is contained in:
parent
3bb9ddf157
commit
9637ebc58b
|
@ -11,19 +11,27 @@
|
|||
hurricane/viewer/HPalette.h
|
||||
hurricane/viewer/DynamicLabel.h
|
||||
hurricane/viewer/HMousePosition.h
|
||||
hurricane/viewer/Selector.h
|
||||
hurricane/viewer/CellWidget.h
|
||||
hurricane/viewer/CellWidgets.h
|
||||
hurricane/viewer/CellViewer.h
|
||||
hurricane/viewer/RecordModel.h
|
||||
hurricane/viewer/HInspectorWidget.h
|
||||
hurricane/viewer/HNetlistModel.h
|
||||
hurricane/viewer/HNetlist.h
|
||||
)
|
||||
set ( exports hurricane/viewer/ScreenUtilities.h
|
||||
hurricane/viewer/HPaletteEntry.h
|
||||
hurricane/viewer/HPalette.h
|
||||
hurricane/viewer/DisplayStyle.h
|
||||
hurricane/viewer/Graphics.h
|
||||
hurricane/viewer/Selector.h
|
||||
hurricane/viewer/CellWidget.h
|
||||
hurricane/viewer/CellWidgets.h
|
||||
hurricane/viewer/CellViewer.h
|
||||
hurricane/viewer/HInspectorWidget.h
|
||||
hurricane/viewer/CellWidget.h
|
||||
hurricane/viewer/NetInformations.h
|
||||
hurricane/viewer/HNetlist.h
|
||||
)
|
||||
set ( cpps ScreenUtilities.cpp
|
||||
DisplayStyle.cpp
|
||||
|
@ -35,10 +43,14 @@
|
|||
HPalette.cpp
|
||||
DynamicLabel.cpp
|
||||
HMousePosition.cpp
|
||||
Selector.cpp
|
||||
CellWidget.cpp
|
||||
CellViewer.cpp
|
||||
RecordModel.cpp
|
||||
HInspectorWidget.cpp
|
||||
NetInformations.cpp
|
||||
HNetlistModel.cpp
|
||||
HNetlist.cpp
|
||||
)
|
||||
|
||||
qt4_wrap_cpp ( MOC_SRCS ${mocincludes} )
|
||||
|
|
|
@ -1,6 +1,53 @@
|
|||
|
||||
|
||||
// -*- C++ -*-
|
||||
//
|
||||
// This file is part of the Coriolis Project.
|
||||
// Copyright (C) Laboratoire LIP6 - Departement ASIM
|
||||
// Universite Pierre et Marie Curie
|
||||
//
|
||||
// Main contributors :
|
||||
// Christophe Alexandre <Christophe.Alexandre@lip6.fr>
|
||||
// Sophie Belloeil <Sophie.Belloeil@lip6.fr>
|
||||
// Hugo Clément <Hugo.Clement@lip6.fr>
|
||||
// Jean-Paul Chaput <Jean-Paul.Chaput@lip6.fr>
|
||||
// Damien Dupuis <Damien.Dupuis@lip6.fr>
|
||||
// Christian Masson <Christian.Masson@lip6.fr>
|
||||
// Marek Sroka <Marek.Sroka@lip6.fr>
|
||||
//
|
||||
// The Coriolis Project is free software; you can redistribute it
|
||||
// and/or modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// The Coriolis Project is distributed in the hope that it will be
|
||||
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with the Coriolis Project; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
// USA
|
||||
//
|
||||
// License-Tag
|
||||
// Authors-Tag
|
||||
// ===================================================================
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
// x-----------------------------------------------------------------x
|
||||
// | |
|
||||
// | H U R R I C A N E |
|
||||
// | V L S I B a c k e n d D a t a - B a s e |
|
||||
// | |
|
||||
// | Author : Jean-Paul CHAPUT |
|
||||
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
||||
// | =============================================================== |
|
||||
// | C++ Module : "./CellViewer.cpp" |
|
||||
// | *************************************************************** |
|
||||
// | U p d a t e s |
|
||||
// | |
|
||||
// x-----------------------------------------------------------------x
|
||||
|
||||
|
||||
#include <QAction>
|
||||
|
@ -17,6 +64,7 @@
|
|||
#include "hurricane/viewer/CellWidget.h"
|
||||
#include "hurricane/viewer/CellViewer.h"
|
||||
#include "hurricane/viewer/HInspectorWidget.h"
|
||||
#include "hurricane/viewer/HNetlist.h"
|
||||
#include "hurricane/viewer/HMousePosition.h"
|
||||
|
||||
|
||||
|
@ -32,8 +80,10 @@ namespace Hurricane {
|
|||
, _exitAction(NULL)
|
||||
, _refreshAction(NULL)
|
||||
, _fitToContentsAction(NULL)
|
||||
, _showSelectionAction(NULL)
|
||||
, _runInspectorOnDataBase(NULL)
|
||||
, _runInspectorOnCell(NULL)
|
||||
, _browseNetlist(NULL)
|
||||
, _fileMenu(NULL)
|
||||
, _viewMenu(NULL)
|
||||
, _toolsMenu(NULL)
|
||||
|
@ -83,11 +133,19 @@ namespace Hurricane {
|
|||
_fitToContentsAction->setStatusTip ( tr("Adjust zoom to fit the whole cell's contents") );
|
||||
_fitToContentsAction->setShortcut ( Qt::Key_F );
|
||||
|
||||
_showSelectionAction = new QAction ( tr("&Show Selection"), this );
|
||||
_showSelectionAction->setStatusTip ( tr("Highlight the selected items (darken others)") );
|
||||
_showSelectionAction->setShortcut ( Qt::Key_S );
|
||||
_showSelectionAction->setCheckable ( true );
|
||||
|
||||
_runInspectorOnDataBase= new QAction ( tr("Inspect &DataBase"), this );
|
||||
_runInspectorOnDataBase->setStatusTip ( tr("Run Inspector on Hurricane DataBase") );
|
||||
|
||||
_runInspectorOnCell= new QAction ( tr("Inspect &Cell"), this );
|
||||
_runInspectorOnCell->setStatusTip ( tr("Run Inspector on the current Cell") );
|
||||
|
||||
_browseNetlist= new QAction ( tr("Browse &Netlist"), this );
|
||||
_browseNetlist->setStatusTip ( tr("Browse netlist from the current Cell") );
|
||||
}
|
||||
|
||||
|
||||
|
@ -108,10 +166,12 @@ namespace Hurricane {
|
|||
_viewMenu = menuBar()->addMenu ( tr("View") );
|
||||
_viewMenu->addAction ( _refreshAction );
|
||||
_viewMenu->addAction ( _fitToContentsAction );
|
||||
_viewMenu->addAction ( _showSelectionAction );
|
||||
|
||||
_toolsMenu = menuBar()->addMenu ( tr("Tool") );
|
||||
_toolsMenu->addAction ( _runInspectorOnDataBase );
|
||||
_toolsMenu->addAction ( _runInspectorOnCell );
|
||||
_toolsMenu->addAction ( _browseNetlist );
|
||||
}
|
||||
|
||||
|
||||
|
@ -154,8 +214,10 @@ namespace Hurricane {
|
|||
|
||||
connect ( _refreshAction , SIGNAL(triggered()) , _cellWidget, SLOT(redraw ()));
|
||||
connect ( _fitToContentsAction , SIGNAL(triggered()) , _cellWidget, SLOT(fitToContents ()));
|
||||
connect ( _showSelectionAction , SIGNAL(toggled(bool)), _cellWidget, SLOT(setShowSelection (bool)));
|
||||
connect ( _runInspectorOnDataBase, SIGNAL(triggered()) , this , SLOT(runInspectorOnDataBase()));
|
||||
connect ( _runInspectorOnCell , SIGNAL(triggered()) , this , SLOT(runInspectorOnCell ()));
|
||||
connect ( _browseNetlist , SIGNAL(triggered()) , this , SLOT(browseNetlist ()));
|
||||
connect ( _cellWidget , SIGNAL(mousePositionChanged(const Point&))
|
||||
, _mousePosition , SLOT(setPosition(const Point&)) );
|
||||
|
||||
|
@ -197,4 +259,24 @@ namespace Hurricane {
|
|||
}
|
||||
|
||||
|
||||
void CellViewer::browseNetlist ()
|
||||
{
|
||||
HNetlist* netlistBrowser = new HNetlist ();
|
||||
netlistBrowser->setCellWidget<SimpleNetInformations> ( _cellWidget );
|
||||
netlistBrowser->show ();
|
||||
}
|
||||
|
||||
|
||||
void CellViewer::select ( Occurrence& occurrence )
|
||||
{ if ( _cellWidget ) _cellWidget->select ( occurrence ); }
|
||||
|
||||
|
||||
void CellViewer::unselect ( Occurrence& occurrence )
|
||||
{ if ( _cellWidget ) _cellWidget->unselect ( occurrence ); }
|
||||
|
||||
|
||||
void CellViewer::unselectAll ()
|
||||
{ if ( _cellWidget ) _cellWidget->unselectAll(); }
|
||||
|
||||
|
||||
} // End of Hurricane namespace.
|
||||
|
|
|
@ -1,5 +1,58 @@
|
|||
|
||||
// -*- C++ -*-
|
||||
//
|
||||
// This file is part of the Coriolis Project.
|
||||
// Copyright (C) Laboratoire LIP6 - Departement ASIM
|
||||
// Universite Pierre et Marie Curie
|
||||
//
|
||||
// Main contributors :
|
||||
// Christophe Alexandre <Christophe.Alexandre@lip6.fr>
|
||||
// Sophie Belloeil <Sophie.Belloeil@lip6.fr>
|
||||
// Hugo Clément <Hugo.Clement@lip6.fr>
|
||||
// Jean-Paul Chaput <Jean-Paul.Chaput@lip6.fr>
|
||||
// Damien Dupuis <Damien.Dupuis@lip6.fr>
|
||||
// Christian Masson <Christian.Masson@lip6.fr>
|
||||
// Marek Sroka <Marek.Sroka@lip6.fr>
|
||||
//
|
||||
// The Coriolis Project is free software; you can redistribute it
|
||||
// and/or modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// The Coriolis Project is distributed in the hope that it will be
|
||||
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with the Coriolis Project; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
// USA
|
||||
//
|
||||
// License-Tag
|
||||
// Authors-Tag
|
||||
// ===================================================================
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
// x-----------------------------------------------------------------x
|
||||
// | |
|
||||
// | H U R R I C A N E |
|
||||
// | V L S I B a c k e n d D a t a - B a s e |
|
||||
// | |
|
||||
// | Author : Jean-Paul CHAPUT |
|
||||
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
||||
// | =============================================================== |
|
||||
// | C++ Module : "./CellWidget.cpp" |
|
||||
// | *************************************************************** |
|
||||
// | U p d a t e s |
|
||||
// | |
|
||||
// x-----------------------------------------------------------------x
|
||||
|
||||
|
||||
#include <QAction>
|
||||
#include <QMenu>
|
||||
#include <QMenuBar>
|
||||
|
||||
|
||||
# include <QMouseEvent>
|
||||
|
@ -46,7 +99,7 @@ namespace Hurricane {
|
|||
void CellWidget::Spot::restore ()
|
||||
{
|
||||
if ( _restore ) {
|
||||
_cellWidget->copyToScreen ( _spotPoint.x()-5, _spotPoint.y()-5, 10, 10 );
|
||||
_cellWidget->getDrawingPlanes().copyToScreen ( _spotPoint.x()-5, _spotPoint.y()-5, 10, 10 );
|
||||
_restore = false;
|
||||
}
|
||||
}
|
||||
|
@ -60,7 +113,7 @@ namespace Hurricane {
|
|||
|
||||
void CellWidget::Spot::moveTo ( const QPoint& screenPoint )
|
||||
{
|
||||
QPainter& screenPainter = _cellWidget->getScreenPainter();
|
||||
QPainter& screenPainter = _cellWidget->getDrawingPlanes().painter(2);
|
||||
|
||||
Point mousePoint = _cellWidget->screenToDbuPoint ( screenPoint );
|
||||
Point spotPoint = Point ( DbU::getOnSnapGrid(mousePoint.getX())
|
||||
|
@ -76,6 +129,106 @@ namespace Hurricane {
|
|||
}
|
||||
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// Class : "Hurricane::CellWidget::Drawingplanes".
|
||||
|
||||
|
||||
CellWidget::DrawingPlanes::DrawingPlanes ( const QSize& size, CellWidget* cw )
|
||||
: _cellWidget(cw)
|
||||
, _workingPlane(0)
|
||||
{
|
||||
for ( size_t i=0 ; i<2 ; i++ )
|
||||
_planes[i] = new QPixmap ( size );
|
||||
}
|
||||
|
||||
|
||||
CellWidget::DrawingPlanes::~DrawingPlanes ()
|
||||
{
|
||||
for ( size_t i=0 ; i<2 ; i++ ) {
|
||||
if ( _painters[i].isActive() ) _painters[i].end();
|
||||
delete _planes[i];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CellWidget::DrawingPlanes::resize ( const QSize& size )
|
||||
{
|
||||
for ( size_t i=0 ; i<2 ; i++ ) {
|
||||
bool activePainter = _painters[i].isActive();
|
||||
|
||||
if ( activePainter ) _painters[i].end();
|
||||
delete _planes[i];
|
||||
|
||||
_planes[i] = new QPixmap ( size );
|
||||
if ( activePainter ) _painters[i].begin ( _planes[i] );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CellWidget::DrawingPlanes::shiftLeft ( int dx )
|
||||
{
|
||||
paintersBegin ();
|
||||
_painters[0].drawPixmap ( dx, 0, *_planes[0], 0, 0, width()-dx, height() );
|
||||
_painters[1].drawPixmap ( dx, 0, *_planes[1], 0, 0, width()-dx, height() );
|
||||
paintersEnd ();
|
||||
}
|
||||
|
||||
|
||||
void CellWidget::DrawingPlanes::shiftRight ( int dx )
|
||||
{
|
||||
paintersBegin ();
|
||||
_painters[0].drawPixmap ( 0, 0, *_planes[0], dx, 0, width()-dx, height() );
|
||||
_painters[1].drawPixmap ( 0, 0, *_planes[1], dx, 0, width()-dx, height() );
|
||||
paintersEnd ();
|
||||
}
|
||||
|
||||
|
||||
void CellWidget::DrawingPlanes::shiftUp ( int dy )
|
||||
{
|
||||
paintersBegin ();
|
||||
_painters[0].drawPixmap ( 0, dy, *_planes[0], 0, 0, width(), height()-dy );
|
||||
_painters[1].drawPixmap ( 0, dy, *_planes[1], 0, 0, width(), height()-dy );
|
||||
paintersEnd ();
|
||||
}
|
||||
|
||||
|
||||
void CellWidget::DrawingPlanes::shiftDown ( int dy )
|
||||
{
|
||||
paintersBegin ();
|
||||
_painters[0].drawPixmap ( 0, 0, *_planes[0], 0, dy, width(), height()-dy );
|
||||
_painters[1].drawPixmap ( 0, 0, *_planes[1], 0, dy, width(), height()-dy );
|
||||
paintersEnd ();
|
||||
}
|
||||
|
||||
|
||||
void CellWidget::DrawingPlanes::copyToSelect ( int sx, int sy, int w, int h )
|
||||
{
|
||||
painterBegin ( 1 );
|
||||
_painters[1].setPen ( Qt::NoPen );
|
||||
_painters[1].setBackground ( Graphics::getBrush("background") );
|
||||
_painters[1].eraseRect ( sx, sy, w, h );
|
||||
//_painters[1].setOpacity ( 0.5 );
|
||||
_painters[1].drawPixmap ( sx, sy, *_planes[0], sx, sy, w, h );
|
||||
painterEnd ( 1 );
|
||||
}
|
||||
|
||||
|
||||
void CellWidget::DrawingPlanes::copyToScreen ( int sx, int sy, int w, int h )
|
||||
{
|
||||
if ( _cellWidget->showSelection() )
|
||||
_painters[2].drawPixmap ( sx, sy
|
||||
, *_planes[1]
|
||||
, _cellWidget->getOffsetVA().rx()+sx, _cellWidget->getOffsetVA().ry()+sy
|
||||
, w, h
|
||||
);
|
||||
else
|
||||
_painters[2].drawPixmap ( sx, sy
|
||||
, *_planes[0]
|
||||
, _cellWidget->getOffsetVA().rx()+sx, _cellWidget->getOffsetVA().ry()+sy
|
||||
, w, h
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// Class : "Hurricane::CellWidget".
|
||||
|
@ -91,14 +244,14 @@ namespace Hurricane {
|
|||
, _visibleArea(_stripWidth,_stripWidth,4*_stripWidth,4*_stripWidth)
|
||||
, _scale(1.0)
|
||||
, _offsetVA(_stripWidth,_stripWidth)
|
||||
, _drawingBuffer(6*_stripWidth,6*_stripWidth)
|
||||
, _drawingPainter()
|
||||
, _screenPainter()
|
||||
, _drawingPlanes(QSize(6*_stripWidth,6*_stripWidth),this)
|
||||
, _lastMousePosition(0,0)
|
||||
, _spot(this)
|
||||
, _cell(NULL)
|
||||
, _mouseGo(false)
|
||||
, _showBoundaries(true)
|
||||
, _showSelection(false)
|
||||
, _selectionHasChanged(false)
|
||||
, _redrawRectCount(0)
|
||||
{
|
||||
//setBackgroundRole ( QPalette::Dark );
|
||||
|
@ -111,19 +264,6 @@ namespace Hurricane {
|
|||
setFocusPolicy ( Qt::StrongFocus );
|
||||
setMouseTracking ( true );
|
||||
|
||||
// _statusBar = new QStatusBar ( this );
|
||||
|
||||
// _xPosition = new DynamicLabel ();
|
||||
// _xPosition->setStaticText ( "X:" );
|
||||
// _xPosition->setDynamicText ( "0l" );
|
||||
|
||||
// _yPosition = new DynamicLabel ();
|
||||
// _yPosition->setStaticText ( "Y:" );
|
||||
// _yPosition->setDynamicText ( "0l" );
|
||||
|
||||
// _statusBar->addPermanentWidget ( _xPosition );
|
||||
// _statusBar->addPermanentWidget ( _yPosition );
|
||||
|
||||
//_mapView = new MapView ( this );
|
||||
DataBase* database = DataBase::getDB();
|
||||
if ( database )
|
||||
|
@ -181,53 +321,61 @@ namespace Hurricane {
|
|||
}
|
||||
|
||||
|
||||
void CellWidget::setShowSelection ( bool state )
|
||||
{
|
||||
if ( state != _showSelection ) {
|
||||
_showSelection = state;
|
||||
redraw ();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CellWidget::redraw ( QRect redrawArea )
|
||||
{
|
||||
cerr << "CellWidget::redraw()" << endl;
|
||||
|
||||
_redrawRectCount = 0;
|
||||
|
||||
pushCursor ( Qt::BusyCursor );
|
||||
|
||||
_spot.setRestore ( false );
|
||||
_drawingPainter.begin ( &_drawingBuffer );
|
||||
if ( !_selectionHasChanged ) {
|
||||
_spot.setRestore ( false );
|
||||
_drawingPlanes.select ( 0 );
|
||||
_drawingPlanes.painterBegin ();
|
||||
|
||||
_drawingPainter.setPen ( Qt::NoPen );
|
||||
_drawingPainter.setBackground ( Graphics::getBrush("background") );
|
||||
_drawingPainter.setClipRect ( redrawArea );
|
||||
_drawingPainter.eraseRect ( redrawArea );
|
||||
_drawingPlanes.painter().setPen ( Qt::NoPen );
|
||||
_drawingPlanes.painter().setBackground ( Graphics::getBrush("background") );
|
||||
_drawingPlanes.painter().setClipRect ( redrawArea );
|
||||
_drawingPlanes.painter().eraseRect ( redrawArea );
|
||||
|
||||
if ( _cell ) {
|
||||
Box redrawBox = displayToDbuBox ( redrawArea );
|
||||
int darkening = (_showSelection) ? 200 : 100;
|
||||
|
||||
for_each_basic_layer ( basicLayer, _technology->getBasicLayers() ) {
|
||||
_drawingPainter.setPen ( Graphics::getPen (basicLayer->getName()) );
|
||||
_drawingPainter.setBrush ( Graphics::getBrush(basicLayer->getName()) );
|
||||
if ( _cell ) {
|
||||
Box redrawBox = displayToDbuBox ( redrawArea );
|
||||
|
||||
if ( isDrawable(basicLayer->getName()) )
|
||||
drawCell ( _cell, basicLayer, redrawBox, Transformation() );
|
||||
end_for;
|
||||
}
|
||||
if ( isDrawable("boundaries") ) {
|
||||
_drawingPainter.setPen ( Graphics::getPen ("boundaries") );
|
||||
_drawingPainter.setBrush ( Graphics::getBrush("boundaries") );
|
||||
for_each_basic_layer ( basicLayer, _technology->getBasicLayers() ) {
|
||||
_drawingPlanes.painter().setPen ( Graphics::getPen (basicLayer->getName(),darkening) );
|
||||
_drawingPlanes.painter().setBrush ( Graphics::getBrush(basicLayer->getName(),darkening) );
|
||||
|
||||
drawBoundaries ( _cell, redrawBox, Transformation() );
|
||||
if ( isDrawable(basicLayer->getName()) )
|
||||
drawCell ( _cell, basicLayer, redrawBox, Transformation() );
|
||||
end_for;
|
||||
}
|
||||
if ( isDrawable("boundaries") ) {
|
||||
_drawingPlanes.painter().setPen ( Graphics::getPen ("boundaries") );
|
||||
_drawingPlanes.painter().setBrush ( Graphics::getBrush("boundaries") );
|
||||
|
||||
drawBoundaries ( _cell, redrawBox, Transformation() );
|
||||
}
|
||||
}
|
||||
|
||||
// vector<HPaletteEntry*>& paletteEntries = _palette->getEntries ();
|
||||
// for ( size_t i=0 ; i<paletteEntries.size() ; i++ ) {
|
||||
// _drawingPainter.setPen ( Graphics::getPen (paletteEntries[i]->getName()) );
|
||||
// _drawingPainter.setBrush ( Graphics::getBrush(paletteEntries[i]->getName()) );
|
||||
|
||||
// if ( paletteEntries[i]->isBasicLayer() && isDrawable(paletteEntries[i]) ) {
|
||||
// drawCell ( _cell, paletteEntries[i]->getBasicLayer(), redrawBox, Transformation() );
|
||||
// } else if ( (paletteEntries[i]->getName() == DisplayStyle::Boundaries)
|
||||
// && paletteEntries[i]->isChecked() ) {
|
||||
// drawBoundaries ( _cell, redrawBox, Transformation() );
|
||||
// }
|
||||
// }
|
||||
_drawingPlanes.painterEnd ();
|
||||
}
|
||||
|
||||
_drawingPainter.end ();
|
||||
if ( _showSelection )
|
||||
redrawSelection ( redrawArea );
|
||||
|
||||
cerr << "CellWidget::redraw() - finished." << endl;
|
||||
|
||||
update ();
|
||||
popCursor ();
|
||||
|
@ -236,6 +384,53 @@ namespace Hurricane {
|
|||
}
|
||||
|
||||
|
||||
void CellWidget::redrawSelection ( QRect redrawArea )
|
||||
{
|
||||
cerr << "CellWidget::redrawSelection()" << endl;
|
||||
|
||||
_drawingPlanes.copyToSelect ( redrawArea.x()
|
||||
, redrawArea.y()
|
||||
, redrawArea.width()
|
||||
, redrawArea.height()
|
||||
);
|
||||
|
||||
_drawingPlanes.select ( 1 );
|
||||
_drawingPlanes.painterBegin ();
|
||||
_drawingPlanes.painter().setPen ( Qt::NoPen );
|
||||
_drawingPlanes.painter().setBackground ( Graphics::getBrush("background") );
|
||||
_drawingPlanes.painter().setClipRect ( redrawArea );
|
||||
|
||||
if ( _cell ) {
|
||||
Box redrawBox = displayToDbuBox ( redrawArea );
|
||||
|
||||
for_each_basic_layer ( basicLayer, _technology->getBasicLayers() ) {
|
||||
if ( !isDrawable(basicLayer->getName()) ) continue;
|
||||
|
||||
_drawingPlanes.painter().setPen ( Graphics::getPen (basicLayer->getName()) );
|
||||
_drawingPlanes.painter().setBrush ( Graphics::getBrush(basicLayer->getName()) );
|
||||
|
||||
set<Selector*>::iterator iselector = _selectors.begin ();
|
||||
for ( ; iselector != _selectors.end() ; iselector++ ) {
|
||||
Occurrence occurrence = (*iselector)->getOccurrence();
|
||||
Transformation transformation = occurrence.getPath().getTransformation();
|
||||
|
||||
Instance* instance = dynamic_cast<Instance*>(occurrence.getEntity());
|
||||
if ( instance ) {
|
||||
drawInstance ( instance, basicLayer, redrawBox, transformation );
|
||||
continue;
|
||||
}
|
||||
|
||||
drawGo ( dynamic_cast<Go*>(occurrence.getEntity()), basicLayer, redrawBox, transformation );
|
||||
}
|
||||
end_for;
|
||||
}
|
||||
}
|
||||
|
||||
_drawingPlanes.painterEnd ();
|
||||
_selectionHasChanged = false;
|
||||
}
|
||||
|
||||
|
||||
void CellWidget::drawBoundaries ( const Cell* cell
|
||||
, const Box& redrawArea
|
||||
, const Transformation& transformation
|
||||
|
@ -387,19 +582,19 @@ namespace Hurricane {
|
|||
void CellWidget::drawBox ( const Box& box )
|
||||
{
|
||||
_redrawRectCount++;
|
||||
_drawingPainter.drawRect ( dbuToDisplayRect(box) );
|
||||
_drawingPlanes.painter().drawRect ( dbuToDisplayRect(box) );
|
||||
}
|
||||
|
||||
|
||||
void CellWidget::drawLine ( const Point& p1, const Point& p2 )
|
||||
{
|
||||
_drawingPainter.drawLine ( dbuToDisplayPoint(p1), dbuToDisplayPoint(p2) );
|
||||
_drawingPlanes.painter().drawLine ( dbuToDisplayPoint(p1), dbuToDisplayPoint(p2) );
|
||||
}
|
||||
|
||||
|
||||
void CellWidget::drawGrid ()
|
||||
{
|
||||
_screenPainter.setPen ( Graphics::getPen("grid") );
|
||||
_drawingPlanes.painter(2).setPen ( Graphics::getPen("grid") );
|
||||
|
||||
DbU::Unit gridStep = DbU::getSnapGridStep();
|
||||
DbU::Unit superGridStep = gridStep*5;
|
||||
|
@ -417,10 +612,10 @@ namespace Hurricane {
|
|||
) {
|
||||
center = dbuToScreenPoint(xGrid,yGrid);
|
||||
if ( (xGrid % superGridStep) || (yGrid % superGridStep) )
|
||||
_screenPainter.drawPoint ( center );
|
||||
_drawingPlanes.painter(2).drawPoint ( center );
|
||||
else {
|
||||
_screenPainter.drawLine ( center.x()-3, center.y() , center.x()+3, center.y() );
|
||||
_screenPainter.drawLine ( center.x() , center.y()-3, center.x() , center.y()+3 );
|
||||
_drawingPlanes.painter(2).drawLine ( center.x()-3, center.y() , center.x()+3, center.y() );
|
||||
_drawingPlanes.painter(2).drawLine ( center.x() , center.y()-3, center.x() , center.y()+3 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -494,9 +689,9 @@ namespace Hurricane {
|
|||
_offsetVA.ry() = _stripWidth;
|
||||
|
||||
DbU::Unit xmin = (DbU::Unit)( _visibleArea.getXMin() - ((float)_offsetVA.x()/_scale) );
|
||||
DbU::Unit xmax = (DbU::Unit)( xmin + ((float)_drawingBuffer.width()/_scale) ) ;
|
||||
DbU::Unit xmax = (DbU::Unit)( xmin + ((float)_drawingPlanes.width()/_scale) ) ;
|
||||
DbU::Unit ymax = (DbU::Unit)( _visibleArea.getYMax() + ((float)_offsetVA.y()/_scale) );
|
||||
DbU::Unit ymin = (DbU::Unit)( ymax - ((float)_drawingBuffer.height()/_scale) ) ;
|
||||
DbU::Unit ymin = (DbU::Unit)( ymax - ((float)_drawingPlanes.height()/_scale) ) ;
|
||||
|
||||
_displayArea = Box ( xmin, ymin, xmax, ymax );
|
||||
|
||||
|
@ -527,7 +722,7 @@ namespace Hurricane {
|
|||
void CellWidget::reframe ( const Box& box )
|
||||
{
|
||||
//cerr << "CellWidget::reframe() - " << box << endl;
|
||||
//cerr << " widget size := " << _drawingBuffer.width() << "x" << _drawingBuffer.height() << endl;
|
||||
//cerr << " widget size := " << _drawingPlanes.width() << "x" << _drawingPlanes.height() << endl;
|
||||
|
||||
int width = this->width ();
|
||||
int height = this->height ();
|
||||
|
@ -567,20 +762,13 @@ namespace Hurricane {
|
|||
_displayArea.translate ( - (DbU::Unit)( leftShift / _scale ) , 0 );
|
||||
_offsetVA.rx() -= dx - leftShift;
|
||||
|
||||
if ( leftShift >= _drawingBuffer.width() ) {
|
||||
if ( leftShift >= _drawingPlanes.width() ) {
|
||||
redraw ();
|
||||
} else {
|
||||
//cerr << "Left Shift " << leftShift << " (offset: " << _offsetVA.rx() << ")" << endl;
|
||||
_drawingPainter.begin ( &_drawingBuffer );
|
||||
_drawingPainter.drawPixmap ( leftShift, 0
|
||||
, _drawingBuffer
|
||||
, 0, 0
|
||||
, _drawingBuffer.width()-leftShift, _drawingBuffer.height()
|
||||
);
|
||||
_drawingPainter.end ();
|
||||
_drawingPlanes.shiftLeft ( leftShift );
|
||||
|
||||
redraw ( QRect ( QPoint ( 0, 0 )
|
||||
, QSize ( leftShift, _drawingBuffer.height() )) );
|
||||
, QSize ( leftShift, _drawingPlanes.height() )) );
|
||||
}
|
||||
|
||||
assert ( _offsetVA.rx() >= 0 );
|
||||
|
@ -598,20 +786,13 @@ namespace Hurricane {
|
|||
|
||||
//cerr << " _displayArea: " << _displayArea << endl;
|
||||
|
||||
if ( rightShift >= _drawingBuffer.width() ) {
|
||||
if ( rightShift >= _drawingPlanes.width() ) {
|
||||
redraw ();
|
||||
} else {
|
||||
//cerr << " Right Shift " << rightShift << " (offset: " << _offsetVA.rx() << ")" << endl;
|
||||
_drawingPainter.begin ( &_drawingBuffer );
|
||||
_drawingPainter.drawPixmap ( 0, 0
|
||||
, _drawingBuffer
|
||||
, rightShift, 0
|
||||
, _drawingBuffer.width()-rightShift, _drawingBuffer.height()
|
||||
);
|
||||
_drawingPainter.end ();
|
||||
_drawingPlanes.shiftRight ( rightShift );
|
||||
|
||||
redraw ( QRect ( QPoint ( _drawingBuffer.width()-rightShift, 0 )
|
||||
, QSize ( rightShift, _drawingBuffer.height() )) );
|
||||
redraw ( QRect ( QPoint ( _drawingPlanes.width()-rightShift, 0 )
|
||||
, QSize ( rightShift, _drawingPlanes.height() )) );
|
||||
}
|
||||
|
||||
assert ( _offsetVA.rx() >= 0 );
|
||||
|
@ -627,20 +808,13 @@ namespace Hurricane {
|
|||
_displayArea.translate ( 0, (DbU::Unit)( upShift / _scale ) );
|
||||
_offsetVA.ry() -= dy - upShift;
|
||||
|
||||
if ( upShift >= _drawingBuffer.height() ) {
|
||||
if ( upShift >= _drawingPlanes.height() ) {
|
||||
redraw ();
|
||||
} else {
|
||||
//cerr << "Left Shift " << upShift << " (offset: " << _offsetVA.ry() << ")" << endl;
|
||||
_drawingPainter.begin ( &_drawingBuffer );
|
||||
_drawingPainter.drawPixmap ( 0, upShift
|
||||
, _drawingBuffer
|
||||
, 0, 0
|
||||
, _drawingBuffer.width(), _drawingBuffer.height()-upShift
|
||||
);
|
||||
_drawingPainter.end ();
|
||||
_drawingPlanes.shiftUp ( upShift );
|
||||
|
||||
redraw ( QRect ( QPoint ( 0, 0 )
|
||||
, QSize ( _drawingBuffer.width(), upShift )) );
|
||||
, QSize ( _drawingPlanes.width(), upShift )) );
|
||||
}
|
||||
|
||||
assert ( _offsetVA.ry() >= 0 );
|
||||
|
@ -656,20 +830,13 @@ namespace Hurricane {
|
|||
_displayArea.translate ( 0, - (DbU::Unit)( downShift / _scale ) );
|
||||
_offsetVA.ry() += dy - downShift;
|
||||
|
||||
if ( downShift >= _drawingBuffer.height() ) {
|
||||
if ( downShift >= _drawingPlanes.height() ) {
|
||||
redraw ();
|
||||
} else {
|
||||
//cerr << "Right Shift " << downShift << " (offset: " << _offsetVA.ry() << ")" << endl;
|
||||
_drawingPainter.begin ( &_drawingBuffer );
|
||||
_drawingPainter.drawPixmap ( 0, 0
|
||||
, _drawingBuffer
|
||||
, 0, downShift
|
||||
, _drawingBuffer.width(), _drawingBuffer.height()-downShift
|
||||
);
|
||||
_drawingPainter.end ();
|
||||
_drawingPlanes.shiftDown ( downShift );
|
||||
|
||||
redraw ( QRect ( QPoint ( 0, _drawingBuffer.height()-downShift )
|
||||
, QSize ( _drawingBuffer.width(), downShift )) );
|
||||
redraw ( QRect ( QPoint ( 0, _drawingPlanes.height()-downShift )
|
||||
, QSize ( _drawingPlanes.width(), downShift )) );
|
||||
}
|
||||
|
||||
assert ( _offsetVA.ry() >= 0 );
|
||||
|
@ -678,14 +845,13 @@ namespace Hurricane {
|
|||
|
||||
void CellWidget::paintEvent ( QPaintEvent* )
|
||||
{
|
||||
_screenPainter.begin ( this );
|
||||
|
||||
copyToScreen ();
|
||||
_drawingPlanes.painterBegin ( 2 );
|
||||
_drawingPlanes.copyToScreen ();
|
||||
|
||||
if ( isDrawable("grid") ) drawGrid ();
|
||||
if ( isDrawable("spot") ) _spot.moveTo ( _lastMousePosition );
|
||||
|
||||
_screenPainter.end ();
|
||||
_drawingPlanes.painterEnd ( 2 );
|
||||
}
|
||||
|
||||
|
||||
|
@ -697,11 +863,11 @@ namespace Hurricane {
|
|||
uaSize.rwidth () += 2*_stripWidth;
|
||||
uaSize.rheight() += 2*_stripWidth;
|
||||
|
||||
if ( uaSize.width () > _drawingBuffer.width () )
|
||||
uaDelta.rwidth () = uaSize.width () - _drawingBuffer.width ();
|
||||
if ( uaSize.width () > _drawingPlanes.width () )
|
||||
uaDelta.rwidth () = uaSize.width () - _drawingPlanes.width ();
|
||||
|
||||
if ( uaSize.height() > _drawingBuffer.height() )
|
||||
uaDelta.rheight() = uaSize.height() - _drawingBuffer.height();
|
||||
if ( uaSize.height() > _drawingPlanes.height() )
|
||||
uaDelta.rheight() = uaSize.height() - _drawingPlanes.height();
|
||||
|
||||
//cerr << "New UA widget size: " << uaSize.width() << "x" << uaSize.height() << endl;
|
||||
|
||||
|
@ -710,12 +876,12 @@ namespace Hurricane {
|
|||
_visibleArea.inflate ( 0, 0, (DbU::Unit)(uaDelta.width()/_scale), (DbU::Unit)(uaDelta.height()/_scale) );
|
||||
//cerr << "new " << _displayArea << endl;
|
||||
|
||||
//cerr << "Previous buffer size: " << _drawingBuffer.width () << "x"
|
||||
// << _drawingBuffer.height() << endl;
|
||||
//cerr << "Previous buffer size: " << _drawingPlanes.width () << "x"
|
||||
// << _drawingPlanes.height() << endl;
|
||||
|
||||
QSize bufferSize ( ( ( uaSize.width () / _stripWidth ) + 1 ) * _stripWidth
|
||||
, ( ( uaSize.height() / _stripWidth ) + 1 ) * _stripWidth );
|
||||
_drawingBuffer = QPixmap ( bufferSize );
|
||||
_drawingPlanes.resize ( bufferSize );
|
||||
|
||||
//cerr << "Effective buffer resize to: " << bufferSize.width() << "x"
|
||||
// << bufferSize.height() << endl;
|
||||
|
@ -733,6 +899,7 @@ namespace Hurricane {
|
|||
case Qt::Key_Right: goRight (); break;
|
||||
case Qt::Key_Z: setScale ( _scale*2.0 ); break;
|
||||
case Qt::Key_M: setScale ( _scale/2.0 ); break;
|
||||
default: QWidget::keyPressEvent ( event );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -835,4 +1002,72 @@ namespace Hurricane {
|
|||
}
|
||||
|
||||
|
||||
void CellWidget::select ( const Net* net, bool delayRedraw )
|
||||
{
|
||||
for_each_component ( component, net->getComponents() ) {
|
||||
Occurrence occurrence ( component );
|
||||
select ( occurrence );
|
||||
end_for;
|
||||
}
|
||||
if ( !delayRedraw ) redraw ();
|
||||
}
|
||||
|
||||
|
||||
void CellWidget::select ( Occurrence& occurrence )
|
||||
{
|
||||
if ( !occurrence.isValid() )
|
||||
throw Error ( "Can't select occurrence : invalid occurrence" );
|
||||
|
||||
if ( occurrence.getOwnerCell() != getCell() )
|
||||
throw Error ( "Can't select occurrence : incompatible occurrence" );
|
||||
|
||||
Property* property = occurrence.getProperty ( Selector::getPropertyName() );
|
||||
Selector* selector = NULL;
|
||||
if ( !property )
|
||||
selector = Selector::create ( occurrence );
|
||||
else {
|
||||
selector = dynamic_cast<Selector*>(property);
|
||||
if ( !selector )
|
||||
throw Error ( "Abnormal property named " + getString(Selector::getPropertyName()) );
|
||||
}
|
||||
|
||||
selector->attachTo(this);
|
||||
|
||||
_selectionHasChanged = true;
|
||||
}
|
||||
|
||||
|
||||
void CellWidget::unselect ( Occurrence& occurrence )
|
||||
{
|
||||
if ( !occurrence.isValid() )
|
||||
throw Error ( "Can't unselect occurrence : invalid occurrence" );
|
||||
|
||||
if ( occurrence.getOwnerCell() != getCell() )
|
||||
throw Error ( "Can't unselect occurrence : incompatible occurrence" );
|
||||
|
||||
Property* property = occurrence.getProperty ( Selector::getPropertyName() );
|
||||
if ( property ) {
|
||||
Selector* selector = dynamic_cast<Selector*>(property);
|
||||
if ( !selector )
|
||||
throw Error ( "Abnormal property named " + getString(Selector::getPropertyName()) );
|
||||
|
||||
selector->detachFrom(this);
|
||||
}
|
||||
|
||||
_selectionHasChanged = true;
|
||||
}
|
||||
|
||||
|
||||
void CellWidget::unselectAll ( bool delayRedraw )
|
||||
{
|
||||
set<Selector*>::iterator iselector = _selectors.begin ();
|
||||
for ( ; iselector != _selectors.end() ; iselector++ ) {
|
||||
(*iselector)->detachFrom ( this );
|
||||
}
|
||||
|
||||
_selectionHasChanged = true;
|
||||
if ( !delayRedraw ) redraw ();
|
||||
}
|
||||
|
||||
|
||||
} // End of Hurricane namespace.
|
||||
|
|
|
@ -1,5 +1,58 @@
|
|||
|
||||
// -*- C++ -*-
|
||||
//
|
||||
// This file is part of the Coriolis Project.
|
||||
// Copyright (C) Laboratoire LIP6 - Departement ASIM
|
||||
// Universite Pierre et Marie Curie
|
||||
//
|
||||
// Main contributors :
|
||||
// Christophe Alexandre <Christophe.Alexandre@lip6.fr>
|
||||
// Sophie Belloeil <Sophie.Belloeil@lip6.fr>
|
||||
// Hugo Clément <Hugo.Clement@lip6.fr>
|
||||
// Jean-Paul Chaput <Jean-Paul.Chaput@lip6.fr>
|
||||
// Damien Dupuis <Damien.Dupuis@lip6.fr>
|
||||
// Christian Masson <Christian.Masson@lip6.fr>
|
||||
// Marek Sroka <Marek.Sroka@lip6.fr>
|
||||
//
|
||||
// The Coriolis Project is free software; you can redistribute it
|
||||
// and/or modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// The Coriolis Project is distributed in the hope that it will be
|
||||
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with the Coriolis Project; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
// USA
|
||||
//
|
||||
// License-Tag
|
||||
// Authors-Tag
|
||||
// ===================================================================
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
// x-----------------------------------------------------------------x
|
||||
// | |
|
||||
// | H U R R I C A N E |
|
||||
// | V L S I B a c k e n d D a t a - B a s e |
|
||||
// | |
|
||||
// | Author : Jean-Paul CHAPUT |
|
||||
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
||||
// | =============================================================== |
|
||||
// | C++ Module : "./DisplayStyle.cpp" |
|
||||
// | *************************************************************** |
|
||||
// | U p d a t e s |
|
||||
// | |
|
||||
// x-----------------------------------------------------------------x
|
||||
|
||||
|
||||
#include <QAction>
|
||||
#include <QMenu>
|
||||
#include <QMenuBar>
|
||||
|
||||
|
||||
# include <cassert>
|
||||
|
@ -67,6 +120,28 @@ namespace Hurricane {
|
|||
}
|
||||
|
||||
|
||||
QColor DrawingStyle::getColor ( int darkening ) const
|
||||
{
|
||||
return _color.darker ( darkening );
|
||||
}
|
||||
|
||||
|
||||
QPen DrawingStyle::getPen ( int darkening ) const
|
||||
{
|
||||
QPen pen ( _pen );
|
||||
pen.setColor ( _color.darker(darkening) );
|
||||
return pen;
|
||||
}
|
||||
|
||||
|
||||
QBrush DrawingStyle::getBrush ( int darkening ) const
|
||||
{
|
||||
QBrush brush ( _brush );
|
||||
brush.setColor ( _color.darker(darkening) );
|
||||
return brush;
|
||||
}
|
||||
|
||||
|
||||
DrawingStyle::~DrawingStyle ()
|
||||
{
|
||||
assert ( _refcount == 0 );
|
||||
|
@ -207,21 +282,21 @@ namespace Hurricane {
|
|||
}
|
||||
|
||||
|
||||
const QColor& DisplayStyle::getColor ( const Name& key ) const
|
||||
QColor DisplayStyle::getColor ( const Name& key, int darkening ) const
|
||||
{
|
||||
return find(key)->getColor();
|
||||
return find(key)->getColor(darkening);
|
||||
}
|
||||
|
||||
|
||||
const QPen& DisplayStyle::getPen ( const Name& key ) const
|
||||
QPen DisplayStyle::getPen ( const Name& key, int darkening ) const
|
||||
{
|
||||
return find(key)->getPen();
|
||||
return find(key)->getPen(darkening);
|
||||
}
|
||||
|
||||
|
||||
const QBrush& DisplayStyle::getBrush ( const Name& key ) const
|
||||
QBrush DisplayStyle::getBrush ( const Name& key, int darkening ) const
|
||||
{
|
||||
return find(key)->getBrush();
|
||||
return find(key)->getBrush(darkening);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,58 @@
|
|||
|
||||
// -*- C++ -*-
|
||||
//
|
||||
// This file is part of the Coriolis Project.
|
||||
// Copyright (C) Laboratoire LIP6 - Departement ASIM
|
||||
// Universite Pierre et Marie Curie
|
||||
//
|
||||
// Main contributors :
|
||||
// Christophe Alexandre <Christophe.Alexandre@lip6.fr>
|
||||
// Sophie Belloeil <Sophie.Belloeil@lip6.fr>
|
||||
// Hugo Clément <Hugo.Clement@lip6.fr>
|
||||
// Jean-Paul Chaput <Jean-Paul.Chaput@lip6.fr>
|
||||
// Damien Dupuis <Damien.Dupuis@lip6.fr>
|
||||
// Christian Masson <Christian.Masson@lip6.fr>
|
||||
// Marek Sroka <Marek.Sroka@lip6.fr>
|
||||
//
|
||||
// The Coriolis Project is free software; you can redistribute it
|
||||
// and/or modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// The Coriolis Project is distributed in the hope that it will be
|
||||
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with the Coriolis Project; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
// USA
|
||||
//
|
||||
// License-Tag
|
||||
// Authors-Tag
|
||||
// ===================================================================
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
// x-----------------------------------------------------------------x
|
||||
// | |
|
||||
// | H U R R I C A N E |
|
||||
// | V L S I B a c k e n d D a t a - B a s e |
|
||||
// | |
|
||||
// | Author : Jean-Paul CHAPUT |
|
||||
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
||||
// | =============================================================== |
|
||||
// | C++ Module : "./DynamicLabel.cpp" |
|
||||
// | *************************************************************** |
|
||||
// | U p d a t e s |
|
||||
// | |
|
||||
// x-----------------------------------------------------------------x
|
||||
|
||||
|
||||
#include <QAction>
|
||||
#include <QMenu>
|
||||
#include <QMenuBar>
|
||||
|
||||
|
||||
# include <QFontMetrics>
|
||||
|
|
|
@ -1,6 +1,58 @@
|
|||
|
||||
|
||||
// -*- C++ -*-
|
||||
//
|
||||
// This file is part of the Coriolis Project.
|
||||
// Copyright (C) Laboratoire LIP6 - Departement ASIM
|
||||
// Universite Pierre et Marie Curie
|
||||
//
|
||||
// Main contributors :
|
||||
// Christophe Alexandre <Christophe.Alexandre@lip6.fr>
|
||||
// Sophie Belloeil <Sophie.Belloeil@lip6.fr>
|
||||
// Hugo Clément <Hugo.Clement@lip6.fr>
|
||||
// Jean-Paul Chaput <Jean-Paul.Chaput@lip6.fr>
|
||||
// Damien Dupuis <Damien.Dupuis@lip6.fr>
|
||||
// Christian Masson <Christian.Masson@lip6.fr>
|
||||
// Marek Sroka <Marek.Sroka@lip6.fr>
|
||||
//
|
||||
// The Coriolis Project is free software; you can redistribute it
|
||||
// and/or modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// The Coriolis Project is distributed in the hope that it will be
|
||||
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with the Coriolis Project; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
// USA
|
||||
//
|
||||
// License-Tag
|
||||
// Authors-Tag
|
||||
// ===================================================================
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
// x-----------------------------------------------------------------x
|
||||
// | |
|
||||
// | H U R R I C A N E |
|
||||
// | V L S I B a c k e n d D a t a - B a s e |
|
||||
// | |
|
||||
// | Author : Jean-Paul CHAPUT |
|
||||
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
||||
// | =============================================================== |
|
||||
// | C++ Module : "./Graphics.cpp" |
|
||||
// | *************************************************************** |
|
||||
// | U p d a t e s |
|
||||
// | |
|
||||
// x-----------------------------------------------------------------x
|
||||
|
||||
|
||||
#include <QAction>
|
||||
#include <QMenu>
|
||||
#include <QMenuBar>
|
||||
|
||||
|
||||
# include <assert.h>
|
||||
|
@ -143,21 +195,21 @@ namespace Hurricane {
|
|||
}
|
||||
|
||||
|
||||
const QColor& Graphics::getColor ( const Name& key )
|
||||
QColor Graphics::getColor ( const Name& key, int darkening )
|
||||
{
|
||||
return getGraphics()->_getColor ( key );
|
||||
return getGraphics()->_getColor ( key, darkening );
|
||||
}
|
||||
|
||||
|
||||
const QPen& Graphics::getPen ( const Name& key )
|
||||
QPen Graphics::getPen ( const Name& key, int darkening )
|
||||
{
|
||||
return getGraphics()->_getPen ( key );
|
||||
return getGraphics()->_getPen ( key, darkening );
|
||||
}
|
||||
|
||||
|
||||
const QBrush& Graphics::getBrush ( const Name& key )
|
||||
QBrush Graphics::getBrush ( const Name& key, int darkening )
|
||||
{
|
||||
return getGraphics()->_getBrush ( key );
|
||||
return getGraphics()->_getBrush ( key, darkening );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,58 @@
|
|||
|
||||
// -*- C++ -*-
|
||||
//
|
||||
// This file is part of the Coriolis Project.
|
||||
// Copyright (C) Laboratoire LIP6 - Departement ASIM
|
||||
// Universite Pierre et Marie Curie
|
||||
//
|
||||
// Main contributors :
|
||||
// Christophe Alexandre <Christophe.Alexandre@lip6.fr>
|
||||
// Sophie Belloeil <Sophie.Belloeil@lip6.fr>
|
||||
// Hugo Clément <Hugo.Clement@lip6.fr>
|
||||
// Jean-Paul Chaput <Jean-Paul.Chaput@lip6.fr>
|
||||
// Damien Dupuis <Damien.Dupuis@lip6.fr>
|
||||
// Christian Masson <Christian.Masson@lip6.fr>
|
||||
// Marek Sroka <Marek.Sroka@lip6.fr>
|
||||
//
|
||||
// The Coriolis Project is free software; you can redistribute it
|
||||
// and/or modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// The Coriolis Project is distributed in the hope that it will be
|
||||
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with the Coriolis Project; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
// USA
|
||||
//
|
||||
// License-Tag
|
||||
// Authors-Tag
|
||||
// ===================================================================
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
// x-----------------------------------------------------------------x
|
||||
// | |
|
||||
// | H U R R I C A N E |
|
||||
// | V L S I B a c k e n d D a t a - B a s e |
|
||||
// | |
|
||||
// | Author : Jean-Paul CHAPUT |
|
||||
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
||||
// | =============================================================== |
|
||||
// | C++ Module : "./GroupPaletteEntry.cpp" |
|
||||
// | *************************************************************** |
|
||||
// | U p d a t e s |
|
||||
// | |
|
||||
// x-----------------------------------------------------------------x
|
||||
|
||||
|
||||
#include <QAction>
|
||||
#include <QMenu>
|
||||
#include <QMenuBar>
|
||||
|
||||
|
||||
# include <QPushButton>
|
||||
|
|
|
@ -1,4 +1,58 @@
|
|||
|
||||
// -*- C++ -*-
|
||||
//
|
||||
// This file is part of the Coriolis Project.
|
||||
// Copyright (C) Laboratoire LIP6 - Departement ASIM
|
||||
// Universite Pierre et Marie Curie
|
||||
//
|
||||
// Main contributors :
|
||||
// Christophe Alexandre <Christophe.Alexandre@lip6.fr>
|
||||
// Sophie Belloeil <Sophie.Belloeil@lip6.fr>
|
||||
// Hugo Clément <Hugo.Clement@lip6.fr>
|
||||
// Jean-Paul Chaput <Jean-Paul.Chaput@lip6.fr>
|
||||
// Damien Dupuis <Damien.Dupuis@lip6.fr>
|
||||
// Christian Masson <Christian.Masson@lip6.fr>
|
||||
// Marek Sroka <Marek.Sroka@lip6.fr>
|
||||
//
|
||||
// The Coriolis Project is free software; you can redistribute it
|
||||
// and/or modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// The Coriolis Project is distributed in the hope that it will be
|
||||
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with the Coriolis Project; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
// USA
|
||||
//
|
||||
// License-Tag
|
||||
// Authors-Tag
|
||||
// ===================================================================
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
// x-----------------------------------------------------------------x
|
||||
// | |
|
||||
// | H U R R I C A N E |
|
||||
// | V L S I B a c k e n d D a t a - B a s e |
|
||||
// | |
|
||||
// | Author : Jean-Paul CHAPUT |
|
||||
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
||||
// | =============================================================== |
|
||||
// | C++ Module : "./HInspectorWidget.cpp" |
|
||||
// | *************************************************************** |
|
||||
// | U p d a t e s |
|
||||
// | |
|
||||
// x-----------------------------------------------------------------x
|
||||
|
||||
|
||||
#include <QAction>
|
||||
#include <QMenu>
|
||||
#include <QMenuBar>
|
||||
|
||||
#include <QFontMetrics>
|
||||
#include <QComboBox>
|
||||
|
@ -248,7 +302,7 @@ namespace Hurricane {
|
|||
}
|
||||
|
||||
|
||||
void HInspectorWidget::keyPressEvent(QKeyEvent *event)
|
||||
void HInspectorWidget::keyPressEvent ( QKeyEvent *event )
|
||||
{
|
||||
if ( event->key() == Qt::Key_Right ) {
|
||||
QModelIndex index = _slotsView->currentIndex();
|
||||
|
|
|
@ -1,5 +1,58 @@
|
|||
|
||||
// -*- C++ -*-
|
||||
//
|
||||
// This file is part of the Coriolis Project.
|
||||
// Copyright (C) Laboratoire LIP6 - Departement ASIM
|
||||
// Universite Pierre et Marie Curie
|
||||
//
|
||||
// Main contributors :
|
||||
// Christophe Alexandre <Christophe.Alexandre@lip6.fr>
|
||||
// Sophie Belloeil <Sophie.Belloeil@lip6.fr>
|
||||
// Hugo Clément <Hugo.Clement@lip6.fr>
|
||||
// Jean-Paul Chaput <Jean-Paul.Chaput@lip6.fr>
|
||||
// Damien Dupuis <Damien.Dupuis@lip6.fr>
|
||||
// Christian Masson <Christian.Masson@lip6.fr>
|
||||
// Marek Sroka <Marek.Sroka@lip6.fr>
|
||||
//
|
||||
// The Coriolis Project is free software; you can redistribute it
|
||||
// and/or modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// The Coriolis Project is distributed in the hope that it will be
|
||||
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with the Coriolis Project; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
// USA
|
||||
//
|
||||
// License-Tag
|
||||
// Authors-Tag
|
||||
// ===================================================================
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
// x-----------------------------------------------------------------x
|
||||
// | |
|
||||
// | H U R R I C A N E |
|
||||
// | V L S I B a c k e n d D a t a - B a s e |
|
||||
// | |
|
||||
// | Author : Jean-Paul CHAPUT |
|
||||
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
||||
// | =============================================================== |
|
||||
// | C++ Module : "./HMousePosition.cpp" |
|
||||
// | *************************************************************** |
|
||||
// | U p d a t e s |
|
||||
// | |
|
||||
// x-----------------------------------------------------------------x
|
||||
|
||||
|
||||
#include <QAction>
|
||||
#include <QMenu>
|
||||
#include <QMenuBar>
|
||||
|
||||
|
||||
# include <QHBoxLayout>
|
||||
|
|
|
@ -0,0 +1,165 @@
|
|||
|
||||
// -*- C++ -*-
|
||||
//
|
||||
// This file is part of the Coriolis Project.
|
||||
// Copyright (C) Laboratoire LIP6 - Departement ASIM
|
||||
// Universite Pierre et Marie Curie
|
||||
//
|
||||
// Main contributors :
|
||||
// Christophe Alexandre <Christophe.Alexandre@lip6.fr>
|
||||
// Sophie Belloeil <Sophie.Belloeil@lip6.fr>
|
||||
// Hugo Clément <Hugo.Clement@lip6.fr>
|
||||
// Jean-Paul Chaput <Jean-Paul.Chaput@lip6.fr>
|
||||
// Damien Dupuis <Damien.Dupuis@lip6.fr>
|
||||
// Christian Masson <Christian.Masson@lip6.fr>
|
||||
// Marek Sroka <Marek.Sroka@lip6.fr>
|
||||
//
|
||||
// The Coriolis Project is free software; you can redistribute it
|
||||
// and/or modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// The Coriolis Project is distributed in the hope that it will be
|
||||
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with the Coriolis Project; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
// USA
|
||||
//
|
||||
// License-Tag
|
||||
// Authors-Tag
|
||||
// ===================================================================
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
// x-----------------------------------------------------------------x
|
||||
// | |
|
||||
// | H U R R I C A N E |
|
||||
// | V L S I B a c k e n d D a t a - B a s e |
|
||||
// | |
|
||||
// | Author : Jean-Paul CHAPUT |
|
||||
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
||||
// | =============================================================== |
|
||||
// | C++ Module : "./HNetlist.cpp" |
|
||||
// | *************************************************************** |
|
||||
// | U p d a t e s |
|
||||
// | |
|
||||
// x-----------------------------------------------------------------x
|
||||
|
||||
|
||||
#include <QAction>
|
||||
#include <QMenu>
|
||||
#include <QMenuBar>
|
||||
|
||||
#include <QFontMetrics>
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#include <QHeaderView>
|
||||
#include <QKeyEvent>
|
||||
#include <QGroupBox>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
#include "hurricane/Commons.h"
|
||||
#include "hurricane/Net.h"
|
||||
|
||||
#include "hurricane/viewer/Graphics.h"
|
||||
#include "hurricane/viewer/HNetlistModel.h"
|
||||
#include "hurricane/viewer/HNetlist.h"
|
||||
|
||||
|
||||
namespace Hurricane {
|
||||
|
||||
|
||||
|
||||
HNetlist::HNetlist ( QWidget* parent )
|
||||
: QWidget(parent)
|
||||
, _netlistModel(NULL)
|
||||
, _sortModel(NULL)
|
||||
, _netlistView(NULL)
|
||||
, _rowHeight(20)
|
||||
, _cellWidget(NULL)
|
||||
{
|
||||
setAttribute ( Qt::WA_DeleteOnClose );
|
||||
|
||||
_rowHeight = QFontMetrics(Graphics::getFixedFont()).height() + 4;
|
||||
|
||||
_netlistModel = new HNetlistModel ( this );
|
||||
|
||||
_sortModel = new QSortFilterProxyModel ( this );
|
||||
_sortModel->setSourceModel ( _netlistModel );
|
||||
_sortModel->setDynamicSortFilter ( true );
|
||||
_sortModel->setFilterKeyColumn ( 0 );
|
||||
|
||||
_netlistView = new QTableView(this);
|
||||
_netlistView->setShowGrid(false);
|
||||
_netlistView->setAlternatingRowColors(true);
|
||||
_netlistView->setSelectionBehavior(QAbstractItemView::SelectRows);
|
||||
_netlistView->setSortingEnabled(true);
|
||||
_netlistView->setModel ( _sortModel );
|
||||
_netlistView->horizontalHeader()->setStretchLastSection ( true );
|
||||
_netlistView->resizeColumnToContents ( 0 );
|
||||
|
||||
QHeaderView* horizontalHeader = _netlistView->horizontalHeader ();
|
||||
horizontalHeader->setStretchLastSection ( true );
|
||||
horizontalHeader->setMinimumSectionSize ( 200 );
|
||||
|
||||
QHeaderView* verticalHeader = _netlistView->verticalHeader ();
|
||||
verticalHeader->setVisible ( false );
|
||||
|
||||
_filterPatternLineEdit = new QLineEdit(this);
|
||||
QLabel* filterPatternLabel = new QLabel(tr("&Filter pattern:"), this);
|
||||
filterPatternLabel->setBuddy(_filterPatternLineEdit);
|
||||
|
||||
QGridLayout* inspectorLayout = new QGridLayout();
|
||||
inspectorLayout->addWidget(_netlistView , 1, 0, 1, 2);
|
||||
inspectorLayout->addWidget(filterPatternLabel , 2, 0);
|
||||
inspectorLayout->addWidget(_filterPatternLineEdit, 2, 1);
|
||||
|
||||
setLayout ( inspectorLayout );
|
||||
|
||||
connect ( _filterPatternLineEdit, SIGNAL(textChanged(const QString &))
|
||||
, this , SLOT(textFilterChanged())
|
||||
);
|
||||
connect ( _netlistView , SIGNAL(activated(const QModelIndex&))
|
||||
, this , SLOT(selectNet(const QModelIndex&))
|
||||
);
|
||||
|
||||
setWindowTitle(tr("Netlist"));
|
||||
resize(500, 300);
|
||||
|
||||
}
|
||||
|
||||
|
||||
void HNetlist::selectNet ( const QModelIndex& index )
|
||||
{
|
||||
const Net* net = _netlistModel->getNet ( _sortModel->mapToSource(index).row() );
|
||||
|
||||
if ( _cellWidget && net ) {
|
||||
_cellWidget->unselectAll ();
|
||||
_cellWidget->select ( net );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void HNetlist::keyPressEvent ( QKeyEvent* event )
|
||||
{
|
||||
cerr << "keyPressEvent" << endl;
|
||||
|
||||
if ( event->key() == Qt::Key_Left ) {
|
||||
cerr << "Key Left Pressed." << endl;
|
||||
} else {
|
||||
event->ignore();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void HNetlist::textFilterChanged ()
|
||||
{
|
||||
_sortModel->setFilterRegExp ( _filterPatternLineEdit->text() );
|
||||
}
|
||||
|
||||
|
||||
} // End of Hurricane namespace.
|
|
@ -0,0 +1,147 @@
|
|||
|
||||
// -*- C++ -*-
|
||||
//
|
||||
// This file is part of the Coriolis Project.
|
||||
// Copyright (C) Laboratoire LIP6 - Departement ASIM
|
||||
// Universite Pierre et Marie Curie
|
||||
//
|
||||
// Main contributors :
|
||||
// Christophe Alexandre <Christophe.Alexandre@lip6.fr>
|
||||
// Sophie Belloeil <Sophie.Belloeil@lip6.fr>
|
||||
// Hugo Clément <Hugo.Clement@lip6.fr>
|
||||
// Jean-Paul Chaput <Jean-Paul.Chaput@lip6.fr>
|
||||
// Damien Dupuis <Damien.Dupuis@lip6.fr>
|
||||
// Christian Masson <Christian.Masson@lip6.fr>
|
||||
// Marek Sroka <Marek.Sroka@lip6.fr>
|
||||
//
|
||||
// The Coriolis Project is free software; you can redistribute it
|
||||
// and/or modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// The Coriolis Project is distributed in the hope that it will be
|
||||
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with the Coriolis Project; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
// USA
|
||||
//
|
||||
// License-Tag
|
||||
// Authors-Tag
|
||||
// ===================================================================
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
// x-----------------------------------------------------------------x
|
||||
// | |
|
||||
// | H U R R I C A N E |
|
||||
// | V L S I B a c k e n d D a t a - B a s e |
|
||||
// | |
|
||||
// | Author : Jean-Paul CHAPUT |
|
||||
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
||||
// | =============================================================== |
|
||||
// | C++ Module : "./HNetlistModel.cpp" |
|
||||
// | *************************************************************** |
|
||||
// | U p d a t e s |
|
||||
// | |
|
||||
// x-----------------------------------------------------------------x
|
||||
|
||||
|
||||
#include <QAction>
|
||||
#include <QMenu>
|
||||
#include <QMenuBar>
|
||||
#include <QFont>
|
||||
#include <QApplication>
|
||||
|
||||
#include "hurricane/Name.h"
|
||||
#include "hurricane/Net.h"
|
||||
#include "hurricane/Cell.h"
|
||||
#include "hurricane/viewer/Graphics.h"
|
||||
#include "hurricane/viewer/NetInformations.h"
|
||||
#include "hurricane/viewer/HNetlistModel.h"
|
||||
|
||||
|
||||
namespace Hurricane {
|
||||
|
||||
|
||||
HNetlistModel::HNetlistModel ( QObject* parent )
|
||||
: QAbstractTableModel(parent)
|
||||
, _cell(NULL)
|
||||
, _netlist(NULL)
|
||||
{ }
|
||||
|
||||
|
||||
HNetlistModel::~HNetlistModel ()
|
||||
{
|
||||
if ( _netlist ) delete _netlist;
|
||||
}
|
||||
|
||||
|
||||
QVariant HNetlistModel::data ( const QModelIndex& index, int role ) const
|
||||
{
|
||||
static QFont nameFont = Graphics::getFixedFont ( QFont::Bold );
|
||||
static QFont valueFont = Graphics::getFixedFont ( QFont::Normal, true );
|
||||
|
||||
if ( !index.isValid() ) return QVariant ();
|
||||
|
||||
if ( role == Qt::SizeHintRole ) {
|
||||
switch (index.column()) {
|
||||
case 0: return 200;
|
||||
default: return -1;
|
||||
}
|
||||
}
|
||||
|
||||
if ( role == Qt::FontRole ) {
|
||||
switch (index.column()) {
|
||||
case 0: return nameFont;
|
||||
default: return valueFont;
|
||||
}
|
||||
}
|
||||
|
||||
if ( role == Qt::DisplayRole ) {
|
||||
int row = index.row ();
|
||||
return _netlist->getRow(row)->getColumn(index.column());
|
||||
}
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
|
||||
QVariant HNetlistModel::headerData ( int section
|
||||
, Qt::Orientation orientation
|
||||
, int role ) const
|
||||
{
|
||||
if ( !_netlist ) return QVariant();
|
||||
|
||||
if ( ( orientation == Qt::Vertical )
|
||||
|| ( section >= _netlist->getColumnCount() )
|
||||
|| (role != Qt::DisplayRole) )
|
||||
return QVariant();
|
||||
|
||||
return _netlist->getColumnName(section);
|
||||
}
|
||||
|
||||
|
||||
int HNetlistModel::rowCount ( const QModelIndex& parent ) const
|
||||
{
|
||||
return (_netlist) ? _netlist->size() : 0;
|
||||
}
|
||||
|
||||
|
||||
int HNetlistModel::columnCount ( const QModelIndex& parent ) const
|
||||
{
|
||||
return (_netlist) ? _netlist->getColumnCount() : 0;
|
||||
}
|
||||
|
||||
|
||||
const Net* HNetlistModel::getNet ( int row )
|
||||
{
|
||||
if ( !_netlist || ( row >= (int)_netlist->size() ) ) return NULL;
|
||||
|
||||
return _netlist->getRow(row)->getNet();
|
||||
}
|
||||
|
||||
|
||||
} // End of Hurricane namespace.
|
|
@ -1,5 +1,58 @@
|
|||
|
||||
// -*- C++ -*-
|
||||
//
|
||||
// This file is part of the Coriolis Project.
|
||||
// Copyright (C) Laboratoire LIP6 - Departement ASIM
|
||||
// Universite Pierre et Marie Curie
|
||||
//
|
||||
// Main contributors :
|
||||
// Christophe Alexandre <Christophe.Alexandre@lip6.fr>
|
||||
// Sophie Belloeil <Sophie.Belloeil@lip6.fr>
|
||||
// Hugo Clément <Hugo.Clement@lip6.fr>
|
||||
// Jean-Paul Chaput <Jean-Paul.Chaput@lip6.fr>
|
||||
// Damien Dupuis <Damien.Dupuis@lip6.fr>
|
||||
// Christian Masson <Christian.Masson@lip6.fr>
|
||||
// Marek Sroka <Marek.Sroka@lip6.fr>
|
||||
//
|
||||
// The Coriolis Project is free software; you can redistribute it
|
||||
// and/or modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// The Coriolis Project is distributed in the hope that it will be
|
||||
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with the Coriolis Project; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
// USA
|
||||
//
|
||||
// License-Tag
|
||||
// Authors-Tag
|
||||
// ===================================================================
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
// x-----------------------------------------------------------------x
|
||||
// | |
|
||||
// | H U R R I C A N E |
|
||||
// | V L S I B a c k e n d D a t a - B a s e |
|
||||
// | |
|
||||
// | Author : Jean-Paul CHAPUT |
|
||||
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
||||
// | =============================================================== |
|
||||
// | C++ Module : "./HPalette.cpp" |
|
||||
// | *************************************************************** |
|
||||
// | U p d a t e s |
|
||||
// | |
|
||||
// x-----------------------------------------------------------------x
|
||||
|
||||
|
||||
#include <QAction>
|
||||
#include <QMenu>
|
||||
#include <QMenuBar>
|
||||
|
||||
|
||||
# include <vector>
|
||||
|
|
|
@ -1,5 +1,58 @@
|
|||
|
||||
// -*- C++ -*-
|
||||
//
|
||||
// This file is part of the Coriolis Project.
|
||||
// Copyright (C) Laboratoire LIP6 - Departement ASIM
|
||||
// Universite Pierre et Marie Curie
|
||||
//
|
||||
// Main contributors :
|
||||
// Christophe Alexandre <Christophe.Alexandre@lip6.fr>
|
||||
// Sophie Belloeil <Sophie.Belloeil@lip6.fr>
|
||||
// Hugo Clément <Hugo.Clement@lip6.fr>
|
||||
// Jean-Paul Chaput <Jean-Paul.Chaput@lip6.fr>
|
||||
// Damien Dupuis <Damien.Dupuis@lip6.fr>
|
||||
// Christian Masson <Christian.Masson@lip6.fr>
|
||||
// Marek Sroka <Marek.Sroka@lip6.fr>
|
||||
//
|
||||
// The Coriolis Project is free software; you can redistribute it
|
||||
// and/or modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// The Coriolis Project is distributed in the hope that it will be
|
||||
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with the Coriolis Project; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
// USA
|
||||
//
|
||||
// License-Tag
|
||||
// Authors-Tag
|
||||
// ===================================================================
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
// x-----------------------------------------------------------------x
|
||||
// | |
|
||||
// | H U R R I C A N E |
|
||||
// | V L S I B a c k e n d D a t a - B a s e |
|
||||
// | |
|
||||
// | Author : Jean-Paul CHAPUT |
|
||||
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
||||
// | =============================================================== |
|
||||
// | C++ Module : "./HPaletteEntry.cpp" |
|
||||
// | *************************************************************** |
|
||||
// | U p d a t e s |
|
||||
// | |
|
||||
// x-----------------------------------------------------------------x
|
||||
|
||||
|
||||
#include <QAction>
|
||||
#include <QMenu>
|
||||
#include <QMenuBar>
|
||||
|
||||
|
||||
# include <QPainter>
|
||||
|
|
|
@ -1,5 +1,58 @@
|
|||
|
||||
// -*- C++ -*-
|
||||
//
|
||||
// This file is part of the Coriolis Project.
|
||||
// Copyright (C) Laboratoire LIP6 - Departement ASIM
|
||||
// Universite Pierre et Marie Curie
|
||||
//
|
||||
// Main contributors :
|
||||
// Christophe Alexandre <Christophe.Alexandre@lip6.fr>
|
||||
// Sophie Belloeil <Sophie.Belloeil@lip6.fr>
|
||||
// Hugo Clément <Hugo.Clement@lip6.fr>
|
||||
// Jean-Paul Chaput <Jean-Paul.Chaput@lip6.fr>
|
||||
// Damien Dupuis <Damien.Dupuis@lip6.fr>
|
||||
// Christian Masson <Christian.Masson@lip6.fr>
|
||||
// Marek Sroka <Marek.Sroka@lip6.fr>
|
||||
//
|
||||
// The Coriolis Project is free software; you can redistribute it
|
||||
// and/or modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// The Coriolis Project is distributed in the hope that it will be
|
||||
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with the Coriolis Project; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
// USA
|
||||
//
|
||||
// License-Tag
|
||||
// Authors-Tag
|
||||
// ===================================================================
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
// x-----------------------------------------------------------------x
|
||||
// | |
|
||||
// | H U R R I C A N E |
|
||||
// | V L S I B a c k e n d D a t a - B a s e |
|
||||
// | |
|
||||
// | Author : Jean-Paul CHAPUT |
|
||||
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
||||
// | =============================================================== |
|
||||
// | C++ Module : "./LayerPaletteEntry.cpp" |
|
||||
// | *************************************************************** |
|
||||
// | U p d a t e s |
|
||||
// | |
|
||||
// x-----------------------------------------------------------------x
|
||||
|
||||
|
||||
#include <QAction>
|
||||
#include <QMenu>
|
||||
#include <QMenuBar>
|
||||
|
||||
|
||||
# include <QCheckBox>
|
||||
|
|
|
@ -0,0 +1,147 @@
|
|||
|
||||
// -*- C++ -*-
|
||||
//
|
||||
// This file is part of the Coriolis Project.
|
||||
// Copyright (C) Laboratoire LIP6 - Departement ASIM
|
||||
// Universite Pierre et Marie Curie
|
||||
//
|
||||
// Main contributors :
|
||||
// Christophe Alexandre <Christophe.Alexandre@lip6.fr>
|
||||
// Sophie Belloeil <Sophie.Belloeil@lip6.fr>
|
||||
// Hugo Clément <Hugo.Clement@lip6.fr>
|
||||
// Jean-Paul Chaput <Jean-Paul.Chaput@lip6.fr>
|
||||
// Damien Dupuis <Damien.Dupuis@lip6.fr>
|
||||
// Christian Masson <Christian.Masson@lip6.fr>
|
||||
// Marek Sroka <Marek.Sroka@lip6.fr>
|
||||
//
|
||||
// The Coriolis Project is free software; you can redistribute it
|
||||
// and/or modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// The Coriolis Project is distributed in the hope that it will be
|
||||
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with the Coriolis Project; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
// USA
|
||||
//
|
||||
// License-Tag
|
||||
// Authors-Tag
|
||||
// ===================================================================
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
// x-----------------------------------------------------------------x
|
||||
// | |
|
||||
// | H U R R I C A N E |
|
||||
// | V L S I B a c k e n d D a t a - B a s e |
|
||||
// | |
|
||||
// | Author : Jean-Paul CHAPUT |
|
||||
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
||||
// | =============================================================== |
|
||||
// | C++ Module : "./NetInformations.cpp" |
|
||||
// | *************************************************************** |
|
||||
// | U p d a t e s |
|
||||
// | |
|
||||
// x-----------------------------------------------------------------x
|
||||
|
||||
|
||||
#include <QAction>
|
||||
#include <QMenu>
|
||||
#include <QMenuBar>
|
||||
#include <QObject>
|
||||
|
||||
#include "hurricane/Name.h"
|
||||
#include "hurricane/Net.h"
|
||||
#include "hurricane/viewer/NetInformations.h"
|
||||
|
||||
|
||||
namespace Hurricane {
|
||||
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// Class : "NetInformations"
|
||||
|
||||
|
||||
int NetInformations::getColumnCount ()
|
||||
{ return 1; }
|
||||
|
||||
|
||||
QVariant NetInformations::getColumnName ( int column )
|
||||
{
|
||||
switch ( column ) {
|
||||
case 0: return QVariant(QObject::tr("Net"));
|
||||
}
|
||||
return QVariant(QObject::tr("Column Out of Bound"));
|
||||
}
|
||||
|
||||
|
||||
QVariant NetInformations::getColumn ( int column )
|
||||
{
|
||||
switch ( column ) {
|
||||
case 0: return QVariant(getString(getName()).c_str());
|
||||
}
|
||||
return QVariant(QObject::tr("Column Out of Bound"));
|
||||
}
|
||||
|
||||
|
||||
NetInformations::NetInformations ( const Net* net )
|
||||
: _net(net)
|
||||
{ }
|
||||
|
||||
|
||||
NetInformations::~NetInformations ()
|
||||
{ }
|
||||
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// Class : "SimpleNetInformations"
|
||||
|
||||
|
||||
int SimpleNetInformations::getColumnCount ()
|
||||
{ return 2; }
|
||||
|
||||
|
||||
QVariant SimpleNetInformations::getColumnName ( int column )
|
||||
{
|
||||
switch ( column ) {
|
||||
case 0: return QVariant(QObject::tr("Net"));
|
||||
case 1: return QVariant(QObject::tr("Plugs"));
|
||||
}
|
||||
return QVariant(QObject::tr("Column Out of Bound"));
|
||||
}
|
||||
|
||||
|
||||
QVariant SimpleNetInformations::getColumn ( int column )
|
||||
{
|
||||
switch ( column ) {
|
||||
case 0: return QVariant(getString(getName()).c_str());
|
||||
case 1: return QVariant(getPlugsCount());
|
||||
}
|
||||
return QVariant(QObject::tr("Column Out of Bound"));
|
||||
}
|
||||
|
||||
|
||||
SimpleNetInformations::SimpleNetInformations ( const Net* net )
|
||||
: NetInformations(net)
|
||||
, _plugsCount(_net->getPlugs().getSize())
|
||||
{ }
|
||||
|
||||
|
||||
SimpleNetInformations::~SimpleNetInformations ()
|
||||
{ }
|
||||
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// Class : "AbstractNetInformationsVector"
|
||||
|
||||
|
||||
AbstractNetInformationsVector::~AbstractNetInformationsVector ()
|
||||
{ }
|
||||
|
||||
|
||||
} // End of Hurricane namespace.
|
|
@ -1,4 +1,58 @@
|
|||
|
||||
// -*- C++ -*-
|
||||
//
|
||||
// This file is part of the Coriolis Project.
|
||||
// Copyright (C) Laboratoire LIP6 - Departement ASIM
|
||||
// Universite Pierre et Marie Curie
|
||||
//
|
||||
// Main contributors :
|
||||
// Christophe Alexandre <Christophe.Alexandre@lip6.fr>
|
||||
// Sophie Belloeil <Sophie.Belloeil@lip6.fr>
|
||||
// Hugo Clément <Hugo.Clement@lip6.fr>
|
||||
// Jean-Paul Chaput <Jean-Paul.Chaput@lip6.fr>
|
||||
// Damien Dupuis <Damien.Dupuis@lip6.fr>
|
||||
// Christian Masson <Christian.Masson@lip6.fr>
|
||||
// Marek Sroka <Marek.Sroka@lip6.fr>
|
||||
//
|
||||
// The Coriolis Project is free software; you can redistribute it
|
||||
// and/or modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// The Coriolis Project is distributed in the hope that it will be
|
||||
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with the Coriolis Project; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
// USA
|
||||
//
|
||||
// License-Tag
|
||||
// Authors-Tag
|
||||
// ===================================================================
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
// x-----------------------------------------------------------------x
|
||||
// | |
|
||||
// | H U R R I C A N E |
|
||||
// | V L S I B a c k e n d D a t a - B a s e |
|
||||
// | |
|
||||
// | Author : Jean-Paul CHAPUT |
|
||||
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
||||
// | =============================================================== |
|
||||
// | C++ Module : "./RecordModel.cpp" |
|
||||
// | *************************************************************** |
|
||||
// | U p d a t e s |
|
||||
// | |
|
||||
// x-----------------------------------------------------------------x
|
||||
|
||||
|
||||
#include <QAction>
|
||||
#include <QMenu>
|
||||
#include <QMenuBar>
|
||||
#include <QFont>
|
||||
#include <QApplication>
|
||||
|
||||
|
|
|
@ -1,5 +1,58 @@
|
|||
|
||||
// -*- C++ -*-
|
||||
//
|
||||
// This file is part of the Coriolis Project.
|
||||
// Copyright (C) Laboratoire LIP6 - Departement ASIM
|
||||
// Universite Pierre et Marie Curie
|
||||
//
|
||||
// Main contributors :
|
||||
// Christophe Alexandre <Christophe.Alexandre@lip6.fr>
|
||||
// Sophie Belloeil <Sophie.Belloeil@lip6.fr>
|
||||
// Hugo Clément <Hugo.Clement@lip6.fr>
|
||||
// Jean-Paul Chaput <Jean-Paul.Chaput@lip6.fr>
|
||||
// Damien Dupuis <Damien.Dupuis@lip6.fr>
|
||||
// Christian Masson <Christian.Masson@lip6.fr>
|
||||
// Marek Sroka <Marek.Sroka@lip6.fr>
|
||||
//
|
||||
// The Coriolis Project is free software; you can redistribute it
|
||||
// and/or modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// The Coriolis Project is distributed in the hope that it will be
|
||||
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with the Coriolis Project; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
// USA
|
||||
//
|
||||
// License-Tag
|
||||
// Authors-Tag
|
||||
// ===================================================================
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
// x-----------------------------------------------------------------x
|
||||
// | |
|
||||
// | H U R R I C A N E |
|
||||
// | V L S I B a c k e n d D a t a - B a s e |
|
||||
// | |
|
||||
// | Author : Jean-Paul CHAPUT |
|
||||
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
||||
// | =============================================================== |
|
||||
// | C++ Module : "./ScreenUtilisties.cpp" |
|
||||
// | *************************************************************** |
|
||||
// | U p d a t e s |
|
||||
// | |
|
||||
// x-----------------------------------------------------------------x
|
||||
|
||||
|
||||
#include <QAction>
|
||||
#include <QMenu>
|
||||
#include <QMenuBar>
|
||||
|
||||
|
||||
# include <QBitmap>
|
||||
|
|
|
@ -0,0 +1,140 @@
|
|||
|
||||
|
||||
// -*- C++ -*-
|
||||
//
|
||||
// This file is part of the Hurricane Software.
|
||||
// Copyright (c) BULL S.A. 2000-2004, All Rights Reserved
|
||||
//
|
||||
// ===================================================================
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
// x-----------------------------------------------------------------x
|
||||
// | |
|
||||
// | H U R R I C A N E |
|
||||
// | V L S I B a c k e n d D a t a - B a s e |
|
||||
// | |
|
||||
// | Author : Remy Escassut |
|
||||
// | E-mail : Jean-Paul.Chaput@lip6.fr |
|
||||
// | =============================================================== |
|
||||
// | C++ Module : "./Selector.cpp" |
|
||||
// | *************************************************************** |
|
||||
// | U p d a t e s |
|
||||
// | |
|
||||
// x-----------------------------------------------------------------x
|
||||
|
||||
|
||||
#include "hurricane/Quark.h"
|
||||
#include "hurricane/Error.h"
|
||||
#include "hurricane/viewer/Selector.h"
|
||||
#include "hurricane/viewer/CellWidget.h"
|
||||
|
||||
|
||||
namespace Hurricane {
|
||||
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// Class : "Hurricane::Selector".
|
||||
|
||||
|
||||
const Name Selector::_propertyName = _PName ( "Selector" );
|
||||
|
||||
|
||||
Selector::Selector () : PrivateProperty()
|
||||
, _cellWidgets()
|
||||
{ }
|
||||
|
||||
|
||||
string Selector::_getTypeName () const
|
||||
{ return _TName("Selector"); }
|
||||
|
||||
|
||||
const Name& Selector::getPropertyName ()
|
||||
{ return _propertyName; }
|
||||
|
||||
|
||||
Name Selector::getName () const
|
||||
{ return Selector::getPropertyName(); }
|
||||
|
||||
|
||||
Occurrence Selector::getOccurrence () const
|
||||
{
|
||||
DBo* owner = getOwner();
|
||||
if (!owner) return Occurrence();
|
||||
|
||||
Quark* quark = dynamic_cast<Quark*>(owner);
|
||||
assert ( quark );
|
||||
|
||||
return quark->getOccurrence();
|
||||
}
|
||||
|
||||
|
||||
Selector* Selector::create ( Occurrence& occurrence )
|
||||
{
|
||||
if ( !occurrence.isValid() )
|
||||
throw Error ( "Can't create " + _TName("Selector") + " : invalid occurrence" );
|
||||
|
||||
if ( occurrence.getProperty(Selector::getPropertyName()) )
|
||||
throw Error ( "Can't create " + _TName("Selector") + " : already exists" );
|
||||
|
||||
Selector* selector = new Selector();
|
||||
|
||||
selector->_postCreate();
|
||||
occurrence.put ( selector );
|
||||
|
||||
return selector;
|
||||
}
|
||||
|
||||
|
||||
void Selector::_preDestroy()
|
||||
{
|
||||
set<CellWidget*>::iterator it = _cellWidgets.begin ();
|
||||
for ( ; it != _cellWidgets.end() ; it++ )
|
||||
detachFrom ( *it, true );
|
||||
|
||||
PrivateProperty::_preDestroy();
|
||||
}
|
||||
|
||||
|
||||
string Selector::_getString() const
|
||||
{
|
||||
return "<" + _TName("Selector") + " " + getString(getOccurrence()) + ">";
|
||||
}
|
||||
|
||||
|
||||
Record* Selector::_getRecord () const
|
||||
{
|
||||
Record* record = PrivateProperty::_getRecord();
|
||||
if ( record )
|
||||
record->add(getSlot("_cellWidgets", &_cellWidgets));
|
||||
|
||||
return record;
|
||||
}
|
||||
|
||||
|
||||
void Selector::attachTo ( CellWidget* widget )
|
||||
{
|
||||
if ( !widget )
|
||||
throw Error ( "Can't attach selector : null CellWidget." );
|
||||
|
||||
_cellWidgets.insert ( widget );
|
||||
widget->getSelectorSet().insert ( this );
|
||||
}
|
||||
|
||||
|
||||
void Selector::detachFrom ( CellWidget* widget, bool inDeletion )
|
||||
{
|
||||
if ( !widget )
|
||||
throw Error ( "Can't detach selector : null CellWidget" );
|
||||
|
||||
widget->getSelectorSet().erase ( this );
|
||||
_cellWidgets.erase ( widget );
|
||||
|
||||
if ( !inDeletion && _cellWidgets.empty() ) destroy();
|
||||
}
|
||||
|
||||
|
||||
} // End of Hurricane namespace.
|
|
@ -1,5 +1,58 @@
|
|||
|
||||
// -*- C++ -*-
|
||||
//
|
||||
// This file is part of the Coriolis Project.
|
||||
// Copyright (C) Laboratoire LIP6 - Departement ASIM
|
||||
// Universite Pierre et Marie Curie
|
||||
//
|
||||
// Main contributors :
|
||||
// Christophe Alexandre <Christophe.Alexandre@lip6.fr>
|
||||
// Sophie Belloeil <Sophie.Belloeil@lip6.fr>
|
||||
// Hugo Clément <Hugo.Clement@lip6.fr>
|
||||
// Jean-Paul Chaput <Jean-Paul.Chaput@lip6.fr>
|
||||
// Damien Dupuis <Damien.Dupuis@lip6.fr>
|
||||
// Christian Masson <Christian.Masson@lip6.fr>
|
||||
// Marek Sroka <Marek.Sroka@lip6.fr>
|
||||
//
|
||||
// The Coriolis Project is free software; you can redistribute it
|
||||
// and/or modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// The Coriolis Project is distributed in the hope that it will be
|
||||
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with the Coriolis Project; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
// USA
|
||||
//
|
||||
// License-Tag
|
||||
// Authors-Tag
|
||||
// ===================================================================
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
// x-----------------------------------------------------------------x
|
||||
// | |
|
||||
// | H U R R I C A N E |
|
||||
// | V L S I B a c k e n d D a t a - B a s e |
|
||||
// | |
|
||||
// | Author : Jean-Paul CHAPUT |
|
||||
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
||||
// | =============================================================== |
|
||||
// | C++ Module : "./ViewerPaletteEntry.cpp" |
|
||||
// | *************************************************************** |
|
||||
// | U p d a t e s |
|
||||
// | |
|
||||
// x-----------------------------------------------------------------x
|
||||
|
||||
|
||||
#include <QAction>
|
||||
#include <QMenu>
|
||||
#include <QMenuBar>
|
||||
|
||||
|
||||
# include <QCheckBox>
|
||||
|
|
|
@ -1,20 +1,75 @@
|
|||
|
||||
// -*- C++ -*-
|
||||
//
|
||||
// This file is part of the Coriolis Project.
|
||||
// Copyright (C) Laboratoire LIP6 - Departement ASIM
|
||||
// Universite Pierre et Marie Curie
|
||||
//
|
||||
// Main contributors :
|
||||
// Christophe Alexandre <Christophe.Alexandre@lip6.fr>
|
||||
// Sophie Belloeil <Sophie.Belloeil@lip6.fr>
|
||||
// Hugo Clément <Hugo.Clement@lip6.fr>
|
||||
// Jean-Paul Chaput <Jean-Paul.Chaput@lip6.fr>
|
||||
// Damien Dupuis <Damien.Dupuis@lip6.fr>
|
||||
// Christian Masson <Christian.Masson@lip6.fr>
|
||||
// Marek Sroka <Marek.Sroka@lip6.fr>
|
||||
//
|
||||
// The Coriolis Project is free software; you can redistribute it
|
||||
// and/or modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// The Coriolis Project is distributed in the hope that it will be
|
||||
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with the Coriolis Project; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
// USA
|
||||
//
|
||||
// License-Tag
|
||||
// Authors-Tag
|
||||
// ===================================================================
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
// x-----------------------------------------------------------------x
|
||||
// | |
|
||||
// | H U R R I C A N E |
|
||||
// | V L S I B a c k e n d D a t a - B a s e |
|
||||
// | |
|
||||
// | Author : Jean-Paul CHAPUT |
|
||||
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
||||
// | =============================================================== |
|
||||
// | C++ Header : "./CellViewer.h" |
|
||||
// | *************************************************************** |
|
||||
// | U p d a t e s |
|
||||
// | |
|
||||
// x-----------------------------------------------------------------x
|
||||
|
||||
|
||||
# ifndef __CELL_VIEWER_H__
|
||||
# define __CELL_VIEWER_H__
|
||||
#include <QAction>
|
||||
#include <QMenu>
|
||||
#include <QMenuBar>
|
||||
|
||||
|
||||
#ifndef __CELL_VIEWER_H__
|
||||
#define __CELL_VIEWER_H__
|
||||
|
||||
|
||||
using namespace std;
|
||||
|
||||
# include <QMainWindow>
|
||||
#include <QMainWindow>
|
||||
|
||||
class QEvent;
|
||||
class QKeyEvent;
|
||||
class QAction;
|
||||
class QMenu;
|
||||
|
||||
# include "hurricane/Commons.h"
|
||||
#include "hurricane/Commons.h"
|
||||
#include "hurricane/Occurrence.h"
|
||||
|
||||
|
||||
|
||||
|
@ -33,40 +88,54 @@ namespace Hurricane {
|
|||
Q_OBJECT;
|
||||
|
||||
public:
|
||||
CellViewer ( QWidget* parent=NULL );
|
||||
void setCell ( Cell* cell );
|
||||
CellViewer ( QWidget* parent=NULL );
|
||||
void setCell ( Cell* cell );
|
||||
inline CellWidget* getCellWidget ();
|
||||
void select ( Occurrence& occurence );
|
||||
void unselect ( Occurrence& occurence );
|
||||
void unselectAll ();
|
||||
public slots:
|
||||
void runInspectorOnDataBase ();
|
||||
void runInspectorOnCell ();
|
||||
void runInspectorOnDataBase ();
|
||||
void runInspectorOnCell ();
|
||||
void browseNetlist ();
|
||||
|
||||
protected:
|
||||
QAction* _openAction;
|
||||
QAction* _nextCellAction;
|
||||
QAction* _previousCellAction;
|
||||
QAction* _nextAction;
|
||||
QAction* _saveAction;
|
||||
QAction* _exitAction;
|
||||
QAction* _refreshAction;
|
||||
QAction* _fitToContentsAction;
|
||||
QAction* _runInspectorOnDataBase;
|
||||
QAction* _runInspectorOnCell;
|
||||
QMenu* _fileMenu;
|
||||
QMenu* _viewMenu;
|
||||
QMenu* _toolsMenu;
|
||||
//MapView* _mapView;
|
||||
HPalette* _palette;
|
||||
HMousePosition* _mousePosition;
|
||||
CellWidget* _cellWidget;
|
||||
QAction* _openAction;
|
||||
QAction* _nextCellAction;
|
||||
QAction* _previousCellAction;
|
||||
QAction* _nextAction;
|
||||
QAction* _saveAction;
|
||||
QAction* _exitAction;
|
||||
QAction* _refreshAction;
|
||||
QAction* _fitToContentsAction;
|
||||
QAction* _showSelectionAction;
|
||||
QAction* _runInspectorOnDataBase;
|
||||
QAction* _runInspectorOnCell;
|
||||
QAction* _browseNetlist;
|
||||
QMenu* _fileMenu;
|
||||
QMenu* _viewMenu;
|
||||
QMenu* _toolsMenu;
|
||||
//MapView* _mapView;
|
||||
HPalette* _palette;
|
||||
HMousePosition* _mousePosition;
|
||||
CellWidget* _cellWidget;
|
||||
|
||||
protected:
|
||||
void createActions ();
|
||||
void createMenus ();
|
||||
void createLayout ();
|
||||
void runInspector ( Record* record );
|
||||
void createActions ();
|
||||
void createMenus ();
|
||||
void createLayout ();
|
||||
void runInspector ( Record* record );
|
||||
};
|
||||
|
||||
|
||||
// Inline Functions.
|
||||
inline CellWidget* CellViewer::getCellWidget ()
|
||||
{ return _cellWidget; }
|
||||
|
||||
|
||||
|
||||
|
||||
} // End of Hurricane namespace.
|
||||
|
||||
|
||||
# endif
|
||||
#endif
|
||||
|
|
|
@ -1,5 +1,58 @@
|
|||
|
||||
// -*- C++ -*-
|
||||
//
|
||||
// This file is part of the Coriolis Project.
|
||||
// Copyright (C) Laboratoire LIP6 - Departement ASIM
|
||||
// Universite Pierre et Marie Curie
|
||||
//
|
||||
// Main contributors :
|
||||
// Christophe Alexandre <Christophe.Alexandre@lip6.fr>
|
||||
// Sophie Belloeil <Sophie.Belloeil@lip6.fr>
|
||||
// Hugo Clément <Hugo.Clement@lip6.fr>
|
||||
// Jean-Paul Chaput <Jean-Paul.Chaput@lip6.fr>
|
||||
// Damien Dupuis <Damien.Dupuis@lip6.fr>
|
||||
// Christian Masson <Christian.Masson@lip6.fr>
|
||||
// Marek Sroka <Marek.Sroka@lip6.fr>
|
||||
//
|
||||
// The Coriolis Project is free software; you can redistribute it
|
||||
// and/or modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// The Coriolis Project is distributed in the hope that it will be
|
||||
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with the Coriolis Project; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
// USA
|
||||
//
|
||||
// License-Tag
|
||||
// Authors-Tag
|
||||
// ===================================================================
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
// x-----------------------------------------------------------------x
|
||||
// | |
|
||||
// | H U R R I C A N E |
|
||||
// | V L S I B a c k e n d D a t a - B a s e |
|
||||
// | |
|
||||
// | Author : Jean-Paul CHAPUT |
|
||||
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
||||
// | =============================================================== |
|
||||
// | C++ Header : "./CellWidget.h" |
|
||||
// | *************************************************************** |
|
||||
// | U p d a t e s |
|
||||
// | |
|
||||
// x-----------------------------------------------------------------x
|
||||
|
||||
|
||||
#include <QAction>
|
||||
#include <QMenu>
|
||||
#include <QMenuBar>
|
||||
|
||||
|
||||
# ifndef __CELL_WIDGET_H__
|
||||
|
@ -28,6 +81,8 @@ class QAction;
|
|||
# include "hurricane/Transformation.h"
|
||||
|
||||
# include "hurricane/viewer/DisplayStyle.h"
|
||||
# include "hurricane/viewer/CellWidgets.h"
|
||||
# include "hurricane/viewer/Selector.h"
|
||||
|
||||
|
||||
|
||||
|
@ -37,6 +92,7 @@ namespace Hurricane {
|
|||
class Technology;
|
||||
class BasicLayer;
|
||||
class Go;
|
||||
class Net;
|
||||
class Cell;
|
||||
class Instance;
|
||||
class Slice;
|
||||
|
@ -44,6 +100,7 @@ namespace Hurricane {
|
|||
class Contact;
|
||||
class Pad;
|
||||
|
||||
class Selector;
|
||||
class HPaletteEntry;
|
||||
class HPalette;
|
||||
//class MapView;
|
||||
|
@ -52,6 +109,9 @@ namespace Hurricane {
|
|||
class CellWidget : public QWidget {
|
||||
Q_OBJECT;
|
||||
|
||||
private:
|
||||
class DrawingPlanes;
|
||||
|
||||
public:
|
||||
// Constructor & Destructor.
|
||||
CellWidget ( QWidget* parent=NULL );
|
||||
|
@ -64,6 +124,12 @@ namespace Hurricane {
|
|||
void bindToPalette ( HPalette* palette );
|
||||
void detachFromPalette ();
|
||||
inline bool showBoundaries () const;
|
||||
inline set<Selector*>& getSelectorSet ();
|
||||
inline bool showSelection () const;
|
||||
void select ( const Net* net, bool delayRedraw=false );
|
||||
void select ( Occurrence& occurence );
|
||||
void unselect ( Occurrence& occurence );
|
||||
void unselectAll ( bool delayRedraw=true );
|
||||
// Painter control & Hurricane objects drawing primitives.
|
||||
void drawBoundaries ( const Cell* , const Box&, const Transformation& );
|
||||
void drawBoundaries ( const Instance*, const Box&, const Transformation& );
|
||||
|
@ -112,11 +178,13 @@ namespace Hurricane {
|
|||
void mousePositionChanged ( const Point& position );
|
||||
public slots:
|
||||
// Qt QWidget Slots Overload & CellWidget Specifics.
|
||||
inline QPainter& getScreenPainter ();
|
||||
void redraw ( QRect redrawArea );
|
||||
inline DrawingPlanes& getDrawingPlanes ();
|
||||
inline QPoint& getOffsetVA ();
|
||||
void setShowSelection ( bool state );
|
||||
inline void redraw ();
|
||||
inline void copyToScreen ( int sx, int sy, int h, int w );
|
||||
inline void copyToScreen ();
|
||||
void redraw ( QRect redrawArea );
|
||||
inline void redrawSelection ();
|
||||
void redrawSelection ( QRect redrawArea );
|
||||
void goLeft ( int dx = 0 );
|
||||
void goRight ( int dx = 0 );
|
||||
void goUp ( int dy = 0 );
|
||||
|
@ -144,115 +212,235 @@ namespace Hurricane {
|
|||
bool _restore;
|
||||
};
|
||||
|
||||
private:
|
||||
class DrawingPlanes {
|
||||
public:
|
||||
DrawingPlanes ( const QSize& size, CellWidget* cw );
|
||||
~DrawingPlanes ();
|
||||
inline int width () const;
|
||||
inline int height () const;
|
||||
inline QSize size () const;
|
||||
inline void select ( size_t i );
|
||||
inline QPixmap* plane ();
|
||||
inline QPixmap* plane ( size_t i );
|
||||
inline QPainter& painter ();
|
||||
inline QPainter& painter ( size_t i );
|
||||
inline void painterBegin ();
|
||||
inline void painterBegin ( size_t i );
|
||||
inline void paintersBegin ();
|
||||
inline void painterEnd ();
|
||||
inline void painterEnd ( size_t i );
|
||||
inline void paintersEnd ();
|
||||
void resize ( const QSize& size );
|
||||
void shiftLeft ( int dx );
|
||||
void shiftRight ( int dx );
|
||||
void shiftUp ( int dy );
|
||||
void shiftDown ( int dy );
|
||||
inline void copyToSelect ();
|
||||
void copyToSelect ( int sx, int sy, int h, int w );
|
||||
inline void copyToScreen ();
|
||||
void copyToScreen ( int sx, int sy, int h, int w );
|
||||
private:
|
||||
CellWidget* _cellWidget;
|
||||
QPixmap* _planes[2];
|
||||
QPainter _painters[3];
|
||||
size_t _workingPlane;
|
||||
private:
|
||||
DrawingPlanes ( const DrawingPlanes& );
|
||||
DrawingPlanes& operator= ( const DrawingPlanes& );
|
||||
};
|
||||
|
||||
protected:
|
||||
// Internal: Attributes.
|
||||
static const int _stripWidth;
|
||||
vector<Qt::CursorShape> _cursors;
|
||||
// MapView* _mapView;
|
||||
Technology* _technology;
|
||||
HPalette* _palette;
|
||||
HPalette* _palette;
|
||||
Box _displayArea;
|
||||
Box _visibleArea;
|
||||
float _scale;
|
||||
QPoint _offsetVA;
|
||||
QPixmap _drawingBuffer;
|
||||
QPainter _drawingPainter;
|
||||
QPainter _screenPainter;
|
||||
DrawingPlanes _drawingPlanes;
|
||||
QPoint _lastMousePosition;
|
||||
Spot _spot;
|
||||
Cell* _cell;
|
||||
bool _mouseGo;
|
||||
bool _showBoundaries;
|
||||
bool _showSelection;
|
||||
bool _selectionHasChanged;
|
||||
set<Selector*> _selectors;
|
||||
size_t _redrawRectCount;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
inline QPainter& CellWidget::getScreenPainter ()
|
||||
{ return _screenPainter; }
|
||||
inline int CellWidget::DrawingPlanes::width () const
|
||||
{ return _planes[0]->width(); }
|
||||
|
||||
|
||||
inline void CellWidget::copyToScreen ( int sx, int sy, int w, int h )
|
||||
{ _screenPainter.drawPixmap ( sx, sy, _drawingBuffer, _offsetVA.rx()+sx, _offsetVA.ry()+sy, w, h ); }
|
||||
inline int CellWidget::DrawingPlanes::height () const
|
||||
{ return _planes[0]->height(); }
|
||||
|
||||
|
||||
inline void CellWidget::copyToScreen ()
|
||||
{ copyToScreen ( 0, 0, width(), height() ); }
|
||||
inline QSize CellWidget::DrawingPlanes::size () const
|
||||
{ return _planes[0]->size(); }
|
||||
|
||||
|
||||
inline void CellWidget::redraw ()
|
||||
{ redraw ( QRect(QPoint(0,0),_drawingBuffer.size()) ); }
|
||||
inline void CellWidget::DrawingPlanes::select ( size_t i )
|
||||
{ _workingPlane = i; }
|
||||
|
||||
|
||||
inline int CellWidget::dbuToDisplayX ( DbU::Unit x ) const
|
||||
{ return (int)rint ( (float)( x - _displayArea.getXMin() ) * _scale ); }
|
||||
inline QPixmap* CellWidget::DrawingPlanes::plane ()
|
||||
{ return plane(_workingPlane); }
|
||||
|
||||
|
||||
inline int CellWidget::dbuToDisplayY ( DbU::Unit y ) const
|
||||
{ return (int)rint ( (float)( _displayArea.getYMax() - y ) * _scale ); }
|
||||
inline QPixmap* CellWidget::DrawingPlanes::plane ( size_t i )
|
||||
{ return _planes[i]; }
|
||||
|
||||
|
||||
inline int CellWidget::dbuToDisplayLength ( DbU::Unit length ) const
|
||||
{ return (int)rint ( (float)length * _scale ); }
|
||||
inline QPainter& CellWidget::DrawingPlanes::painter ()
|
||||
{ return painter(_workingPlane); }
|
||||
|
||||
|
||||
inline int CellWidget::dbuToScreenX ( DbU::Unit x ) const
|
||||
{ return (int)rint ( (float)( x - _displayArea.getXMin() ) * _scale ) - _offsetVA.x(); }
|
||||
inline QPainter& CellWidget::DrawingPlanes::painter ( size_t i )
|
||||
{ return _painters[i]; }
|
||||
|
||||
|
||||
inline int CellWidget::dbuToScreenY ( DbU::Unit y ) const
|
||||
{ return (int)rint ( (float)( _displayArea.getYMax() - y ) * _scale ) - _offsetVA.y(); }
|
||||
inline void CellWidget::DrawingPlanes::painterBegin ()
|
||||
{ painterBegin ( _workingPlane ); }
|
||||
|
||||
|
||||
inline QPoint CellWidget::dbuToScreenPoint ( const Point& point ) const
|
||||
{ return QPoint ( dbuToScreenX(point.getX()), dbuToScreenY(point.getY()) ); }
|
||||
inline void CellWidget::DrawingPlanes::painterBegin ( size_t i )
|
||||
{
|
||||
if ( i<2 ) _painters[i].begin ( _planes[i] );
|
||||
else _painters[i].begin ( _cellWidget );
|
||||
}
|
||||
|
||||
|
||||
inline DbU::Unit CellWidget::displayToDbuX ( int x ) const
|
||||
{ return (DbU::Unit)(x/_scale) + _displayArea.getXMin(); }
|
||||
inline void CellWidget::DrawingPlanes::paintersBegin ()
|
||||
{
|
||||
painterBegin ( 0 );
|
||||
painterBegin ( 1 );
|
||||
}
|
||||
|
||||
|
||||
inline DbU::Unit CellWidget::displayToDbuY ( int y ) const
|
||||
{ return _displayArea.getYMax() - (DbU::Unit)(y/_scale); }
|
||||
inline void CellWidget::DrawingPlanes::painterEnd ()
|
||||
{ painterEnd ( _workingPlane ); }
|
||||
|
||||
|
||||
inline DbU::Unit CellWidget::displayToDbuLength ( int length ) const
|
||||
{ return (int)( (float)length / _scale ); }
|
||||
inline void CellWidget::DrawingPlanes::painterEnd ( size_t i )
|
||||
{ _painters[i].end (); }
|
||||
|
||||
|
||||
inline Box CellWidget::displayToDbuBox ( const QRect& rect ) const
|
||||
{
|
||||
return Box ( displayToDbuX(rect.x())
|
||||
, displayToDbuY(rect.y())
|
||||
, displayToDbuX(rect.x()+rect.width ())
|
||||
, displayToDbuY(rect.y()+rect.height())
|
||||
);
|
||||
}
|
||||
inline void CellWidget::DrawingPlanes::paintersEnd ()
|
||||
{
|
||||
painterEnd ( 0 );
|
||||
painterEnd ( 1 );
|
||||
}
|
||||
|
||||
|
||||
inline DbU::Unit CellWidget::screenToDbuX ( int x ) const
|
||||
{ return displayToDbuX(x+_offsetVA.x()); }
|
||||
inline void CellWidget::DrawingPlanes::copyToSelect ()
|
||||
{ copyToSelect ( 0, 0, width(), height() ); }
|
||||
|
||||
|
||||
inline DbU::Unit CellWidget::screenToDbuY ( int y ) const
|
||||
{ return displayToDbuY(y+_offsetVA.y()); }
|
||||
inline void CellWidget::DrawingPlanes::copyToScreen ()
|
||||
{ copyToScreen ( 0, 0, width(), height() ); }
|
||||
|
||||
|
||||
inline Point CellWidget::screenToDbuPoint ( const QPoint& point ) const
|
||||
{ return Point ( screenToDbuX(point.x()), screenToDbuY(point.y()) ); }
|
||||
inline CellWidget::DrawingPlanes& CellWidget::getDrawingPlanes ()
|
||||
{ return _drawingPlanes; }
|
||||
|
||||
|
||||
inline Cell* CellWidget::getCell () const
|
||||
{ return _cell; }
|
||||
inline set<Selector*>& CellWidget::getSelectorSet ()
|
||||
{ return _selectors; }
|
||||
|
||||
|
||||
inline HPalette* CellWidget::getPalette ()
|
||||
{ return _palette; }
|
||||
inline QPoint& CellWidget::getOffsetVA ()
|
||||
{ return _offsetVA; }
|
||||
|
||||
|
||||
inline bool CellWidget::showBoundaries () const
|
||||
{ return _showBoundaries; }
|
||||
inline void CellWidget::redraw ()
|
||||
{ redraw ( QRect(QPoint(0,0),_drawingPlanes.size()) ); }
|
||||
|
||||
|
||||
inline void CellWidget::redrawSelection ()
|
||||
{ redrawSelection ( QRect(QPoint(0,0),_drawingPlanes.size()) ); }
|
||||
|
||||
|
||||
inline int CellWidget::dbuToDisplayX ( DbU::Unit x ) const
|
||||
{ return (int)rint ( (float)( x - _displayArea.getXMin() ) * _scale ); }
|
||||
|
||||
|
||||
inline int CellWidget::dbuToDisplayY ( DbU::Unit y ) const
|
||||
{ return (int)rint ( (float)( _displayArea.getYMax() - y ) * _scale ); }
|
||||
|
||||
|
||||
inline int CellWidget::dbuToDisplayLength ( DbU::Unit length ) const
|
||||
{ return (int)rint ( (float)length * _scale ); }
|
||||
|
||||
|
||||
inline int CellWidget::dbuToScreenX ( DbU::Unit x ) const
|
||||
{ return (int)rint ( (float)( x - _displayArea.getXMin() ) * _scale ) - _offsetVA.x(); }
|
||||
|
||||
|
||||
inline int CellWidget::dbuToScreenY ( DbU::Unit y ) const
|
||||
{ return (int)rint ( (float)( _displayArea.getYMax() - y ) * _scale ) - _offsetVA.y(); }
|
||||
|
||||
|
||||
inline QPoint CellWidget::dbuToScreenPoint ( const Point& point ) const
|
||||
{ return QPoint ( dbuToScreenX(point.getX()), dbuToScreenY(point.getY()) ); }
|
||||
|
||||
|
||||
inline DbU::Unit CellWidget::displayToDbuX ( int x ) const
|
||||
{ return (DbU::Unit)(x/_scale) + _displayArea.getXMin(); }
|
||||
|
||||
|
||||
inline DbU::Unit CellWidget::displayToDbuY ( int y ) const
|
||||
{ return _displayArea.getYMax() - (DbU::Unit)(y/_scale); }
|
||||
|
||||
|
||||
inline DbU::Unit CellWidget::displayToDbuLength ( int length ) const
|
||||
{ return (int)( (float)length / _scale ); }
|
||||
|
||||
|
||||
inline Box CellWidget::displayToDbuBox ( const QRect& rect ) const
|
||||
{
|
||||
return Box ( displayToDbuX(rect.x())
|
||||
, displayToDbuY(rect.y())
|
||||
, displayToDbuX(rect.x()+rect.width ())
|
||||
, displayToDbuY(rect.y()+rect.height())
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
inline DbU::Unit CellWidget::screenToDbuX ( int x ) const
|
||||
{ return displayToDbuX(x+_offsetVA.x()); }
|
||||
|
||||
|
||||
inline DbU::Unit CellWidget::screenToDbuY ( int y ) const
|
||||
{ return displayToDbuY(y+_offsetVA.y()); }
|
||||
|
||||
|
||||
inline Point CellWidget::screenToDbuPoint ( const QPoint& point ) const
|
||||
{ return Point ( screenToDbuX(point.x()), screenToDbuY(point.y()) ); }
|
||||
|
||||
|
||||
inline Cell* CellWidget::getCell () const
|
||||
{ return _cell; }
|
||||
|
||||
|
||||
inline HPalette* CellWidget::getPalette ()
|
||||
{ return _palette; }
|
||||
|
||||
|
||||
inline bool CellWidget::showBoundaries () const
|
||||
{ return _showBoundaries; }
|
||||
|
||||
|
||||
inline bool CellWidget::showSelection () const
|
||||
{ return _showSelection; }
|
||||
|
||||
|
||||
} // End of Hurricane namespace.
|
||||
|
|
|
@ -0,0 +1,64 @@
|
|||
|
||||
|
||||
// -*- C++ -*-
|
||||
//
|
||||
// This file is part of the Coriolis Project.
|
||||
// Copyright (C) Laboratoire LIP6 - Departement ASIM
|
||||
// Universite Pierre et Marie Curie
|
||||
//
|
||||
// Main contributors :
|
||||
// Christophe Alexandre <Christophe.Alexandre@lip6.fr>
|
||||
// Sophie Belloeil <Sophie.Belloeil@lip6.fr>
|
||||
// Hugo Clément <Hugo.Clement@lip6.fr>
|
||||
// Jean-Paul Chaput <Jean-Paul.Chaput@lip6.fr>
|
||||
// Damien Dupuis <Damien.Dupuis@lip6.fr>
|
||||
// Christian Masson <Christian.Masson@lip6.fr>
|
||||
// Marek Sroka <Marek.Sroka@lip6.fr>
|
||||
//
|
||||
// The Coriolis Project is free software; you can redistribute it
|
||||
// and/or modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// The Coriolis Project is distributed in the hope that it will be
|
||||
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with the Coriolis Project; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
// USA
|
||||
//
|
||||
// License-Tag
|
||||
// Authors-Tag
|
||||
// ===================================================================
|
||||
|
||||
|
||||
# ifndef __CELL_WIDGETS_H__
|
||||
# define __CELL_WIDGETS_H__
|
||||
|
||||
|
||||
# include "hurricane/Collection.h"
|
||||
|
||||
|
||||
namespace Hurricane {
|
||||
|
||||
|
||||
class CellWidget;
|
||||
|
||||
|
||||
typedef GenericCollection<CellWidget*> CellWidgets;
|
||||
typedef GenericLocator<CellWidget*> CellWidgetLocator;
|
||||
typedef GenericFilter<CellWidget*> CellWidgetFilter;
|
||||
|
||||
# define for_each_cell_widget(cellWidget, cellWidgets) { \
|
||||
CellWidgetLocator _locator = cellWidgets.getLocator(); \
|
||||
while ( _locator.isValid() ) { \
|
||||
CellWidget* cellWidget = _locator.getElement(); \
|
||||
_locator.progress();
|
||||
|
||||
}
|
||||
|
||||
|
||||
# endif // __CELL_WIDGETS__
|
|
@ -1,5 +1,58 @@
|
|||
|
||||
// -*- C++ -*-
|
||||
//
|
||||
// This file is part of the Coriolis Project.
|
||||
// Copyright (C) Laboratoire LIP6 - Departement ASIM
|
||||
// Universite Pierre et Marie Curie
|
||||
//
|
||||
// Main contributors :
|
||||
// Christophe Alexandre <Christophe.Alexandre@lip6.fr>
|
||||
// Sophie Belloeil <Sophie.Belloeil@lip6.fr>
|
||||
// Hugo Clément <Hugo.Clement@lip6.fr>
|
||||
// Jean-Paul Chaput <Jean-Paul.Chaput@lip6.fr>
|
||||
// Damien Dupuis <Damien.Dupuis@lip6.fr>
|
||||
// Christian Masson <Christian.Masson@lip6.fr>
|
||||
// Marek Sroka <Marek.Sroka@lip6.fr>
|
||||
//
|
||||
// The Coriolis Project is free software; you can redistribute it
|
||||
// and/or modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// The Coriolis Project is distributed in the hope that it will be
|
||||
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with the Coriolis Project; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
// USA
|
||||
//
|
||||
// License-Tag
|
||||
// Authors-Tag
|
||||
// ===================================================================
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
// x-----------------------------------------------------------------x
|
||||
// | |
|
||||
// | H U R R I C A N E |
|
||||
// | V L S I B a c k e n d D a t a - B a s e |
|
||||
// | |
|
||||
// | Author : Jean-Paul CHAPUT |
|
||||
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
||||
// | =============================================================== |
|
||||
// | C++ Header : "./DisplayStyle.h" |
|
||||
// | *************************************************************** |
|
||||
// | U p d a t e s |
|
||||
// | |
|
||||
// x-----------------------------------------------------------------x
|
||||
|
||||
|
||||
#include <QAction>
|
||||
#include <QMenu>
|
||||
#include <QMenuBar>
|
||||
|
||||
|
||||
# ifndef __DISPLAYSTYLE_H__
|
||||
|
@ -42,9 +95,9 @@ namespace Hurricane {
|
|||
// Accessors.
|
||||
inline const Name& getName () const;
|
||||
inline const string& getPattern () const;
|
||||
inline const QColor& getColor () const;
|
||||
inline const QPen& getPen () const;
|
||||
inline const QBrush& getBrush () const;
|
||||
QColor getColor ( int darkening ) const;
|
||||
QPen getPen ( int darkening ) const;
|
||||
QBrush getBrush ( int darkening ) const;
|
||||
inline float getThreshold () const;
|
||||
|
||||
protected:
|
||||
|
@ -140,9 +193,9 @@ namespace Hurricane {
|
|||
const Name& getName () const;
|
||||
const Name& getGroup ( const Name& key ) const;
|
||||
const string& getPattern ( const Name& key ) const;
|
||||
const QColor& getColor ( const Name& key ) const;
|
||||
const QPen& getPen ( const Name& key ) const;
|
||||
const QBrush& getBrush ( const Name& key ) const;
|
||||
QColor getColor ( const Name& key, int darkening ) const;
|
||||
QPen getPen ( const Name& key, int darkening ) const;
|
||||
QBrush getBrush ( const Name& key, int darkening ) const;
|
||||
float getThreshold ( const Name& key ) const;
|
||||
inline vector<DrawingGroup*>& getDrawingGroups ();
|
||||
DrawingStyle* find ( const Name& key ) const;
|
||||
|
@ -180,9 +233,6 @@ namespace Hurricane {
|
|||
// Functions.
|
||||
inline const Name& DrawingStyle::getName () const { return _name; }
|
||||
inline const string& DrawingStyle::getPattern () const { return _pattern; }
|
||||
inline const QColor& DrawingStyle::getColor () const { return _color; }
|
||||
inline const QPen& DrawingStyle::getPen () const { return _pen; }
|
||||
inline const QBrush& DrawingStyle::getBrush () const { return _brush; }
|
||||
inline float DrawingStyle::getThreshold () const { return _threshold; }
|
||||
|
||||
inline const Name& DrawingGroup::getName () const { return _name; }
|
||||
|
|
|
@ -1,5 +1,58 @@
|
|||
|
||||
// -*- C++ -*-
|
||||
//
|
||||
// This file is part of the Coriolis Project.
|
||||
// Copyright (C) Laboratoire LIP6 - Departement ASIM
|
||||
// Universite Pierre et Marie Curie
|
||||
//
|
||||
// Main contributors :
|
||||
// Christophe Alexandre <Christophe.Alexandre@lip6.fr>
|
||||
// Sophie Belloeil <Sophie.Belloeil@lip6.fr>
|
||||
// Hugo Clément <Hugo.Clement@lip6.fr>
|
||||
// Jean-Paul Chaput <Jean-Paul.Chaput@lip6.fr>
|
||||
// Damien Dupuis <Damien.Dupuis@lip6.fr>
|
||||
// Christian Masson <Christian.Masson@lip6.fr>
|
||||
// Marek Sroka <Marek.Sroka@lip6.fr>
|
||||
//
|
||||
// The Coriolis Project is free software; you can redistribute it
|
||||
// and/or modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// The Coriolis Project is distributed in the hope that it will be
|
||||
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with the Coriolis Project; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
// USA
|
||||
//
|
||||
// License-Tag
|
||||
// Authors-Tag
|
||||
// ===================================================================
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
// x-----------------------------------------------------------------x
|
||||
// | |
|
||||
// | H U R R I C A N E |
|
||||
// | V L S I B a c k e n d D a t a - B a s e |
|
||||
// | |
|
||||
// | Author : Jean-Paul CHAPUT |
|
||||
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
||||
// | =============================================================== |
|
||||
// | C++ Header : "./DynamicLabel.h" |
|
||||
// | *************************************************************** |
|
||||
// | U p d a t e s |
|
||||
// | |
|
||||
// x-----------------------------------------------------------------x
|
||||
|
||||
|
||||
#include <QAction>
|
||||
#include <QMenu>
|
||||
#include <QMenuBar>
|
||||
|
||||
|
||||
# ifndef __DYNAMIC_LABEL_H__
|
||||
|
|
|
@ -1,5 +1,58 @@
|
|||
|
||||
// -*- C++ -*-
|
||||
//
|
||||
// This file is part of the Coriolis Project.
|
||||
// Copyright (C) Laboratoire LIP6 - Departement ASIM
|
||||
// Universite Pierre et Marie Curie
|
||||
//
|
||||
// Main contributors :
|
||||
// Christophe Alexandre <Christophe.Alexandre@lip6.fr>
|
||||
// Sophie Belloeil <Sophie.Belloeil@lip6.fr>
|
||||
// Hugo Clément <Hugo.Clement@lip6.fr>
|
||||
// Jean-Paul Chaput <Jean-Paul.Chaput@lip6.fr>
|
||||
// Damien Dupuis <Damien.Dupuis@lip6.fr>
|
||||
// Christian Masson <Christian.Masson@lip6.fr>
|
||||
// Marek Sroka <Marek.Sroka@lip6.fr>
|
||||
//
|
||||
// The Coriolis Project is free software; you can redistribute it
|
||||
// and/or modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// The Coriolis Project is distributed in the hope that it will be
|
||||
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with the Coriolis Project; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
// USA
|
||||
//
|
||||
// License-Tag
|
||||
// Authors-Tag
|
||||
// ===================================================================
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
// x-----------------------------------------------------------------x
|
||||
// | |
|
||||
// | H U R R I C A N E |
|
||||
// | V L S I B a c k e n d D a t a - B a s e |
|
||||
// | |
|
||||
// | Author : Jean-Paul CHAPUT |
|
||||
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
||||
// | =============================================================== |
|
||||
// | C++ Header : "./Graphics.h" |
|
||||
// | *************************************************************** |
|
||||
// | U p d a t e s |
|
||||
// | |
|
||||
// x-----------------------------------------------------------------x
|
||||
|
||||
|
||||
#include <QAction>
|
||||
#include <QMenu>
|
||||
#include <QMenuBar>
|
||||
|
||||
|
||||
# ifndef __GRAPHICS_H__
|
||||
|
@ -32,9 +85,9 @@ namespace Hurricane {
|
|||
static Graphics* getGraphics ();
|
||||
static const QFont getFixedFont ( int weight=-1, bool italic=false, bool underline=false );
|
||||
static const Name& getGroup ( const Name& key );
|
||||
static const QColor& getColor ( const Name& key );
|
||||
static const QPen& getPen ( const Name& key );
|
||||
static const QBrush& getBrush ( const Name& key );
|
||||
static QColor getColor ( const Name& key, int darkening=100 );
|
||||
static QPen getPen ( const Name& key, int darkening=100 );
|
||||
static QBrush getBrush ( const Name& key, int darkening=100 );
|
||||
static const string& getPattern ( const Name& key );
|
||||
static float getThreshold ( const Name& key );
|
||||
|
||||
|
@ -63,34 +116,34 @@ namespace Hurricane {
|
|||
DisplayStyle* _getStyle ( const Name& key );
|
||||
DisplayStyle* _getStyle () const;
|
||||
inline const Name& _getGroup ( const Name& key ) const;
|
||||
inline const QColor& _getColor ( const Name& key ) const;
|
||||
inline const QPen& _getPen ( const Name& key ) const;
|
||||
inline const QBrush& _getBrush ( const Name& key ) const;
|
||||
inline QColor _getColor ( const Name& key, int darkening ) const;
|
||||
inline QPen _getPen ( const Name& key, int darkening ) const;
|
||||
inline QBrush _getBrush ( const Name& key, int darkening ) const;
|
||||
inline const string& _getPattern ( const Name& key ) const;
|
||||
inline float _getThreshold ( const Name& key ) const;
|
||||
|
||||
};
|
||||
|
||||
|
||||
inline const Name& Graphics::_getGroup ( const Name& name ) const
|
||||
inline const Name& Graphics::_getGroup ( const Name& name ) const
|
||||
{ return _active->getGroup(name); }
|
||||
|
||||
inline const QColor& Graphics::_getColor ( const Name& name ) const
|
||||
{ return _active->getColor(name); }
|
||||
inline QColor Graphics::_getColor ( const Name& name, int darkening ) const
|
||||
{ return _active->getColor(name,darkening); }
|
||||
|
||||
inline const QPen& Graphics::_getPen ( const Name& name ) const
|
||||
{ return _active->getPen(name); }
|
||||
inline QPen Graphics::_getPen ( const Name& name, int darkening ) const
|
||||
{ return _active->getPen(name,darkening); }
|
||||
|
||||
inline const QBrush& Graphics::_getBrush ( const Name& name ) const
|
||||
{ return _active->getBrush(name); }
|
||||
inline QBrush Graphics::_getBrush ( const Name& name, int darkening ) const
|
||||
{ return _active->getBrush(name,darkening); }
|
||||
|
||||
inline const string& Graphics::_getPattern ( const Name& name ) const
|
||||
inline const string& Graphics::_getPattern ( const Name& name ) const
|
||||
{ return _active->getPattern(name); }
|
||||
|
||||
inline float Graphics::_getThreshold ( const Name& name ) const
|
||||
inline float Graphics::_getThreshold ( const Name& name ) const
|
||||
{ return _active->getThreshold(name); }
|
||||
|
||||
inline DisplayStyle* Graphics::_getStyle () const
|
||||
inline DisplayStyle* Graphics::_getStyle () const
|
||||
{ return _active; }
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,58 @@
|
|||
|
||||
// -*- C++ -*-
|
||||
//
|
||||
// This file is part of the Coriolis Project.
|
||||
// Copyright (C) Laboratoire LIP6 - Departement ASIM
|
||||
// Universite Pierre et Marie Curie
|
||||
//
|
||||
// Main contributors :
|
||||
// Christophe Alexandre <Christophe.Alexandre@lip6.fr>
|
||||
// Sophie Belloeil <Sophie.Belloeil@lip6.fr>
|
||||
// Hugo Clément <Hugo.Clement@lip6.fr>
|
||||
// Jean-Paul Chaput <Jean-Paul.Chaput@lip6.fr>
|
||||
// Damien Dupuis <Damien.Dupuis@lip6.fr>
|
||||
// Christian Masson <Christian.Masson@lip6.fr>
|
||||
// Marek Sroka <Marek.Sroka@lip6.fr>
|
||||
//
|
||||
// The Coriolis Project is free software; you can redistribute it
|
||||
// and/or modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// The Coriolis Project is distributed in the hope that it will be
|
||||
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with the Coriolis Project; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
// USA
|
||||
//
|
||||
// License-Tag
|
||||
// Authors-Tag
|
||||
// ===================================================================
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
// x-----------------------------------------------------------------x
|
||||
// | |
|
||||
// | H U R R I C A N E |
|
||||
// | V L S I B a c k e n d D a t a - B a s e |
|
||||
// | |
|
||||
// | Author : Jean-Paul CHAPUT |
|
||||
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
||||
// | =============================================================== |
|
||||
// | C++ Header : "./GroupPaletteEntry.h" |
|
||||
// | *************************************************************** |
|
||||
// | U p d a t e s |
|
||||
// | |
|
||||
// x-----------------------------------------------------------------x
|
||||
|
||||
|
||||
#include <QAction>
|
||||
#include <QMenu>
|
||||
#include <QMenuBar>
|
||||
|
||||
|
||||
# ifndef __GROUP_HPALETTE_ENTRY_H__
|
||||
|
|
|
@ -1,4 +1,58 @@
|
|||
|
||||
// -*- C++ -*-
|
||||
//
|
||||
// This file is part of the Coriolis Project.
|
||||
// Copyright (C) Laboratoire LIP6 - Departement ASIM
|
||||
// Universite Pierre et Marie Curie
|
||||
//
|
||||
// Main contributors :
|
||||
// Christophe Alexandre <Christophe.Alexandre@lip6.fr>
|
||||
// Sophie Belloeil <Sophie.Belloeil@lip6.fr>
|
||||
// Hugo Clément <Hugo.Clement@lip6.fr>
|
||||
// Jean-Paul Chaput <Jean-Paul.Chaput@lip6.fr>
|
||||
// Damien Dupuis <Damien.Dupuis@lip6.fr>
|
||||
// Christian Masson <Christian.Masson@lip6.fr>
|
||||
// Marek Sroka <Marek.Sroka@lip6.fr>
|
||||
//
|
||||
// The Coriolis Project is free software; you can redistribute it
|
||||
// and/or modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// The Coriolis Project is distributed in the hope that it will be
|
||||
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with the Coriolis Project; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
// USA
|
||||
//
|
||||
// License-Tag
|
||||
// Authors-Tag
|
||||
// ===================================================================
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
// x-----------------------------------------------------------------x
|
||||
// | |
|
||||
// | H U R R I C A N E |
|
||||
// | V L S I B a c k e n d D a t a - B a s e |
|
||||
// | |
|
||||
// | Author : Jean-Paul CHAPUT |
|
||||
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
||||
// | =============================================================== |
|
||||
// | C++ Header : "./HInspectorWidget.h" |
|
||||
// | *************************************************************** |
|
||||
// | U p d a t e s |
|
||||
// | |
|
||||
// x-----------------------------------------------------------------x
|
||||
|
||||
|
||||
#include <QAction>
|
||||
#include <QMenu>
|
||||
#include <QMenuBar>
|
||||
#ifndef __HINSPECTOR_WIDGET_H__
|
||||
#define __HINSPECTOR_WIDGET_H__
|
||||
|
||||
|
|
|
@ -1,5 +1,58 @@
|
|||
|
||||
// -*- C++ -*-
|
||||
//
|
||||
// This file is part of the Coriolis Project.
|
||||
// Copyright (C) Laboratoire LIP6 - Departement ASIM
|
||||
// Universite Pierre et Marie Curie
|
||||
//
|
||||
// Main contributors :
|
||||
// Christophe Alexandre <Christophe.Alexandre@lip6.fr>
|
||||
// Sophie Belloeil <Sophie.Belloeil@lip6.fr>
|
||||
// Hugo Clément <Hugo.Clement@lip6.fr>
|
||||
// Jean-Paul Chaput <Jean-Paul.Chaput@lip6.fr>
|
||||
// Damien Dupuis <Damien.Dupuis@lip6.fr>
|
||||
// Christian Masson <Christian.Masson@lip6.fr>
|
||||
// Marek Sroka <Marek.Sroka@lip6.fr>
|
||||
//
|
||||
// The Coriolis Project is free software; you can redistribute it
|
||||
// and/or modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// The Coriolis Project is distributed in the hope that it will be
|
||||
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with the Coriolis Project; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
// USA
|
||||
//
|
||||
// License-Tag
|
||||
// Authors-Tag
|
||||
// ===================================================================
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
// x-----------------------------------------------------------------x
|
||||
// | |
|
||||
// | H U R R I C A N E |
|
||||
// | V L S I B a c k e n d D a t a - B a s e |
|
||||
// | |
|
||||
// | Author : Jean-Paul CHAPUT |
|
||||
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
||||
// | =============================================================== |
|
||||
// | C++ Header : "./HMousePosition.h" |
|
||||
// | *************************************************************** |
|
||||
// | U p d a t e s |
|
||||
// | |
|
||||
// x-----------------------------------------------------------------x
|
||||
|
||||
|
||||
#include <QAction>
|
||||
#include <QMenu>
|
||||
#include <QMenuBar>
|
||||
|
||||
|
||||
# ifndef __HMOUSE_POSITION_H__
|
||||
|
|
|
@ -0,0 +1,137 @@
|
|||
|
||||
// -*- C++ -*-
|
||||
//
|
||||
// This file is part of the Coriolis Project.
|
||||
// Copyright (C) Laboratoire LIP6 - Departement ASIM
|
||||
// Universite Pierre et Marie Curie
|
||||
//
|
||||
// Main contributors :
|
||||
// Christophe Alexandre <Christophe.Alexandre@lip6.fr>
|
||||
// Sophie Belloeil <Sophie.Belloeil@lip6.fr>
|
||||
// Hugo Clément <Hugo.Clement@lip6.fr>
|
||||
// Jean-Paul Chaput <Jean-Paul.Chaput@lip6.fr>
|
||||
// Damien Dupuis <Damien.Dupuis@lip6.fr>
|
||||
// Christian Masson <Christian.Masson@lip6.fr>
|
||||
// Marek Sroka <Marek.Sroka@lip6.fr>
|
||||
//
|
||||
// The Coriolis Project is free software; you can redistribute it
|
||||
// and/or modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// The Coriolis Project is distributed in the hope that it will be
|
||||
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with the Coriolis Project; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
// USA
|
||||
//
|
||||
// License-Tag
|
||||
// Authors-Tag
|
||||
// ===================================================================
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
// x-----------------------------------------------------------------x
|
||||
// | |
|
||||
// | H U R R I C A N E |
|
||||
// | V L S I B a c k e n d D a t a - B a s e |
|
||||
// | |
|
||||
// | Author : Jean-Paul CHAPUT |
|
||||
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
||||
// | =============================================================== |
|
||||
// | C++ Header : "./HNetlist.h" |
|
||||
// | *************************************************************** |
|
||||
// | U p d a t e s |
|
||||
// | |
|
||||
// x-----------------------------------------------------------------x
|
||||
|
||||
|
||||
#include <QAction>
|
||||
#include <QMenu>
|
||||
#include <QMenuBar>
|
||||
#ifndef __HNETLIST_WIDGET_H__
|
||||
#define __HNETLIST_WIDGET_H__
|
||||
|
||||
|
||||
#include <QWidget>
|
||||
#include <QTableView>
|
||||
#include <QSortFilterProxyModel>
|
||||
|
||||
#include "hurricane/Commons.h"
|
||||
#include "hurricane/viewer/CellWidget.h"
|
||||
#include "hurricane/viewer/HNetlistModel.h"
|
||||
|
||||
|
||||
class QSortFilterProxyModel;
|
||||
class QModelIndex;
|
||||
class QTableView;
|
||||
class QLineEdit;
|
||||
class QComboBox;
|
||||
class QHeaderView;
|
||||
|
||||
|
||||
namespace Hurricane {
|
||||
|
||||
|
||||
class Cell;
|
||||
class CellWidget;
|
||||
|
||||
|
||||
class HNetlist : public QWidget {
|
||||
Q_OBJECT;
|
||||
|
||||
public:
|
||||
HNetlist ( QWidget* parent=NULL );
|
||||
template<typename InformationType>
|
||||
void setCell ( Cell* cell );
|
||||
template<typename InformationType>
|
||||
void setCellWidget ( CellWidget* cw );
|
||||
private slots:
|
||||
void textFilterChanged ();
|
||||
void selectNet ( const QModelIndex& index );
|
||||
protected:
|
||||
void keyPressEvent ( QKeyEvent * event );
|
||||
|
||||
private:
|
||||
HNetlistModel* _netlistModel;
|
||||
QSortFilterProxyModel* _sortModel;
|
||||
QTableView* _netlistView;
|
||||
QLineEdit* _filterPatternLineEdit;
|
||||
int _rowHeight;
|
||||
CellWidget* _cellWidget;
|
||||
};
|
||||
|
||||
|
||||
template<typename InformationType>
|
||||
void HNetlist::setCell ( Cell* cell )
|
||||
{
|
||||
_netlistModel->setCell<InformationType> ( cell );
|
||||
|
||||
string windowTitle = "Netlist" + getString(cell);
|
||||
setWindowTitle ( tr(windowTitle.c_str()) );
|
||||
|
||||
int rows = _sortModel->rowCount ();
|
||||
for ( rows-- ; rows >= 0 ; rows-- )
|
||||
_netlistView->setRowHeight ( rows, _rowHeight );
|
||||
_netlistView->selectRow ( 0 );
|
||||
}
|
||||
|
||||
|
||||
template<typename InformationType>
|
||||
void HNetlist::setCellWidget ( CellWidget* cw )
|
||||
{
|
||||
if ( _netlistModel->getCell() != cw->getCell() )
|
||||
setCell<InformationType>( cw->getCell() );
|
||||
|
||||
_cellWidget = cw;
|
||||
}
|
||||
|
||||
|
||||
} // End of Hurricane namespace.
|
||||
|
||||
|
||||
#endif // __HNETLIST_WIDGET_H__
|
|
@ -0,0 +1,132 @@
|
|||
|
||||
// -*- C++ -*-
|
||||
//
|
||||
// This file is part of the Coriolis Project.
|
||||
// Copyright (C) Laboratoire LIP6 - Departement ASIM
|
||||
// Universite Pierre et Marie Curie
|
||||
//
|
||||
// Main contributors :
|
||||
// Christophe Alexandre <Christophe.Alexandre@lip6.fr>
|
||||
// Sophie Belloeil <Sophie.Belloeil@lip6.fr>
|
||||
// Hugo Clément <Hugo.Clement@lip6.fr>
|
||||
// Jean-Paul Chaput <Jean-Paul.Chaput@lip6.fr>
|
||||
// Damien Dupuis <Damien.Dupuis@lip6.fr>
|
||||
// Christian Masson <Christian.Masson@lip6.fr>
|
||||
// Marek Sroka <Marek.Sroka@lip6.fr>
|
||||
//
|
||||
// The Coriolis Project is free software; you can redistribute it
|
||||
// and/or modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// The Coriolis Project is distributed in the hope that it will be
|
||||
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with the Coriolis Project; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
// USA
|
||||
//
|
||||
// License-Tag
|
||||
// Authors-Tag
|
||||
// ===================================================================
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
// x-----------------------------------------------------------------x
|
||||
// | |
|
||||
// | H U R R I C A N E |
|
||||
// | V L S I B a c k e n d D a t a - B a s e |
|
||||
// | |
|
||||
// | Author : Jean-Paul CHAPUT |
|
||||
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
||||
// | =============================================================== |
|
||||
// | C++ Header : "./HNetlistModel.h" |
|
||||
// | *************************************************************** |
|
||||
// | U p d a t e s |
|
||||
// | |
|
||||
// x-----------------------------------------------------------------x
|
||||
|
||||
|
||||
#include <QAction>
|
||||
#include <QMenu>
|
||||
#include <QMenuBar>
|
||||
#ifndef __NETLIST_MODEL_H__
|
||||
#define __NETLIST_MODEL_H__
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include <QFont>
|
||||
#include <QApplication>
|
||||
#include <QAbstractTableModel>
|
||||
|
||||
#include "hurricane/Commons.h"
|
||||
#include "hurricane/Name.h"
|
||||
#include "hurricane/Net.h"
|
||||
#include "hurricane/Cell.h"
|
||||
#include "hurricane/viewer/Graphics.h"
|
||||
#include "hurricane/viewer/NetInformations.h"
|
||||
#include "hurricane/viewer/HNetlistModel.h"
|
||||
|
||||
|
||||
namespace Hurricane {
|
||||
|
||||
|
||||
class Net;
|
||||
class Cell;
|
||||
|
||||
|
||||
class HNetlistModel : public QAbstractTableModel {
|
||||
Q_OBJECT;
|
||||
|
||||
public:
|
||||
HNetlistModel ( QObject* parent=NULL );
|
||||
~HNetlistModel ();
|
||||
template<typename InformationType>
|
||||
void setCell ( Cell* cell );
|
||||
int rowCount ( const QModelIndex& parent=QModelIndex() ) const;
|
||||
int columnCount ( const QModelIndex& parent=QModelIndex() ) const;
|
||||
QVariant data ( const QModelIndex& index, int role=Qt::DisplayRole ) const;
|
||||
QVariant headerData ( int section, Qt::Orientation orientation, int role=Qt::DisplayRole ) const;
|
||||
inline Cell* getCell ();
|
||||
const Net* getNet ( int row );
|
||||
|
||||
private:
|
||||
Cell* _cell;
|
||||
AbstractNetInformationsVector* _netlist;
|
||||
};
|
||||
|
||||
|
||||
// Inline Functions.
|
||||
|
||||
inline Cell* HNetlistModel::getCell () { return _cell; }
|
||||
|
||||
|
||||
// Template Functions.
|
||||
|
||||
template<typename InformationType>
|
||||
void HNetlistModel::setCell ( Cell* cell )
|
||||
{
|
||||
if ( _cell != cell ) {
|
||||
if ( _cell )
|
||||
delete _netlist;
|
||||
|
||||
_cell = cell;
|
||||
_netlist = new NetInformationsVector<InformationType>();
|
||||
|
||||
for_each_net ( net, _cell->getNets() ) {
|
||||
_netlist->addNet ( net );
|
||||
end_for;
|
||||
}
|
||||
|
||||
emit layoutChanged ();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} // End of Hurricane namespace.
|
||||
|
||||
|
||||
#endif // __NETLIST_MODEL_H__
|
|
@ -1,5 +1,58 @@
|
|||
|
||||
// -*- C++ -*-
|
||||
//
|
||||
// This file is part of the Coriolis Project.
|
||||
// Copyright (C) Laboratoire LIP6 - Departement ASIM
|
||||
// Universite Pierre et Marie Curie
|
||||
//
|
||||
// Main contributors :
|
||||
// Christophe Alexandre <Christophe.Alexandre@lip6.fr>
|
||||
// Sophie Belloeil <Sophie.Belloeil@lip6.fr>
|
||||
// Hugo Clément <Hugo.Clement@lip6.fr>
|
||||
// Jean-Paul Chaput <Jean-Paul.Chaput@lip6.fr>
|
||||
// Damien Dupuis <Damien.Dupuis@lip6.fr>
|
||||
// Christian Masson <Christian.Masson@lip6.fr>
|
||||
// Marek Sroka <Marek.Sroka@lip6.fr>
|
||||
//
|
||||
// The Coriolis Project is free software; you can redistribute it
|
||||
// and/or modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// The Coriolis Project is distributed in the hope that it will be
|
||||
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with the Coriolis Project; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
// USA
|
||||
//
|
||||
// License-Tag
|
||||
// Authors-Tag
|
||||
// ===================================================================
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
// x-----------------------------------------------------------------x
|
||||
// | |
|
||||
// | H U R R I C A N E |
|
||||
// | V L S I B a c k e n d D a t a - B a s e |
|
||||
// | |
|
||||
// | Author : Jean-Paul CHAPUT |
|
||||
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
||||
// | =============================================================== |
|
||||
// | C++ Header : "./HPalette.h" |
|
||||
// | *************************************************************** |
|
||||
// | U p d a t e s |
|
||||
// | |
|
||||
// x-----------------------------------------------------------------x
|
||||
|
||||
|
||||
#include <QAction>
|
||||
#include <QMenu>
|
||||
#include <QMenuBar>
|
||||
|
||||
|
||||
# ifndef __HPALETTE__
|
||||
|
|
|
@ -1,5 +1,58 @@
|
|||
|
||||
// -*- C++ -*-
|
||||
//
|
||||
// This file is part of the Coriolis Project.
|
||||
// Copyright (C) Laboratoire LIP6 - Departement ASIM
|
||||
// Universite Pierre et Marie Curie
|
||||
//
|
||||
// Main contributors :
|
||||
// Christophe Alexandre <Christophe.Alexandre@lip6.fr>
|
||||
// Sophie Belloeil <Sophie.Belloeil@lip6.fr>
|
||||
// Hugo Clément <Hugo.Clement@lip6.fr>
|
||||
// Jean-Paul Chaput <Jean-Paul.Chaput@lip6.fr>
|
||||
// Damien Dupuis <Damien.Dupuis@lip6.fr>
|
||||
// Christian Masson <Christian.Masson@lip6.fr>
|
||||
// Marek Sroka <Marek.Sroka@lip6.fr>
|
||||
//
|
||||
// The Coriolis Project is free software; you can redistribute it
|
||||
// and/or modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// The Coriolis Project is distributed in the hope that it will be
|
||||
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with the Coriolis Project; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
// USA
|
||||
//
|
||||
// License-Tag
|
||||
// Authors-Tag
|
||||
// ===================================================================
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
// x-----------------------------------------------------------------x
|
||||
// | |
|
||||
// | H U R R I C A N E |
|
||||
// | V L S I B a c k e n d D a t a - B a s e |
|
||||
// | |
|
||||
// | Author : Jean-Paul CHAPUT |
|
||||
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
||||
// | =============================================================== |
|
||||
// | C++ Header : "./HPaletteEntry.h" |
|
||||
// | *************************************************************** |
|
||||
// | U p d a t e s |
|
||||
// | |
|
||||
// x-----------------------------------------------------------------x
|
||||
|
||||
|
||||
#include <QAction>
|
||||
#include <QMenu>
|
||||
#include <QMenuBar>
|
||||
|
||||
|
||||
# ifndef __PALETTE_ENTRY_H__
|
||||
|
|
|
@ -1,5 +1,58 @@
|
|||
|
||||
// -*- C++ -*-
|
||||
//
|
||||
// This file is part of the Coriolis Project.
|
||||
// Copyright (C) Laboratoire LIP6 - Departement ASIM
|
||||
// Universite Pierre et Marie Curie
|
||||
//
|
||||
// Main contributors :
|
||||
// Christophe Alexandre <Christophe.Alexandre@lip6.fr>
|
||||
// Sophie Belloeil <Sophie.Belloeil@lip6.fr>
|
||||
// Hugo Clément <Hugo.Clement@lip6.fr>
|
||||
// Jean-Paul Chaput <Jean-Paul.Chaput@lip6.fr>
|
||||
// Damien Dupuis <Damien.Dupuis@lip6.fr>
|
||||
// Christian Masson <Christian.Masson@lip6.fr>
|
||||
// Marek Sroka <Marek.Sroka@lip6.fr>
|
||||
//
|
||||
// The Coriolis Project is free software; you can redistribute it
|
||||
// and/or modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// The Coriolis Project is distributed in the hope that it will be
|
||||
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with the Coriolis Project; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
// USA
|
||||
//
|
||||
// License-Tag
|
||||
// Authors-Tag
|
||||
// ===================================================================
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
// x-----------------------------------------------------------------x
|
||||
// | |
|
||||
// | H U R R I C A N E |
|
||||
// | V L S I B a c k e n d D a t a - B a s e |
|
||||
// | |
|
||||
// | Author : Jean-Paul CHAPUT |
|
||||
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
||||
// | =============================================================== |
|
||||
// | C++ Header : "./LayerPaletteEntry.h" |
|
||||
// | *************************************************************** |
|
||||
// | U p d a t e s |
|
||||
// | |
|
||||
// x-----------------------------------------------------------------x
|
||||
|
||||
|
||||
#include <QAction>
|
||||
#include <QMenu>
|
||||
#include <QMenuBar>
|
||||
|
||||
|
||||
# ifndef __LAYER_PALETTE_ENTRY_H__
|
||||
|
|
|
@ -0,0 +1,200 @@
|
|||
|
||||
// -*- C++ -*-
|
||||
//
|
||||
// This file is part of the Coriolis Project.
|
||||
// Copyright (C) Laboratoire LIP6 - Departement ASIM
|
||||
// Universite Pierre et Marie Curie
|
||||
//
|
||||
// Main contributors :
|
||||
// Christophe Alexandre <Christophe.Alexandre@lip6.fr>
|
||||
// Sophie Belloeil <Sophie.Belloeil@lip6.fr>
|
||||
// Hugo Clément <Hugo.Clement@lip6.fr>
|
||||
// Jean-Paul Chaput <Jean-Paul.Chaput@lip6.fr>
|
||||
// Damien Dupuis <Damien.Dupuis@lip6.fr>
|
||||
// Christian Masson <Christian.Masson@lip6.fr>
|
||||
// Marek Sroka <Marek.Sroka@lip6.fr>
|
||||
//
|
||||
// The Coriolis Project is free software; you can redistribute it
|
||||
// and/or modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// The Coriolis Project is distributed in the hope that it will be
|
||||
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with the Coriolis Project; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
// USA
|
||||
//
|
||||
// License-Tag
|
||||
// Authors-Tag
|
||||
// ===================================================================
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
// x-----------------------------------------------------------------x
|
||||
// | |
|
||||
// | H U R R I C A N E |
|
||||
// | V L S I B a c k e n d D a t a - B a s e |
|
||||
// | |
|
||||
// | Author : Jean-Paul CHAPUT |
|
||||
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
||||
// | =============================================================== |
|
||||
// | C++ Header : "./NetInformations.h" |
|
||||
// | *************************************************************** |
|
||||
// | U p d a t e s |
|
||||
// | |
|
||||
// x-----------------------------------------------------------------x
|
||||
|
||||
|
||||
#include <QAction>
|
||||
#include <QMenu>
|
||||
#include <QMenuBar>
|
||||
#ifndef __NET_INFORMATIONS_H__
|
||||
#define __NET_INFORMATIONS_H__
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include <QVariant>
|
||||
|
||||
#include "hurricane/Commons.h"
|
||||
|
||||
|
||||
namespace Hurricane {
|
||||
|
||||
|
||||
class Net;
|
||||
class Cell;
|
||||
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// Class : "NetInformations"
|
||||
|
||||
|
||||
class NetInformations {
|
||||
public:
|
||||
NetInformations ( const Net* net );
|
||||
virtual ~NetInformations ();
|
||||
static int getColumnCount ();
|
||||
static QVariant getColumnName ( int column );
|
||||
virtual QVariant getColumn ( int column );
|
||||
inline const Net* getNet () const;
|
||||
inline const Name& getName () const;
|
||||
|
||||
protected:
|
||||
const Net* _net;
|
||||
};
|
||||
|
||||
|
||||
inline const Net* NetInformations::getNet () const
|
||||
{ return _net; }
|
||||
|
||||
|
||||
inline const Name& NetInformations::getName () const
|
||||
{ return _net->getName(); }
|
||||
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// Class : "SimpleNetInformations"
|
||||
|
||||
|
||||
class SimpleNetInformations : public NetInformations {
|
||||
public:
|
||||
SimpleNetInformations ( const Net* net );
|
||||
virtual ~SimpleNetInformations ();
|
||||
static int getColumnCount ();
|
||||
static QVariant getColumnName ( int column );
|
||||
virtual QVariant getColumn ( int column );
|
||||
inline size_t getPlugsCount () const;
|
||||
|
||||
protected:
|
||||
size_t _plugsCount;
|
||||
};
|
||||
|
||||
|
||||
inline size_t SimpleNetInformations::getPlugsCount () const
|
||||
{ return _plugsCount; }
|
||||
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// Class : "AbstractNetInformationsVector"
|
||||
|
||||
|
||||
class AbstractNetInformationsVector {
|
||||
public:
|
||||
virtual ~AbstractNetInformationsVector ();
|
||||
virtual void addNet ( const Net* net ) = 0;
|
||||
virtual NetInformations* getRow ( int row ) = 0;
|
||||
virtual int getColumnCount () const = 0;
|
||||
virtual QVariant getColumnName ( int column ) const = 0;
|
||||
virtual int size () const = 0;
|
||||
};
|
||||
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// Template Class : "NetInformationsVector"
|
||||
|
||||
|
||||
template<typename InformationType>
|
||||
class NetInformationsVector : public AbstractNetInformationsVector {
|
||||
public:
|
||||
virtual ~NetInformationsVector ();
|
||||
virtual void addNet ( const Net* net );
|
||||
virtual InformationType* getRow ( int row );
|
||||
virtual int getColumnCount () const;
|
||||
virtual QVariant getColumnName ( int column ) const;
|
||||
virtual int size () const;
|
||||
protected:
|
||||
vector<InformationType> _netlist;
|
||||
};
|
||||
|
||||
|
||||
template<typename InformationType>
|
||||
NetInformationsVector<InformationType>::~NetInformationsVector ()
|
||||
{ }
|
||||
|
||||
|
||||
template<typename InformationType>
|
||||
void NetInformationsVector<InformationType>::addNet ( const Net* net )
|
||||
{
|
||||
_netlist.push_back ( InformationType(net) );
|
||||
}
|
||||
|
||||
|
||||
template<typename InformationType>
|
||||
InformationType* NetInformationsVector<InformationType>::getRow ( int row )
|
||||
{
|
||||
if ( row >= (int)_netlist.size() ) return NULL;
|
||||
|
||||
return &_netlist[row];
|
||||
}
|
||||
|
||||
|
||||
template<typename InformationType>
|
||||
int NetInformationsVector<InformationType>::getColumnCount () const
|
||||
{
|
||||
return InformationType::getColumnCount();
|
||||
}
|
||||
|
||||
|
||||
template<typename InformationType>
|
||||
QVariant NetInformationsVector<InformationType>::getColumnName ( int column ) const
|
||||
{
|
||||
return InformationType::getColumnName ( column );
|
||||
}
|
||||
|
||||
|
||||
template<typename InformationType>
|
||||
int NetInformationsVector<InformationType>::size () const
|
||||
{
|
||||
return _netlist.size();
|
||||
}
|
||||
|
||||
|
||||
} // End of Hurricane namespace.
|
||||
|
||||
|
||||
#endif // __NET_INFORMATIONS_H__
|
|
@ -1,4 +1,58 @@
|
|||
|
||||
// -*- C++ -*-
|
||||
//
|
||||
// This file is part of the Coriolis Project.
|
||||
// Copyright (C) Laboratoire LIP6 - Departement ASIM
|
||||
// Universite Pierre et Marie Curie
|
||||
//
|
||||
// Main contributors :
|
||||
// Christophe Alexandre <Christophe.Alexandre@lip6.fr>
|
||||
// Sophie Belloeil <Sophie.Belloeil@lip6.fr>
|
||||
// Hugo Clément <Hugo.Clement@lip6.fr>
|
||||
// Jean-Paul Chaput <Jean-Paul.Chaput@lip6.fr>
|
||||
// Damien Dupuis <Damien.Dupuis@lip6.fr>
|
||||
// Christian Masson <Christian.Masson@lip6.fr>
|
||||
// Marek Sroka <Marek.Sroka@lip6.fr>
|
||||
//
|
||||
// The Coriolis Project is free software; you can redistribute it
|
||||
// and/or modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// The Coriolis Project is distributed in the hope that it will be
|
||||
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with the Coriolis Project; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
// USA
|
||||
//
|
||||
// License-Tag
|
||||
// Authors-Tag
|
||||
// ===================================================================
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
// x-----------------------------------------------------------------x
|
||||
// | |
|
||||
// | H U R R I C A N E |
|
||||
// | V L S I B a c k e n d D a t a - B a s e |
|
||||
// | |
|
||||
// | Author : Jean-Paul CHAPUT |
|
||||
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
||||
// | =============================================================== |
|
||||
// | C++ Header : "./RecordModel.h" |
|
||||
// | *************************************************************** |
|
||||
// | U p d a t e s |
|
||||
// | |
|
||||
// x-----------------------------------------------------------------x
|
||||
|
||||
|
||||
#include <QAction>
|
||||
#include <QMenu>
|
||||
#include <QMenuBar>
|
||||
#ifndef __RECORD_MODEL_H__
|
||||
#define __RECORD_MODEL_H__
|
||||
|
||||
|
|
|
@ -1,5 +1,58 @@
|
|||
|
||||
// -*- C++ -*-
|
||||
//
|
||||
// This file is part of the Coriolis Project.
|
||||
// Copyright (C) Laboratoire LIP6 - Departement ASIM
|
||||
// Universite Pierre et Marie Curie
|
||||
//
|
||||
// Main contributors :
|
||||
// Christophe Alexandre <Christophe.Alexandre@lip6.fr>
|
||||
// Sophie Belloeil <Sophie.Belloeil@lip6.fr>
|
||||
// Hugo Clément <Hugo.Clement@lip6.fr>
|
||||
// Jean-Paul Chaput <Jean-Paul.Chaput@lip6.fr>
|
||||
// Damien Dupuis <Damien.Dupuis@lip6.fr>
|
||||
// Christian Masson <Christian.Masson@lip6.fr>
|
||||
// Marek Sroka <Marek.Sroka@lip6.fr>
|
||||
//
|
||||
// The Coriolis Project is free software; you can redistribute it
|
||||
// and/or modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// The Coriolis Project is distributed in the hope that it will be
|
||||
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with the Coriolis Project; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
// USA
|
||||
//
|
||||
// License-Tag
|
||||
// Authors-Tag
|
||||
// ===================================================================
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
// x-----------------------------------------------------------------x
|
||||
// | |
|
||||
// | H U R R I C A N E |
|
||||
// | V L S I B a c k e n d D a t a - B a s e |
|
||||
// | |
|
||||
// | Author : Jean-Paul CHAPUT |
|
||||
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
||||
// | =============================================================== |
|
||||
// | C++ Header : "./ScreenUtilities.h" |
|
||||
// | *************************************************************** |
|
||||
// | U p d a t e s |
|
||||
// | |
|
||||
// x-----------------------------------------------------------------x
|
||||
|
||||
|
||||
#include <QAction>
|
||||
#include <QMenu>
|
||||
#include <QMenuBar>
|
||||
|
||||
|
||||
# ifndef __SCREENUTILITIES_H__
|
||||
|
|
|
@ -0,0 +1,77 @@
|
|||
|
||||
|
||||
// -*- C++ -*-
|
||||
//
|
||||
// This file is part of the Hurricane Software.
|
||||
// Copyright (c) BULL S.A. 2000-2004, All Rights Reserved
|
||||
//
|
||||
// ===================================================================
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
// x-----------------------------------------------------------------x
|
||||
// | |
|
||||
// | H U R R I C A N E |
|
||||
// | V L S I B a c k e n d D a t a - B a s e |
|
||||
// | |
|
||||
// | Author : Remy Escassut |
|
||||
// | E-mail : Jean-Paul.Chaput@lip6.fr |
|
||||
// | =============================================================== |
|
||||
// | C++ Header : "./Selector.h" |
|
||||
// | *************************************************************** |
|
||||
// | U p d a t e s |
|
||||
// | |
|
||||
// x-----------------------------------------------------------------x
|
||||
|
||||
|
||||
#ifndef __HURRICANE_SELECTOR__
|
||||
#define __HURRICANE_SELECTOR__
|
||||
|
||||
#include "hurricane/Property.h"
|
||||
#include "hurricane/Selectors.h"
|
||||
#include "hurricane/Occurrence.h"
|
||||
|
||||
|
||||
namespace Hurricane {
|
||||
|
||||
|
||||
class CellWidget;
|
||||
|
||||
|
||||
class Selector : public PrivateProperty {
|
||||
|
||||
public:
|
||||
// Constructor.
|
||||
static Selector* create ( Occurrence& occurrence );
|
||||
// Methods.
|
||||
static const Name& getPropertyName ();
|
||||
virtual Name getName () const;
|
||||
Occurrence getOccurrence () const;
|
||||
inline set<CellWidget*>& getCellWidgetSet ();
|
||||
void attachTo ( CellWidget* widget );
|
||||
void detachFrom ( CellWidget* widget, bool inDeletion=false );
|
||||
// Inspector Managment.
|
||||
virtual string _getTypeName () const;
|
||||
virtual string _getString () const;
|
||||
virtual Record* _getRecord () const;
|
||||
|
||||
protected:
|
||||
// Internal: Attributes.
|
||||
static const Name _propertyName;
|
||||
set<CellWidget*> _cellWidgets;
|
||||
|
||||
protected:
|
||||
// Internal: Constructor.
|
||||
Selector ();
|
||||
virtual void _preDestroy ();
|
||||
};
|
||||
|
||||
|
||||
// Inline Functions.
|
||||
inline set<CellWidget*>& Selector::getCellWidgetSet () { return _cellWidgets; }
|
||||
|
||||
|
||||
} // End of Hurricane namespace.
|
||||
|
||||
|
||||
#endif
|
|
@ -1,5 +1,58 @@
|
|||
|
||||
// -*- C++ -*-
|
||||
//
|
||||
// This file is part of the Coriolis Project.
|
||||
// Copyright (C) Laboratoire LIP6 - Departement ASIM
|
||||
// Universite Pierre et Marie Curie
|
||||
//
|
||||
// Main contributors :
|
||||
// Christophe Alexandre <Christophe.Alexandre@lip6.fr>
|
||||
// Sophie Belloeil <Sophie.Belloeil@lip6.fr>
|
||||
// Hugo Clément <Hugo.Clement@lip6.fr>
|
||||
// Jean-Paul Chaput <Jean-Paul.Chaput@lip6.fr>
|
||||
// Damien Dupuis <Damien.Dupuis@lip6.fr>
|
||||
// Christian Masson <Christian.Masson@lip6.fr>
|
||||
// Marek Sroka <Marek.Sroka@lip6.fr>
|
||||
//
|
||||
// The Coriolis Project is free software; you can redistribute it
|
||||
// and/or modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2 of
|
||||
// the License, or (at your option) any later version.
|
||||
//
|
||||
// The Coriolis Project is distributed in the hope that it will be
|
||||
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with the Coriolis Project; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||
// USA
|
||||
//
|
||||
// License-Tag
|
||||
// Authors-Tag
|
||||
// ===================================================================
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
// x-----------------------------------------------------------------x
|
||||
// | |
|
||||
// | H U R R I C A N E |
|
||||
// | V L S I B a c k e n d D a t a - B a s e |
|
||||
// | |
|
||||
// | Author : Jean-Paul CHAPUT |
|
||||
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
||||
// | =============================================================== |
|
||||
// | C++ Header : "./ViewerPaletteEntry.h" |
|
||||
// | *************************************************************** |
|
||||
// | U p d a t e s |
|
||||
// | |
|
||||
// x-----------------------------------------------------------------x
|
||||
|
||||
|
||||
#include <QAction>
|
||||
#include <QMenu>
|
||||
#include <QMenuBar>
|
||||
|
||||
|
||||
# ifndef __VIEWER_PALETTE_ENTRY_H__
|
||||
|
|
Loading…
Reference in New Issue