diff --git a/hurricane/src/hurricane/ExtensionSlice.cpp b/hurricane/src/hurricane/ExtensionSlice.cpp index daa4e507..8f065ed5 100644 --- a/hurricane/src/hurricane/ExtensionSlice.cpp +++ b/hurricane/src/hurricane/ExtensionSlice.cpp @@ -51,6 +51,7 @@ namespace Hurricane { unsigned int ExtensionSlice::_masks = 0; + vector ExtensionSlice::_names; ExtensionSlice::ExtensionSlice ( Cell* cell, const Name& name, ExtensionSlice::Mask mask ) @@ -95,7 +96,16 @@ namespace Hurricane { , getString(name).c_str() ); - ExtensionSlice* slice = new ExtensionSlice(cell,name,(1<<++_masks)); + size_t ibit = 0; + for ( ibit=0 ; ibit<_masks ; ibit++ ) { + if ( _names[ibit] == name ) break; + } + if ( ibit == _masks ) { + _names.push_back ( name ); + _masks++; + } + + ExtensionSlice* slice = new ExtensionSlice(cell,name,(1<getTransformation().getBox(_entity->getBoundingBox()); } +Box Occurrence::getBoundingBox(const BasicLayer* basicLayer) const +// *************************************************************** +{ + const Component* component = dynamic_cast(_entity); + if ( not component ) return getBoundingBox(); + + if (!_sharedPath) return component->getBoundingBox(basicLayer); + return _sharedPath->getTransformation().getBox(component->getBoundingBox(basicLayer)); +} + bool Occurrence::hasProperty() const // ******************************** { diff --git a/hurricane/src/hurricane/hurricane/ExtensionSlice.h b/hurricane/src/hurricane/hurricane/ExtensionSlice.h index 0ff179a0..ba03e1a5 100644 --- a/hurricane/src/hurricane/hurricane/ExtensionSlice.h +++ b/hurricane/src/hurricane/hurricane/ExtensionSlice.h @@ -78,6 +78,7 @@ namespace Hurricane { private: // Internal: Attributes. static unsigned int _masks; + static vector _names; Cell* _cell; Name _name; Mask _mask; diff --git a/hurricane/src/hurricane/hurricane/Occurrence.h b/hurricane/src/hurricane/hurricane/Occurrence.h index 80cd3414..33f04fc9 100644 --- a/hurricane/src/hurricane/hurricane/Occurrence.h +++ b/hurricane/src/hurricane/hurricane/Occurrence.h @@ -29,6 +29,7 @@ namespace Hurricane { class Entity; class SharedPath; class Quark; +class BasicLayer; @@ -72,6 +73,7 @@ class Occurrence { public: Property* getProperty(const Name& name) const; public: Properties getProperties() const; public: Box getBoundingBox() const; + public: Box getBoundingBox(const BasicLayer*) const; // Predicates // ********** diff --git a/hurricane/src/hviewer/CMakeLists.txt b/hurricane/src/hviewer/CMakeLists.txt index 10017a17..a71f3f66 100644 --- a/hurricane/src/hviewer/CMakeLists.txt +++ b/hurricane/src/hviewer/CMakeLists.txt @@ -112,14 +112,14 @@ add_library ( hviewer-static STATIC ${cpps} ${MOC_SRCS} ${RCC_SRCS} ) target_link_libraries ( hviewer-static hurricane-static ${QT_LIBRARIES} - ${Boost_LIBRARIES} +# ${Boost_LIBRARIES} ) install ( TARGETS hviewer-static DESTINATION /lib ) else ( BUILD_STATIC ) add_library ( hviewer SHARED ${cpps} ${MOC_SRCS} ${RCC_SRCS} ) target_link_libraries ( hviewer hurricane ${QT_LIBRARIES} - ${Boost_LIBRARIES} +# ${Boost_LIBRARIES} ) install ( TARGETS hviewer DESTINATION /lib ) endif ( BUILD_STATIC ) diff --git a/hurricane/src/hviewer/SelectCommand.cpp b/hurricane/src/hviewer/SelectCommand.cpp index 9b7077d6..e91612d8 100644 --- a/hurricane/src/hviewer/SelectCommand.cpp +++ b/hurricane/src/hviewer/SelectCommand.cpp @@ -23,11 +23,12 @@ // x-----------------------------------------------------------------x +#include #include #include #include -#include +//#include #include "hurricane/Path.h" #include "hurricane/Entity.h" @@ -140,8 +141,8 @@ namespace Hurricane { { ltrace(80) << "Occurrences_GetNets::Locator::progress()" << endl; - boost::regex pattern ( "onymous" ); - boost::smatch match; + //boost::regex pattern ( "onymous" ); + //boost::smatch match; for ( ; _primaryLoc->isValid() ; _primaryLoc->progress() ) { Occurrence element = _primaryLoc->getElement(); @@ -152,8 +153,11 @@ namespace Hurricane { Net* net = component->getNet(); Occurrence netOccurrence ( net, element.getPath() ); + //if ( _hideAnonymous + // and boost::regex_search(getString(net->getName()),match,pattern,boost::match_extra) ) + // continue; if ( _hideAnonymous - and boost::regex_search(getString(net->getName()),match,pattern,boost::match_extra) ) + and QString(getString(net->getName()).c_str()).contains("onymous") ) continue; _element = getHyperNetRootNetOccurrence ( netOccurrence ); @@ -238,16 +242,15 @@ namespace Hurricane { event->accept (); QRect selectArea ( event->pos() - QPoint(2,2), QSize(4,4) ); - //_selectionPopup->loadOccurrences ( _cellWidget->getOccurrencesUnder(selectArea) ); Occurrences selection; switch ( _selectMode ) { - case 0: + case AllMode: // 0 selection = _cellWidget->getOccurrencesUnder(selectArea); break; - case 1: + case NetMode: // 1 selection = Occurrences_GetNets(_cellWidget->getOccurrencesUnder(selectArea),false); break; - case 2: + case NoAnonNetMode: // 2 selection = Occurrences_GetNets(_cellWidget->getOccurrencesUnder(selectArea),true); break; } diff --git a/hurricane/src/hviewer/hurricane/viewer/Command.h b/hurricane/src/hviewer/hurricane/viewer/Command.h index 6f782082..8432aa02 100644 --- a/hurricane/src/hviewer/hurricane/viewer/Command.h +++ b/hurricane/src/hviewer/hurricane/viewer/Command.h @@ -27,10 +27,9 @@ #define __HURRICANE_COMMAND_H__ +#include #include -using std::map; - class QKeyEvent; class QMouseEvent; @@ -39,6 +38,8 @@ class QWheelEvent; namespace Hurricane { + using std::map; + using std::string; class CellWidget; diff --git a/hurricane/src/hviewer/hurricane/viewer/SelectCommand.h b/hurricane/src/hviewer/hurricane/viewer/SelectCommand.h index a10d46f8..51819861 100644 --- a/hurricane/src/hviewer/hurricane/viewer/SelectCommand.h +++ b/hurricane/src/hviewer/hurricane/viewer/SelectCommand.h @@ -51,10 +51,14 @@ namespace Hurricane { class SelectCommand : public QObject, public AreaCommand { Q_OBJECT; + public: + enum SelectMode { AllMode=0, NetMode=1, NoAnonNetMode=2 }; public: SelectCommand (); virtual ~SelectCommand (); virtual const string& getName () const; + inline unsigned int getSelectMode () const; + inline void setSelectMode ( unsigned int ); virtual void keyPressEvent ( QKeyEvent* ); virtual void mousePressEvent ( QMouseEvent* ); virtual void mouseReleaseEvent ( QMouseEvent* ); @@ -71,6 +75,10 @@ namespace Hurricane { }; + inline unsigned int SelectCommand::getSelectMode () const { return _selectMode; } + inline void SelectCommand::setSelectMode ( unsigned int mode ) { _selectMode = mode%3; } + + } // End of Hurricane namespace.