|
orca-robotics INTRODUCTION Overview Download and Install Quick Start Documentation Publications REPOSITORY Interfaces Components Libraries Utilities Software Map DEVELOPER Tutorials Examples Dev Guide Dashboard Wiki login/pass: orca/orca PEOPLE Contributors Users Project Download Mailing lists
|
QGraphics2dComponents can implement this interface to define how they'd like to draw themselves.
More... |
|||||||||||||||||||||||
Classes | |
| struct | orca::QGraphics2dData |
| QGraphics2d command structure: tells how to paint something. More... | |
| class | orca::QGraphics2dConsumer |
| class | orca::QGraphics2d |
| Access to the drawable entity. More... | |
Variables | |
| vector< byte > | orca::SerializedQPicture |
| A serialized QPicture. | |
The interface is Qt-specific. It works like this:
1) The interface provider instantiates a QPicture, and paints to it.
2) The QPicture knows how to serialize itself. The interface provider serializes the QPicture into the QGraphics2dData object.
3) A component that knows how to paint things connects and gets the QGraphics2dData object, de-serializes it into a QPicture, and paints it.
This allows extremely general painting: the interface provider can use all of Qt's power to paint into the QPicture.
//
// Set up the QPicture
//
QPicture qpic;
QPainter p;
p.begin( &qpic );
{
//
// Painting code goes here: paint to the painter...
//
}
p.end();
//
// Then stick it in the orca object
//
orca::QGraphics2dDataPtr data = new QGraphics2dData;
data->z = [1..12];
data->isInGlobalCS = {true|false};
data->qpicture.resize( qpic.size() );
memcpy( &(data->qpicture[0]), qpic.data(), qpic.size() );
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)
1.4.5