PyANGKernel.GKViewModeStyle

class GKViewModeStyle

Inheritance diagram of PyANGKernel.GKViewModeStyle

Synopsis

Methods

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

Detailed Description

A visualization attribute style based in the value of an object attribute. It has several entries, each entry contains a range of values. In function of the object attribute value one of the entries is chosen. Note that a GKViewModeStyle modifies only one visualization attribute.

The internal name of the centroid configuration folder is “GKModel::viewStyles” The external name is “View Styles”

class GKViewModeStyleType

This enum defines the various visualization attributes that can be modified.

Warning

keep GKViewModeStyleTypeSize consistent with it.

class GKViewModeStyleVariableType

This enum defines if the visualization attribute will be modified discretely (one value per range) or continuously (interpolated values).

class GKViewModeStyleColorType

This enum defines the way the brush and the pen are affected: - ePen: only the pen is visible and modified, no special brush is drawn. - eBrush: only the brush is visible and modified, no special pen is drawn. - eBoth: like eBrush, but with a black solid pen.

__init__()
addRange(range)
Parameters:

rangeGKViewModeStyleRange

Adds a new range

addRange(value[, asDefault=false])
Parameters:
  • value – str

  • asDefault – bool

Return type:

GKViewModeStyleRange

adds a regexp string value DISCRETE

addRange(value[, asDefault=false])
Parameters:
  • value – float

  • asDefault – bool

Return type:

GKViewModeStyleRange

adds a range value DISCRETE

addRange(value, numberValue[, asDefault=false])
Parameters:
  • value – str

  • numberValue – float

  • asDefault – bool

Return type:

GKViewModeStyleRange

adds a regexp string value DISCRETE initializing the from and to fields too

addRange(from, to[, asDefault=false])
Parameters:
  • from – float

  • to – float

  • asDefault – bool

Return type:

GKViewModeStyleRange

adds a range entry as: [from, to) CONTINUOUS

appliesTo(type)
Parameters:

typeGKType

Return type:

bool

appliesToSubtypes()
Return type:

bool

Gets if GKType inheriting from type owner are included

applyToSubtypes(apply)
Parameters:

apply – bool

Sets if GKType inheriting from type owner are included

doRotate()
Return type:

bool

Returns true if the view mode style rotates the painting according to the object’s angle.

See also

setDoRotate()

getColorType()
Return type:

GKViewModeStyleColorType

Returns the color type

getColumn()
Return type:

GKColumn

Returns the column

getCondition()
Return type:

GKMultiCondition

Returns the condition

getDefaultRange()
Return type:

GKViewModeStyleRange

returns the default range

getDividerColumn()
Return type:

GKColumn

UnknownCommandGKViewModeStyle::setNormalizerColumn

getFromScale()
Return type:

int

return the from scale value

getInternalName()
Return type:

str

internal name of this style… there are functions that require some styles and they use this attribute to find the style (since the name is user editable and the ID depends of the moment of creation). It’s a good idea to set a unique value for this field (among all the other styles).

getLabelDecimalPlaces()
Return type:

int

When drawing numeric labels, the precision.

getLabelRoundingToZeroPlaces()
Return type:

int

getMaxNormalizer()
Return type:

float

Gets the max normalizer.

getRange(value)
Parameters:

value – str

Return type:

GKViewModeStyleRange

returns the range for this value

getRange(from[, to=0.0])
Parameters:
  • from – float

  • to – float

Return type:

GKViewModeStyleRange

returns the range for a value (from and to equal to the range values). For discrete variables the “to” parameter is not use.

getRange(obj, modelConn, context)
Parameters:
Return type:

GKViewModeStyleRange

returns the range for this value

getRangeByIndex(pos)
Parameters:

pos – int

Return type:

GKViewModeStyleRange

returns the range at pos (fron 0 to getRanges() .size()-1)

getRanges()
Return type:

.list of GKViewModeStyleRange

returns all ranges

getRangesForStackedBandsColumns(obj, modelConn, context)
Parameters:
Return type:

Dictionary with keys of type .int and values of type GKViewModeStyleRange.

returns the range for the value of each of the Diagram Columns (if any)

getScaleByLane()
Return type:

bool

getStyleType()
Return type:

GKViewModeStyleType

Returns the style type

getToScale()
Return type:

int

return the to scale value

getTypeOwner()
Return type:

GKType

Returns the type

getUnits()
Return type:

SizeUnits

Return the units

getVariableType()
Return type:

GKViewModeStyleVariableType

Returns the variable type

isScaleDependand()
Return type:

bool

returns whether the view mode style visibility depends of scale or not

matchCondition(obj, modelConn[, context=GKContext.anyContext])
Parameters:
Return type:

bool

Returns true if the object fits the condition

removeAllRanges()

removes all ranges

removeRange(range)
Parameters:

rangeGKViewModeStyleRange

Removes the specified range. *

Warning

The specified range MUST be contained in the GKViewModeStyle .

setColorType(aType)
Parameters:

aTypeGKViewModeStyleColorType

Sets the color type

setColumn(atypeOwner, acol)
Parameters:

Sets the column of a specified type

setCondition(cond)
Parameters:

condGKMultiCondition

Sets a condition to filter objects

setDefaultRange(range)
Parameters:

rangeGKViewModeStyleRange

sets the default range

setDividerColumn(acol)
Parameters:

acolGKColumn

Set a column that will normalize the values of the style column (dividing by). If setUseNormalizing (True) is set then we will normalize the value by the maximum value in all the objects. If setUseNormalizing (False) we will take the object value.

setDoRotate(rotate)
Parameters:

rotate – bool

See doRotate .

See also

doRotate()

setDrawScale(afrom, ato)
Parameters:
  • afrom – int

  • ato – int

Sets the drawing scale

setInternalName(iname)
Parameters:

iname – str

internal name of this style… there are functions that require some styles and they use this attribute to find the style (since the name is user editable and the ID depends of the moment of creation). It’s a good idea to set a unique value for this field (among all the other styles).

setLabelDecimalPlaces(value)
Parameters:

value – int

When drawing numeric labels, the precision.

setLabelRoundingToZeroPlaces(value)
Parameters:

value – int

setMaxNormalizer(value)
Parameters:

value – float

Sets the max normalizer.

setScaleByLane(scale)
Parameters:

scale – bool

setScaleDependand(value)
Parameters:

value – bool

sets whether the view mode style visibility depends of scale or not

setShowLabelAsPercentage(enabled)
Parameters:

enabled – bool

Sets the label to be shown as percentage

setStyleType(aType)
Parameters:

aTypeGKViewModeStyleType

Sets the style type

setUnits(newUnits)
Parameters:

newUnitsSizeUnits

Sets the units

setUseNormalizing(normalize)
Parameters:

normalize – bool

UnknownCommandGKViewModeStyle::setNormalizerColumn

setVariableType(aType)
Parameters:

aTypeGKViewModeStyleVariableType

Sets the variable type

showLabelAsPercentage()
Return type:

bool

Gets whether the label is set to be shown as percentage

sortRanges()

Sort ranges by from value

useMaxNormalizing()
Return type:

bool

UnknownCommandGKViewModeStyle::setNormalizerColumn

usesColumn(acol)
Parameters:

acolGKColumn

Return type:

bool

Returns true if the column is used in this style (or any of its ranges).

usesType(type)
Parameters:

typeGKType

Return type:

bool

visibleAtThisScale(scale)
Parameters:

scale – int

Return type:

bool

returns if the style is visible at a specified scale value