Page 1 of 1

Creare riempimenti personalizzati; programazione in javascri

Posted: Fri Apr 17, 2015 7:13 am
by pietro_72_
Salve

Volevo sapere se è possibile con QCAD realizzare dei riempimenti personalizzati?

Inoltre ho l'hobby per la programazione http://pietro72li.altervista.org, se volessi provare a realizzare qualche estensione per QCAD in javascript quali guide di riferimento potrei consultare?

Re: Creare riempimenti personalizzati; programazione in java

Posted: Fri Apr 17, 2015 7:45 am
by andrew
Per tradurre in italiano, si prega di utilizzare http://translate.google.com, grazie.

You can find the documentation for developers (script / C++) at:
http://www.qcad.org/doc/qcad/latest/dev ... index.html

The best resource are probably the scripts which are included with every QCAD installation in the scripts directory. Note that every tool in QCAD is implemented as script at least on the highest level.

Some simple examples can be found under scripts/Misc/Examples.

Re: Creare riempimenti personalizzati; programazione in java

Posted: Fri Apr 17, 2015 8:32 am
by pietro_72_
Grazie della risposte riguardo la programmazione.

Per quanto riguarda la realizzazione di riempimenti personalizzati intendo la realizzazione di tratteggi personalizzati.

Translation by Google

Thanks for the answer about programming.

With regard to the realization of custom fills mean the realization of custom hatches.

Re: Creare riempimenti personalizzati; programazione in java

Posted: Fri Apr 17, 2015 8:38 am
by andrew
Hatch patterns are defined in standard .pat files located in patterns/metric of your QCAD installation directory.

The .pat file format is well documented:
https://www.google.com/#q=autocad+hatch ... ile+format

Re: Creare riempimenti personalizzati; programazione in java

Posted: Tue Apr 21, 2015 6:35 am
by pietro_72_
Un'altra domanda riguardo l'estensione di qcad in ECMAScript, è possibile gestire gli eventi del mouse down, move, up, tipo ottenere la posizione del puntatore quando si verificano tali eventi?

Translation by Google

Another question regarding the extension of qcad in ECMAScript, you can handle the mouse events down, move, up, type get the location of the pointer when these events occur?

Re: Creare riempimenti personalizzati; programazione in java

Posted: Tue Apr 21, 2015 8:14 am
by andrew
pietro_72_ wrote:Another question regarding the extension of qcad in ECMAScript, you can handle the mouse events down, move, up, type get the location of the pointer when these events occur?
Yes:
MyAction.prototype.mousePressEvent = function(event) {
    if (event.button() === Qt.LeftButton) {
        qDebug("left button clicked at: ", event.getModelPosition());
    }
};

MyAction.prototype.mouseReleaseEvent = function(event) {
};

MyAction.prototype.mouseDoubleClickEvent = function(event) {
};

Re: Creare riempimenti personalizzati; programazione in java

Posted: Wed Apr 22, 2015 1:09 pm
by andrew
Please start new threads for new, unrelated questions. I've split this topic. You can find your latest post at:
viewtopic.php?f=95&t=3450