OpenASIP  2.0
Public Member Functions | Protected Member Functions | Private Member Functions | List of all members
BusContainerFigure Class Reference

#include <BusContainerFigure.hh>

Inheritance diagram for BusContainerFigure:
Inheritance graph
Collaboration diagram for BusContainerFigure:
Collaboration graph

Public Member Functions

 BusContainerFigure ()
 
virtual ~BusContainerFigure ()
 
- Public Member Functions inherited from Figure
 Figure ()
 
virtual ~Figure ()
 
wxPoint location () const
 
void setLocation (wxPoint point)
 
void setX (int x)
 
void setY (int y)
 
void setPreferredX (int x)
 
bool xSet () const
 
void clearXSetFlag ()
 
virtual wxRect bounds () const
 
virtual wxRect virtualBounds () const
 
void setBounds (wxSize bounds)
 
void setWidth (int width)
 
void setHeight (int height)
 
virtual void addChild (Figure *child)
 
int childCount () const
 
Figurechild (int index) const
 
virtual void layout (wxDC *dc)
 
virtual void draw (wxDC *dc)
 
void highlight (const wxColour &colour)
 
void clearHighlight ()
 
void setOptions (MachineCanvasOptions *options)
 
MachineCanvasOptionsoptions ()
 

Protected Member Functions

virtual void layoutSelf (wxDC *)
 
virtual void layoutChildren (wxDC *)
 
- Protected Member Functions inherited from Figure
virtual void drawSelf (wxDC *dc)
 
void drawChildren (wxDC *dc)
 

Private Member Functions

BusContainerFigureoperator= (BusContainerFigure &old)
 Assignment not allowed. More...
 
 BusContainerFigure (BusContainerFigure &old)
 Copying not allowed. More...
 

Additional Inherited Members

- Protected Attributes inherited from Figure
wxPoint location_
 Top-left location of the Figure's bounding rectangle. More...
 
wxSize size_
 wxSize of the Figure's bounding rectangle. More...
 
wxSize minSize_
 Figure's minimum size. More...
 
std::vector< Figure * > children_
 Figure's children. More...
 
bool xSet_
 Tells if x-coordinate has been fixed. More...
 
bool laidOut_
 Tells whether the Figure and its children have been laid out or not. More...
 
bool drawn_
 Tells whether the Figure and its children have been drawn or not. More...
 
wxColour highlight_
 Highlight colour. More...
 
bool highlighted_
 Tells if the figure is highlighted. More...
 
MachineCanvasOptionsoptions_
 Options which are used for customizing figures. More...
 

Detailed Description

Figure of a container EditPart for buses.

Definition at line 47 of file BusContainerFigure.hh.

Constructor & Destructor Documentation

◆ BusContainerFigure() [1/2]

BusContainerFigure::BusContainerFigure ( )

The Constructor.

Definition at line 47 of file BusContainerFigure.cc.

47  : Figure() {
48 }

◆ ~BusContainerFigure()

BusContainerFigure::~BusContainerFigure ( )
virtual

The Destructor.

Definition at line 53 of file BusContainerFigure.cc.

53  {
54 }

◆ BusContainerFigure() [2/2]

BusContainerFigure::BusContainerFigure ( BusContainerFigure old)
private

Copying not allowed.

Member Function Documentation

◆ layoutChildren()

void BusContainerFigure::layoutChildren ( wxDC *  dc)
protectedvirtual

Lays out buses and bridges.

Parameters
dcDevice context.

Reimplemented from Figure.

Definition at line 62 of file BusContainerFigure.cc.

62  {
63 
64  int busX = location_.x;
65  int busY = location_.y;
66 
67  vector<Figure*>::iterator i = children_.begin();
68  while (i != children_.end()) {
69  (*i)->setLocation(wxPoint(busX, busY));
70  (*i)->setWidth(size_.GetWidth());
71  (*i)->layout(dc);
72 
73  busY += (*i)->bounds().GetHeight() +
75 
76  i++;
77  }
78 }

References MachineCanvasLayoutConstraints::BUS_SPACE, Figure::children_, Figure::location_, and Figure::size_.

◆ layoutSelf()

void BusContainerFigure::layoutSelf ( wxDC *  )
protectedvirtual

Calculates and sets the size of the container.

Depends on the size and amount of buses.

Reimplemented from Figure.

Definition at line 86 of file BusContainerFigure.cc.

86  {
87 
88  int height = 0;
89 
90  vector<Figure*>::const_iterator i = children_.begin();
91  while (i != children_.end()) {
92  height += (*i)->bounds().GetHeight();
93  i++;
94  }
95 
97  size_.SetHeight(height);
98 
99  if (size_.GetWidth() == 0) {
100  size_.SetWidth(children_[0]->bounds().GetWidth());
101  }
102 }

References Figure::bounds(), MachineCanvasLayoutConstraints::BUS_SPACE, Figure::children_, and Figure::size_.

Here is the call graph for this function:

◆ operator=()

BusContainerFigure& BusContainerFigure::operator= ( BusContainerFigure old)
private

Assignment not allowed.


The documentation for this class was generated from the following files:
Figure::bounds
virtual wxRect bounds() const
Figure::children_
std::vector< Figure * > children_
Figure's children.
Definition: Figure.hh:90
Figure::size_
wxSize size_
wxSize of the Figure's bounding rectangle.
Definition: Figure.hh:86
Figure::location_
wxPoint location_
Top-left location of the Figure's bounding rectangle.
Definition: Figure.hh:84
MachineCanvasLayoutConstraints::BUS_SPACE
static const int BUS_SPACE
Space between buses and bus chains.
Definition: MachineCanvasLayoutConstraints.hh:75
Figure::Figure
Figure()
Definition: Figure.cc:44