We have moved to https://dokuwiki.librecad.org/
Lots of content was already moved to the new wiki, but there is still work to do. If you want to contribute, please register a new account at https://dokuwiki.librecad.org/
This wiki will be kept for a while to keep search engine results valid. Moved sites may be deleted here in future.
Difference between revisions of "Plug Entity class"
(Created page with "===Plug_Entity Class Reference=== Wrapper for acces entities from plugins. <p>Wrapper class for create, access and modify entities from plugins. <p>TODO: terminate access ...") |
|||
Line 2: | Line 2: | ||
Wrapper for acces entities from plugins. | Wrapper for acces entities from plugins. | ||
− | + | Wrapper class for create, access and modify entities from plugins. | |
− | + | ||
− | + | ||
− | + | ||
+ | TODO: terminate access function -> getData() | ||
− | <p><code>#include | + | implementation of modify function -> modData() |
+ | |||
+ | implementation of create function -> createData() | ||
+ | |||
+ | <p><code>#include <document_interface.h></code></p> | ||
<table> | <table> | ||
<tr><td colspan="2"><h2>Public Member Functions</h2></td></tr> | <tr><td colspan="2"><h2>Public Member Functions</h2></td></tr> | ||
− | <tr><td>virtual | + | <tr><td>virtual ~Plug_Entity ()</td></tr> |
− | <tr><td>virtual void | + | <tr><td>virtual void '''getData''' (QHash< int, QVariant > *data)=0</td><td>''Obtain the entity data.''</td></tr> |
− | + | <tr><td>virtual void '''move''' (QPointF offset)=0</td><td>''Move the entity.''</td></tr> | |
− | <tr><td>virtual void | + | <tr><td>virtual void '''rotate''' (QPointF center, double angle)=0</td><td>''rotate the entity.''</td></tr> |
− | + | <tr><td>virtual void '''scale''' (QPointF center, QPointF factor)=0</td><td>''Scale the entity.''</td></tr> | |
− | <tr><td>virtual void | + | |
− | + | ||
− | <tr><td>virtual void | + | |
− | + | ||
</table> | </table> | ||
+ | ---- | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | virtual Plug_Entity::'''~Plug_Entity''' () <code>[inline, virtual]</code> | |
==Member Function Documentation== | ==Member Function Documentation== | ||
− | + | virtual void Plug_Entity::'''getData''' (QHash< int, QVariant > *''data'') <code>[pure virtual]</code> | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
<p>Obtain the entity data. </p> | <p>Obtain the entity data. </p> | ||
'''Parameters:''' | '''Parameters:''' | ||
− | <table | + | <table> |
− | <tr><td | + | <tr><td>''data''</td><td>pointer to a QHash<int, QVariant> that store the entity data.</td></tr> |
</table> | </table> | ||
---- | ---- | ||
− | + | virtual void Plug_Entity::'''move''' (QPointF ''offset'') <code>[pure virtual]</code> | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
<p>Move the entity. </p> | <p>Move the entity. </p> | ||
'''Parameters:''' | '''Parameters:''' | ||
− | <table | + | <table> |
− | <tr><td | + | <tr><td>''offset''</td><td>move the entity by the given QPointF.</td></tr> |
</table> | </table> | ||
---- | ---- | ||
− | virtual void Plug_Entity::rotate | + | virtual void Plug_Entity::'''rotate''' (QPointF ''center'', double ''angle'') <code>[pure virtual]</code> |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
<p>rotate the entity. </p> | <p>rotate the entity. </p> | ||
'''Parameters''': | '''Parameters''': | ||
− | <table | + | <table> |
− | <tr><td | + | <tr><td>''center''</td><td>center of rotation. </td></tr> |
− | <tr><td | + | <tr><td>''angle''</td><td>angle to rotate. </td></tr> |
</table> | </table> | ||
---- | ---- | ||
− | + | virtual void Plug_Entity::'''scale''' (QPointF ''center'', QPointF ''factor'') <code>[pure virtual]</code> | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
<p>Scale the entity. </p> | <p>Scale the entity. </p> | ||
'''Parameters:''' | '''Parameters:''' |
Revision as of 09:25, 26 July 2012
Plug_Entity Class Reference
Wrapper for acces entities from plugins.
Wrapper class for create, access and modify entities from plugins.
TODO: terminate access function -> getData()
implementation of modify function -> modData()
implementation of create function -> createData()
#include <document_interface.h>
Public Member Functions | |
virtual ~Plug_Entity () | |
virtual void getData (QHash< int, QVariant > *data)=0 | Obtain the entity data. |
virtual void move (QPointF offset)=0 | Move the entity. |
virtual void rotate (QPointF center, double angle)=0 | rotate the entity. |
virtual void scale (QPointF center, QPointF factor)=0 | Scale the entity. |
virtual Plug_Entity::~Plug_Entity () [inline, virtual]
Member Function Documentation
virtual void Plug_Entity::getData (QHash< int, QVariant > *data) [pure virtual]
Obtain the entity data.
Parameters:
data | pointer to a QHash<int, QVariant> that store the entity data. |
virtual void Plug_Entity::move (QPointF offset) [pure virtual]
Move the entity.
Parameters:
offset | move the entity by the given QPointF. |
virtual void Plug_Entity::rotate (QPointF center, double angle) [pure virtual]
rotate the entity.
Parameters:
center | center of rotation. |
angle | angle to rotate. |
virtual void Plug_Entity::scale (QPointF center, QPointF factor) [pure virtual]
Scale the entity.
Parameters:
center | base point for scale. |
factor | scale factor. |