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

SourceForge.net Logo
Project
Download
Mailing lists

 

         

QGraphics2d
[Interfaces]

Components 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...
interface  orca::QGraphics2dConsumer
interface  orca::QGraphics2d
 Access to the drawable entity. More...
interface  orca::QGraphics2d
 Access to the drawable entity. More...

Detailed Description

Components can implement this interface to define how they'd like to draw themselves.

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.

Example
An example of how an interface provider would draw itself:

        //
        // 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)


Generated for Orca Robotics by  doxygen 1.4.5