new conventions

This commit is contained in:
The Coriolis Project 2008-01-07 12:55:04 +00:00
parent 7134556b5e
commit 611d368c9c
13 changed files with 380 additions and 406 deletions

View File

@ -16,8 +16,8 @@ inline void BoxToRectangle(const Box& box, QRectF& rec) {
} }
inline void HurricanePositionToQtPosition(const Transformation& transformation, QTransform& transform, QPoint& position) { inline void HurricanePositionToQtPosition(const Transformation& transformation, QTransform& transform, QPoint& position) {
double tx = GetValue(transformation.GetTx()); double tx = GetValue(transformation.getTx());
double ty = GetValue(transformation.GetTy()); double ty = GetValue(transformation.getTy());
position.setX((int)tx); position.setX((int)tx);
position.setY((int)ty); position.setY((int)ty);

View File

@ -279,7 +279,7 @@ void Cell::_Fit(const Box& box)
if (_boundingBox.contains(box)) return; if (_boundingBox.contains(box)) return;
_boundingBox.merge(box); _boundingBox.merge(box);
for_each_instance(instance, GetSlaveInstances()) { for_each_instance(instance, GetSlaveInstances()) {
instance->GetCell()->_Fit(instance->GetTransformation().GetBox(box)); instance->GetCell()->_Fit(instance->GetTransformation().getBox(box));
end_for; end_for;
} }
} }
@ -292,7 +292,7 @@ void Cell::_Unfit(const Box& box)
if (!_boundingBox.isConstrainedBy(box)) return; if (!_boundingBox.isConstrainedBy(box)) return;
_boundingBox.makeEmpty(); _boundingBox.makeEmpty();
for_each_instance(instance, GetSlaveInstances()) { for_each_instance(instance, GetSlaveInstances()) {
instance->GetCell()->_Unfit(instance->GetTransformation().GetBox(box)); instance->GetCell()->_Unfit(instance->GetTransformation().getBox(box));
end_for; end_for;
} }
} }

View File

