OpenASIP  2.0
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. More...
 
 OutputSocketFigure (OutputSocketFigure &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 = wxColour(255, 255, 255)
 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 an output socket.

Definition at line 46 of file OutputSocketFigure.hh.

Constructor & Destructor Documentation

◆ OutputSocketFigure() [1/2]

OutputSocketFigure::OutputSocketFigure ( )

◆ ~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 }

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:
MachineCanvasLayoutConstraints::SOCKET_WIDTH
static const int SOCKET_WIDTH
Width of a socket.
Definition: MachineCanvasLayoutConstraints.hh:59
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
MachineCanvasLayoutConstraints::TRIANGLE_HEIGHT
static const int TRIANGLE_HEIGHT
Size of the sockets' direction triangle.
Definition: MachineCanvasLayoutConstraints.hh:89
Figure::highlighted_
bool highlighted_
Tells if the figure is highlighted.
Definition: Figure.hh:101
Figure::Figure
Figure()
Definition: Figure.cc:44
MachineCanvasLayoutConstraints::SOCKET_HEIGHT
static const int SOCKET_HEIGHT
Height of a socket.
Definition: MachineCanvasLayoutConstraints.hh:61
OutputSocketFigure::DEFAULT_COLOUR
static const wxColour DEFAULT_COLOUR
Default colour for the figure.
Definition: OutputSocketFigure.hh:61
OutputSocketFigure::DEFAULT_BG_COLOUR
static const wxColour DEFAULT_BG_COLOUR
Default background colour for the figure.
Definition: OutputSocketFigure.hh:63