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"

From LibreCAD wiki
Jump to: navigation, search
(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 ...")
 
(Put in Category:Developers)
 
(One intermediate revision by one user not shown)
Line 2: Line 2:
 
Wrapper for acces entities from plugins.   
 
Wrapper for acces entities from plugins.   
  
<p>Wrapper class for create, access and modify entities from plugins.  
+
Wrapper class for create, access and modify entities from plugins.
<p>TODO: terminate access function -> getData() </p>
+
<p>implementation of modify function -> modData() </p>
+
<p>implementation of create function -> createData() </p>
+
  
 +
TODO: terminate access function -> getData()
  
<p><code>#include &lt;document_interface.h</a>&gt;</code></p>
+
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</td><td><a href="#a7186c81063debb130e4eb2a6819f66ec">~Plug_Entity</a> ()</td></tr>
+
<tr><td>virtual ~Plug_Entity ()</td></tr>
<tr><td>virtual void</td><td><a href="#a3e2acf80beecc81e0e7596bf782b869a">getData</a> (QHash&lt; int, QVariant &gt; *data)=0</td></tr>
+
<tr><td>virtual void '''getData''' (QHash< int, QVariant > *data)=0</td><td>''Obtain the entity data.''</td></tr>
<tr><td></td><td>Obtain the entity data. <a href="#a3e2acf80beecc81e0e7596bf782b869a"></a><br/></td></tr>
+
<tr><td>virtual void '''move''' (QPointF offset)=0</td><td>''Move the entity.''</td></tr>
<tr><td>virtual void</td><td><a href="#a83b1ec84b81854d4fb8099d95930397b">move</a> (QPointF offset)=0</td></tr>
+
<tr><td>virtual void '''rotate''' (QPointF center, double angle)=0</td><td>''rotate the entity.''</td></tr>
<tr><td></td><td>Move the entity.<br/></td></tr>
+
<tr><td>virtual void '''scale''' (QPointF center, QPointF factor)=0</td><td>''Scale the entity.''</td></tr>
<tr><td>virtual void</td><td><a href="#a2a4a27a59029c7c43f6ee7750db1d4af">rotate</a> (QPointF center, double angle)=0</td></tr>
+
<tr><td></td><td>rotate the entity.<br/></td></tr>
+
<tr><td>virtual void</td><td><a href="#a93f8d76ad98f7f5b0f24f111681c31a4">scale</a> (QPointF center, QPointF factor)=0</td></tr>
+
<tr><td></td><td>Scale the entity.<br/></td></tr>
+
 
</table>
 
</table>
  
 +
----
  
==Constructor &amp; Destructor Documentation==
 
      <table class="memname">
 
        <tr>
 
          <td class="memname">virtual Plug_Entity::~Plug_Entity </td>
 
          <td>(</td>
 
          <td class="paramname"></td><td>)</td>
 
          <td><code> [inline, virtual]</code></td>
 
        </tr>
 
      </table>
 
  
----
+
virtual Plug_Entity::'''~Plug_Entity''' () <code>[inline, virtual]</code>
  
 
==Member Function Documentation==
 
==Member Function Documentation==
  
      <table class="memname">
+
virtual void Plug_Entity::'''getData''' (QHash< int, QVariant > *''data'') <code>[pure virtual]</code>
        <tr>
+
          <td class="memname">virtual void Plug_Entity::getData </td>
+
          <td>(</td>
+
          <td class="paramtype">QHash&lt; int, QVariant &gt; *&#160;</td>
+
          <td class="paramname"><em>data</em></td><td>)</td>
+
          <td><code> [pure virtual]</code></td>
+
        </tr>
+
      </table>
+
 
+
  
 
<p>Obtain the entity data. </p>
 
<p>Obtain the entity data. </p>
 
'''Parameters:'''
 
'''Parameters:'''
   <table class="params">
+
   <table>
     <tr><td class="paramname">data</td><td>pointer to a QHash&lt;int, QVariant&gt; to store the entity data. </td></tr>
+
     <tr><td>''data''</td><td>pointer to a QHash<int, QVariant> that store the entity data.</td></tr>
 
   </table>
 
   </table>
  
 
----
 
----
  
      <table class="memname">
+
virtual void Plug_Entity::'''move''' (QPointF ''offset'') <code>[pure virtual]</code>
        <tr>
+
          <td class="memname">virtual void Plug_Entity::move </td>
+
          <td>(</td>
+
          <td class="paramtype">QPointF&#160;</td>
+
          <td class="paramname"><em>offset</em></td><td>)</td>
+
          <td><code> [pure virtual]</code></td>
+
        </tr>
+
      </table>
+
  
 
<p>Move the entity. </p>
 
<p>Move the entity. </p>
 
'''Parameters:'''
 
'''Parameters:'''
   <table class="params">
+
   <table>
     <tr><td class="paramname">offset</td><td>move the entity by the given QPointF. </td></tr>
+
     <tr><td>''offset''</td><td>move the entity by the given QPointF.</td></tr>
 
   </table>
 
   </table>
  
 
----
 
----
  
virtual void Plug_Entity::rotate </td>
+
virtual void Plug_Entity::'''rotate''' (QPointF ''center'', double ''angle'') <code>[pure virtual]</code>
          <td>(</td>
+
          <td class="paramtype">QPointF&#160;</td>
+
          <td class="paramname"><em>center</em>, </td>
+
        </tr>
+
        <tr>
+
          <td class="paramkey"></td>
+
          <td></td>
+
          <td class="paramtype">double&#160;</td>
+
          <td class="paramname"><em>angle</em>&#160;</td>
+
        </tr>
+
        <tr>
+
          <td></td>
+
          <td>)</td>
+
          <td></td><td><code> [pure virtual]</code></td>
+
        </tr>
+
      </table>
+
 
+
 
<p>rotate the entity. </p>
 
<p>rotate the entity. </p>
 
'''Parameters''':
 
'''Parameters''':
   <table class="params">
+
   <table>
     <tr><td class="paramname">center</td><td>center of rotation. </td></tr>
+
     <tr><td>''center''</td><td>center of rotation. </td></tr>
     <tr><td class="paramname">angle</td><td>angle to rotate. </td></tr>
+
     <tr><td>''angle''</td><td>angle to rotate. </td></tr>
 
   </table>
 
   </table>
  
 
----
 
----
  
      <table class="memname">
+
virtual void Plug_Entity::'''scale''' (QPointF ''center'', QPointF ''factor'') <code>[pure virtual]</code>
        <tr>
+
          <td class="memname">virtual void Plug_Entity::scale </td>
+
          <td>(</td>
+
          <td class="paramtype">QPointF&#160;</td>
+
          <td class="paramname"><em>center</em>, </td>
+
        </tr>
+
        <tr>
+
          <td class="paramkey"></td>
+
          <td></td>
+
          <td class="paramtype">QPointF&#160;</td>
+
          <td class="paramname"><em>factor</em>&#160;</td>
+
        </tr>
+
        <tr>
+
          <td></td>
+
          <td>)</td>
+
          <td></td><td><code> [pure virtual]</code></td>
+
        </tr>
+
      </table>
+
 
+
 
<p>Scale the entity. </p>
 
<p>Scale the entity. </p>
 
'''Parameters:'''
 
'''Parameters:'''
Line 128: Line 65:
 
     <tr><td>''factor''</td><td>scale factor. </td></tr>
 
     <tr><td>''factor''</td><td>scale factor. </td></tr>
 
   </table>
 
   </table>
 +
 +
[[Category:Developers]]

Latest revision as of 19:13, 25 April 2015

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)=0Obtain the entity data.
virtual void move (QPointF offset)=0Move the entity.
virtual void rotate (QPointF center, double angle)=0rotate the entity.
virtual void scale (QPointF center, QPointF factor)=0Scale 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:

datapointer to a QHash<int, QVariant> that store the entity data.

virtual void Plug_Entity::move (QPointF offset) [pure virtual]

Move the entity.

Parameters:

offsetmove the entity by the given QPointF.

virtual void Plug_Entity::rotate (QPointF center, double angle) [pure virtual]

rotate the entity.

Parameters:

centercenter of rotation.
angleangle to rotate.

virtual void Plug_Entity::scale (QPointF center, QPointF factor) [pure virtual]

Scale the entity.

Parameters:

centerbase point for scale.
factorscale factor.