@ -2407,7 +2407,7 @@ void Cell_OccurrencesUnder::Locator::Progress()
} }
else { else {
Box masterArea = _area; Box masterArea = _area;
instance->GetTransformation().GetInvert().ApplyOn(masterArea); instance->GetTransformation().getInvert().applyOn(masterArea);
Cell* masterCell = instance->GetMasterCell(); Cell* masterCell = instance->GetMasterCell();
_occurrenceLocator = _occurrenceLocator =
masterCell->GetOccurrencesUnder(masterArea, _searchDepth - 1).GetLocator(); masterCell->GetOccurrencesUnder(masterArea, _searchDepth - 1).GetLocator();
@ -2728,7 +2728,7 @@ Cell_LeafInstanceOccurrencesUnder::Locator::Locator(const Cell* cell, const Box&
Instance* instance = _nonLeafInstanceLocator.GetElement(); Instance* instance = _nonLeafInstanceLocator.GetElement();
Cell* masterCell = instance->GetMasterCell(); Cell* masterCell = instance->GetMasterCell();
Box masterArea = _area; Box masterArea = _area;
instance->GetTransformation().GetInvert().ApplyOn(masterArea); instance->GetTransformation().getInvert().applyOn(masterArea);
_occurrenceLocator = _occurrenceLocator =
masterCell->GetLeafInstanceOccurrencesUnder(masterArea).GetLocator(); masterCell->GetLeafInstanceOccurrencesUnder(masterArea).GetLocator();
if (_occurrenceLocator.IsValid()) if (_occurrenceLocator.IsValid())
@ -2807,7 +2807,7 @@ void Cell_LeafInstanceOccurrencesUnder::Locator::Progress()
Instance* instance = _nonLeafInstanceLocator.GetElement(); Instance* instance = _nonLeafInstanceLocator.GetElement();
Cell* masterCell = instance->GetMasterCell(); Cell* masterCell = instance->GetMasterCell();
Box masterArea = _area; Box masterArea = _area;
instance->GetTransformation().GetInvert().ApplyOn(masterArea); instance->GetTransformation().getInvert().applyOn(masterArea);
_occurrenceLocator = _occurrenceLocator =
masterCell->GetLeafInstanceOccurrencesUnder(masterArea).GetLocator(); masterCell->GetLeafInstanceOccurrencesUnder(masterArea).GetLocator();
if (_occurrenceLocator.IsValid()) if (_occurrenceLocator.IsValid())
@ -2827,7 +2827,7 @@ void Cell_LeafInstanceOccurrencesUnder::Locator::Progress()
Instance* instance = _nonLeafInstanceLocator.GetElement(); Instance* instance = _nonLeafInstanceLocator.GetElement();
Cell* masterCell = instance->GetMasterCell(); Cell* masterCell = instance->GetMasterCell();
Box masterArea = _area; Box masterArea = _area;
instance->GetTransformation().GetInvert().ApplyOn(masterArea); instance->GetTransformation().getInvert().applyOn(masterArea);
_occurrenceLocator = _occurrenceLocator =
masterCell->GetLeafInstanceOccurrencesUnder(masterArea).GetLocator(); masterCell->GetLeafInstanceOccurrencesUnder(masterArea).GetLocator();
if (_occurrenceLocator.IsValid()) if (_occurrenceLocator.IsValid())
@ -3137,7 +3137,7 @@ Cell_TerminalInstanceOccurrencesUnder::Locator::Locator(const Cell* cell, const
Instance* instance = _nonTerminalInstanceLocator.GetElement(); Instance* instance = _nonTerminalInstanceLocator.GetElement();
Cell* masterCell = instance->GetMasterCell(); Cell* masterCell = instance->GetMasterCell();
Box masterArea = _area; Box masterArea = _area;
instance->GetTransformation().GetInvert().ApplyOn(masterArea); instance->GetTransformation().getInvert().applyOn(masterArea);
_occurrenceLocator = _occurrenceLocator =
masterCell->GetTerminalInstanceOccurrencesUnder(masterArea).GetLocator(); masterCell->GetTerminalInstanceOccurrencesUnder(masterArea).GetLocator();
if (_occurrenceLocator.IsValid()) if (_occurrenceLocator.IsValid())
@ -3216,7 +3216,7 @@ void Cell_TerminalInstanceOccurrencesUnder::Locator::Progress()
Instance* instance = _nonTerminalInstanceLocator.GetElement(); Instance* instance = _nonTerminalInstanceLocator.GetElement();
Cell* masterCell = instance->GetMasterCell(); Cell* masterCell = instance->GetMasterCell();
Box masterArea = _area; Box masterArea = _area;
instance->GetTransformation().GetInvert().ApplyOn(masterArea); instance->GetTransformation().getInvert().applyOn(masterArea);
_occurrenceLocator = _occurrenceLocator =
masterCell->GetTerminalInstanceOccurrencesUnder(masterArea).GetLocator(); masterCell->GetTerminalInstanceOccurrencesUnder(masterArea).GetLocator();
if (_occurrenceLocator.IsValid()) if (_occurrenceLocator.IsValid())
@ -3236,7 +3236,7 @@ void Cell_TerminalInstanceOccurrencesUnder::Locator::Progress()
Instance* instance = _nonTerminalInstanceLocator.GetElement(); Instance* instance = _nonTerminalInstanceLocator.GetElement();
Cell* masterCell = instance->GetMasterCell(); Cell* masterCell = instance->GetMasterCell();
Box masterArea = _area; Box masterArea = _area;
instance->GetTransformation().GetInvert().ApplyOn(masterArea); instance->GetTransformation().getInvert().applyOn(masterArea);
_occurrenceLocator = _occurrenceLocator =
masterCell->GetTerminalInstanceOccurrencesUnder(masterArea).GetLocator(); masterCell->GetTerminalInstanceOccurrencesUnder(masterArea).GetLocator();
if (_occurrenceLocator.IsValid()) if (_occurrenceLocator.IsValid())
@ -3584,7 +3584,7 @@ Cell_ComponentOccurrencesUnder::Locator::Locator(const Cell* cell, const Box& ar
Instance* instance = _instanceLocator.GetElement(); Instance* instance = _instanceLocator.GetElement();
Cell* masterCell = instance->GetMasterCell(); Cell* masterCell = instance->GetMasterCell();
Box masterArea = _area; Box masterArea = _area;
instance->GetTransformation().GetInvert().ApplyOn(masterArea); instance->GetTransformation().getInvert().applyOn(masterArea);
_occurrenceLocator = _occurrenceLocator =
masterCell->GetComponentOccurrencesUnder(masterArea, _mask).GetLocator(); masterCell->GetComponentOccurrencesUnder(masterArea, _mask).GetLocator();
if (_occurrenceLocator.IsValid()) if (_occurrenceLocator.IsValid())
@ -3665,7 +3665,7 @@ void Cell_ComponentOccurrencesUnder::Locator::Progress()
Instance* instance = _instanceLocator.GetElement(); Instance* instance = _instanceLocator.GetElement();
Cell* masterCell = instance->GetMasterCell(); Cell* masterCell = instance->GetMasterCell();
Box masterArea = _area; Box masterArea = _area;
instance->GetTransformation().GetInvert().ApplyOn(masterArea); instance->GetTransformation().getInvert().applyOn(masterArea);
_occurrenceLocator = _occurrenceLocator =
masterCell->GetComponentOccurrencesUnder(masterArea, _mask).GetLocator(); masterCell->GetComponentOccurrencesUnder(masterArea, _mask).GetLocator();
if (_occurrenceLocator.IsValid()) if (_occurrenceLocator.IsValid())
@ -3685,7 +3685,7 @@ void Cell_ComponentOccurrencesUnder::Locator::Progress()
Instance* instance = _instanceLocator.GetElement(); Instance* instance = _instanceLocator.GetElement();
Cell* masterCell = instance->GetMasterCell(); Cell* masterCell = instance->GetMasterCell();
Box masterArea = _area; Box masterArea = _area;
instance->GetTransformation().GetInvert().ApplyOn(masterArea); instance->GetTransformation().getInvert().applyOn(masterArea);
_occurrenceLocator = _occurrenceLocator =
masterCell->GetComponentOccurrencesUnder(masterArea, _mask).GetLocator(); masterCell->GetComponentOccurrencesUnder(masterArea, _mask).GetLocator();
if (_occurrenceLocator.IsValid()) if (_occurrenceLocator.IsValid())

View File

@ -507,10 +507,10 @@ static bool IsConnex(const Occurrence& componentOccurrence1, const Occurrence& c
Transformation transformation1 = componentOccurrence1.GetPath().GetTransformation(); Transformation transformation1 = componentOccurrence1.GetPath().GetTransformation();
Transformation transformation2 = componentOccurrence2.GetPath().GetTransformation(); Transformation transformation2 = componentOccurrence2.GetPath().GetTransformation();
for_each_basic_layer(basicLayer1, layer1->GetBasicLayers()) { for_each_basic_layer(basicLayer1, layer1->GetBasicLayers()) {
Box box1 = transformation1.GetBox(component1->GetBoundingBox(basicLayer1)); Box box1 = transformation1.getBox(component1->GetBoundingBox(basicLayer1));
for_each_basic_layer(basicLayer2, layer2->GetBasicLayers()) { for_each_basic_layer(basicLayer2, layer2->GetBasicLayers()) {
if (basicLayer1->GetExtractMask() & basicLayer2->GetExtractMask()) { if (basicLayer1->GetExtractMask() & basicLayer2->GetExtractMask()) {
Box box2 = transformation2.GetBox(component2->GetBoundingBox(basicLayer2)); Box box2 = transformation2.getBox(component2->GetBoundingBox(basicLayer2));
if (box1.intersect(box2)) return true; if (box1.intersect(box2)) return true;
} }
end_for; end_for;

View File

@ -207,7 +207,7 @@ Instance* Instance::Create(Cell* cell, const Name& name, Cell* masterCell, const
Box Instance::GetBoundingBox() const Box Instance::GetBoundingBox() const
// ********************************* // *********************************
{ {
return _transformation.GetBox(_masterCell->GetBoundingBox()); return _transformation.getBox(_masterCell->GetBoundingBox());
} }
Plugs Instance::GetConnectedPlugs() const Plugs Instance::GetConnectedPlugs() const
@ -231,7 +231,7 @@ Path Instance::GetPath(const Path& tailPath) const
Box Instance::GetAbutmentBox() const Box Instance::GetAbutmentBox() const
// ********************************* // *********************************
{ {
return _transformation.GetBox(_masterCell->GetAbutmentBox()); return _transformation.getBox(_masterCell->GetAbutmentBox());
} }
bool Instance::IsTerminal() const bool Instance::IsTerminal() const
@ -327,7 +327,7 @@ void Instance::Translate(const Unit& dx, const Unit& dy)
// ***************************************************** // *****************************************************
{ {
if ((dx != 0) || (dy !=0)) { if ((dx != 0) || (dy !=0)) {
Point translation = _transformation.GetTranslation(); Point translation = _transformation.getTranslation();
Unit x = translation.getX() + dx; Unit x = translation.getX() + dx;
Unit y = translation.getY() + dy; Unit y = translation.getY() + dy;
Transformation::Orientation orientation = _transformation.GetOrientation(); Transformation::Orientation orientation = _transformation.GetOrientation();

View File

@ -118,7 +118,7 @@ Box Occurrence::GetBoundingBox() const
{ {
if (!_entity) return Box(); if (!_entity) return Box();
if (!_sharedPath) return _entity->GetBoundingBox(); if (!_sharedPath) return _entity->GetBoundingBox();
return _sharedPath->GetTransformation().GetBox(_entity->GetBoundingBox()); return _sharedPath->GetTransformation().getBox(_entity->GetBoundingBox());
} }
bool Occurrence::HasProperty() const bool Occurrence::HasProperty() const

View File

@ -79,25 +79,25 @@ Cell* Plug::GetCell() const
Unit Plug::GetX() const Unit Plug::GetX() const
// ******************** // ********************
{ {
return _instance->GetTransformation().GetX(_masterNet->GetPosition()); return _instance->GetTransformation().getX(_masterNet->GetPosition());
} }
Unit Plug::GetY() const Unit Plug::GetY() const
// ******************** // ********************
{ {
return _instance->GetTransformation().GetY(_masterNet->GetPosition()); return _instance->GetTransformation().getY(_masterNet->GetPosition());
} }
Point Plug::GetPosition() const Point Plug::GetPosition() const
// **************************** // ****************************
{ {
return _instance->GetTransformation().GetPoint(_masterNet->GetPosition()); return _instance->GetTransformation().getPoint(_masterNet->GetPosition());
} }
Box Plug::GetBoundingBox() const Box Plug::GetBoundingBox() const
// ***************************** // *****************************
{ {
return _instance->GetTransformation().GetBox(_masterNet->GetPosition()); return _instance->GetTransformation().getBox(_masterNet->GetPosition());
} }
Box Plug::GetBoundingBox(BasicLayer* basicLayer) const Box Plug::GetBoundingBox(BasicLayer* basicLayer) const

View File

@ -52,11 +52,11 @@ RoutingPad* RoutingPad::Create(Net* net, Occurrence occurrence)
Point position; Point position;
if ( (plug = dynamic_cast<Plug*>(occurrence.GetEntity()) ) ) { if ( (plug = dynamic_cast<Plug*>(occurrence.GetEntity()) ) ) {
position = occurrence.GetPath().GetTransformation().GetPoint( plug->GetPosition() ); position = occurrence.GetPath().GetTransformation().getPoint( plug->GetPosition() );
} else if ( (pin = dynamic_cast<Pin*>(occurrence.GetEntity()) ) ) { } else if ( (pin = dynamic_cast<Pin*>(occurrence.GetEntity()) ) ) {
position = occurrence.GetPath().GetTransformation().GetPoint( pin->GetPosition() ); position = occurrence.GetPath().GetTransformation().getPoint( pin->GetPosition() );
} else if ( (contact = dynamic_cast<Contact*>(occurrence.GetEntity()) ) ) { } else if ( (contact = dynamic_cast<Contact*>(occurrence.GetEntity()) ) ) {
position = occurrence.GetPath().GetTransformation().GetPoint( contact->GetPosition() ); position = occurrence.GetPath().GetTransformation().getPoint( contact->GetPosition() );
} }
if ( !plug && !pin && !contact ) if ( !plug && !pin && !contact )
@ -95,7 +95,7 @@ Box RoutingPad::GetBoundingBox() const
{ {
Component* component = _GetEntityAsComponent(); Component* component = _GetEntityAsComponent();
if ( component ) { if ( component ) {
return _occurrence.GetPath().GetTransformation().GetBox ( component->GetBoundingBox() ); return _occurrence.GetPath().GetTransformation().getBox ( component->GetBoundingBox() );
} }
return Box(GetPosition()); return Box(GetPosition());
@ -106,7 +106,7 @@ Box RoutingPad::GetBoundingBox(BasicLayer* basicLayer) const
{ {
Component* component = _GetEntityAsComponent(); Component* component = _GetEntityAsComponent();
if ( component ) if ( component )
return _occurrence.GetPath().GetTransformation().GetBox ( component->GetBoundingBox(basicLayer) ); return _occurrence.GetPath().GetTransformation().getBox ( component->GetBoundingBox(basicLayer) );
return Box(GetPosition()); return Box(GetPosition());
} }
@ -125,7 +125,7 @@ Point RoutingPad::GetSourcePosition() const
{ {
Segment* segment = _GetEntityAsSegment(); Segment* segment = _GetEntityAsSegment();
if ( segment ) if ( segment )
return _occurrence.GetPath().GetTransformation().GetPoint ( segment->GetSourcePosition() ); return _occurrence.GetPath().GetTransformation().getPoint ( segment->GetSourcePosition() );
return GetPosition(); return GetPosition();
} }
@ -135,7 +135,7 @@ Point RoutingPad::GetTargetPosition() const
{ {
Segment* segment = _GetEntityAsSegment(); Segment* segment = _GetEntityAsSegment();
if ( segment ) if ( segment )
return _occurrence.GetPath().GetTransformation().GetPoint ( segment->GetTargetPosition() ); return _occurrence.GetPath().GetTransformation().getPoint ( segment->GetTargetPosition() );
return GetPosition(); return GetPosition();
} }
@ -169,7 +169,7 @@ Point RoutingPad::GetCenter() const
{ {
Segment* segment = _GetEntityAsSegment(); Segment* segment = _GetEntityAsSegment();
if ( segment ) if ( segment )
return _occurrence.GetPath().GetTransformation().GetPoint ( segment->GetCenter() ); return _occurrence.GetPath().GetTransformation().getPoint ( segment->GetCenter() );
return GetPosition(); return GetPosition();
} }
@ -329,7 +329,7 @@ void RoutingPad::SetExternalComponent(Component* component)
_occurrence.GetMasterCell()->_RemoveSlaveEntity(_occurrence.GetEntity(),this); _occurrence.GetMasterCell()->_RemoveSlaveEntity(_occurrence.GetEntity(),this);
_occurrence = Occurrence(component,Path(plugOccurrence.GetPath(),plug->GetInstance())); _occurrence = Occurrence(component,Path(plugOccurrence.GetPath(),plug->GetInstance()));
Point position = _occurrence.GetPath().GetTransformation().GetPoint ( component->GetPosition() ); Point position = _occurrence.GetPath().GetTransformation().getPoint ( component->GetPosition() );
Horizontal* horizontal = dynamic_cast<Horizontal*>(component); Horizontal* horizontal = dynamic_cast<Horizontal*>(component);
if ( horizontal ) { if ( horizontal ) {
@ -374,7 +374,7 @@ void RoutingPad::RestorePlugOccurrence()
if (IsMaterialized()) Unmaterialize(); if (IsMaterialized()) Unmaterialize();
_occurrence=GetPlugOccurrence(); _occurrence=GetPlugOccurrence();
SetPosition ( _occurrence.GetPath().GetTransformation().GetPoint SetPosition ( _occurrence.GetPath().GetTransformation().getPoint
( dynamic_cast<Component*>(_occurrence.GetEntity())->GetPosition() ) ); ( dynamic_cast<Component*>(_occurrence.GetEntity())->GetPosition() ) );
} }

View File

@ -187,7 +187,7 @@ Transformation SharedPath::GetTransformation(const Transformation& transformatio
Transformation headTransformation = _headInstance->GetTransformation(); Transformation headTransformation = _headInstance->GetTransformation();
Transformation tailTransformation = Transformation tailTransformation =
(!_tailSharedPath) ? transformation : _tailSharedPath->GetTransformation(transformation); (!_tailSharedPath) ? transformation : _tailSharedPath->GetTransformation(transformation);
return headTransformation.GetTransformation(tailTransformation); return headTransformation.getTransformation(tailTransformation);
} }
void SharedPath::SetNameSeparator(char nameSeparator) void SharedPath::SetNameSeparator(char nameSeparator)

View File

@ -100,74 +100,74 @@ bool Transformation::operator!=(const Transformation& transformation) const
(_orientation != transformation._orientation)); (_orientation != transformation._orientation));
} }
Unit Transformation::GetX(const Unit& x, const Unit& y) const Unit Transformation::getX(const Unit& x, const Unit& y) const
// ********************************************************** // **********************************************************
{ {
return (x * A[_orientation]) + (y * B[_orientation]) + _tx; return (x * A[_orientation]) + (y * B[_orientation]) + _tx;
} }
Unit Transformation::GetY(const Unit& x, const Unit& y) const Unit Transformation::getY(const Unit& x, const Unit& y) const
// ********************************************************** // **********************************************************
{ {
return (x * C[_orientation]) + (y * D[_orientation]) + _ty; return (x * C[_orientation]) + (y * D[_orientation]) + _ty;
} }
Unit Transformation::GetX(const Point& point) const Unit Transformation::getX(const Point& point) const
// ************************************************ // ************************************************
{ {
return GetX(point.getX(), point.getY()); return getX(point.getX(), point.getY());
} }
Unit Transformation::GetY(const Point& point) const Unit Transformation::getY(const Point& point) const
// ************************************************ // ************************************************
{ {
return GetY(point.getX(), point.getY()); return getY(point.getX(), point.getY());
} }
Unit Transformation::GetDx(const Unit& dx, const Unit& dy) const Unit Transformation::getDx(const Unit& dx, const Unit& dy) const
// ************************************************************* // *************************************************************
{ {
return (dx * A[_orientation]) + (dy * B[_orientation]); return (dx * A[_orientation]) + (dy * B[_orientation]);
} }
Unit Transformation::GetDy(const Unit& dx, const Unit& dy) const Unit Transformation::getDy(const Unit& dx, const Unit& dy) const
// ************************************************************* // *************************************************************
{ {
return (dx * C[_orientation]) + (dy * D[_orientation]); return (dx * C[_orientation]) + (dy * D[_orientation]);
} }
Point Transformation::GetPoint(const Unit& x, const Unit& y) const Point Transformation::getPoint(const Unit& x, const Unit& y) const
// *************************************************************** // ***************************************************************
{ {
return Point(GetX(x, y), GetY(x, y)); return Point(getX(x, y), getY(x, y));
} }
Point Transformation::GetPoint(const Point& point) const Point Transformation::getPoint(const Point& point) const
// ***************************************************** // *****************************************************
{ {
return GetPoint(point.getX(), point.getY()); return getPoint(point.getX(), point.getY());
} }
Box Transformation::GetBox(const Unit& x1, const Unit& y1, const Unit& x2, const Unit& y2) const Box Transformation::getBox(const Unit& x1, const Unit& y1, const Unit& x2, const Unit& y2) const
// ********************************************************************************************* // *********************************************************************************************
{ {
return Box(GetX(x1, y1), GetY(x1, y1), GetX(x2, y2), GetY(x2, y2)); return Box(getX(x1, y1), getY(x1, y1), getX(x2, y2), getY(x2, y2));
} }
Box Transformation::GetBox(const Point& point1, const Point& point2) const Box Transformation::getBox(const Point& point1, const Point& point2) const
// *********************************************************************** // ***********************************************************************
{ {
return GetBox(point1.getX(), point1.getY(), point2.getX(), point2.getY()); return getBox(point1.getX(), point1.getY(), point2.getX(), point2.getY());
} }
Box Transformation::GetBox(const Box& box) const Box Transformation::getBox(const Box& box) const
// ********************************************* // *********************************************
{ {
if (box.isEmpty()) return box; if (box.isEmpty()) return box;
return GetBox(box.getXMin(), box.getYMin(), box.getXMax(), box.getYMax()); return getBox(box.getXMin(), box.getYMin(), box.getXMax(), box.getYMax());
} }
Transformation Transformation::GetTransformation(const Transformation& transformation) const Transformation Transformation::getTransformation(const Transformation& transformation) const
// ***************************************************************************************** // *****************************************************************************************
{ {
Unit x = transformation._tx; Unit x = transformation._tx;
@ -179,14 +179,14 @@ Transformation Transformation::GetTransformation(const Transformation& transform
COMPOSE[(_orientation * 8) + transformation._orientation]); COMPOSE[(_orientation * 8) + transformation._orientation]);
} }
Transformation Transformation::GetInvert() const Transformation Transformation::getInvert() const
// ********************************************* // *********************************************
{ {
Transformation transformation = *this; Transformation transformation = *this;
return transformation.Invert(); return transformation.invert();
} }
Transformation& Transformation::Invert() Transformation& Transformation::invert()
// ************************************* // *************************************
{ {
return operator=( return operator=(
@ -196,30 +196,30 @@ Transformation& Transformation::Invert()
INVERT[_orientation])); INVERT[_orientation]));
} }
void Transformation::ApplyOn(Unit& x, Unit& y) const void Transformation::applyOn(Unit& x, Unit& y) const
// ************************************************* // *************************************************
{ {
Unit xi = x, yi = y; Unit xi = x, yi = y;
x = GetX(xi, yi); x = getX(xi, yi);
y = GetY(xi, yi); y = getY(xi, yi);
} }
void Transformation::ApplyOn(Point& point) const void Transformation::applyOn(Point& point) const
// ********************************************* // *********************************************
{ {
point = GetPoint(point); point = getPoint(point);
} }
void Transformation::ApplyOn(Box& box) const void Transformation::applyOn(Box& box) const
// ***************************************** // *****************************************
{ {
box = GetBox(box); box = getBox(box);
} }
void Transformation::ApplyOn(Transformation& transformation) const void Transformation::applyOn(Transformation& transformation) const
// *************************************************************** // ***************************************************************
{ {
transformation = GetTransformation(transformation); transformation = getTransformation(transformation);
} }
string Transformation::_GetString() const string Transformation::_GetString() const

View File

@ -42,7 +42,6 @@ class Transformation {
public: string _GetTypeName() const { return _TName("Transformation::Orientation"); }; public: string _GetTypeName() const { return _TName("Transformation::Orientation"); };
public: string _GetString() const; public: string _GetString() const;
public: Record* _GetRecord() const; public: Record* _GetRecord() const;
}; };
// Attributes // Attributes
@ -73,49 +72,49 @@ class Transformation {
// Accessors // Accessors
// ********* // *********
public: const Unit& GetTx() const {return _tx;}; public: const Unit& getTx() const {return _tx;};
public: const Unit& GetTy() const {return _ty;}; public: const Unit& getTy() const {return _ty;};
public: Point GetTranslation() const {return Point(_tx, _ty);}; public: Point getTranslation() const {return Point(_tx, _ty);};
public: const Orientation& GetOrientation() const {return _orientation;}; public: const Orientation& GetOrientation() const {return _orientation;};
public: Unit GetX(const Unit& x, const Unit& y) const; public: Unit getX(const Unit& x, const Unit& y) const;
public: Unit GetY(const Unit& x, const Unit& y) const; public: Unit getY(const Unit& x, const Unit& y) const;
public: Unit GetX(const Point& point) const; public: Unit getX(const Point& point) const;
public: Unit GetY(const Point& point) const; public: Unit getY(const Point& point) const;
public: Unit GetDx(const Unit& dx, const Unit& dy) const; public: Unit getDx(const Unit& dx, const Unit& dy) const;
public: Unit GetDy(const Unit& dx, const Unit& dy) const; public: Unit getDy(const Unit& dx, const Unit& dy) const;
public: Point GetPoint(const Unit& x, const Unit& y) const; public: Point getPoint(const Unit& x, const Unit& y) const;
public: Point GetPoint(const Point& point) const; public: Point getPoint(const Point& point) const;
public: Box GetBox(const Unit& x1, const Unit& y1, const Unit& x2, const Unit& y2) const; public: Box getBox(const Unit& x1, const Unit& y1, const Unit& x2, const Unit& y2) const;
public: Box GetBox(const Point& point1, const Point& point2) const; public: Box getBox(const Point& point1, const Point& point2) const;
public: Box GetBox(const Box& box) const; public: Box getBox(const Box& box) const;
public: Transformation GetTransformation(const Transformation& transformation) const; public: Transformation getTransformation(const Transformation& transformation) const;
public: Transformation GetInvert() const; public: Transformation getInvert() const;
// Predicates // Predicates
// ********** // **********
public: bool IsEven() const {return !(_orientation.GetCode() & 1);}; public: bool isEven() const {return !(_orientation.GetCode() & 1);};
public: bool IsOdd() const {return (_orientation.GetCode() & 1);}; public: bool isOdd() const {return (_orientation.GetCode() & 1);};
// Updators // Updators
// ******** // ********
public: Transformation& Invert(); public: Transformation& invert();
// Manipulators // Manipulators
// ************ // ************
public: void ApplyOn(Unit& x, Unit& y) const; public: void applyOn(Unit& x, Unit& y) const;
public: void ApplyOn(Point& point) const; public: void applyOn(Point& point) const;
public: void ApplyOn(Box& box) const; public: void applyOn(Box& box) const;
public: void ApplyOn(Transformation& transformation) const; public: void applyOn(Transformation& transformation) const;
// Others // Others
// ****** // ******

View File

@ -24,7 +24,7 @@ Technology* getTechnology() {
} }
CellWidget::CellWidget(Cell* c, QWidget* parent) CellWidget::CellWidget(Cell* c, QWidget* parent)
: QAbstractScrollArea(parent), : QWidget(parent),
cell(c), cell(c),
invalidRegion(), invalidRegion(),
clipBox(), clipBox(),
@ -37,32 +37,7 @@ CellWidget::CellWidget(Cell* c, QWidget* parent)
void CellWidget::paintEvent(QPaintEvent* event) { void CellWidget::paintEvent(QPaintEvent* event) {
invalidate(event->rect()); invalidate(event->rect());
redraw();
if (!invalidRegion.isEmpty()) {
QRect invalidRect = invalidRegion.boundingRect();
H::Box area = getBox(invalidRect).inflate(getSize(1));
cerr << "akecoucou3" << endl;
//QPaintDevice* device = this;
//QPainter newPainter(device);
//QPainter* oldPainter = painter;
//painter = &newPainter;
painter->setPen(QPen(QColor(255, 255, 255)));
painter->fillRect(QRectF(0, 0, 100, 100), QBrush(QColor(255, 255, 255)));
drawPhantoms(cell, area, Transformation());
drawBoundaries(cell, area, Transformation());
for_each_layer(layer, getTechnology()->GetLayers()) {
drawCell(cell, layer, area, Transformation());
end_for;
}
invalidRegion = QRegion();
}
} }
void CellWidget::invalidate() { void CellWidget::invalidate() {
@ -85,7 +60,6 @@ void CellWidget::redraw() {
QRect invalidRect = invalidRegion.boundingRect(); QRect invalidRect = invalidRegion.boundingRect();
H::Box area = getBox(invalidRect).inflate(getSize(1)); H::Box area = getBox(invalidRect).inflate(getSize(1));
cerr << "akecoucou2" << endl;
QPaintDevice* device = this; QPaintDevice* device = this;
@ -93,16 +67,17 @@ void CellWidget::redraw() {
QPainter* oldPainter = painter; QPainter* oldPainter = painter;
painter = &newPainter; painter = &newPainter;
//painter->fillRect(QRectF(0, 0, 100, 100), QBrush(QColor(255, 255, 255))); painter->fillRect(QRectF(0, 0, 100, 100), QBrush(QColor(255, 255, 255)));
//painter->setPen(QPen(QColor(255, 255, 255))); painter->setPen(QPen(QColor(255, 255, 0)));
painter->setBrush(QBrush(QColor(255, 255, 0)));
//drawPhantoms(cell, area, Transformation()); drawPhantoms(cell, area, Transformation());
//drawBoundaries(cell, area, Transformation()); drawBoundaries(cell, area, Transformation());
//for_each_layer(layer, getTechnology()->GetLayers()) { for_each_layer(layer, getTechnology()->GetLayers()) {
// drawCell(cell, layer, area, Transformation()); drawCell(cell, layer, area, Transformation());
// end_for; end_for;
//} }
invalidRegion = QRegion(); invalidRegion = QRegion();
} }
@ -121,8 +96,8 @@ void CellWidget::drawPhantoms(const Cell* cell, const H::Box& updateArea, const
void CellWidget::drawPhantoms(const Instance* instance, const H::Box& updateArea, const Transformation& transformation) const { void CellWidget::drawPhantoms(const Instance* instance, const H::Box& updateArea, const Transformation& transformation) const {
H::Box masterArea = updateArea; H::Box masterArea = updateArea;
Transformation masterTransformation = instance->GetTransformation(); Transformation masterTransformation = instance->GetTransformation();
instance->GetTransformation().GetInvert().ApplyOn(masterArea); instance->GetTransformation().getInvert().applyOn(masterArea);
transformation.ApplyOn(masterTransformation); transformation.applyOn(masterTransformation);
drawPhantoms(instance->GetMasterCell(), masterArea, masterTransformation); drawPhantoms(instance->GetMasterCell(), masterArea, masterTransformation);
} }
@ -137,8 +112,8 @@ void CellWidget::drawBoundaries(const Cell* cell, const H::Box& updateArea, cons
void CellWidget::drawBoundaries(const Instance* instance, const H::Box& updateArea, const Transformation& transformation) const { void CellWidget::drawBoundaries(const Instance* instance, const H::Box& updateArea, const Transformation& transformation) const {
H::Box masterArea = updateArea; H::Box masterArea = updateArea;
Transformation masterTransformation = instance->GetTransformation(); Transformation masterTransformation = instance->GetTransformation();
instance->GetTransformation().GetInvert().ApplyOn(masterArea); instance->GetTransformation().getInvert().applyOn(masterArea);
transformation.ApplyOn(masterTransformation); transformation.applyOn(masterTransformation);
drawBoundaries(instance->GetMasterCell(), masterArea, masterTransformation); drawBoundaries(instance->GetMasterCell(), masterArea, masterTransformation);
} }

View File

@ -1,14 +1,14 @@
#ifndef __CELL_WIDGET_H #ifndef __CELL_WIDGET_H
#define __CELL_WIDGET_H #define __CELL_WIDGET_H
#include <QAbstractScrollArea> #include <QWidget>
#include "Box.h" #include "Box.h"
#include "Cell.h" #include "Cell.h"
using namespace H; using namespace H;
class CellWidget : public QAbstractScrollArea { class CellWidget : public QWidget {
public: public:
CellWidget(Cell* cell, QWidget* parent=0); CellWidget(Cell* cell, QWidget* parent=0);
void redraw(); void redraw();