![]() |
TinkerCell Core 1.0
TinkerCell's Core library providing all basic functionalities
|
A simple circle or square that is used for changing specific locations. More...
#include <ControlPoint.h>
Public Types | |
enum | { Type = UserType + 1 } |
paint method. Call's parent's paint after setting antialiasing to true More... | |
enum | ShapeType { circle, square, triangle } |
type of shape to paint. More... | |
Public Member Functions | |
virtual qreal | x () |
x position | |
virtual qreal | y () |
y position | |
ControlPoint (QGraphicsItem *parent=0) | |
Constructor: Setup colors and z value. | |
ControlPoint (const ControlPoint ©) | |
copy constructor | |
virtual int | type () const |
for enabling dynamic_cast | |
virtual void | sideEffect () |
side effect when moved. always call this after moving | |
virtual ControlPoint * | clone () const |
make a copy of this control point | |
virtual void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option=new QStyleOptionGraphicsItem(), QWidget *widget=0) |
paint method. | |
virtual QRectF | boundingRect () const |
bounding rect method. | |
virtual void | setRect (const QRectF &) |
set size rect. | |
virtual QRectF | rect () const |
get size rect. | |
virtual ItemHandle * | handle () const |
get the handle of this control point, usually 0 or the parent's handle | |
virtual void | setHandle (ItemHandle *) |
set the handle of this control point, usually sets parent's handle or does nothing | |
Static Public Member Functions | |
static ControlPoint * | cast (QGraphicsItem *item) |
cast QGraphicsItem to ControlPoint item. output will be 0 if pointer is not a control point | |
static QList< ControlPoint * > | cast (const QList< QGraphicsItem * > &items) |
cast QGraphicsItems to ControlPoint items | |
Public Attributes | |
QBrush | defaultBrush |
permanent brush for this control point | |
QPen | defaultPen |
permanent pen for this control point | |
QSizeF | defaultSize |
default size for this item | |
ShapeType | shapeType |
type of shape to paint. | |
Protected Attributes | |
QRectF | bounds |
A simple circle or square that is used for changing specific locations.
Definition at line 52 of file ControlPoint.h.
anonymous enum |
paint method. Call's parent's paint after setting antialiasing to true
for enabling dynamic_cast
Definition at line 72 of file ControlPoint.h.
type of shape to paint.
Definition at line 88 of file ControlPoint.h.
Tinkercell::ControlPoint::ControlPoint | ( | QGraphicsItem * | parent = 0 | ) |
Constructor: Setup colors and z value.
Definition at line 38 of file ControlPoint.cpp.
Tinkercell::ControlPoint::ControlPoint | ( | const ControlPoint & | copy | ) |
copy constructor
Copy Constructor.
Definition at line 52 of file ControlPoint.cpp.
QRectF Tinkercell::ControlPoint::boundingRect | ( | ) | const [virtual] |
bounding rect method.
Definition at line 69 of file ControlPoint.cpp.
ControlPoint * Tinkercell::ControlPoint::cast | ( | QGraphicsItem * | item | ) | [static] |
cast QGraphicsItem to ControlPoint item. output will be 0 if pointer is not a control point
Definition at line 73 of file ConnectionGraphicsItem.cpp.
QList< ControlPoint * > Tinkercell::ControlPoint::cast | ( | const QList< QGraphicsItem * > & | items | ) | [static] |
cast QGraphicsItems to ControlPoint items
Definition at line 102 of file ConnectionGraphicsItem.cpp.
ControlPoint * Tinkercell::ControlPoint::clone | ( | ) | const [virtual] |
make a copy of this control point
make a copy of this item
Reimplemented in Tinkercell::ConnectionGraphicsItem::ControlPoint, and Tinkercell::NodeGraphicsItem::ControlPoint.
Definition at line 88 of file ControlPoint.cpp.
ItemHandle * Tinkercell::ControlPoint::handle | ( | ) | const [virtual] |
get the handle of this control point, usually 0 or the parent's handle
Reimplemented in Tinkercell::ConnectionGraphicsItem::ControlPoint, and Tinkercell::NodeGraphicsItem::ControlPoint.
Definition at line 27 of file ControlPoint.cpp.
void Tinkercell::ControlPoint::paint | ( | QPainter * | painter, |
const QStyleOptionGraphicsItem * | option = new QStyleOptionGraphicsItem() , |
||
QWidget * | widget = 0 |
||
) | [virtual] |
paint method.
paint method. draw one of the shapes
Reimplemented in Tinkercell::NodeGraphicsItem::ControlPoint.
Definition at line 100 of file ControlPoint.cpp.
QRectF Tinkercell::ControlPoint::rect | ( | ) | const [virtual] |
get size rect.
bounding rect method.
Definition at line 76 of file ControlPoint.cpp.
void Tinkercell::ControlPoint::setHandle | ( | ItemHandle * | ) | [virtual] |
set the handle of this control point, usually sets parent's handle or does nothing
Reimplemented in Tinkercell::ConnectionGraphicsItem::ControlPoint, and Tinkercell::NodeGraphicsItem::ControlPoint.
Definition at line 32 of file ControlPoint.cpp.
void Tinkercell::ControlPoint::setRect | ( | const QRectF & | rect | ) | [virtual] |
set size rect.
set size.
Definition at line 82 of file ControlPoint.cpp.
void Tinkercell::ControlPoint::sideEffect | ( | ) | [virtual] |
side effect when moved. always call this after moving
Reimplemented in Tinkercell::NodeGraphicsItem::ControlPoint.
Definition at line 94 of file ControlPoint.cpp.
virtual int Tinkercell::ControlPoint::type | ( | ) | const [inline, virtual] |
for enabling dynamic_cast
Reimplemented in Tinkercell::ConnectionGraphicsItem::ControlPoint, and Tinkercell::NodeGraphicsItem::ControlPoint.
Definition at line 74 of file ControlPoint.h.
virtual qreal Tinkercell::ControlPoint::x | ( | ) | [inline, virtual] |
x position
Definition at line 62 of file ControlPoint.h.
virtual qreal Tinkercell::ControlPoint::y | ( | ) | [inline, virtual] |
y position
Definition at line 64 of file ControlPoint.h.
QRectF Tinkercell::ControlPoint::bounds [protected] |
Definition at line 104 of file ControlPoint.h.
permanent brush for this control point
Definition at line 56 of file ControlPoint.h.
permanent pen for this control point
Definition at line 58 of file ControlPoint.h.
default size for this item
Definition at line 60 of file ControlPoint.h.
type of shape to paint.
Definition at line 90 of file ControlPoint.h.