* ./hurricane :
- New: In Occurrence, new method getBoundingBox(const BasicLayer*). Returns a different value from getBoundingBox() only if the Entity is a Component. Long awaited by the Solstice extractor. - Change: In ExtensionSlice, keep track of the created ExtensionSlice by name to avoid consuming a new bit each time an ExtensionGo slice is deallocated/ re-allocated (happens often in Solstice/Equinox). - Backtrack: In SelectCommand, do not uses::boost regex as their library have not been compiled for 32 bits support under OSX Snow Leopard ?!$#. - Bug: In Command.h, include and uses std::string has in some rare case no one has done it before.
This commit is contained in:
parent
56b2abb260
commit
e5c4402395
|
@ -51,6 +51,7 @@ namespace Hurricane {
|
|||
|
||||
|
||||
unsigned int ExtensionSlice::_masks = 0;
|
||||
vector<Name> 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<<ibit));
|
||||
|
||||
return slice;
|
||||
}
|
||||
|
|
|
@ -134,6 +134,16 @@ Box Occurrence::getBoundingBox() const
|
|||
return _sharedPath->getTransformation().getBox(_entity->getBoundingBox());
|
||||
}
|
||||
|
||||
Box Occurrence::getBoundingBox(const BasicLayer* basicLayer) const
|
||||
// ***************************************************************
|
||||
{
|
||||
const Component* component = dynamic_cast<const Component*>(_entity);
|
||||
if ( not component ) return getBoundingBox();
|
||||
|
||||
if (!_sharedPath) return component->getBoundingBox(basicLayer);
|
||||
return _sharedPath->getTransformation().getBox(component->getBoundingBox(basicLayer));
|
||||
}
|
||||
|
||||
bool Occurrence::hasProperty() const
|
||||
// ********************************
|
||||
{
|
||||
|
|
|
@ -78,6 +78,7 @@ namespace Hurricane {
|
|||
private:
|
||||
// Internal: Attributes.
|
||||
static unsigned int _masks;
|
||||
static vector<Name> _names;
|
||||
Cell* _cell;
|
||||
Name _name;
|
||||
Mask _mask;
|
||||
|
|
|
@ -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
|
||||
// **********
|
||||
|
|
|
@ -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 )
|
||||
|
|
|
@ -23,11 +23,12 @@
|
|||
// x-----------------------------------------------------------------x
|
||||
|
||||
|
||||
#include <QString>
|
||||
#include <QMouseEvent>
|
||||
#include <QKeyEvent>
|
||||
#include <QAction>
|
||||
|
||||
#include <boost/regex.hpp>
|
||||
//#include <boost/regex.hpp>
|
||||
|
||||
#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;
|
||||
}
|
||||
|
|
|
@ -27,10 +27,9 @@
|
|||
#define __HURRICANE_COMMAND_H__
|
||||
|
||||
|
||||
#include <string>
|
||||
#include <map>
|
||||
|
||||
using std::map;
|
||||
|
||||
|
||||
class QKeyEvent;
|
||||
class QMouseEvent;
|
||||
|
@ -39,6 +38,8 @@ class QWheelEvent;
|
|||
|
||||
namespace Hurricane {
|
||||
|
||||
using std::map;
|
||||
using std::string;
|
||||
|
||||
class CellWidget;
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue