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

#include <InputSocketFigure.hh>

Inheritance diagram for InputSocketFigure:
Inheritance graph
Collaboration diagram for InputSocketFigure:
Collaboration graph

Public Member Functions

 InputSocketFigure ()
 
virtual ~InputSocketFigure ()
 
- 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

InputSocketFigureoperator= (InputSocketFigure &old)
 Assignment not allowed. More...
 
 InputSocketFigure (InputSocketFigure &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 input socket.

Definition at line 46 of file InputSocketFigure.hh.

Constructor & Destructor Documentation

◆ InputSocketFigure() [1/2]

InputSocketFigure::InputSocketFigure ( )

◆ ~InputSocketFigure()

InputSocketFigure::~InputSocketFigure ( )
virtual

The Destructor.

Definition at line 52 of file InputSocketFigure.cc.

52  {
53 }

◆ InputSocketFigure() [2/2]

InputSocketFigure::InputSocketFigure ( InputSocketFigure old)
private

Copying not allowed.

Member Function Documentation

◆ drawSelf()

void InputSocketFigure::drawSelf ( wxDC *  dc)
protectedvirtual

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

Parameters
dcThe device context.

Reimplemented from Figure.

Definition at line 61 of file InputSocketFigure.cc.

61  {
62 
63  wxPen pen = wxPen(DEFAULT_COLOUR, 1, wxSOLID);
64  dc->SetPen(pen);
65  wxBrush brush = wxBrush(DEFAULT_BG_COLOUR, wxSOLID);
66  if (highlighted_) {
67  brush = wxBrush(highlight_, wxSOLID);
68  }
69  dc->SetBrush(brush);
70 
72 
73  wxPoint point1 = wxPoint(size_.GetWidth()/2, 0);
74  wxPoint point2 = wxPoint(0, triangleHeight);
75  wxPoint point3 = wxPoint(size_.GetWidth(), triangleHeight);
76  wxPoint trianglePoints[3] = {point1, point2, point3};
77 
78  dc->DrawPolygon(3, trianglePoints, location_.x, location_.y);
79  dc->DrawRectangle(
80  location_.x, location_.y + triangleHeight, size_.GetWidth(),
81  size_.GetHeight() - triangleHeight);
82 
83 }

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

◆ operator=()

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

Assignment not allowed.

Member Data Documentation

◆ DEFAULT_BG_COLOUR

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

Default background colour for the figure.

Definition at line 63 of file InputSocketFigure.hh.

Referenced by drawSelf().

◆ DEFAULT_COLOUR

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

Default colour for the figure.

Definition at line 61 of file InputSocketFigure.hh.

Referenced by drawSelf().


The documentation for this class was generated from the following files:
InputSocketFigure::DEFAULT_BG_COLOUR
static const wxColour DEFAULT_BG_COLOUR
Default background colour for the figure.
Definition: InputSocketFigure.hh:63
InputSocketFigure::DEFAULT_COLOUR
static const wxColour DEFAULT_COLOUR
Default colour for the figure.
Definition: InputSocketFigure.hh:61
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