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.
Document Interface class
Document_Interface Class Reference
Interface for comunicate plugins.
Class for comunicate plugins with document (drawing).
#include <document_interface.h>
Public Member Functions | |
virtual | ~Document_Interface() |
virtual void | addPoint (QPointF *start)=0 |
Add point entity to current document. | |
virtual void | addLine (QPointF *start, QPointF *end)=0 |
Add line entity to current document. | |
virtual void | addText(QString txt, QString sty, QPointF *start, double height, double angle, DPI::HAlign ha, DPI::VAlign va)=0 |
Add text entity to current document. | |
virtual void | setLayer(QString name)=0 |
Set the current layer in current document. | |
virtual QString | getCurrentLayer()=0 |
Get the current layer in current document. | |
virtual bool | getPoint(QPointF *point, const QString &mesage="", QPointF *base=0)=0 |
Gets a point. | |
virtual Plug_Entity* | getEnt (const QString &mesage="")=0 |
Select a entity. | |
virtual QList< Plug_Entity* > | getSelect (const QString &mesage="")=0 |
Gets a entities selection. |
Constructor & Destructor Documentation
virtual Document_Interface::~Document_Interface | ( | ) | [inline, virtual] |
Member Function Documentation
virtual void Document_Interface::addLine(QPointF * start, QPointF * end ) [pure virtual]
Add line entity to current document with current attributes.
Parameters:
start | start point coordinate. |
end | end point coordinate. |
virtual void Document_Interface::addPoint(QPointF * start) [pure virtual]
Add point entity to current document.
Add point entity to current document with current attributes.
Parameters:
start | start point coordinate. |
virtual void Document_Interface::addText (QString txt, QString sty, QPointF * start, double height, double angle, DPI::HAlign ha, DPI::VAlign va [pure virtual]
Add text entity to current document.
Add text entity to current document with current attributes
Parameters:
txt | a QString with text content |
sty | a QString with text style name |
start | insertion point coordinate |
height | height of text |
angle | rotation angle of text |
ha | horizontal alignement of text |
va | vertical alignement of text |
virtual QString Document_Interface::getCurrentLayer | ( | ) | [pure virtual] |
Get the current layer in current document.
Get the current layer in current document.
- Returns:
- The name of the current layer.
Implemented in Doc_plugin_interface
<a name="a7308de4c648f7d50f16b80409a96e219"></a>
virtual <a href="Plug_Entity-Class-Reference">Plug_Entity</a>* Document_Interface::getEnt | ( | const QString & | mesage = "" | ) | [pure virtual] |
Select a entity.
Prompt message or a default message to the user asking for a sigle selection. You can delete the <a href="Plug_Entity-Class-Reference" title="Wrapper for acces entities from plugins.">Plug_Entity</a> wen no more needed.
Parameters:
mesage | an optional QString with prompt message. |
Returns:a <a href="Plug_Entity-Class-Reference" title="Wrapper for acces entities from plugins.">Plug_Entity</a> handle the selected entity or NULL.
Implemented in Doc_plugin_interface
<a name="accafc3c2812bbe033a6b8d073ad4e08e"></a>
virtual bool Document_Interface::getPoint | ( | QPointF * | point, | ||
const QString & | mesage = "" , |
||||
QPointF * | base = 0 |
||||
) | [pure virtual] |
point | a pointer to QPointF to store the obtained point. |
mesage | an optional QString with prompt message. |
base | visual helper point, if present. |
false if fail, i.e. user cancel.
Implemented in Doc_plugin_interface
<a name="a98f11873900dcf95f64dad6325d70a9b"></a>
virtual QList<<a href="Plug_Entity-Class-Reference">Plug_Entity</a> *> Document_Interface::getSelect | ( | const QString & | mesage = "" | ) | [pure virtual] |
Gets a entities selection.
Prompt message or an default message to the user asking for a selection. You can delete all, the <a href="Plug_Entity-Class-Reference" title="Wrapper for acces entities from plugins.">Plug_Entity</a> and the returned QList wen no more needed.
Parameters:
mesage | an optional QString with prompt message. |
Returns:a QList of poiters to <a href="Plug_Entity-Class-Reference" title="Wrapper for acces entities from plugins.">Plug_Entity</a> handled the selected entites or an empty QList.
Implemented in Doc_plugin_interface
<a name="a32cb7bf0798d060e3ed06dcfe470303c"></a>
virtual void Document_Interface::setLayer | ( | QString | name | ) | [pure virtual] |
Set the current layer in current document.
Set the current layer in current document, if not exist create it.
Parameters:
name | a QString with the name of the layer. |
Implemented in Doc_plugin_interface