Script
List of all members
element Class Reference

With the Element functions, you can retrieve information about the elements in your scene and you can add and remove them. Each element has an index (0..nbElements), an integer id (key of the element in the database), which is unique and a name ( which is not guaranteed to be unique ). More...

#include <elementinterface.h>

Inheritance diagram for element:
Inheritance graph
[legend]
Collaboration diagram for element:
Collaboration graph
[legend]

Public Slots

Elements Data
int numberOf () const
 returns the number of elements in the scene
 
int id (int elementIndex)
 returns the id (key) of the element
 
QString getNameById (int id)
 return the current element name.
 
QString scanType (int id) const
 returns a string that is the scan type of the element. The scan type is either: COLOR, GRAY_SCALE or BW
 
double fieldChart (int id) const
 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.
 
int vectorType (int id) const
 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.
 
QString pixmapFormat (int id) const
 returns the pixmap format for the provided element ID
 
QString folder (int id) const
 return 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.
 
QString completeFolder (int id) const
 return 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.
 
QString physicalName (int id) const
 return 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.
 
Element Edition
bool modify (int id, QString scanType, double fieldChart, QString pixmapFormat, int vectorType)
 changes the attributes of the folder of element elem
 
int add (QString name, QString scanType, double fieldChart, QString fileFormat, QString vectorize)
 create a new element. returns the element id of the newly added element if successful, otherwise it returns -1
 
bool remove (int id, bool deleteDiskFile)
 remove given element. Also optionally delete the disk files. This function returns true when successful.
 
bool renameById (int id, QString name)
 rename an existing element. The element ID must be provided
 

Detailed Description

With the Element functions, you can retrieve information about the elements in your scene and you can add and remove them. Each element has an index (0..nbElements), an integer id (key of the element in the database), which is unique and a name ( which is not guaranteed to be unique ).

function addElement
{
var id = element.add("newDrawing", "BW", 12, "TVG", "SCAN");
}

Member Function Documentation

int element::add ( QString  name,
QString  scanType,
double  fieldChart,
QString  fileFormat,
QString  vectorize 
)
slot

create a new element. returns the element id of the newly added element if successful, otherwise it returns -1

Parameters
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".
QString element::completeFolder ( int  id) const
slot

return 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.

Parameters
id,:the unique id of the element
double element::fieldChart ( int  id) const
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.

Parameters
id,:the unique id of the element
QString element::folder ( int  id) const
slot

return 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.

Parameters
id,:the unique id of the element
QString element::getNameById ( int  id)
slot

return the current element name.

Parameters
id,:the unique id of the element
int element::id ( int  elementIndex)
slot

returns the id (key) of the element

Parameters
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
bool element::modify ( int  id,
QString  scanType,
double  fieldChart,
QString  pixmapFormat,
int  vectorType 
)
slot

changes the attributes of the folder of element elem

Parameters
id,:the unique id 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".
int element::numberOf ( ) const
slot

returns the number of elements in the scene

QString element::physicalName ( int  id) const
slot

return 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.

Parameters
id,:the unique id of the element
QString element::pixmapFormat ( int  id) const
slot

returns the pixmap format for the provided element ID

Parameters
id,:the unique id of the element
bool element::remove ( int  id,
bool  deleteDiskFile 
)
slot

remove given element. Also optionally delete the disk files. This function returns true when successful.

Parameters
id,:the unique id of the element
deleteDiskFile,:Optionally, delete the element from the disk.
bool element::renameById ( int  id,
QString  name 
)
slot

rename an existing element. The element ID must be provided

Parameters
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.
QString element::scanType ( int  id) const
slot

returns a string that is the scan type of the element. The scan type is either: COLOR, GRAY_SCALE or BW

Parameters
id,:the unique id of the element
int element::vectorType ( int  id) const
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.

Parameters
id,:the unique id of the element

The documentation for this class was generated from the following file: