OpenASIP  2.0
Public Member Functions | Protected Member Functions | Private Member Functions | Static Private Attributes | List of all members
TriggeringPortFigure Class Reference

#include <TriggeringPortFigure.hh>

Inheritance diagram for TriggeringPortFigure:
Inheritance graph
Collaboration diagram for TriggeringPortFigure:
Collaboration graph

Public Member Functions

 TriggeringPortFigure (std::string name, int bitWidth)
 
virtual ~TriggeringPortFigure ()
 
- Public Member Functions inherited from UnitPortFigure
 UnitPortFigure (std::string name, int bitWidth)
 
virtual ~UnitPortFigure ()
 
std::string name () const
 
- 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 drawSelf (wxDC *dc)
 
- Protected Member Functions inherited from UnitPortFigure
virtual void layoutChildren (wxDC *)
 
- Protected Member Functions inherited from Figure
void drawChildren (wxDC *dc)
 
virtual void layoutSelf (wxDC *)
 

Private Member Functions

TriggeringPortFigureoperator= (TriggeringPortFigure &old)
 Assignment not allowed. More...
 
 TriggeringPortFigure (TriggeringPortFigure &old)
 Copying not allowed. More...
 

Static Private Attributes

static const wxColour DEFAULT_COLOUR = wxColour(0, 0, 0)
 Default colour for the figure. More...
 
static const wxColour DEFAULT_BG_COLOUR
 Default background colour for the figure. 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 triggering function unit port.

Definition at line 45 of file TriggeringPortFigure.hh.

Constructor & Destructor Documentation

◆ TriggeringPortFigure() [1/2]

TriggeringPortFigure::TriggeringPortFigure ( std::string  name,
int  bitWidth 
)

The Constructor.

Parameters
nameName of the port.

Definition at line 50 of file TriggeringPortFigure.cc.

50  :
51  UnitPortFigure(name, bitWidth) {
52 }

◆ ~TriggeringPortFigure()

TriggeringPortFigure::~TriggeringPortFigure ( )
virtual

The Destructor.

Definition at line 57 of file TriggeringPortFigure.cc.

57  {
58 }

◆ TriggeringPortFigure() [2/2]

TriggeringPortFigure::TriggeringPortFigure ( TriggeringPortFigure old)
private

Copying not allowed.

Member Function Documentation

◆ drawSelf()

void TriggeringPortFigure::drawSelf ( wxDC *  dc)
protectedvirtual

Draws the port's Figure on the given device context.

Parameters
dcThe device context.

Reimplemented from UnitPortFigure.

Definition at line 67 of file TriggeringPortFigure.cc.

67  {
68 
69  wxPen pen = wxPen(DEFAULT_COLOUR, 1, wxSOLID);
70  dc->SetPen(pen);
71  wxBrush brush = wxBrush(DEFAULT_BG_COLOUR, wxSOLID);
72  if (highlighted_) {
73  brush = wxBrush(highlight_, wxSOLID);
74  }
75 
76  dc->SetBrush(brush);
77 
78  dc->DrawRectangle(location_.x, location_.y, size_.GetWidth(),
79  size_.GetHeight());
80 
81  dc->DrawLine(
82  location_.x, location_.y,
83  location_.x + size_.GetWidth() - 1,
84  location_.y + size_.GetHeight() - 1);
85  dc->DrawLine(
86  location_.x, location_.y + size_.GetHeight() - 1,
87  location_.x + size_.GetWidth() - 1, location_.y);
88 
89 }

References DEFAULT_BG_COLOUR, DEFAULT_COLOUR, Figure::highlight_, Figure::highlighted_, Figure::location_, and Figure::size_.

◆ operator=()

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

Assignment not allowed.

Member Data Documentation

◆ DEFAULT_BG_COLOUR

const wxColour TriggeringPortFigure::DEFAULT_BG_COLOUR
staticprivate
Initial value:
=
wxColour(255, 255, 255)

Default background colour for the figure.

Definition at line 62 of file TriggeringPortFigure.hh.

Referenced by drawSelf().

◆ DEFAULT_COLOUR

const wxColour TriggeringPortFigure::DEFAULT_COLOUR = wxColour(0, 0, 0)
staticprivate

Default colour for the figure.

Definition at line 60 of file TriggeringPortFigure.hh.

Referenced by drawSelf().


The documentation for this class was generated from the following files:
UnitPortFigure::UnitPortFigure
UnitPortFigure(std::string name, int bitWidth)
Definition: UnitPortFigure.cc:51
TriggeringPortFigure::DEFAULT_BG_COLOUR
static const wxColour DEFAULT_BG_COLOUR
Default background colour for the figure.
Definition: TriggeringPortFigure.hh:62
UnitPortFigure::name
std::string name() const
Definition: UnitPortFigure.cc:112
TriggeringPortFigure::DEFAULT_COLOUR
static const wxColour DEFAULT_COLOUR
Default colour for the figure.
Definition: TriggeringPortFigure.hh:60
Figure::highlight_
wxColour highlight_
Highlight colour.
Definition: Figure.hh:99
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
Figure::highlighted_
bool highlighted_
Tells if the figure is highlighted.
Definition: Figure.hh:101