PenstyleManager Class Reference

The PenstyleManager JavaScript global object. Query/modify the current penstyle and list of penstyles. More...

Public Slots

String currentToolName ()
 Returns the name of the currently active tool. More...
 
int getNumberOfPenstyles ()
 Returns the number of penstyles. More...
 
String getPenstyleName (int index)
 Returns the name of the penstyle at the given index for the current tool. More...
 
int getCurrentPenstyleIndex ()
 Returns the index of the current penstyle for the active tool. More...
 
String getCurrentPenstyleName ()
 Returns the name of the current penstyle for the active tool. More...
 
void setCurrentPenstyleByName (String name)
 Sets the current penstyle for the active tool. More...
 
void setCurrentPenstyleByIndex (int index)
 Sets the current penstyle for the active tool. More...
 
void changeCurrentPenstyleMinimumSize (double minimum)
 Sets the current penstyle minimum size. More...
 
void changeCurrentPenstyleMaximumSize (double maximum)
 Sets the current penstyle maximum size. More...
 
void changeCurrentPenstyleOutlineSmoothness (double smooth)
 Sets the current penstyle outline smoothness. More...
 
void changeCurrentPenstyleCenterlineSmoothness (double smooth)
 Sets the current penstyle centreline smoothness. More...
 
double getCurrentPenstyleMinimumSize ()
 Gets the current penstyle minimum size. More...
 
double getCurrentPenstyleMaximumSize ()
 Gets the current penstyle maximum size. More...
 
double getCurrentPenstyleOutlineSmoothness ()
 Gets the current penstyle outline smoothness. More...
 
double getCurrentPenstyleCenterlineSmoothness ()
 Gets the current penstyle centerline smoothness. More...
 
bool getCurrentPenstyleEraserFlag ()
 Gets the current penstyle eraser flag. More...
 
String exportPenstyleToString (int index)
 Create a string representing the penstyle which can be used to store the penstyle and import it later. More...
 
String exportPenstyleListToString ()
 Formats the penstyle list into a string, which can be used to store the penstyle list and import it later. More...
 
void importPenstyleListFromString (String str)
 Imports a penstyle list from a previously formatted penstyle string. More...
 
void savePenstyles ()
 Saves the penstyles. More...
 

Detailed Description

The PenstyleManager JavaScript global object. Query/modify the current penstyle and list of penstyles.

The list of penstyles differs by active tool. Query the currentToolId to know which list is active.

function queryPenstyles()
{
// work on the brush pen styles by activating the tool
Action.perform("onActionChooseBrushTool()", "sceneUI");
for ( var i =0 ; i < num ; ++i )
{
MessageLog.trace( "penstyle name is " + PenstyleManager.getPenstyleName(i) );
}
MessageLog.trace("The current penstyle has min size of " + PenstyleManager.getCurrentPenstyleMinimumSize() +
" and maximum size of " + PenstyleManager.getCurrentPenstyleMaximumSize());
}

Member Function Documentation

◆ changeCurrentPenstyleCenterlineSmoothness

void PenstyleManager::changeCurrentPenstyleCenterlineSmoothness ( double  smooth)
slot

Sets the current penstyle centreline smoothness.

Parameters
smooth: New centreline smoothness value.

◆ changeCurrentPenstyleMaximumSize

void PenstyleManager::changeCurrentPenstyleMaximumSize ( double  maximum)
slot

Sets the current penstyle maximum size.

Parameters
maximum: New maximum size.

◆ changeCurrentPenstyleMinimumSize

void PenstyleManager::changeCurrentPenstyleMinimumSize ( double  minimum)
slot

Sets the current penstyle minimum size.

Parameters
minimum: New minimum size.

◆ changeCurrentPenstyleOutlineSmoothness

void PenstyleManager::changeCurrentPenstyleOutlineSmoothness ( double  smooth)
slot

Sets the current penstyle outline smoothness.

Parameters
smooth: New outline smoothness value.

◆ currentToolName

String PenstyleManager::currentToolName ( )
slot

Returns the name of the currently active tool.

Pen styles are separated by tools. Use this value to know which set of pen styles are currently active.

Returns
The name of the current active tool

◆ exportPenstyleListToString

String PenstyleManager::exportPenstyleListToString ( )
slot

Formats the penstyle list into a string, which can be used to store the penstyle list and import it later.

Returns
Returns a string representing the penstyle list.

◆ exportPenstyleToString

String PenstyleManager::exportPenstyleToString ( int  index)
slot

Create a string representing the penstyle which can be used to store the penstyle and import it later.

Parameters
index: Index of the penstyle.
Returns
Returns a string representing the penstyle.

◆ getCurrentPenstyleCenterlineSmoothness

double PenstyleManager::getCurrentPenstyleCenterlineSmoothness ( )
slot

Gets the current penstyle centerline smoothness.

Returns
Returns the current penstyle centerline smoothness.

◆ getCurrentPenstyleEraserFlag

bool PenstyleManager::getCurrentPenstyleEraserFlag ( )
slot

Gets the current penstyle eraser flag.

Returns
Returns true if the current penstyle eraser flag is set.

◆ getCurrentPenstyleIndex

int PenstyleManager::getCurrentPenstyleIndex ( )
slot

Returns the index of the current penstyle for the active tool.

Returns
Returns the index of the current penstyle.

◆ getCurrentPenstyleMaximumSize

double PenstyleManager::getCurrentPenstyleMaximumSize ( )
slot

Gets the current penstyle maximum size.

Returns
Returns the current penstyle maximum size.

◆ getCurrentPenstyleMinimumSize

double PenstyleManager::getCurrentPenstyleMinimumSize ( )
slot

Gets the current penstyle minimum size.

Returns
Returns the current penstyle minimum size.

◆ getCurrentPenstyleName

String PenstyleManager::getCurrentPenstyleName ( )
slot

Returns the name of the current penstyle for the active tool.

Returns
Returns the name of the current penstyle.

◆ getCurrentPenstyleOutlineSmoothness

double PenstyleManager::getCurrentPenstyleOutlineSmoothness ( )
slot

Gets the current penstyle outline smoothness.

Returns
Returns the current penstyle outline smoothness.

◆ getNumberOfPenstyles

int PenstyleManager::getNumberOfPenstyles ( )
slot

Returns the number of penstyles.

Returns
Returns the number of penstyles for the current tool.

◆ getPenstyleName

String PenstyleManager::getPenstyleName ( int  index)
slot

Returns the name of the penstyle at the given index for the current tool.

Parameters
index: Index of the penstyle.
Returns
Returns the name of the penstyle.

◆ importPenstyleListFromString

void PenstyleManager::importPenstyleListFromString ( String  str)
slot

Imports a penstyle list from a previously formatted penstyle string.

Parameters
str: A formatted penstyle or penstyle list, which can be created from exportPenstyleToString or exportPenstylesListToString.

◆ savePenstyles

void PenstyleManager::savePenstyles ( )
slot

Saves the penstyles.

◆ setCurrentPenstyleByIndex

void PenstyleManager::setCurrentPenstyleByIndex ( int  index)
slot

Sets the current penstyle for the active tool.

Parameters
index: Index of penstyle to be set as current penstyle.

◆ setCurrentPenstyleByName

void PenstyleManager::setCurrentPenstyleByName ( String  name)
slot

Sets the current penstyle for the active tool.

Parameters
name: Name of the penstyle to be set as current penstyle.