OpenASIP 2.2
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Private Member Functions | Static Private Attributes | List of all members
OutputSocketFigure Class Reference

#include <OutputSocketFigure.hh>

Inheritance diagram for OutputSocketFigure:
Inheritance graph
Collaboration diagram for OutputSocketFigure:
Collaboration graph

Public Member Functions

 OutputSocketFigure ()
 
virtual ~OutputSocketFigure ()
 
- 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 Figure
void drawChildren (wxDC *dc)
 
virtual void layoutSelf (wxDC *)
 
virtual void layoutChildren (wxDC *)
 

Private Member Functions

OutputSocketFigureoperator= (OutputSocketFigure &old)
 Assignment not allowed.
 
 OutputSocketFigure (OutputSocketFigure &old)
 Copying not allowed.
 

Static Private Attributes

static const wxColour DEFAULT_COLOUR = wxColour(0, 0, 0)
 Default colour for the figure.
 
static const wxColour DEFAULT_BG_COLOUR = wxColour(255, 255, 255)
 Default background colour for the figure.
 

Additional Inherited Members

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

Detailed Description

Figure of an output socket.

Definition at line 46 of file OutputSocketFigure.hh.

Constructor & Destructor Documentation

◆ OutputSocketFigure() [1/2]

OutputSocketFigure::OutputSocketFigure ( )

The Constructor.

Definition at line 43 of file OutputSocketFigure.cc.

43 : Figure() {
44 size_ = wxSize(
47}
Figure()
Definition Figure.cc:44
wxSize size_
wxSize of the Figure's bounding rectangle.
Definition Figure.hh:86
static const int SOCKET_WIDTH
Width of a socket.
static const int SOCKET_HEIGHT
Height of a socket.

References Figure::size_, MachineCanvasLayoutConstraints::SOCKET_HEIGHT, and MachineCanvasLayoutConstraints::SOCKET_WIDTH.

◆ ~OutputSocketFigure()

OutputSocketFigure::~OutputSocketFigure ( )
virtual

The Destructor.

Definition at line 52 of file OutputSocketFigure.cc.

52 {
53}

◆ OutputSocketFigure() [2/2]

OutputSocketFigure::OutputSocketFigure ( OutputSocketFigure old)
private

Copying not allowed.

Member Function Documentation

◆ drawSelf()

void OutputSocketFigure::drawSelf ( wxDC *  dc)
protectedvirtual

Draws the output socket's Figure on the given device context.

Parameters
dcThe device context.

Reimplemented from Figure.

Definition at line 61 of file OutputSocketFigure.cc.

61 {
62 wxPen pen = wxPen(DEFAULT_COLOUR, 1, wxSOLID);
63 dc->SetPen(pen);
64 wxBrush brush = wxBrush(DEFAULT_BG_COLOUR, wxSOLID);
65 if (highlighted_) {
66 brush = wxBrush(highlight_, wxSOLID);
67 }
68 dc->SetBrush(brush);
69
71
72 wxPoint point1 = wxPoint(0, 0);
73 wxPoint point2 = wxPoint(size_.GetWidth(), 0);
74 wxPoint point3 = wxPoint(size_.GetWidth()/2, triangleHeight);
75 wxPoint trianglePoints[3] = {point1, point2, point3};
76
77 dc->DrawPolygon(3, trianglePoints, location_.x, location_.y);
78 dc->DrawRectangle(
79 location_.x, location_.y + triangleHeight, size_.GetWidth(),
80 size_.GetHeight() - triangleHeight);
81}
wxColour highlight_
Highlight colour.
Definition Figure.hh:99
bool highlighted_
Tells if the figure is highlighted.
Definition Figure.hh:101
wxPoint location_
Top-left location of the Figure's bounding rectangle.
Definition Figure.hh:84
static const int TRIANGLE_HEIGHT
Size of the sockets' direction triangle.
static const wxColour DEFAULT_BG_COLOUR
Default background colour for the figure.
static const wxColour DEFAULT_COLOUR
Default colour for the figure.

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

◆ operator=()

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

Assignment not allowed.

Member Data Documentation

◆ DEFAULT_BG_COLOUR

const wxColour OutputSocketFigure::DEFAULT_BG_COLOUR = wxColour(255, 255, 255)
staticprivate

Default background colour for the figure.

Definition at line 63 of file OutputSocketFigure.hh.

Referenced by drawSelf().

◆ DEFAULT_COLOUR

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

Default colour for the figure.

Definition at line 61 of file OutputSocketFigure.hh.

Referenced by drawSelf().


The documentation for this class was generated from the following files: