- Change: In CellWidget & Command, rewrite of the active command mechanism.
Now a command is associated to one CellWidget exactly, the active flag was shared among all CellWidget which was an error (do not show unless we start to multithread). - New: In SelectCommand/SelectionPopup/SelectionPopupModel now there are three selection mode: Mode 0: Select all Component under point. Mode 1: Select whole nets whose at least one component is under point. Mode 2: Same as 1, but hide all cluttering "*nymous*" nets. Rotation through the mode is done by pressing repeadedly the 'N' key. The various select modes are implemented through "sub" Collections.
This commit is contained in:
parent
7f9c707871
commit
56b2abb260
|
@ -42,6 +42,7 @@ SET(QT_USE_QTXML "true")
|
||||||
FIND_PACKAGE(Qt4 REQUIRED) # find and setup Qt4 for this project
|
FIND_PACKAGE(Qt4 REQUIRED) # find and setup Qt4 for this project
|
||||||
FIND_PACKAGE(BISON REQUIRED)
|
FIND_PACKAGE(BISON REQUIRED)
|
||||||
FIND_PACKAGE(FLEX REQUIRED)
|
FIND_PACKAGE(FLEX REQUIRED)
|
||||||
|
FIND_PACKAGE(Boost 1.33.1 COMPONENTS regex REQUIRED)
|
||||||
FIND_PACKAGE(PythonLibs REQUIRED)
|
FIND_PACKAGE(PythonLibs REQUIRED)
|
||||||
IF(BUILD_DOC)
|
IF(BUILD_DOC)
|
||||||
FIND_PACKAGE(Doxygen)
|
FIND_PACKAGE(Doxygen)
|
||||||
|
|
|
@ -39,7 +39,7 @@ namespace Hurricane {
|
||||||
|
|
||||||
|
|
||||||
AreaCommand::AreaCommand ()
|
AreaCommand::AreaCommand ()
|
||||||
: Command()
|
: Command ()
|
||||||
, _startPoint ()
|
, _startPoint ()
|
||||||
, _stopPoint ()
|
, _stopPoint ()
|
||||||
, _drawingThreshold(10)
|
, _drawingThreshold(10)
|
||||||
|
@ -52,32 +52,30 @@ namespace Hurricane {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool AreaCommand::mouseMoveEvent ( CellWidget* widget, QMouseEvent* event )
|
void AreaCommand::mouseMoveEvent ( QMouseEvent* event )
|
||||||
{
|
{
|
||||||
if ( !_drawingEnabled ) return false;
|
if ( !_drawingEnabled ) return;
|
||||||
|
|
||||||
setStopPoint ( event->pos() );
|
setStopPoint ( event->pos() );
|
||||||
widget->update ();
|
_cellWidget->update ();
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void AreaCommand::draw ( CellWidget* widget )
|
void AreaCommand::draw ()
|
||||||
{
|
{
|
||||||
if ( !_drawingEnabled ) return;
|
if ( !_drawingEnabled ) return;
|
||||||
|
|
||||||
if ( ( abs(_stopPoint.x()-_startPoint.x()) > _drawingThreshold )
|
if ( ( abs(_stopPoint.x()-_startPoint.x()) > _drawingThreshold )
|
||||||
&& ( abs(_stopPoint.y()-_startPoint.y()) > _drawingThreshold ) ) {
|
&& ( abs(_stopPoint.y()-_startPoint.y()) > _drawingThreshold ) ) {
|
||||||
widget->setPen ( Graphics::getPen("grid"), 2 );
|
_cellWidget->setPen ( Graphics::getPen("grid"), 2 );
|
||||||
widget->drawScreenRect ( _startPoint, _stopPoint, 2 );
|
_cellWidget->drawScreenRect ( _startPoint, _stopPoint, 2 );
|
||||||
drawCorner ( widget, true );
|
drawCorner ( true );
|
||||||
drawCorner ( widget, false );
|
drawCorner ( false );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void AreaCommand::drawCorner ( CellWidget* widget, bool bottomLeft )
|
void AreaCommand::drawCorner ( bool bottomLeft )
|
||||||
{
|
{
|
||||||
QRect zoomRect = QRect(_startPoint,_stopPoint).normalized();
|
QRect zoomRect = QRect(_startPoint,_stopPoint).normalized();
|
||||||
QPoint base = (bottomLeft) ? zoomRect.bottomLeft() : zoomRect.topRight();
|
QPoint base = (bottomLeft) ? zoomRect.bottomLeft() : zoomRect.topRight();
|
||||||
|
@ -92,7 +90,7 @@ namespace Hurricane {
|
||||||
_cornerPoints[0].ry() += (bottomLeft) ? -10 : 10;
|
_cornerPoints[0].ry() += (bottomLeft) ? -10 : 10;
|
||||||
_cornerPoints[2].rx() += (bottomLeft) ? 10 : -10;
|
_cornerPoints[2].rx() += (bottomLeft) ? 10 : -10;
|
||||||
|
|
||||||
widget->drawScreenPolyline ( _cornerPoints, 3, 4, 2 );
|
_cellWidget->drawScreenPolyline ( _cornerPoints, 3, 4, 2 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
|
|
||||||
include ( ${QT_USE_FILE} )
|
include ( ${QT_USE_FILE} )
|
||||||
|
|
||||||
include_directories ( ${HURRICANE_SOURCE_DIR}/src/hurricane
|
include_directories ( ${Boost_INCLUDE_DIRS}
|
||||||
|
${HURRICANE_SOURCE_DIR}/src/hurricane
|
||||||
${HURRICANE_SOURCE_DIR}/src/hviewer )
|
${HURRICANE_SOURCE_DIR}/src/hviewer )
|
||||||
|
|
||||||
set ( mocincludes hurricane/viewer/HApplication.h
|
set ( mocincludes hurricane/viewer/HApplication.h
|
||||||
|
@ -109,10 +110,16 @@
|
||||||
|
|
||||||
if ( BUILD_STATIC )
|
if ( BUILD_STATIC )
|
||||||
add_library ( hviewer-static STATIC ${cpps} ${MOC_SRCS} ${RCC_SRCS} )
|
add_library ( hviewer-static STATIC ${cpps} ${MOC_SRCS} ${RCC_SRCS} )
|
||||||
target_link_libraries ( hviewer-static hurricane-static ${QT_LIBRARIES} )
|
target_link_libraries ( hviewer-static hurricane-static
|
||||||
|
${QT_LIBRARIES}
|
||||||
|
${Boost_LIBRARIES}
|
||||||
|
)
|
||||||
install ( TARGETS hviewer-static DESTINATION /lib )
|
install ( TARGETS hviewer-static DESTINATION /lib )
|
||||||
else ( BUILD_STATIC )
|
else ( BUILD_STATIC )
|
||||||
add_library ( hviewer SHARED ${cpps} ${MOC_SRCS} ${RCC_SRCS} )
|
add_library ( hviewer SHARED ${cpps} ${MOC_SRCS} ${RCC_SRCS} )
|
||||||
target_link_libraries ( hviewer ${QT_LIBRARIES} hurricane )
|
target_link_libraries ( hviewer hurricane
|
||||||
|
${QT_LIBRARIES}
|
||||||
|
${Boost_LIBRARIES}
|
||||||
|
)
|
||||||
install ( TARGETS hviewer DESTINATION /lib )
|
install ( TARGETS hviewer DESTINATION /lib )
|
||||||
endif ( BUILD_STATIC )
|
endif ( BUILD_STATIC )
|
||||||
|
|
|
@ -49,40 +49,40 @@
|
||||||
namespace Hurricane {
|
namespace Hurricane {
|
||||||
|
|
||||||
|
|
||||||
CellViewer::CellViewer ( QWidget* parent ) : QMainWindow (parent)
|
CellViewer::CellViewer ( QWidget* parent ) : QMainWindow (parent)
|
||||||
, _applicationName (tr("Viewer"))
|
, _applicationName (tr("Viewer"))
|
||||||
, _toolInterruptAction(NULL)
|
, _toolInterruptAction (NULL)
|
||||||
, _openAction (NULL)
|
, _openAction (NULL)
|
||||||
, _nextAction (NULL)
|
, _nextAction (NULL)
|
||||||
, _printAction (NULL)
|
, _printAction (NULL)
|
||||||
, _imageAction (NULL)
|
, _imageAction (NULL)
|
||||||
, _saveAction (NULL)
|
, _saveAction (NULL)
|
||||||
, _closeAction (NULL)
|
, _closeAction (NULL)
|
||||||
, _exitAction (NULL)
|
, _exitAction (NULL)
|
||||||
, _refreshAction (NULL)
|
, _refreshAction (NULL)
|
||||||
, _fitToContentsAction(NULL)
|
, _fitToContentsAction (NULL)
|
||||||
, _showSelectionAction(NULL)
|
, _showSelectionAction (NULL)
|
||||||
, _rubberChangeAction (NULL)
|
, _rubberChangeAction (NULL)
|
||||||
, _clearRulersAction (NULL)
|
, _clearRulersAction (NULL)
|
||||||
, _controllerAction (NULL)
|
, _controllerAction (NULL)
|
||||||
, _fileMenu (NULL)
|
, _fileMenu (NULL)
|
||||||
, _viewMenu (NULL)
|
, _viewMenu (NULL)
|
||||||
, _toolsMenu (NULL)
|
, _toolsMenu (NULL)
|
||||||
, _debugMenu (NULL)
|
, _debugMenu (NULL)
|
||||||
//, _mapView (NULL)
|
//, _mapView (NULL)
|
||||||
, _palette (NULL)
|
, _palette (NULL)
|
||||||
, _mousePosition (NULL)
|
, _mousePosition (NULL)
|
||||||
, _controller (NULL)
|
, _controller (NULL)
|
||||||
, _cellWidget (NULL)
|
, _cellWidget (NULL)
|
||||||
, _moveCommand ()
|
, _moveCommand ()
|
||||||
, _zoomCommand ()
|
, _zoomCommand ()
|
||||||
, _rulerCommand ()
|
, _rulerCommand ()
|
||||||
, _selectCommand ()
|
, _selectCommand ()
|
||||||
, _hierarchyCommand ()
|
, _hierarchyCommand ()
|
||||||
, _cellHistory ()
|
, _cellHistory ()
|
||||||
, _firstShow (false)
|
, _firstShow (false)
|
||||||
, _toolInterrupt (false)
|
, _toolInterrupt (false)
|
||||||
, _updateState (ExternalEmit)
|
, _updateState (ExternalEmit)
|
||||||
{
|
{
|
||||||
setObjectName("viewer");
|
setObjectName("viewer");
|
||||||
|
|
||||||
|
|
|
@ -61,6 +61,9 @@
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
|
||||||
string getTime ( const char* format )
|
string getTime ( const char* format )
|
||||||
{
|
{
|
||||||
time_t t = time(NULL);
|
time_t t = time(NULL);
|
||||||
|
@ -1095,6 +1098,7 @@ namespace Hurricane {
|
||||||
, _cellModificated (true)
|
, _cellModificated (true)
|
||||||
, _enableRedrawInterrupt(false)
|
, _enableRedrawInterrupt(false)
|
||||||
, _selectors ()
|
, _selectors ()
|
||||||
|
, _activeCommand (NULL)
|
||||||
, _commands ()
|
, _commands ()
|
||||||
, _redrawRectCount (0)
|
, _redrawRectCount (0)
|
||||||
, _textFontHeight (20)
|
, _textFontHeight (20)
|
||||||
|
@ -1172,6 +1176,7 @@ namespace Hurricane {
|
||||||
for ( size_t i=0 ; i<_commands.size() ; i++ )
|
for ( size_t i=0 ; i<_commands.size() ; i++ )
|
||||||
if ( _commands[i] == command ) return;
|
if ( _commands[i] == command ) return;
|
||||||
|
|
||||||
|
command->setCellWidget ( this );
|
||||||
_commands.push_back ( command );
|
_commands.push_back ( command );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1182,6 +1187,8 @@ namespace Hurricane {
|
||||||
for ( ; i<_commands.size() ; i++ )
|
for ( ; i<_commands.size() ; i++ )
|
||||||
if ( _commands[i] == command ) break;
|
if ( _commands[i] == command ) break;
|
||||||
|
|
||||||
|
if ( i < _commands.size() ) _commands[i]->setCellWidget ( NULL );
|
||||||
|
|
||||||
for ( ; i+1<_commands.size() ; i++ )
|
for ( ; i+1<_commands.size() ; i++ )
|
||||||
_commands[i] = _commands[i+1];
|
_commands[i] = _commands[i+1];
|
||||||
|
|
||||||
|
@ -1806,10 +1813,17 @@ namespace Hurricane {
|
||||||
if ( onScreen ) pxGrad = dbuToScreenX ( graduation );
|
if ( onScreen ) pxGrad = dbuToScreenX ( graduation );
|
||||||
else pxGrad = dbuToDisplayX ( graduation );
|
else pxGrad = dbuToDisplayX ( graduation );
|
||||||
|
|
||||||
|
|
||||||
if ( tick % 10 ) {
|
if ( tick % 10 ) {
|
||||||
_drawingPlanes.painter().drawLine ( pxGrad, pxOrigin.y()
|
_drawingPlanes.painter().drawLine ( pxGrad, pxOrigin.y()
|
||||||
, pxGrad, pxOrigin.y()+((tick%2)?5:10) );
|
, pxGrad, pxOrigin.y()+((tick%2)?5:10) );
|
||||||
} else {
|
} else {
|
||||||
|
if ( tick == 0 ) {
|
||||||
|
int delta = (increase) ? 2 : -2;
|
||||||
|
_drawingPlanes.painter().drawLine ( pxGrad-delta, pxOrigin.y()
|
||||||
|
, pxGrad-delta, pxOrigin.y()+tickLength );
|
||||||
|
}
|
||||||
|
|
||||||
_drawingPlanes.painter().drawLine ( pxGrad, pxOrigin.y()
|
_drawingPlanes.painter().drawLine ( pxGrad, pxOrigin.y()
|
||||||
, pxGrad, pxOrigin.y()+tickLength );
|
, pxGrad, pxOrigin.y()+tickLength );
|
||||||
|
|
||||||
|
@ -1867,6 +1881,11 @@ namespace Hurricane {
|
||||||
_drawingPlanes.painter().drawLine ( pxAngle.x() , pyGrad
|
_drawingPlanes.painter().drawLine ( pxAngle.x() , pyGrad
|
||||||
, pxAngle.x()-((tick%2)?5:10), pyGrad );
|
, pxAngle.x()-((tick%2)?5:10), pyGrad );
|
||||||
} else {
|
} else {
|
||||||
|
if ( tick == 0 ) {
|
||||||
|
_drawingPlanes.painter().drawLine ( pxAngle.x() , pyGrad-2
|
||||||
|
, pxAngle.x()-tickLength, pyGrad-2);
|
||||||
|
}
|
||||||
|
|
||||||
_drawingPlanes.painter().drawLine ( pxAngle.x() , pyGrad
|
_drawingPlanes.painter().drawLine ( pxAngle.x() , pyGrad
|
||||||
, pxAngle.x()-tickLength, pyGrad );
|
, pxAngle.x()-tickLength, pyGrad );
|
||||||
|
|
||||||
|
@ -2234,7 +2253,7 @@ namespace Hurricane {
|
||||||
_drawingPlanes.begin ();
|
_drawingPlanes.begin ();
|
||||||
_drawingPlanes.copyToScreen ();
|
_drawingPlanes.copyToScreen ();
|
||||||
for ( size_t i=0 ; i<_commands.size() ; i++ )
|
for ( size_t i=0 ; i<_commands.size() ; i++ )
|
||||||
_commands[i]->draw ( this );
|
_commands[i]->draw ();
|
||||||
|
|
||||||
if ( isDrawable("spot") ) _spot.moveTo ( _mousePosition );
|
if ( isDrawable("spot") ) _spot.moveTo ( _mousePosition );
|
||||||
_drawingPlanes.end ();
|
_drawingPlanes.end ();
|
||||||
|
@ -2282,63 +2301,94 @@ namespace Hurricane {
|
||||||
|
|
||||||
void CellWidget::wheelEvent ( QWheelEvent* event )
|
void CellWidget::wheelEvent ( QWheelEvent* event )
|
||||||
{
|
{
|
||||||
bool commandActive = false;
|
event->ignore ();
|
||||||
for ( size_t i=0 ; i<_commands.size() && !commandActive; i++ )
|
for ( size_t i=0 ; (i<_commands.size()) and not event->isAccepted(); i++ ) {
|
||||||
commandActive = _commands[i]->wheelEvent ( this, event );
|
if ( _activeCommand
|
||||||
|
and (_commands[i] != _activeCommand )
|
||||||
if ( !commandActive ) QWidget::wheelEvent ( event );
|
and (_commands[i]->getType() != Command::AlwaysActive) )
|
||||||
|
continue;
|
||||||
|
_commands[i]->wheelEvent ( event );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CellWidget::keyPressEvent ( QKeyEvent* event )
|
void CellWidget::keyPressEvent ( QKeyEvent* event )
|
||||||
{
|
{
|
||||||
bool commandActive = false;
|
event->ignore ();
|
||||||
for ( size_t i=0 ; i<_commands.size() && !commandActive; i++ )
|
//cerr << "CellWidget::keyPressEvent " << event->isAccepted() << endl;
|
||||||
commandActive = _commands[i]->keyPressEvent ( this, event );
|
for ( size_t i=0 ; (i<_commands.size()) and not event->isAccepted(); i++ ) {
|
||||||
|
if ( _activeCommand
|
||||||
if ( !commandActive ) QWidget::keyPressEvent ( event );
|
and (_commands[i] != _activeCommand )
|
||||||
|
and (_commands[i]->getType() != Command::AlwaysActive) )
|
||||||
|
continue;
|
||||||
|
//cerr << " Calling [" << i << "] " << _commands[i]->getName() << endl;
|
||||||
|
_commands[i]->keyPressEvent ( event );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CellWidget::keyReleaseEvent ( QKeyEvent* event )
|
void CellWidget::keyReleaseEvent ( QKeyEvent* event )
|
||||||
{
|
{
|
||||||
bool commandActive = false;
|
event->ignore ();
|
||||||
for ( size_t i=0 ; i<_commands.size() && !commandActive; i++ )
|
//cerr << "CellWidget::keyReleaseEvent " << event->isAccepted() << endl;
|
||||||
commandActive = _commands[i]->keyReleaseEvent ( this, event );
|
for ( size_t i=0 ; (i<_commands.size()) and not event->isAccepted(); i++ ) {
|
||||||
|
if ( _activeCommand
|
||||||
if ( !commandActive ) QWidget::keyReleaseEvent ( event );
|
and (_commands[i] != _activeCommand )
|
||||||
|
and (_commands[i]->getType() != Command::AlwaysActive) )
|
||||||
|
continue;
|
||||||
|
//cerr << " Calling [" << i << "] " << _commands[i]->getName() << endl;
|
||||||
|
_commands[i]->keyReleaseEvent ( event );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CellWidget::mouseMoveEvent ( QMouseEvent* event )
|
void CellWidget::mouseMoveEvent ( QMouseEvent* event )
|
||||||
{
|
{
|
||||||
bool commandActive = false;
|
event->ignore ();
|
||||||
for ( size_t i=0 ; i<_commands.size() && !commandActive; i++ )
|
for ( size_t i=0 ; (i<_commands.size()) and not event->isAccepted(); i++ ) {
|
||||||
commandActive = _commands[i]->mouseMoveEvent ( this, event );
|
if ( _activeCommand
|
||||||
|
and (_commands[i] != _activeCommand )
|
||||||
if ( !commandActive ) {
|
and (_commands[i]->getType() != Command::AlwaysActive) )
|
||||||
_mousePosition = event->pos();
|
continue;
|
||||||
updateMousePosition ();
|
_commands[i]->mouseMoveEvent ( event );
|
||||||
repaint ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_mousePosition = event->pos();
|
||||||
|
updateMousePosition ();
|
||||||
|
repaint ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CellWidget::mousePressEvent ( QMouseEvent* event )
|
void CellWidget::mousePressEvent ( QMouseEvent* event )
|
||||||
{
|
{
|
||||||
bool commandActive = false;
|
event->ignore ();
|
||||||
for ( size_t i=0 ; i<_commands.size() && !commandActive; i++ )
|
//cerr << "CellWidget::mousePressEvent " << event->isAccepted() << endl;
|
||||||
commandActive = _commands[i]->mousePressEvent ( this, event );
|
for ( size_t i=0 ; (i<_commands.size()) and not event->isAccepted(); i++ ) {
|
||||||
|
if ( _activeCommand
|
||||||
|
and (_commands[i] != _activeCommand )
|
||||||
|
and (_commands[i]->getType() != Command::AlwaysActive) )
|
||||||
|
continue;
|
||||||
|
//cerr << " Calling [" << i << "] " << _commands[i]->getName() << endl;
|
||||||
|
_commands[i]->mousePressEvent ( event );
|
||||||
|
}
|
||||||
|
|
||||||
_spot.setShowSpot ( !commandActive );
|
_spot.setShowSpot ( !_activeCommand );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CellWidget::mouseReleaseEvent ( QMouseEvent* event )
|
void CellWidget::mouseReleaseEvent ( QMouseEvent* event )
|
||||||
{
|
{
|
||||||
bool commandActive = false;
|
event->ignore ();
|
||||||
for ( size_t i=0 ; i<_commands.size() && !commandActive; i++ )
|
//cerr << "CellWidget::mouseReleaseEvent " << event->isAccepted() << endl;
|
||||||
commandActive = _commands[i]->mouseReleaseEvent ( this, event );
|
for ( size_t i=0 ; (i<_commands.size()) and not event->isAccepted(); i++ ) {
|
||||||
|
if ( _activeCommand
|
||||||
|
and (_commands[i] != _activeCommand )
|
||||||
|
and (_commands[i]->getType() != Command::AlwaysActive) )
|
||||||
|
continue;
|
||||||
|
//cerr << " Calling [" << i << "] " << _commands[i]->getName() << endl;
|
||||||
|
_commands[i]->mouseReleaseEvent ( event );
|
||||||
|
}
|
||||||
|
//if ( not _activeCommand ) QWidget::mouseReleaseEvent ( event );
|
||||||
|
|
||||||
_spot.setShowSpot ( true );
|
_spot.setShowSpot ( true );
|
||||||
}
|
}
|
||||||
|
@ -2457,7 +2507,7 @@ namespace Hurricane {
|
||||||
|
|
||||||
Occurrences CellWidget::getOccurrencesUnder ( const Box& area ) const
|
Occurrences CellWidget::getOccurrencesUnder ( const Box& area ) const
|
||||||
{
|
{
|
||||||
return getCell()->getOccurrencesUnder(area).getSubSet(Occurrences_IsSelectable(this));
|
return getCell()->getOccurrencesUnder(area,3).getSubSet(Occurrences_IsSelectable(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -2519,6 +2569,7 @@ namespace Hurricane {
|
||||||
|
|
||||||
selector->attachTo(this);
|
selector->attachTo(this);
|
||||||
|
|
||||||
|
setShowSelection ( true );
|
||||||
_selectionHasChanged = true;
|
_selectionHasChanged = true;
|
||||||
if ( !_delaySelectionChanged ) emit selectionChanged(_selectors);
|
if ( !_delaySelectionChanged ) emit selectionChanged(_selectors);
|
||||||
}
|
}
|
||||||
|
@ -2592,13 +2643,35 @@ namespace Hurricane {
|
||||||
Property* property = occurrence.getProperty ( Selector::getPropertyName() );
|
Property* property = occurrence.getProperty ( Selector::getPropertyName() );
|
||||||
Selector* selector = NULL;
|
Selector* selector = NULL;
|
||||||
if ( !property ) {
|
if ( !property ) {
|
||||||
selector = Selector::create ( occurrence );
|
// Net special case.
|
||||||
selector->attachTo ( this );
|
Net* net = dynamic_cast<Net*>(occurrence.getEntity());
|
||||||
|
if ( net ) {
|
||||||
|
if ( occurrence.getPath().isEmpty() ) {
|
||||||
|
select ( net );
|
||||||
|
} else {
|
||||||
|
cerr << "[UNIMPLEMENTED] Selection of " << occurrence << endl;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
selector = Selector::create ( occurrence );
|
||||||
|
selector->attachTo ( this );
|
||||||
|
setShowSelection ( true );
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
selector = dynamic_cast<Selector*>(property);
|
selector = dynamic_cast<Selector*>(property);
|
||||||
if ( !selector )
|
if ( !selector )
|
||||||
throw Error ( "Abnormal property named " + getString(Selector::getPropertyName()) );
|
throw Error ( "Abnormal property named " + getString(Selector::getPropertyName()) );
|
||||||
selector->detachFrom ( this );
|
|
||||||
|
// Net special case.
|
||||||
|
Net* net = dynamic_cast<Net*>(occurrence.getEntity());
|
||||||
|
if ( net ) {
|
||||||
|
if ( occurrence.getPath().isEmpty() ) {
|
||||||
|
unselect ( net );
|
||||||
|
} else {
|
||||||
|
cerr << "[UNIMPLEMENTED] Selection of " << occurrence << endl;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
selector->detachFrom ( this );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_selectionHasChanged = true;
|
_selectionHasChanged = true;
|
||||||
|
|
|
@ -39,45 +39,35 @@ namespace Hurricane {
|
||||||
|
|
||||||
|
|
||||||
Command::Command ()
|
Command::Command ()
|
||||||
: _cellWidgets()
|
: _cellWidget()
|
||||||
, _active(false)
|
, _active (false)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
|
||||||
Command::~Command ()
|
Command::~Command ()
|
||||||
{
|
{
|
||||||
set<CellWidget*>::iterator iwidget = _cellWidgets.begin();
|
if ( _cellWidget ) _cellWidget->unbindCommand ( this );
|
||||||
for ( ; iwidget != _cellWidgets.end() ; iwidget++ )
|
|
||||||
(*iwidget)->unbindCommand ( this );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Command::wheelEvent ( CellWidget*, QWheelEvent* )
|
Command::Type Command::getType () const
|
||||||
{ return false; }
|
{ return Normal; }
|
||||||
|
|
||||||
|
|
||||||
bool Command::keyPressEvent ( CellWidget*, QKeyEvent* )
|
void Command::setActive ( bool state )
|
||||||
{ return false; }
|
{
|
||||||
|
_active = state;
|
||||||
|
_cellWidget->setActiveCommand ( (state and (getType() != AlwaysActive)) ? this : NULL );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Command::keyReleaseEvent ( CellWidget*, QKeyEvent* )
|
void Command::wheelEvent ( QWheelEvent* ) { }
|
||||||
{ return false; }
|
void Command::keyPressEvent ( QKeyEvent* ) { }
|
||||||
|
void Command::keyReleaseEvent ( QKeyEvent* ) { }
|
||||||
|
void Command::mouseMoveEvent ( QMouseEvent* ) { }
|
||||||
bool Command::mouseMoveEvent ( CellWidget*, QMouseEvent* )
|
void Command::mousePressEvent ( QMouseEvent* ) { }
|
||||||
{ return false; }
|
void Command::mouseReleaseEvent ( QMouseEvent* ) { }
|
||||||
|
void Command::draw () { }
|
||||||
|
|
||||||
bool Command::mousePressEvent ( CellWidget*, QMouseEvent* )
|
|
||||||
{ return false; }
|
|
||||||
|
|
||||||
|
|
||||||
bool Command::mouseReleaseEvent ( CellWidget*, QMouseEvent* )
|
|
||||||
{ return false; }
|
|
||||||
|
|
||||||
|
|
||||||
void Command::draw ( CellWidget* )
|
|
||||||
{ }
|
|
||||||
|
|
||||||
|
|
||||||
} // End of Hurricane namespace.
|
} // End of Hurricane namespace.
|
||||||
|
|
|
@ -40,62 +40,64 @@ namespace Hurricane {
|
||||||
// Class : "HierarchyCommand".
|
// Class : "HierarchyCommand".
|
||||||
|
|
||||||
|
|
||||||
|
string HierarchyCommand::_name = "HierarchyCommand";
|
||||||
|
|
||||||
|
|
||||||
HierarchyCommand::HierarchyCommand ()
|
HierarchyCommand::HierarchyCommand ()
|
||||||
: Command ()
|
: Command ()
|
||||||
, _history()
|
, _history ()
|
||||||
, _historyIndex(0)
|
, _historyIndex(0)
|
||||||
{
|
{ }
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
HierarchyCommand::~HierarchyCommand ()
|
HierarchyCommand::~HierarchyCommand ()
|
||||||
{
|
{ }
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool HierarchyCommand::keyReleaseEvent ( CellWidget* widget, QKeyEvent* event )
|
const string& HierarchyCommand::getName () const
|
||||||
|
{ return _name; }
|
||||||
|
|
||||||
|
|
||||||
|
void HierarchyCommand::keyReleaseEvent ( QKeyEvent* event )
|
||||||
{
|
{
|
||||||
bool control = (event->modifiers() & Qt::ControlModifier);
|
bool control = (event->modifiers() & Qt::ControlModifier);
|
||||||
bool shift = (event->modifiers() & Qt::ShiftModifier );
|
bool shift = (event->modifiers() & Qt::ShiftModifier );
|
||||||
|
|
||||||
if ( !shift && !control ) return false;
|
if ( !shift && !control ) return;
|
||||||
if ( !widget->getCell() ) return false;
|
if ( !_cellWidget->getCell() ) return;
|
||||||
|
|
||||||
QPoint position ( widget->mapFromGlobal(QCursor::pos()) );
|
QPoint position ( _cellWidget->mapFromGlobal(QCursor::pos()) );
|
||||||
Box pointBox ( widget->screenToDbuBox(QRect(position,QSize(1,1))) );
|
Box pointBox ( _cellWidget->screenToDbuBox(QRect(position,QSize(1,1))) );
|
||||||
|
|
||||||
switch ( event->key() ) {
|
switch ( event->key() ) {
|
||||||
case Qt::Key_Up:
|
case Qt::Key_Up:
|
||||||
if ( ( _historyIndex > 0 ) && (shift || control) ) {
|
if ( ( _historyIndex > 0 ) && (shift || control) ) {
|
||||||
widget->setState ( _history[--_historyIndex]._state );
|
_cellWidget->setState ( _history[--_historyIndex]._state );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Qt::Key_Down:
|
case Qt::Key_Down:
|
||||||
{
|
{
|
||||||
if ( control ) {
|
if ( control ) {
|
||||||
if ( _history.empty() )
|
if ( _history.empty() )
|
||||||
_history.push_back ( HistoryEntry ( NULL, widget->getState() ) );
|
_history.push_back ( HistoryEntry ( NULL, _cellWidget->getState() ) );
|
||||||
|
|
||||||
Instances instances = widget->getCell()->getInstancesUnder ( pointBox );
|
Instances instances = _cellWidget->getCell()->getInstancesUnder ( pointBox );
|
||||||
if ( !instances.isEmpty() ) {
|
if ( !instances.isEmpty() ) {
|
||||||
_history.erase ( _history.begin()+_historyIndex+1, _history.end() );
|
_history.erase ( _history.begin()+_historyIndex+1, _history.end() );
|
||||||
|
|
||||||
Instance* instance = instances.getFirst ();
|
Instance* instance = instances.getFirst ();
|
||||||
widget->setCell ( instance->getMasterCell() );
|
_cellWidget->setCell ( instance->getMasterCell() );
|
||||||
_history.push_back ( HistoryEntry ( instance, widget->getState() ) );
|
_history.push_back ( HistoryEntry ( instance, _cellWidget->getState() ) );
|
||||||
_historyIndex++;
|
_historyIndex++;
|
||||||
}
|
}
|
||||||
} else if ( shift ) {
|
} else if ( shift ) {
|
||||||
if ( _historyIndex+1 < _history.size() ) {
|
if ( _historyIndex+1 < _history.size() ) {
|
||||||
widget->setState ( _history[++_historyIndex]._state );
|
_cellWidget->setState ( _history[++_historyIndex]._state );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -37,6 +37,9 @@ namespace Hurricane {
|
||||||
// Class : "MoveCommand".
|
// Class : "MoveCommand".
|
||||||
|
|
||||||
|
|
||||||
|
string MoveCommand::_name = "MoveCommand";
|
||||||
|
|
||||||
|
|
||||||
MoveCommand::MoveCommand ()
|
MoveCommand::MoveCommand ()
|
||||||
: Command ()
|
: Command ()
|
||||||
, _firstEvent (true)
|
, _firstEvent (true)
|
||||||
|
@ -48,47 +51,53 @@ namespace Hurricane {
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
|
||||||
bool MoveCommand::keyPressEvent ( CellWidget* widget, QKeyEvent* event )
|
const string& MoveCommand::getName () const
|
||||||
|
{ return _name; }
|
||||||
|
|
||||||
|
|
||||||
|
Command::Type MoveCommand::getType () const
|
||||||
|
{ return AlwaysActive; }
|
||||||
|
|
||||||
|
|
||||||
|
void MoveCommand::keyPressEvent ( QKeyEvent* event )
|
||||||
{
|
{
|
||||||
if ( event->modifiers() & (Qt::ControlModifier|Qt::ShiftModifier) )
|
if ( event->modifiers() & (Qt::ControlModifier|Qt::ShiftModifier) )
|
||||||
return false;
|
return;
|
||||||
|
|
||||||
switch ( event->key() ) {
|
switch ( event->key() ) {
|
||||||
case Qt::Key_Up: widget->goUp (); return true;
|
case Qt::Key_Up: _cellWidget->goUp (); return;
|
||||||
case Qt::Key_Down: widget->goDown (); return true;
|
case Qt::Key_Down: _cellWidget->goDown (); return;
|
||||||
case Qt::Key_Left: widget->goLeft (); return true;
|
case Qt::Key_Left: _cellWidget->goLeft (); return;
|
||||||
case Qt::Key_Right: widget->goRight (); return true;
|
case Qt::Key_Right: _cellWidget->goRight (); return;
|
||||||
case Qt::Key_Space:
|
case Qt::Key_Space:
|
||||||
if ( !isActive() ) {
|
if ( !isActive() ) {
|
||||||
setActive ( true );
|
setActive ( true );
|
||||||
_firstEvent = true;
|
_firstEvent = true;
|
||||||
//_lastPosition = widget->getMousePosition();
|
//_lastPosition = _cellWidget->getMousePosition();
|
||||||
widget->pushCursor ( Qt::ClosedHandCursor );
|
_cellWidget->pushCursor ( Qt::ClosedHandCursor );
|
||||||
return true;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool MoveCommand::keyReleaseEvent ( CellWidget* widget, QKeyEvent* event )
|
void MoveCommand::keyReleaseEvent ( QKeyEvent* event )
|
||||||
{
|
{
|
||||||
switch ( event->key() ) {
|
switch ( event->key() ) {
|
||||||
case Qt::Key_Space:
|
case Qt::Key_Space:
|
||||||
if ( isActive() && !event->isAutoRepeat() ) {
|
if ( isActive() && !event->isAutoRepeat() ) {
|
||||||
setActive ( false );
|
setActive ( false );
|
||||||
widget->popCursor ();
|
_cellWidget->popCursor ();
|
||||||
return true;
|
return;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool MoveCommand::mouseMoveEvent ( CellWidget* widget, QMouseEvent* event )
|
void MoveCommand::mouseMoveEvent ( QMouseEvent* event )
|
||||||
{
|
{
|
||||||
if ( !isActive() ) return false;
|
if ( !isActive() ) return;
|
||||||
|
|
||||||
QPoint eventPosition = event->pos();
|
QPoint eventPosition = event->pos();
|
||||||
if ( _firstEvent ) { _firstEvent = false; _lastPosition = eventPosition; }
|
if ( _firstEvent ) { _firstEvent = false; _lastPosition = eventPosition; }
|
||||||
|
@ -101,24 +110,10 @@ namespace Hurricane {
|
||||||
dx -= rx;
|
dx -= rx;
|
||||||
dy -= ry;
|
dy -= ry;
|
||||||
|
|
||||||
if ( dx > 0 ) widget->goLeft ( dx );
|
if ( dx > 0 ) _cellWidget->goLeft ( dx );
|
||||||
if ( dx < 0 ) widget->goRight ( -dx );
|
if ( dx < 0 ) _cellWidget->goRight ( -dx );
|
||||||
if ( dy > 0 ) widget->goUp ( dy );
|
if ( dy > 0 ) _cellWidget->goUp ( dy );
|
||||||
if ( dy < 0 ) widget->goDown ( -dy );
|
if ( dy < 0 ) _cellWidget->goDown ( -dy );
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool MoveCommand::mousePressEvent ( CellWidget* widget, QMouseEvent* event )
|
|
||||||
{
|
|
||||||
return isActive();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool MoveCommand::mouseReleaseEvent ( CellWidget* widget, QMouseEvent* event )
|
|
||||||
{
|
|
||||||
return isActive();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -37,9 +37,12 @@ namespace Hurricane {
|
||||||
// Class : "RulerCommand".
|
// Class : "RulerCommand".
|
||||||
|
|
||||||
|
|
||||||
|
string RulerCommand::_name = "RulerCommand";
|
||||||
|
|
||||||
|
|
||||||
RulerCommand::RulerCommand ()
|
RulerCommand::RulerCommand ()
|
||||||
: Command ()
|
: Command()
|
||||||
, _ruler ()
|
, _ruler ()
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
|
||||||
|
@ -47,62 +50,54 @@ namespace Hurricane {
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
|
||||||
bool RulerCommand::keyPressEvent ( CellWidget* widget, QKeyEvent* event )
|
const string& RulerCommand::getName () const
|
||||||
{
|
{ return _name; }
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool RulerCommand::keyReleaseEvent ( CellWidget* widget, QKeyEvent* event )
|
void RulerCommand::mouseMoveEvent ( QMouseEvent* event )
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool RulerCommand::mouseMoveEvent ( CellWidget* widget, QMouseEvent* event )
|
|
||||||
{
|
|
||||||
if ( !isActive() ) return false;
|
|
||||||
|
|
||||||
_ruler->setExtremity ( widget->_onSnapGrid(widget->screenToDbuPoint(event->pos())) );
|
|
||||||
widget->update ();
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool RulerCommand::mousePressEvent ( CellWidget* widget, QMouseEvent* event )
|
|
||||||
{
|
|
||||||
if ( event->modifiers() & Qt::ShiftModifier ) {
|
|
||||||
if ( event->button() == Qt::LeftButton ) {
|
|
||||||
if ( !isActive() ) {
|
|
||||||
setActive ( true );
|
|
||||||
_ruler.reset ( new Ruler
|
|
||||||
(widget->_onSnapGrid(widget->screenToDbuPoint(widget->getMousePosition())) ) );
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
widget->addRuler ( _ruler );
|
|
||||||
setActive ( false );
|
|
||||||
_ruler.reset ();
|
|
||||||
}
|
|
||||||
} else if ( event->button() == Qt::RightButton ){
|
|
||||||
if ( isActive() ) {
|
|
||||||
setActive ( false );
|
|
||||||
_ruler.reset ();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return isActive();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool RulerCommand::mouseReleaseEvent ( CellWidget* widget, QMouseEvent* event )
|
|
||||||
{ return false; }
|
|
||||||
|
|
||||||
|
|
||||||
void RulerCommand::draw ( CellWidget* widget )
|
|
||||||
{
|
{
|
||||||
if ( !isActive() ) return;
|
if ( !isActive() ) return;
|
||||||
widget->drawRuler ( _ruler );
|
|
||||||
|
_ruler->setExtremity ( _cellWidget->_onSnapGrid(_cellWidget->screenToDbuPoint(event->pos())) );
|
||||||
|
_cellWidget->update ();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void RulerCommand::mousePressEvent ( QMouseEvent* event )
|
||||||
|
{
|
||||||
|
if ( (event->modifiers() & Qt::ShiftModifier )
|
||||||
|
and (event->button() == Qt::LeftButton ) ) {
|
||||||
|
setActive ( true );
|
||||||
|
_ruler.reset ( new Ruler
|
||||||
|
(_cellWidget->_onSnapGrid(_cellWidget->screenToDbuPoint(_cellWidget->getMousePosition())) ) );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( isActive() ) {
|
||||||
|
if ( event->button() != Qt::RightButton )
|
||||||
|
_cellWidget->addRuler ( _ruler );
|
||||||
|
|
||||||
|
setActive ( false );
|
||||||
|
_ruler.reset ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void RulerCommand::keyPressEvent ( QKeyEvent* event )
|
||||||
|
{
|
||||||
|
if ( !isActive() ) return;
|
||||||
|
|
||||||
|
if ( event->key() == Qt::Key_Escape ) {
|
||||||
|
setActive ( false );
|
||||||
|
_ruler.reset ();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void RulerCommand::draw ()
|
||||||
|
{
|
||||||
|
if ( !isActive() ) return;
|
||||||
|
_cellWidget->drawRuler ( _ruler );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -23,27 +23,182 @@
|
||||||
// x-----------------------------------------------------------------x
|
// x-----------------------------------------------------------------x
|
||||||
|
|
||||||
|
|
||||||
#include <QMouseEvent>
|
#include <QMouseEvent>
|
||||||
#include <QKeyEvent>
|
#include <QKeyEvent>
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
|
|
||||||
#include "hurricane/Cell.h"
|
#include <boost/regex.hpp>
|
||||||
|
|
||||||
#include "hurricane/viewer/CellWidget.h"
|
#include "hurricane/Path.h"
|
||||||
#include "hurricane/viewer/SelectCommand.h"
|
#include "hurricane/Entity.h"
|
||||||
#include "hurricane/viewer/SelectionPopup.h"
|
#include "hurricane/Net.h"
|
||||||
|
#include "hurricane/Component.h"
|
||||||
|
#include "hurricane/Occurrence.h"
|
||||||
|
#include "hurricane/HyperNet.h"
|
||||||
|
#include "hurricane/Cell.h"
|
||||||
|
#include "hurricane/viewer/CellWidget.h"
|
||||||
|
#include "hurricane/viewer/SelectCommand.h"
|
||||||
|
#include "hurricane/viewer/SelectionPopup.h"
|
||||||
|
|
||||||
|
|
||||||
namespace Hurricane {
|
namespace Hurricane {
|
||||||
|
|
||||||
|
|
||||||
|
typedef Locator<Occurrence> OccurrenceLoc;
|
||||||
|
typedef Collection<Occurrence> OccurrenceCol;
|
||||||
|
|
||||||
|
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
// Class : "Hurricane::Occurrence_GetNets".
|
||||||
|
|
||||||
|
|
||||||
|
class Occurrences_GetNets : public OccurrenceCol {
|
||||||
|
|
||||||
|
public:
|
||||||
|
// Sub-Class: Locator.
|
||||||
|
class Locator : public OccurrenceLoc {
|
||||||
|
public:
|
||||||
|
Locator ( Occurrences, bool hideAnon );
|
||||||
|
inline Locator ( const Locator& );
|
||||||
|
inline ~Locator ();
|
||||||
|
virtual Occurrence getElement () const;
|
||||||
|
virtual OccurrenceLoc* getClone () const;
|
||||||
|
virtual bool isValid () const;
|
||||||
|
virtual void progress ();
|
||||||
|
virtual string _getString () const;
|
||||||
|
protected:
|
||||||
|
OccurrenceLoc* _primaryLoc;
|
||||||
|
Occurrence _element;
|
||||||
|
set<Occurrence> _netOccurrences;
|
||||||
|
bool _hideAnonymous;
|
||||||
|
};
|
||||||
|
|
||||||
|
public:
|
||||||
|
// Occurrences_GetNets Methods.
|
||||||
|
inline Occurrences_GetNets ( Occurrences, bool hideAnon );
|
||||||
|
inline Occurrences_GetNets ( const Occurrences_GetNets& );
|
||||||
|
virtual OccurrenceCol* getClone () const;
|
||||||
|
virtual OccurrenceLoc* getLocator () const;
|
||||||
|
virtual string _getString () const;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// Occurrences_GetNets Attributes.
|
||||||
|
Occurrences _primaryCol;
|
||||||
|
bool _hideAnonymous;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
inline Occurrences_GetNets::Locator::Locator ( const Locator &locator )
|
||||||
|
: OccurrenceLoc ()
|
||||||
|
, _primaryLoc (locator._primaryLoc->getClone())
|
||||||
|
, _element ()
|
||||||
|
, _netOccurrences()
|
||||||
|
, _hideAnonymous (locator._hideAnonymous)
|
||||||
|
{ }
|
||||||
|
|
||||||
|
|
||||||
|
inline Occurrences_GetNets::Locator::~Locator ()
|
||||||
|
{ delete _primaryLoc; }
|
||||||
|
|
||||||
|
|
||||||
|
inline Occurrences_GetNets::Occurrences_GetNets ( Occurrences primaryCol, bool hideAnon )
|
||||||
|
: OccurrenceCol ()
|
||||||
|
, _primaryCol (primaryCol)
|
||||||
|
, _hideAnonymous(hideAnon)
|
||||||
|
{ }
|
||||||
|
|
||||||
|
|
||||||
|
inline Occurrences_GetNets::Occurrences_GetNets ( const Occurrences_GetNets& occurrences )
|
||||||
|
: OccurrenceCol ()
|
||||||
|
, _primaryCol (occurrences._primaryCol)
|
||||||
|
, _hideAnonymous(occurrences._hideAnonymous)
|
||||||
|
{ }
|
||||||
|
|
||||||
|
|
||||||
|
Occurrences_GetNets::Locator::Locator ( Occurrences primaryCol, bool hideAnon )
|
||||||
|
: OccurrenceLoc ()
|
||||||
|
, _primaryLoc (primaryCol.getLocator())
|
||||||
|
, _element ()
|
||||||
|
, _netOccurrences()
|
||||||
|
, _hideAnonymous (hideAnon)
|
||||||
|
{ progress (); }
|
||||||
|
|
||||||
|
|
||||||
|
OccurrenceLoc* Occurrences_GetNets::Locator::getClone () const
|
||||||
|
{ return new Locator(*this); }
|
||||||
|
|
||||||
|
|
||||||
|
Occurrence Occurrences_GetNets::Locator::getElement () const
|
||||||
|
{ return _element; }
|
||||||
|
|
||||||
|
|
||||||
|
bool Occurrences_GetNets::Locator::isValid () const
|
||||||
|
{ return _primaryLoc->isValid(); }
|
||||||
|
|
||||||
|
|
||||||
|
void Occurrences_GetNets::Locator::progress ()
|
||||||
|
{
|
||||||
|
ltrace(80) << "Occurrences_GetNets::Locator::progress()" << endl;
|
||||||
|
|
||||||
|
boost::regex pattern ( "onymous" );
|
||||||
|
boost::smatch match;
|
||||||
|
|
||||||
|
for ( ; _primaryLoc->isValid() ; _primaryLoc->progress() ) {
|
||||||
|
Occurrence element = _primaryLoc->getElement();
|
||||||
|
|
||||||
|
Component* component = dynamic_cast<Component*>(element.getEntity());
|
||||||
|
if ( not component ) continue;
|
||||||
|
|
||||||
|
Net* net = component->getNet();
|
||||||
|
Occurrence netOccurrence ( net, element.getPath() );
|
||||||
|
|
||||||
|
if ( _hideAnonymous
|
||||||
|
and boost::regex_search(getString(net->getName()),match,pattern,boost::match_extra) )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
_element = getHyperNetRootNetOccurrence ( netOccurrence );
|
||||||
|
|
||||||
|
if ( _netOccurrences.find(_element) != _netOccurrences.end() ) continue;
|
||||||
|
_netOccurrences.insert ( _element );
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
string Occurrences_GetNets::Locator::_getString () const
|
||||||
|
{
|
||||||
|
string s = "<" + _TName("Occurrences_GetNets::Locator") + ">";
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
OccurrenceCol* Occurrences_GetNets::getClone () const
|
||||||
|
{ return new Occurrences_GetNets(*this); }
|
||||||
|
|
||||||
|
|
||||||
|
OccurrenceLoc* Occurrences_GetNets::getLocator () const
|
||||||
|
{ return new Locator(_primaryCol,_hideAnonymous); }
|
||||||
|
|
||||||
|
|
||||||
|
string Occurrences_GetNets::_getString () const
|
||||||
|
{
|
||||||
|
string s = "<" + _TName("Occurrences_GetNets") + ">";
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
// Class : "SelectCommand".
|
// Class : "SelectCommand".
|
||||||
|
|
||||||
|
|
||||||
|
string SelectCommand::_name = "SelectCommand";
|
||||||
|
|
||||||
|
|
||||||
SelectCommand::SelectCommand ()
|
SelectCommand::SelectCommand ()
|
||||||
: AreaCommand()
|
: AreaCommand ()
|
||||||
, _selectionPopup(NULL)
|
, _selectionPopup(NULL)
|
||||||
|
, _selectMode (0)
|
||||||
{
|
{
|
||||||
_selectionPopup = new SelectionPopup ();
|
_selectionPopup = new SelectionPopup ();
|
||||||
|
|
||||||
|
@ -53,39 +208,64 @@ namespace Hurricane {
|
||||||
|
|
||||||
|
|
||||||
SelectCommand::~SelectCommand ()
|
SelectCommand::~SelectCommand ()
|
||||||
|
{ delete _selectionPopup; }
|
||||||
|
|
||||||
|
|
||||||
|
const string& SelectCommand::getName () const
|
||||||
|
{ return _name; }
|
||||||
|
|
||||||
|
|
||||||
|
void SelectCommand::keyPressEvent ( QKeyEvent* event )
|
||||||
{
|
{
|
||||||
delete _selectionPopup;
|
if ( event->key() == Qt::Key_N ) {
|
||||||
|
event->accept();
|
||||||
|
_selectMode = (++_selectMode) % 3;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool SelectCommand::mousePressEvent ( CellWidget* widget, QMouseEvent* event )
|
void SelectCommand::mousePressEvent ( QMouseEvent* event )
|
||||||
{
|
{
|
||||||
if ( isActive() ) return true;
|
if ( isActive() ) return;
|
||||||
|
|
||||||
if ( event->button() == Qt::RightButton ) {
|
if ( event->button() == Qt::RightButton ) {
|
||||||
if ( !event->modifiers() ) {
|
if ( !event->modifiers() ) {
|
||||||
|
event->accept ();
|
||||||
setActive ( true );
|
setActive ( true );
|
||||||
setStartPoint ( event->pos() );
|
setStartPoint ( event->pos() );
|
||||||
setDrawingEnabled ( true );
|
setDrawingEnabled ( true );
|
||||||
} else if ( event->modifiers() == Qt::ControlModifier ) {
|
} else if ( event->modifiers() == Qt::ControlModifier ) {
|
||||||
QRect selectArea ( event->pos() - QPoint(2,2), QSize(4,4) );
|
event->accept ();
|
||||||
forEach ( Occurrence, ioccurrence, widget->getOccurrencesUnder(selectArea) )
|
|
||||||
_selectionPopup->add ( *ioccurrence );
|
|
||||||
|
|
||||||
|
QRect selectArea ( event->pos() - QPoint(2,2), QSize(4,4) );
|
||||||
|
//_selectionPopup->loadOccurrences ( _cellWidget->getOccurrencesUnder(selectArea) );
|
||||||
|
Occurrences selection;
|
||||||
|
switch ( _selectMode ) {
|
||||||
|
case 0:
|
||||||
|
selection = _cellWidget->getOccurrencesUnder(selectArea);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
selection = Occurrences_GetNets(_cellWidget->getOccurrencesUnder(selectArea),false);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
selection = Occurrences_GetNets(_cellWidget->getOccurrencesUnder(selectArea),true);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
_selectionPopup->loadOccurrences ( selection );
|
||||||
_selectionPopup->updateLayout ();
|
_selectionPopup->updateLayout ();
|
||||||
_selectionPopup->move ( event->globalPos() );
|
_selectionPopup->move ( event->globalPos() );
|
||||||
_selectionPopup->popup ();
|
_selectionPopup->popup ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return isActive();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool SelectCommand::mouseReleaseEvent ( CellWidget* widget, QMouseEvent* event )
|
void SelectCommand::mouseReleaseEvent ( QMouseEvent* event )
|
||||||
{
|
{
|
||||||
if ( !isActive() )
|
if ( !isActive() ) return;
|
||||||
_startPoint = _stopPoint = event->pos();
|
//_startPoint = _stopPoint = event->pos();
|
||||||
|
|
||||||
|
event->accept ();
|
||||||
|
|
||||||
setActive ( false );
|
setActive ( false );
|
||||||
setDrawingEnabled ( false );
|
setDrawingEnabled ( false );
|
||||||
|
@ -96,16 +276,14 @@ namespace Hurricane {
|
||||||
else
|
else
|
||||||
selectArea = QRect ( _startPoint, _stopPoint );
|
selectArea = QRect ( _startPoint, _stopPoint );
|
||||||
|
|
||||||
//widget->unselectAll ();
|
//_cellWidget->unselectAll ();
|
||||||
widget->selectOccurrencesUnder ( widget->screenToDbuBox(selectArea) );
|
_cellWidget->selectOccurrencesUnder ( _cellWidget->screenToDbuBox(selectArea) );
|
||||||
bool somethingSelected = !widget->getSelectorSet().empty();
|
bool somethingSelected = !_cellWidget->getSelectorSet().empty();
|
||||||
|
|
||||||
if ( widget->getState()->showSelection() != somethingSelected )
|
if ( _cellWidget->showSelection() != somethingSelected )
|
||||||
widget->setShowSelection ( somethingSelected );
|
_cellWidget->setShowSelection ( somethingSelected );
|
||||||
else
|
else
|
||||||
widget->refresh ();
|
_cellWidget->refresh ();
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
// -*- C++ -*-
|
// -*- C++ -*-
|
||||||
//
|
//
|
||||||
// This file is part of the Coriolis Software.
|
// This file is part of the Coriolis Software.
|
||||||
// Copyright (c) UPMC/LIP6 2008-2008, All Rights Reserved
|
// Copyright (c) UPMC/LIP6 2008-2009, All Rights Reserved
|
||||||
//
|
//
|
||||||
// ===================================================================
|
// ===================================================================
|
||||||
//
|
//
|
||||||
|
@ -29,16 +29,18 @@
|
||||||
#include <QGroupBox>
|
#include <QGroupBox>
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
|
|
||||||
#include "hurricane/Commons.h"
|
#include "hurricane/Commons.h"
|
||||||
|
#include "hurricane/viewer/Graphics.h"
|
||||||
#include "hurricane/viewer/Graphics.h"
|
#include "hurricane/viewer/SelectionPopupModel.h"
|
||||||
#include "hurricane/viewer/SelectionPopupModel.h"
|
#include "hurricane/viewer/SelectionPopup.h"
|
||||||
#include "hurricane/viewer/SelectionPopup.h"
|
|
||||||
|
|
||||||
|
|
||||||
namespace Hurricane {
|
namespace Hurricane {
|
||||||
|
|
||||||
|
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
// Class : "Hurricane::SelectionPopup".
|
||||||
|
|
||||||
|
|
||||||
SelectionPopup::SelectionPopup ( QWidget* parent )
|
SelectionPopup::SelectionPopup ( QWidget* parent )
|
||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
|
@ -98,9 +100,8 @@ namespace Hurricane {
|
||||||
|
|
||||||
void SelectionPopup::keyPressEvent ( QKeyEvent* event )
|
void SelectionPopup::keyPressEvent ( QKeyEvent* event )
|
||||||
{
|
{
|
||||||
cerr << "SelectionPopup::keyPressEvent()" << endl;
|
//cerr << "SelectionPopup::keyPressEvent()" << endl;
|
||||||
|
//QWidget::keyPressEvent ( event );
|
||||||
QWidget::keyPressEvent ( event );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -132,16 +133,12 @@ namespace Hurricane {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SelectionPopup::add ( Occurrence occurrence, bool showChange )
|
void SelectionPopup::loadOccurrences ( Occurrences occurrences, bool showChange )
|
||||||
{
|
{ _model->loadOccurrences ( occurrences, showChange ); }
|
||||||
_model->add ( occurrence, showChange );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void SelectionPopup::clear ()
|
void SelectionPopup::clear ()
|
||||||
{
|
{ _model->clear (); }
|
||||||
_model->clear ();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void SelectionPopup::updateLayout ()
|
void SelectionPopup::updateLayout ()
|
||||||
|
@ -158,4 +155,12 @@ namespace Hurricane {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SelectionPopup::clearFilter ()
|
||||||
|
{ if (_model) _model->clearFilter(); }
|
||||||
|
|
||||||
|
|
||||||
|
void SelectionPopup::setFilter ( OccurrenceFilter filter )
|
||||||
|
{ if (_model) _model->setFilter(filter); }
|
||||||
|
|
||||||
|
|
||||||
} // End of Hurricane namespace.
|
} // End of Hurricane namespace.
|
||||||
|
|
|
@ -36,23 +36,56 @@
|
||||||
namespace Hurricane {
|
namespace Hurricane {
|
||||||
|
|
||||||
|
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
// Class : "Occurrence_AcceptAll".
|
||||||
|
|
||||||
|
|
||||||
|
class Occurrence_AcceptAll : public Filter<Occurrence> {
|
||||||
|
public:
|
||||||
|
virtual Filter<Occurrence>* getClone () const;
|
||||||
|
virtual bool accept ( Occurrence ) const;
|
||||||
|
virtual string _getString () const;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Filter<Occurrence>* Occurrence_AcceptAll::getClone () const { return new Occurrence_AcceptAll(); }
|
||||||
|
bool Occurrence_AcceptAll::accept ( Occurrence ) const { return true; }
|
||||||
|
string Occurrence_AcceptAll::_getString () const { return "<Occurrence_AcceptAll>"; }
|
||||||
|
|
||||||
|
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
// Class : "Hurricane::SelectionPopupModel".
|
||||||
|
|
||||||
|
|
||||||
SelectionPopupModel::SelectionPopupModel ( QObject* parent )
|
SelectionPopupModel::SelectionPopupModel ( QObject* parent )
|
||||||
: QAbstractTableModel(parent)
|
: QAbstractTableModel(parent)
|
||||||
, _occurrences(NULL)
|
, _filter (new Occurrence_AcceptAll())
|
||||||
|
, _occurrences (NULL)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
|
||||||
SelectionPopupModel::~SelectionPopupModel ()
|
SelectionPopupModel::~SelectionPopupModel ()
|
||||||
{
|
{ clear (); }
|
||||||
clear ();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void SelectionPopupModel::add ( Occurrence occurrence, bool showChange )
|
void SelectionPopupModel::clearFilter ()
|
||||||
|
{ _filter = new Occurrence_AcceptAll(); }
|
||||||
|
|
||||||
|
|
||||||
|
void SelectionPopupModel::setFilter ( OccurrenceFilter filter )
|
||||||
|
{ _filter = filter; }
|
||||||
|
|
||||||
|
|
||||||
|
OccurrenceFilter SelectionPopupModel::getFilter ()
|
||||||
|
{ return _filter; }
|
||||||
|
|
||||||
|
|
||||||
|
void SelectionPopupModel::loadOccurrences ( Occurrences occurrences, bool showChange )
|
||||||
{
|
{
|
||||||
if ( !_occurrences ) _occurrences = new vector<Occurrence> ();
|
if ( !_occurrences ) _occurrences = new vector<Occurrence> ();
|
||||||
|
forEach ( Occurrence, ioccurrence, occurrences.getSubSet(getFilter()) ) {
|
||||||
_occurrences->push_back ( occurrence );
|
_occurrences->push_back ( *ioccurrence );
|
||||||
|
}
|
||||||
if ( showChange ) emit layoutChanged ();
|
if ( showChange ) emit layoutChanged ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,9 +101,7 @@ namespace Hurricane {
|
||||||
|
|
||||||
|
|
||||||
void SelectionPopupModel::updateLayout ()
|
void SelectionPopupModel::updateLayout ()
|
||||||
{
|
{ emit layoutChanged (); }
|
||||||
emit layoutChanged ();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
QVariant SelectionPopupModel::data ( const QModelIndex& index, int role ) const
|
QVariant SelectionPopupModel::data ( const QModelIndex& index, int role ) const
|
||||||
|
|
|
@ -38,6 +38,9 @@ namespace Hurricane {
|
||||||
// Class : "ZoomCommand".
|
// Class : "ZoomCommand".
|
||||||
|
|
||||||
|
|
||||||
|
string ZoomCommand::_name = "ZoomCommand";
|
||||||
|
|
||||||
|
|
||||||
ZoomCommand::ZoomCommand ()
|
ZoomCommand::ZoomCommand ()
|
||||||
: AreaCommand()
|
: AreaCommand()
|
||||||
{ }
|
{ }
|
||||||
|
@ -47,51 +50,56 @@ namespace Hurricane {
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
|
||||||
bool ZoomCommand::wheelEvent ( CellWidget* widget, QWheelEvent* event )
|
const string& ZoomCommand::getName () const
|
||||||
{
|
{ return _name; }
|
||||||
if ( event->delta() > 0 ) widget->setScale ( widget->getScale()/1.2 );
|
|
||||||
else if ( event->delta() < 0 ) widget->setScale ( widget->getScale()*1.2 );
|
|
||||||
event->accept ();
|
|
||||||
|
|
||||||
return true;
|
|
||||||
|
Command::Type ZoomCommand::getType () const
|
||||||
|
{ return AlwaysActive; }
|
||||||
|
|
||||||
|
|
||||||
|
void ZoomCommand::wheelEvent ( QWheelEvent* event )
|
||||||
|
{
|
||||||
|
if ( event->delta() > 0 ) _cellWidget->setScale ( _cellWidget->getScale()/1.2 );
|
||||||
|
else if ( event->delta() < 0 ) _cellWidget->setScale ( _cellWidget->getScale()*1.2 );
|
||||||
|
event->accept ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool ZoomCommand::keyPressEvent ( CellWidget* widget, QKeyEvent* event )
|
void ZoomCommand::keyPressEvent ( QKeyEvent* event )
|
||||||
{
|
{
|
||||||
bool control = (event->modifiers() & Qt::ControlModifier);
|
bool control = (event->modifiers() & Qt::ControlModifier);
|
||||||
|
|
||||||
switch ( event->key() ) {
|
switch ( event->key() ) {
|
||||||
case Qt::Key_Z:
|
case Qt::Key_Z:
|
||||||
if ( control ) widget->scaleHistoryDown();
|
if ( control ) _cellWidget->scaleHistoryDown();
|
||||||
else widget->setScale ( widget->getScale()*2.0 );
|
else _cellWidget->setScale ( _cellWidget->getScale()*2.0 );
|
||||||
return true;
|
return;
|
||||||
case Qt::Key_M:
|
case Qt::Key_M:
|
||||||
if ( control ) widget->scaleHistoryUp ();
|
if ( control ) _cellWidget->scaleHistoryUp ();
|
||||||
else widget->setScale ( widget->getScale()/2.0 );
|
else _cellWidget->setScale ( _cellWidget->getScale()/2.0 );
|
||||||
return true;
|
return;
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool ZoomCommand::mousePressEvent ( CellWidget* widget, QMouseEvent* event )
|
void ZoomCommand::mousePressEvent ( QMouseEvent* event )
|
||||||
{
|
{
|
||||||
if ( isActive() ) return true;
|
if ( isActive() ) return;
|
||||||
|
if ( _cellWidget->getActiveCommand() and (_cellWidget->getActiveCommand() != this) )
|
||||||
|
return;
|
||||||
|
|
||||||
if ( ( event->button() == Qt::LeftButton ) && !event->modifiers() ) {
|
if ( ( event->button() == Qt::LeftButton ) && !event->modifiers() ) {
|
||||||
setActive ( true );
|
setActive ( true );
|
||||||
setStartPoint ( event->pos() );
|
setStartPoint ( event->pos() );
|
||||||
setDrawingEnabled ( true );
|
setDrawingEnabled ( true );
|
||||||
}
|
}
|
||||||
|
|
||||||
return isActive();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool ZoomCommand::mouseReleaseEvent ( CellWidget* widget, QMouseEvent* event )
|
void ZoomCommand::mouseReleaseEvent ( QMouseEvent* event )
|
||||||
{
|
{
|
||||||
if ( !isActive() ) return false;
|
if ( !isActive() ) return;
|
||||||
|
|
||||||
setActive ( false );
|
setActive ( false );
|
||||||
setDrawingEnabled ( false );
|
setDrawingEnabled ( false );
|
||||||
|
@ -99,14 +107,13 @@ namespace Hurricane {
|
||||||
QRect zoomArea = QRect ( _startPoint, _stopPoint );
|
QRect zoomArea = QRect ( _startPoint, _stopPoint );
|
||||||
if ( ( abs(zoomArea.width ()) > getDrawingThreshold() )
|
if ( ( abs(zoomArea.width ()) > getDrawingThreshold() )
|
||||||
&& ( abs(zoomArea.height()) > getDrawingThreshold() ) ) {
|
&& ( abs(zoomArea.height()) > getDrawingThreshold() ) ) {
|
||||||
widget->reframe ( widget->screenToDbuBox(zoomArea) );
|
_cellWidget->reframe ( _cellWidget->screenToDbuBox(zoomArea) );
|
||||||
return true;
|
return;
|
||||||
} // else {
|
}
|
||||||
|
//else {
|
||||||
// cerr << Warning("Rejecting too small zoom request.") << endl;
|
// cerr << Warning("Rejecting too small zoom request.") << endl;
|
||||||
// widget->update ();
|
// _cellWidget->update ();
|
||||||
//}
|
//}
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -36,26 +36,26 @@ namespace Hurricane {
|
||||||
|
|
||||||
class AreaCommand : public Command {
|
class AreaCommand : public Command {
|
||||||
public:
|
public:
|
||||||
AreaCommand ();
|
AreaCommand ();
|
||||||
virtual ~AreaCommand ();
|
virtual ~AreaCommand ();
|
||||||
inline void setStartPoint ( const QPoint& start );
|
inline void setStartPoint ( const QPoint& start );
|
||||||
inline void setStopPoint ( const QPoint& stop );
|
inline void setStopPoint ( const QPoint& stop );
|
||||||
inline void setDrawingEnabled ( bool state );
|
inline void setDrawingEnabled ( bool state );
|
||||||
inline void setDrawingThreshold ( int );
|
inline void setDrawingThreshold ( int );
|
||||||
virtual void draw ( CellWidget* widget );
|
virtual void draw ();
|
||||||
virtual void drawCorner ( CellWidget* widget, bool bottomLeft );
|
virtual void drawCorner ( bool bottomLeft );
|
||||||
virtual bool mouseMoveEvent ( CellWidget* widget, QMouseEvent* event );
|
virtual void mouseMoveEvent ( QMouseEvent* event );
|
||||||
inline bool isDrawingEnabled () const;
|
inline bool isDrawingEnabled () const;
|
||||||
inline int getDrawingThreshold () const;
|
inline int getDrawingThreshold () const;
|
||||||
protected:
|
protected:
|
||||||
QPoint _startPoint;
|
QPoint _startPoint;
|
||||||
QPoint _stopPoint;
|
QPoint _stopPoint;
|
||||||
QPoint _cornerPoints[3];
|
QPoint _cornerPoints[3];
|
||||||
int _drawingThreshold;
|
int _drawingThreshold;
|
||||||
bool _drawingEnabled;
|
bool _drawingEnabled;
|
||||||
private:
|
private:
|
||||||
AreaCommand ( const AreaCommand& );
|
AreaCommand ( const AreaCommand& );
|
||||||
AreaCommand& operator= ( const AreaCommand& );
|
AreaCommand& operator= ( const AreaCommand& );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -64,7 +64,9 @@ namespace Hurricane {
|
||||||
|
|
||||||
class CellViewer : public QMainWindow {
|
class CellViewer : public QMainWindow {
|
||||||
Q_OBJECT;
|
Q_OBJECT;
|
||||||
|
|
||||||
|
public:
|
||||||
|
enum { CellHistorySize = 10 };
|
||||||
public:
|
public:
|
||||||
CellViewer ( QWidget* parent=NULL );
|
CellViewer ( QWidget* parent=NULL );
|
||||||
virtual ~CellViewer ();
|
virtual ~CellViewer ();
|
||||||
|
@ -93,52 +95,50 @@ namespace Hurricane {
|
||||||
void showSelectionToggled ( bool );
|
void showSelectionToggled ( bool );
|
||||||
void stateChanged ( shared_ptr<CellWidget::State>& );
|
void stateChanged ( shared_ptr<CellWidget::State>& );
|
||||||
void redrawCellWidget ();
|
void redrawCellWidget ();
|
||||||
|
|
||||||
public:
|
|
||||||
enum { CellHistorySize = 10 };
|
|
||||||
protected:
|
|
||||||
QString _applicationName;
|
|
||||||
QAction* _toolInterruptAction;
|
|
||||||
QAction* _openAction;
|
|
||||||
QAction* _nextAction;
|
|
||||||
QAction* _cellHistoryAction[CellHistorySize];
|
|
||||||
QAction* _printAction;
|
|
||||||
QAction* _imageAction;
|
|
||||||
QAction* _saveAction;
|
|
||||||
QAction* _closeAction;
|
|
||||||
QAction* _exitAction;
|
|
||||||
QAction* _refreshAction;
|
|
||||||
QAction* _fitToContentsAction;
|
|
||||||
QAction* _showSelectionAction;
|
|
||||||
QAction* _rubberChangeAction;
|
|
||||||
QAction* _clearRulersAction;
|
|
||||||
QAction* _controllerAction;
|
|
||||||
QMenu* _fileMenu;
|
|
||||||
QMenu* _viewMenu;
|
|
||||||
QMenu* _toolsMenu;
|
|
||||||
QMenu* _debugMenu;
|
|
||||||
//MapView* _mapView;
|
|
||||||
HPalette* _palette;
|
|
||||||
MousePositionWidget* _mousePosition;
|
|
||||||
ControllerWidget* _controller;
|
|
||||||
CellWidget* _cellWidget;
|
|
||||||
MoveCommand _moveCommand;
|
|
||||||
ZoomCommand _zoomCommand;
|
|
||||||
RulerCommand _rulerCommand;
|
|
||||||
SelectCommand _selectCommand;
|
|
||||||
HierarchyCommand _hierarchyCommand;
|
|
||||||
list< shared_ptr<CellWidget::State> >
|
|
||||||
_cellHistory;
|
|
||||||
bool _firstShow;
|
|
||||||
bool _toolInterrupt;
|
|
||||||
UpdateState _updateState;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void createActions ();
|
void createActions ();
|
||||||
void createMenus ();
|
void createMenus ();
|
||||||
void createLayout ();
|
void createLayout ();
|
||||||
void refreshTitle ();
|
void refreshTitle ();
|
||||||
void refreshHistory ();
|
void refreshHistory ();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
QString _applicationName;
|
||||||
|
QAction* _toolInterruptAction;
|
||||||
|
QAction* _openAction;
|
||||||
|
QAction* _nextAction;
|
||||||
|
QAction* _cellHistoryAction[CellHistorySize];
|
||||||
|
QAction* _printAction;
|
||||||
|
QAction* _imageAction;
|
||||||
|
QAction* _saveAction;
|
||||||
|
QAction* _closeAction;
|
||||||
|
QAction* _exitAction;
|
||||||
|
QAction* _refreshAction;
|
||||||
|
QAction* _fitToContentsAction;
|
||||||
|
QAction* _showSelectionAction;
|
||||||
|
QAction* _rubberChangeAction;
|
||||||
|
QAction* _clearRulersAction;
|
||||||
|
QAction* _controllerAction;
|
||||||
|
QMenu* _fileMenu;
|
||||||
|
QMenu* _viewMenu;
|
||||||
|
QMenu* _toolsMenu;
|
||||||
|
QMenu* _debugMenu;
|
||||||
|
//MapView* _mapView;
|
||||||
|
HPalette* _palette;
|
||||||
|
MousePositionWidget* _mousePosition;
|
||||||
|
ControllerWidget* _controller;
|
||||||
|
CellWidget* _cellWidget;
|
||||||
|
MoveCommand _moveCommand;
|
||||||
|
ZoomCommand _zoomCommand;
|
||||||
|
RulerCommand _rulerCommand;
|
||||||
|
SelectCommand _selectCommand;
|
||||||
|
HierarchyCommand _hierarchyCommand;
|
||||||
|
list< shared_ptr<CellWidget::State> >
|
||||||
|
_cellHistory;
|
||||||
|
bool _firstShow;
|
||||||
|
bool _toolInterrupt;
|
||||||
|
UpdateState _updateState;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -137,6 +137,9 @@ namespace Hurricane {
|
||||||
void detachFromPalette ();
|
void detachFromPalette ();
|
||||||
void bindCommand ( Command* );
|
void bindCommand ( Command* );
|
||||||
void unbindCommand ( Command* );
|
void unbindCommand ( Command* );
|
||||||
|
inline void setActiveCommand ( Command* );
|
||||||
|
inline Command* getActiveCommand () const;
|
||||||
|
inline void resetActiveCommand ();
|
||||||
inline void setCursorStep ( DbU::Unit );
|
inline void setCursorStep ( DbU::Unit );
|
||||||
inline bool realMode () const;
|
inline bool realMode () const;
|
||||||
inline bool symbolicMode () const;
|
inline bool symbolicMode () const;
|
||||||
|
@ -625,6 +628,7 @@ namespace Hurricane {
|
||||||
bool _cellModificated;
|
bool _cellModificated;
|
||||||
bool _enableRedrawInterrupt;
|
bool _enableRedrawInterrupt;
|
||||||
SelectorSet _selectors;
|
SelectorSet _selectors;
|
||||||
|
Command* _activeCommand;
|
||||||
vector<Command*> _commands;
|
vector<Command*> _commands;
|
||||||
size_t _redrawRectCount;
|
size_t _redrawRectCount;
|
||||||
int _textFontHeight;
|
int _textFontHeight;
|
||||||
|
@ -1018,16 +1022,28 @@ namespace Hurricane {
|
||||||
{ return _scaleHistory[_ihistory]._scale; }
|
{ return _scaleHistory[_ihistory]._scale; }
|
||||||
|
|
||||||
|
|
||||||
CellWidget::FindStateName::FindStateName ( const Name& cellName )
|
inline CellWidget::FindStateName::FindStateName ( const Name& cellName )
|
||||||
: unary_function< const shared_ptr<State>&, bool >()
|
: unary_function< const shared_ptr<State>&, bool >()
|
||||||
, _cellName(cellName)
|
, _cellName(cellName)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
|
||||||
bool CellWidget::FindStateName::operator () ( const shared_ptr<State>& state )
|
inline bool CellWidget::FindStateName::operator () ( const shared_ptr<State>& state )
|
||||||
{ return state->getName() == _cellName; }
|
{ return state->getName() == _cellName; }
|
||||||
|
|
||||||
|
|
||||||
|
inline void CellWidget::setActiveCommand ( Command* command )
|
||||||
|
{ _activeCommand = command; }
|
||||||
|
|
||||||
|
|
||||||
|
inline Command* CellWidget::getActiveCommand () const
|
||||||
|
{ return _activeCommand; }
|
||||||
|
|
||||||
|
|
||||||
|
inline void CellWidget::resetActiveCommand ()
|
||||||
|
{ _activeCommand = NULL; }
|
||||||
|
|
||||||
|
|
||||||
inline void CellWidget::setCursorStep ( DbU::Unit step )
|
inline void CellWidget::setCursorStep ( DbU::Unit step )
|
||||||
{ _state->setCursorStep(step); }
|
{ _state->setCursorStep(step); }
|
||||||
|
|
||||||
|
|
|
@ -27,9 +27,9 @@
|
||||||
#define __HURRICANE_COMMAND_H__
|
#define __HURRICANE_COMMAND_H__
|
||||||
|
|
||||||
|
|
||||||
#include <set>
|
#include <map>
|
||||||
|
|
||||||
using namespace std;
|
using std::map;
|
||||||
|
|
||||||
|
|
||||||
class QKeyEvent;
|
class QKeyEvent;
|
||||||
|
@ -45,31 +45,34 @@ namespace Hurricane {
|
||||||
|
|
||||||
class Command {
|
class Command {
|
||||||
public:
|
public:
|
||||||
Command ();
|
enum Type { Normal=1, AlwaysActive=2 };
|
||||||
virtual ~Command ();
|
public:
|
||||||
inline bool isActive ();
|
Command ();
|
||||||
inline void setActive ( bool state );
|
virtual ~Command ();
|
||||||
virtual bool wheelEvent ( CellWidget*, QWheelEvent* );
|
virtual const string& getName () const = 0;
|
||||||
virtual bool keyPressEvent ( CellWidget*, QKeyEvent* );
|
virtual Type getType () const;
|
||||||
virtual bool keyReleaseEvent ( CellWidget*, QKeyEvent* );
|
inline bool isActive () const;
|
||||||
virtual bool mouseMoveEvent ( CellWidget*, QMouseEvent* );
|
void setActive ( bool state );
|
||||||
virtual bool mousePressEvent ( CellWidget*, QMouseEvent* );
|
inline void setCellWidget ( CellWidget* );
|
||||||
virtual bool mouseReleaseEvent ( CellWidget*, QMouseEvent* );
|
virtual void wheelEvent ( QWheelEvent* );
|
||||||
virtual void draw ( CellWidget* );
|
virtual void keyPressEvent ( QKeyEvent* );
|
||||||
inline set<CellWidget*>& getCellWidgets ();
|
virtual void keyReleaseEvent ( QKeyEvent* );
|
||||||
|
virtual void mouseMoveEvent ( QMouseEvent* );
|
||||||
|
virtual void mousePressEvent ( QMouseEvent* );
|
||||||
|
virtual void mouseReleaseEvent ( QMouseEvent* );
|
||||||
|
virtual void draw ();
|
||||||
private:
|
private:
|
||||||
set<CellWidget*> _cellWidgets;
|
Command ( const Command& );
|
||||||
bool _active;
|
Command& operator= ( const Command& );
|
||||||
private:
|
protected:
|
||||||
Command ( const Command& );
|
CellWidget* _cellWidget;
|
||||||
Command& operator= ( const Command& );
|
bool _active;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// Inline Functions.
|
// Inline Functions.
|
||||||
inline set<CellWidget*>& Command::getCellWidgets () { return _cellWidgets; }
|
bool Command::isActive () const { return _active; }
|
||||||
inline bool Command::isActive () { return _active; }
|
void Command::setCellWidget ( CellWidget* widget ) { _cellWidget=widget; }
|
||||||
inline void Command::setActive ( bool state ) { _active = state; }
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,7 +51,11 @@ namespace Hurricane {
|
||||||
public:
|
public:
|
||||||
HierarchyCommand ();
|
HierarchyCommand ();
|
||||||
virtual ~HierarchyCommand ();
|
virtual ~HierarchyCommand ();
|
||||||
virtual bool keyReleaseEvent ( CellWidget*, QKeyEvent* );
|
virtual const string& getName () const;
|
||||||
|
virtual void keyReleaseEvent ( QKeyEvent* );
|
||||||
|
private:
|
||||||
|
HierarchyCommand ( const HierarchyCommand& );
|
||||||
|
HierarchyCommand& operator= ( const HierarchyCommand& );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
class HistoryEntry {
|
class HistoryEntry {
|
||||||
|
@ -61,11 +65,8 @@ namespace Hurricane {
|
||||||
Instance* _instance;
|
Instance* _instance;
|
||||||
shared_ptr<CellWidget::State> _state;
|
shared_ptr<CellWidget::State> _state;
|
||||||
};
|
};
|
||||||
|
|
||||||
private:
|
|
||||||
HierarchyCommand ( const HierarchyCommand& );
|
|
||||||
HierarchyCommand& operator= ( const HierarchyCommand& );
|
|
||||||
private:
|
private:
|
||||||
|
static string _name;
|
||||||
vector<HistoryEntry> _history;
|
vector<HistoryEntry> _history;
|
||||||
size_t _historyIndex;
|
size_t _historyIndex;
|
||||||
};
|
};
|
||||||
|
|
|
@ -36,19 +36,20 @@ namespace Hurricane {
|
||||||
|
|
||||||
class MoveCommand : public Command {
|
class MoveCommand : public Command {
|
||||||
public:
|
public:
|
||||||
MoveCommand ();
|
MoveCommand ();
|
||||||
virtual ~MoveCommand ();
|
virtual ~MoveCommand ();
|
||||||
virtual bool keyPressEvent ( CellWidget*, QKeyEvent* );
|
virtual const string& getName () const;
|
||||||
virtual bool keyReleaseEvent ( CellWidget*, QKeyEvent* );
|
virtual Type getType () const;
|
||||||
virtual bool mouseMoveEvent ( CellWidget*, QMouseEvent* );
|
virtual void keyPressEvent ( QKeyEvent* );
|
||||||
virtual bool mousePressEvent ( CellWidget*, QMouseEvent* );
|
virtual void keyReleaseEvent ( QKeyEvent* );
|
||||||
virtual bool mouseReleaseEvent ( CellWidget*, QMouseEvent* );
|
virtual void mouseMoveEvent ( QMouseEvent* );
|
||||||
private:
|
private:
|
||||||
bool _firstEvent;
|
MoveCommand ( const MoveCommand& );
|
||||||
QPoint _lastPosition;
|
MoveCommand& operator= ( const MoveCommand& );
|
||||||
private:
|
private:
|
||||||
MoveCommand ( const MoveCommand& );
|
static string _name;
|
||||||
MoveCommand& operator= ( const MoveCommand& );
|
bool _firstEvent;
|
||||||
|
QPoint _lastPosition;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -37,20 +37,19 @@ namespace Hurricane {
|
||||||
|
|
||||||
class RulerCommand : public Command {
|
class RulerCommand : public Command {
|
||||||
public:
|
public:
|
||||||
RulerCommand ();
|
RulerCommand ();
|
||||||
virtual ~RulerCommand ();
|
virtual ~RulerCommand ();
|
||||||
virtual bool keyPressEvent ( CellWidget*, QKeyEvent* );
|
virtual const string& getName () const;
|
||||||
virtual bool keyReleaseEvent ( CellWidget*, QKeyEvent* );
|
virtual void mouseMoveEvent ( QMouseEvent* );
|
||||||
virtual bool mouseMoveEvent ( CellWidget*, QMouseEvent* );
|
virtual void mousePressEvent ( QMouseEvent* );
|
||||||
virtual bool mousePressEvent ( CellWidget*, QMouseEvent* );
|
virtual void keyPressEvent ( QKeyEvent* );
|
||||||
virtual bool mouseReleaseEvent ( CellWidget*, QMouseEvent* );
|
virtual void draw ();
|
||||||
virtual void draw ( CellWidget* );
|
|
||||||
protected:
|
|
||||||
bool _active;
|
|
||||||
std::tr1::shared_ptr<Ruler> _ruler;
|
|
||||||
private:
|
private:
|
||||||
RulerCommand ( const RulerCommand& );
|
RulerCommand ( const RulerCommand& );
|
||||||
RulerCommand& operator= ( const RulerCommand& );
|
RulerCommand& operator= ( const RulerCommand& );
|
||||||
|
protected:
|
||||||
|
static string _name;
|
||||||
|
std::tr1::shared_ptr<Ruler> _ruler;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -52,18 +52,22 @@ namespace Hurricane {
|
||||||
Q_OBJECT;
|
Q_OBJECT;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SelectCommand ();
|
SelectCommand ();
|
||||||
virtual ~SelectCommand ();
|
virtual ~SelectCommand ();
|
||||||
virtual bool mousePressEvent ( CellWidget*, QMouseEvent* );
|
virtual const string& getName () const;
|
||||||
virtual bool mouseReleaseEvent ( CellWidget*, QMouseEvent* );
|
virtual void keyPressEvent ( QKeyEvent* );
|
||||||
void bindToAction ( QAction* action );
|
virtual void mousePressEvent ( QMouseEvent* );
|
||||||
|
virtual void mouseReleaseEvent ( QMouseEvent* );
|
||||||
|
void bindToAction ( QAction* );
|
||||||
signals:
|
signals:
|
||||||
void selectionToggled ( Occurrence occurrence );
|
void selectionToggled ( Occurrence );
|
||||||
private:
|
private:
|
||||||
SelectionPopup* _selectionPopup;
|
SelectCommand ( const SelectCommand& );
|
||||||
|
SelectCommand& operator= ( const SelectCommand& );
|
||||||
private:
|
private:
|
||||||
SelectCommand ( const SelectCommand& );
|
static string _name;
|
||||||
SelectCommand& operator= ( const SelectCommand& );
|
SelectionPopup* _selectionPopup;
|
||||||
|
unsigned int _selectMode;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
|
|
||||||
#include "hurricane/Commons.h"
|
#include "hurricane/Commons.h"
|
||||||
#include "hurricane/Occurrence.h"
|
#include "hurricane/Occurrence.h"
|
||||||
|
#include "hurricane/Occurrences.h"
|
||||||
|
|
||||||
|
|
||||||
class QModelIndex;
|
class QModelIndex;
|
||||||
|
@ -43,6 +44,10 @@ class QHeaderView;
|
||||||
namespace Hurricane {
|
namespace Hurricane {
|
||||||
|
|
||||||
|
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
// Class : "Hurricane::SelectionPopup".
|
||||||
|
|
||||||
|
|
||||||
class SelectionPopupModel;
|
class SelectionPopupModel;
|
||||||
|
|
||||||
|
|
||||||
|
@ -50,24 +55,26 @@ namespace Hurricane {
|
||||||
Q_OBJECT;
|
Q_OBJECT;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SelectionPopup ( QWidget* parent=NULL );
|
SelectionPopup ( QWidget* parent=NULL );
|
||||||
void updateLayout ();
|
void updateLayout ();
|
||||||
void popup ();
|
void popup ();
|
||||||
|
void clearFilter ();
|
||||||
|
void setFilter ( OccurrenceFilter );
|
||||||
signals:
|
signals:
|
||||||
void selectionToggled ( Occurrence occurrence );
|
void selectionToggled ( Occurrence );
|
||||||
public slots:
|
public slots:
|
||||||
void add ( Occurrence occurrence, bool showChange=false );
|
void loadOccurrences ( Occurrences, bool showChange=false );
|
||||||
void clear ();
|
void clear ();
|
||||||
void forceRowHeight ();
|
void forceRowHeight ();
|
||||||
protected:
|
protected:
|
||||||
virtual void keyPressEvent ( QKeyEvent * event );
|
virtual void keyPressEvent ( QKeyEvent * );
|
||||||
virtual void mouseMoveEvent ( QMouseEvent* event );
|
virtual void mouseMoveEvent ( QMouseEvent* );
|
||||||
virtual void mouseReleaseEvent ( QMouseEvent* event );
|
virtual void mouseReleaseEvent ( QMouseEvent* );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SelectionPopupModel* _model;
|
SelectionPopupModel* _model;
|
||||||
QTableView* _view;
|
QTableView* _view;
|
||||||
int _rowHeight;
|
int _rowHeight;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
// -*- C++ -*-
|
// -*- C++ -*-
|
||||||
//
|
//
|
||||||
// This file is part of the Coriolis Software.
|
// This file is part of the Coriolis Software.
|
||||||
// Copyright (c) UPMC/LIP6 2008-2008, All Rights Reserved
|
// Copyright (c) UPMC/LIP6 2008-2009, All Rights Reserved
|
||||||
//
|
//
|
||||||
// ===================================================================
|
// ===================================================================
|
||||||
//
|
//
|
||||||
|
@ -35,6 +35,7 @@
|
||||||
|
|
||||||
#include "hurricane/Commons.h"
|
#include "hurricane/Commons.h"
|
||||||
#include "hurricane/Occurrence.h"
|
#include "hurricane/Occurrence.h"
|
||||||
|
#include "hurricane/Occurrences.h"
|
||||||
#include "hurricane/viewer/Graphics.h"
|
#include "hurricane/viewer/Graphics.h"
|
||||||
|
|
||||||
|
|
||||||
|
@ -48,19 +49,23 @@ namespace Hurricane {
|
||||||
Q_OBJECT;
|
Q_OBJECT;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SelectionPopupModel ( QObject* parent=NULL );
|
SelectionPopupModel ( QObject* parent=NULL );
|
||||||
~SelectionPopupModel ();
|
~SelectionPopupModel ();
|
||||||
void add ( Occurrence occurrence, bool showChange=false );
|
void clearFilter ();
|
||||||
void clear ();
|
void setFilter ( OccurrenceFilter );
|
||||||
void updateLayout ();
|
OccurrenceFilter getFilter ();
|
||||||
int rowCount ( const QModelIndex& parent=QModelIndex() ) const;
|
void loadOccurrences ( Occurrences, bool showChange=false );
|
||||||
int columnCount ( const QModelIndex& parent=QModelIndex() ) const;
|
void clear ();
|
||||||
QVariant data ( const QModelIndex& index, int role=Qt::DisplayRole ) const;
|
void updateLayout ();
|
||||||
QVariant headerData ( int section, Qt::Orientation orientation, int role=Qt::DisplayRole ) const;
|
int rowCount ( const QModelIndex& parent=QModelIndex() ) const;
|
||||||
Occurrence getOccurrence ( int row );
|
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;
|
||||||
|
Occurrence getOccurrence ( int row );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
vector<Occurrence>* _occurrences;
|
OccurrenceFilter _filter;
|
||||||
|
vector<Occurrence>* _occurrences;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -36,15 +36,19 @@ namespace Hurricane {
|
||||||
|
|
||||||
class ZoomCommand : public AreaCommand {
|
class ZoomCommand : public AreaCommand {
|
||||||
public:
|
public:
|
||||||
ZoomCommand ();
|
ZoomCommand ();
|
||||||
virtual ~ZoomCommand ();
|
virtual ~ZoomCommand ();
|
||||||
virtual bool wheelEvent ( CellWidget*, QWheelEvent* );
|
virtual const string& getName () const;
|
||||||
virtual bool keyPressEvent ( CellWidget*, QKeyEvent* );
|
virtual Type getType () const;
|
||||||
virtual bool mousePressEvent ( CellWidget*, QMouseEvent* );
|
virtual void wheelEvent ( QWheelEvent* );
|
||||||
virtual bool mouseReleaseEvent ( CellWidget*, QMouseEvent* );
|
virtual void keyPressEvent ( QKeyEvent* );
|
||||||
private:
|
virtual void mousePressEvent ( QMouseEvent* );
|
||||||
ZoomCommand ( const ZoomCommand& );
|
virtual void mouseReleaseEvent ( QMouseEvent* );
|
||||||
ZoomCommand& operator= ( const ZoomCommand& );
|
private:
|
||||||
|
ZoomCommand ( const ZoomCommand& );
|
||||||
|
ZoomCommand& operator= ( const ZoomCommand& );
|
||||||
|
private:
|
||||||
|
static string _name;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue