Scripting Interface |
The element JavaScript global object. Add, remove, modify or get information about element nodes in the scene. More...
Public Slots | |
Elements Data | |
int | numberOf () |
Returns the number of elements in the scene. More... | |
int | id (int elementIndex) |
Returns the id (key) of the element. More... | |
String | getNameById (int id) |
Returns the current element name. More... | |
String | scanType (int id) |
Returns a string that is the scan type of the element. The scan type is either: COLOR, GRAY_SCALE or BW. More... | |
double | fieldChart (int id) |
This function returns the field chart size for a given element. The element ID must be provided. The field chart is a number such as 12,16 or 24 field. More... | |
int | vectorType (int id) |
This function returns the vector type for the given element. In theory, there is support for multiple types of vector drawing. In practice, only TVG has been implemented. The value 0 : indicates that the element is NOT a vector drawing. It is an IMAGE type. The value 2: indicates that the element is a TVG vector drawing. More... | |
String | pixmapFormat (int id) |
Returns the pixmap format for the provided element ID. More... | |
String | folder (int id) |
Returns the actual element folder. This is normally the element name (unless it has been renamed and the project is not saved) but may include the ".<element id>" in the name if multiple elements share the same name. More... | |
String | completeFolder (int id) |
Returns the complete element folder. This is normally the element name (unless it has been renamed and the project is not saved) but may include the ".<element id>" in the name if multiple elements share the same name. More... | |
String | physicalName (int id) |
Returns the actual name of the drawings. This is different that the element name if this one has been renamed and the changes have not yet been saved. More... | |
Element Edition | |
bool | modify (int id, String scanType, double fieldChart, String pixmapFormat, int vectorType) |
Changes the attributes of the folder of element elem. More... | |
int | add (String name, String scanType, double fieldChart, String fileFormat, String vectorize) |
Creates a new element. Returns the element id of the newly added element if successful, otherwise it returns -1. More... | |
bool | remove (int id, bool deleteDiskFile) |
Removes the given element. Also optionally delete the disk files. This function returns true when successful. More... | |
bool | renameById (int id, String name) |
Renames an existing element. The element ID must be provided. More... | |
The element JavaScript global object. Add, remove, modify or get information about element nodes in the scene.
With the Element methods, add, remove or retrieve information about the elements in your scene. Each element has an index (0..nbElements-1), an integer id (key of the element in the database), which is unique. They have a name (which is not guaranteed to be unique).
|
slot |
Creates a new element. Returns the element id of the newly added element if successful, otherwise it returns -1.
name | : The name of the element. |
scanType | : "Colour", "Gray_Scale", "BW" (for black and white) or "None". |
fieldChart | : 12, 16 or 24. |
fileFormat | : "SCAN", "OPT", "PAL", "SGI", "TGA", "YUV", "OMF" or "PSD". |
vectorize | : "TVG" or "None". |
|
slot |
Returns the complete element folder. This is normally the element name (unless it has been renamed and the project is not saved) but may include the ".<element id>" in the name if multiple elements share the same name.
id | : The unique id of the elements. |
|
slot |
This function returns the field chart size for a given element. The element ID must be provided. The field chart is a number such as 12,16 or 24 field.
id | : The unique id of the element. |
|
slot |
Returns the actual element folder. This is normally the element name (unless it has been renamed and the project is not saved) but may include the ".<element id>" in the name if multiple elements share the same name.
id | : The unique id of the element. |
|
slot |
Returns the current element name.
id | : The unique id of the element. |
|
slot |
Returns the id (key) of the element.
elementIndex | : An integer from 0 to the value returned by the function element.numberOf, representing the index number of the element. The id and the index are not always the same value. |
|
slot |
Changes the attributes of the folder of element elem.
id | : The unique id of the element. |
scanType | : "Colour", "Gray_Scale", "BW" (for black and white) or "None". |
fieldChart | : 12, 16 or 24. |
pixmapFormat | : 1 for OPT, 3 for SCAN, 4 for SGI, 5 for TGA, 7 for YUV, 9 for OMF or 10 for PSD, 11 for PNG, 12 for JPEG, 13 for BMP, 15 for TIFF. |
vectorType | : 1 or 2. |
|
slot |
Returns the number of elements in the scene.
|
slot |
Returns the actual name of the drawings. This is different that the element name if this one has been renamed and the changes have not yet been saved.
id | : The unique id of the element. |
|
slot |
Returns the pixmap format for the provided element ID.
id | : The unique id of the element. |
|
slot |
Removes the given element. Also optionally delete the disk files. This function returns true when successful.
id | : The unique id of the element. |
deleteDiskFile | : Optionally, delete the element from the disk. |
|
slot |
Renames an existing element. The element ID must be provided.
id | : The unique id of the element. |
name | : The new name of the element. This name must be unique. This operation will physically rename all the files associated to this element. |
|
slot |
Returns a string that is the scan type of the element. The scan type is either: COLOR, GRAY_SCALE or BW.
id | : The unique id of the element. |
|
slot |
This function returns the vector type for the given element. In theory, there is support for multiple types of vector drawing. In practice, only TVG has been implemented. The value 0 : indicates that the element is NOT a vector drawing. It is an IMAGE type. The value 2: indicates that the element is a TVG vector drawing.
id | : The unique id of the element. |