tulipogl module API

Parametric curves computation

tlpogl.computeBezierPoint(controlPoints, t)

Computes the position of the point at t (0 <= t <= 1) along a Bezier curve defined by a set of control points.

Parameters:
  • controlPoints (list of tlp.Coord) – the control points of the Bezier curve
  • t (float) – the curve parameter
Return type:

tlp.Coord

tlpogl.computeBezierPoints(controlPoints[, nbCurvePoints=100])

Computes a set of points approximating a Bezier curve.

Parameters:
  • controlPoints (list of tlp.Coord) – the control points of the Bezier curve
  • nbCurvePoints (integer) – the number of curve points to compute
Return type:

list of tlp.Coord

tlpogl.computeCatmullRomPoint(controlPoints, t[, closedCurve=False, alpha=0.5])

Computes the position of the point at t (0 <= t <= 1) along a Catmull-Rom curve defined by a set of control points. The features of this type of spline are the following :

  • the spline passes through all of the control points
  • the spline is C1 continuous, meaning that there are no discontinuities in the tangent direction and magnitude
  • the spline is not C2 continuous. The second derivative is linearly interpolated within each segment, causing the curvature to vary linearly over the length of the segment
Parameters:
  • controlPoints (list of tlp.Coord) – the control points of the Catmull Rom curve
  • t (float) – the curve parameter
  • closedCurve (boolean) – if True, the curve will be closed, meaning a Bezier segment will connect the last and first control point
  • alpha (float) – curve parameterization parameter (0 <= alpha <= 1), alpha = 0 -> uniform parameterization, alpha = 0.5 -> centripetal parameterization, alpha = 1.0 -> chord-length parameterization
Return type:

tlp.Coord

tlpogl.computeCatmullRomPoints(controlPoints[, closedCurve=False, nbCurvePoints=100, alpha=0.5])

Computes a set of points approximating a Catmull-Rom curve.

Parameters:
  • controlPoints (list of tlp.Coord) – the control points of the Catmull Rom curve
  • closedCurve (boolean) – if True, the curve will be closed, meaning a Bezier segment will connect the last and first control point
  • nbCurvePoints (integer) – the number of curve points to compute
  • alpha (floatts to compute) – curve parameterization parameter (0 <= alpha <= 1), alpha = 0 -> uniform parameterization, alpha = 0.5 -> centripetal parameterization, alpha = 1.0 -> chord-length parameterization
Return type:

list of tlp.Coord

tlpogl.computeOpenUniformBsplinePoint(controlPoints, t[, curveDegree=3])

Computes the position of the point at t (0 <= t <= 1) along an open uniform B-spline curve defined by a set of control points. An uniform B-spline is a piecewise collection of Bezier curves of the same degree, connected end to end. The features of this type of spline are the following :

  • the spline is C^2 continuous, meaning there is no discontinuities in curvature
  • the spline has local control : its parameters only affect a small part of the entire spline

A B-spline is qualified as open when it passes through its first and last control points.

Parameters:
  • controlPoints (list of tlp.Coord) – the control points of the B-spline curve
  • t (float) – the curve parameter
  • curveDegree (integer) – the B-spline degree
Return type:

tlp.Coord

tlpogl.computeOpenUniformBsplinePoints(controlPoints[, curveDegree=3, nbCurvePoints=100])

Computes a set of points approximating an open uniform B-spline curve.

Parameters:
  • controlPoints (list of tlp.Coord) – the control points of the Catmull Rom curve
  • curveDegree (integer) – the B-spline degree
  • nbCurvePoints (integer) – the number of curve points to compute
Return type:

list of tlp.Coord

tlpogl.GlGraphRenderingParameters

class tlpogl.GlGraphRenderingParameters

New in version 4.4.

That class holds all the rendering parameters for a Tulip OpenGL graph drawing. Use tulipgui.tlpgui.NodeLinkDiagramComponent.getRenderingParameters() to get an instance on a such object.

getDisplayFilteringProperty()

Returns the boolean property used to filter the rendering of graph elements.

Return type:tulip.tlp.BooleanProperty
getEdgesLabelStencil()

Returns the stencil value for edges labels.

Return type:integer
getEdgesStencil()

Returns the stencil value for edges.

Return type:integer
getElementOrderingProperty()

Returns the double property used for the ordered rendering of graph elements.

Return type:tulip.tlp.NumericProperty
getFontsPath()

Returns the absolute path used for fonts loading (.ttf files).

Return type:string
getLabelsAreBillboarded()

Returns the state of the labels billboarding (always facing the camera).

Return type:boolean
getLabelsDensity()

Returns the labels density value.

Return type:integer
getMaxSizeOfLabel()

Returns the maximum size of labels. That value is only used if the labels are not scaled to nodes sizes.

Return type:integer
getMetaNodesLabelStencil()

Returns the stencil value for meta-nodes labels.

Return type:integer
getMetaNodesStencil()

Returns the stencil value for meta-nodes.

Return type:integer
getMinSizeOfLabel()

Returns the minimum size of labels. That value is only used if the labels are not scaled to nodes sizes.

Return type:integer
getNodesLabelStencil()

Returns the stencil value for nodes labels.

Return type:integer
getNodesStencil()

Returns the stencil value for nodes.

Return type:integer
getSelectedEdgesStencil()

Returns the stencil value for selected edges.

Return type:integer
getSelectedMetaNodesStencil()

Returns the stencil value for selected meta-nodes.

Return type:integer
getSelectedNodesStencil()

Returns the stencil value for selected nodes.

Return type:integer
getSelectionColor()

Returns the color of selection.

Return type:tulip.tlp.Color
getTexturePath()

Returns the absolute path used for texture loading.

Return type:string
isAntialiased()

Returns if antialiasing rendering is activated.

Return type:boolean
isDisplayEdges()

Returns the state of the displaying of edges.

Return type:boolean
isDisplayMetaNodes()

Returns the state of the displaying of meta-nodes.

Return type:boolean
isDisplayNodes()

Returns the state of the displaying of nodes.

Return type:boolean
isEdge3D()

Returns the state of the 3d edge rendering.

Return type:boolean
isEdgeColorInterpolate()

Returns the state of the edge color interpolation.

Return type:boolean
isEdgeSizeInterpolate()

Returns the state of the edge size interpolation.

Return type:boolean
isElementOrdered()

Returns the state of the ordered rendering of graph elements.

Return type:boolean
isElementZOrdered()

Returns the state of the z-ordered rendering.

Return type:boolean
isLabelFixedFontSize()
Return type:boolean
isLabelScaled()

Returns the state of the scaling of labels to nodes sizes.

Return type:boolean
isViewArrow()

Returns the state of the displaying of arrows along the graph edges.

Return type:boolean
isViewEdgeLabel()

Returns the state of the displaying of edges labels.

Return type:boolean
isViewMetaLabel()

Returns the state of the displaying of labels inside meta-nodes.

Return type:boolean
isViewNodeLabel()

Returns the state of the displaying of nodes labels.

Return type:boolean
isViewOutScreenLabel()

Returns the state of the displaying of labels for elements outside the screen.

Return type:boolean
setAntialiasing()

Activates/desactivates antialiasing.

Parameters:antialiasing (boolean) – the antialiasing state
setDisplayEdges(displayEdges)

Activates / desactivates the displaying of edges.

Parameters:displayEdges (boolean) – the state of the displaying of edges.
setDisplayFilteringProperty(property)

Sets the boolean property used to filter the rendering of graph elements. If sets to None, the filtering is desactivated. If the value for a node / edge in that property is False, it will not be displayed.

Parameters:property (tulip.tlp.BooleanProperty) – the boolean property used to filter the rendering of graph elements
setDisplayMetaNodes(displayMetaNodes)

Activates / desactivates the displaying of nodes.

Parameters:displayMetaNodes (boolean) – the state of the displaying of meta-nodes.
setDisplayNodes(displayNodes)

Activates / desactivates the displaying of nodes.

Parameters:displayNodes (boolean) – the state of the displaying of nodes.
setEdge3D(edge3d)

Activates / desactivates the 3d displaying of edges instead of 2d lines.

Parameters:edge3d (boolean) – the state of the 3d edge rendering
setEdgeColorInterpolate(interpolate)

Activates / desactivates the interpolation of nodes colors along edges.

Parameters:interpolate (boolean) – the state of the edge color interpolation
setEdgeSizeInterpolate(interpolate)

Activates / desactivates the interpolation of nodes sizes along edges.

Parameters:interpolate (boolean) – the state of the edge size interpolation
setEdgesLabelStencil(stencil)

Sets the stencil value for edges labels. The lower the value is, the more the objects will be drawn on top of other ones. The default value is 255.

Parameters:stencil (integer) – a value in the range [0, 255]
setEdgesStencil(stencil)

Sets the stencil value for edges. The lower the value is, the more the objects will be drawn on top of other ones. The default value is 255.

Parameters:stencil (integer) – a value in the range [0, 255]
setElementOrdered(elementOrdered)

Activates / desactivates the ordered rendering of graph elements according to the values in the “viewMetric” double property.

Parameters:elementsOrdered – the state of the ordered rendering
setElementOrderingProperty(property)

Defines which property should be used for the ordered rendering of graph elements. Setting it to None will use the “viewMetric” property if the ordering is enabled.

Parameters:property (tulip.tlp.NumericProperty) – the property to use to order the rendering of graph elements
setElementZOrdered(zOrdering)

Activates / desactivates the ordered rendering of elements according to their distance to the camera.

Parameters:zOrdering (boolean) – the state of the z-ordered rendering
setFontsPath(path)

Sets the absolute path for fonts loading (.ttf files).

Parameters:path (string) – the absolute path of a directory for fonts loading.
setLabelFixedFontSize(fixedFontSize)
Parameters:fixedFontSize (boolean) – the state of using fixed font size with labels
setLabelScaled(labelScaled)

Activates / desactivates the scaling of labels to nodes sizes.

Parameters:labelScaled (boolean) – the state of the scaling of labels to nodes sizes.
setLabelsAreBillboarded(billboardLabels)

Activates / desactivates labels billboarding (always facing the camera).

Parameters:billboardLabels (boolean) – the state of labels billboarding
setLabelsDensity(density)

Sets the labels density value. It must be in the range [-100, 100]. The labels are displayed according to that value :

  • -100 : no labels are displayed
  • 0 : only non overlapping labels are displayed
  • 100 : all labels are displayed
Parameters:density (integer) – a value in the range [-100, 100]
setMaxSizeOfLabel(size)

Sets the maximum size of labels. That value is only used if the labels are not scaled to nodes sizes.

Parameters:size – the maximum size of labels
Type :integer
setMetaNodesLabelStencil()

Sets the stencil value for meta-nodes labels. The lower the value is, the more the objects will be drawn on top of other ones. The default value is 255.

Parameters:stencil (integer) – a value in the range [0, 255]
setMetaNodesStencil(stencil)

Sets the stencil value for meta-nodes. The lower the value is, the more the objects will be drawn on top of other ones. The default value is 255.

Parameters:stencil (integer) – a value in the range [0, 255]
setMinSizeOfLabel(size)

Sets the minimum size of labels. That value is only used if the labels are not scaled to nodes sizes.

Parameters:size – the minimum size of labels
Type :integer
setNodesLabelStencil(stencil)

Sets the stencil value for nodes labels. The lower the value is, the more the objects will be drawn on top of other ones. The default value is 255.

Parameters:stencil (integer) – a value in the range [0, 255]
setNodesStencil(stencil)

Sets the stencil value for nodes. The lower the value is, the more the objects will be drawn on top of other ones. The default value is 255.

Parameters:stencil (integer) – a value in the range [0, 255]
setSelectedEdgesStencil(stencil)

Sets the stencil value for selected edges. The lower the value is, the more the objects will be drawn on top of other ones. The default value is 2.

Parameters:stencil (integer) – a value in the range [0, 255]
setSelectedMetaNodesStencil(stencil)

Sets the stencil value for selected meta-nodes. The lower the value is, the more the objects will be drawn on top of other ones. The default value is 2.

Parameters:stencil (integer) – a value in the range [0, 255]
setSelectedNodesStencil(stencil)

Sets the stencil value for selected nodes. The lower the value is, the more the objects will be drawn on top of other ones. The default value is 2.

Parameters:stencil (integer) – a value in the range [0, 255]
setSelectionColor(color)

Sets the color of selected elements.

Parameters:color (tulip.tlp.Color) – the selection color
setTexturePath(path)

Sets the absolute path for textures loading.

Parameters:path (string) – the absolute path of a directory for textures loading.
setViewArrow(arrow)

Activates / desactivates the displaying of arrows along the graph edges.

Parameters:arrow (boolean) – the state of the arrows rendering
setViewEdgeLabel(edgeLabel)

Activates / desactivates the displaying of edges labels.

Parameters:edgeLabel (boolean) – the state of the edges labels rendering
setViewMetaLabel(metaLabel)

Activates / desactivates the displaying of labels inside meta-nodes.

Parameters:metaLabel – the state of the displaying of labels inside meta-nodes.
setViewNodeLabel(nodeLabel)

Activates / desactivates the displaying of nodes labels.

Parameters:nodeLabel (boolean) – the state of the nodes labels rendering
setViewOutScreenLabel(outScreenLabel)

Activates / desactivates the displaying of labels for elements outside the screen.

Parameters:outScreenLabel (boolean) – the state of the labels rendering for elements outside the screen.

tlpogl.GlGraphInputData

class tlpogl.GlGraphInputData

New in version 4.4.

That class defines all the visual properties used to render a graph (layout, colors, sizes, ...). By default, Tulip creates a pool of default properties whose name is prefixed by “view”. Through the use of that class, you can set other properties as rendering input data.

Use tulipgui.tlpgui.NodeLinkDiagramComponent.getInputData() to get an instance on a such object.

getElementBorderColor()

Returns the color property that defines the current borders colors of graph elements (see Colors of graph elements and labels).

Return type:tulip.tlp.LayoutProperty
getElementBorderWidth()

Returns the double property that defines the current borders widths of graph elements (see Border width of graph elements and labels).

Return type:tulip.tlp.DoubleProperty
getElementColor()

Returns the color property that defines the current colors of graph elements (see Colors of graph elements and labels).

Return type:tulip.tlp.ColorProperty
getElementFont()

Returns the string property that defines the current font files used to render the labels of graph elements (see Labels of graph elements).

Return type:tulip.tlp.StringProperty
getElementFontSize()

Returns the integer property that defines the current font size for labels of graph elements (see Labels of graph elements).

Return type:tulip.tlp.IntegerProperty
getElementLabel()

Returns the string property that defines the current labels of graph elements (see Labels of graph elements).

Return type:tulip.tlp.StringProperty
getElementLabelBorderColor()

Returns the color property that defines the current labels border colors of graph elements (see Colors of graph elements and labels).

Return type:tulip.tlp.ColorProperty
getElementLabelBorderWidth()

Returns the double property that defines the current labels borders widths of graph elements (see Border width of graph elements and labels).

Return type:tulip.tlp.DoubleProperty
getElementLabelColor()

Returns the color property that defines the current labels colors of graph elements (see Colors of graph elements and labels).

Return type:tulip.tlp.ColorProperty
getElementLabelPosition()

Returns the integer property that defines the current labels positions of graph elements (see Labels of graph elements).

Return type:tulip.tlp.IntegerProperty
getElementLayout()

Returns the layout property that defines the current layout of graph elements (see Graph layout).

Return type:tulip.tlp.LayoutProperty
getElementRotation()

Returns the double property that defines the current rotations of graph nodes (see Rotations of the nodes).

Return type:tulip.tlp.DoubleProperty
getElementSelected()

Returns the boolean property that defines the current selection of graph elements (see Selection).

Return type:tulip.tlp.BooleanProperty
getElementShape()

Returns the integer property that defines the current shapes of graph elements (see Shapes of graph elements).

Return type:tulip.tlp.IntegerProperty
getElementSize()

Returns the size property that defines the current sizes of graph elements (see Sizes of graph elements).

Return type:tulip.tlp.SizeProperty
getElementSrcAnchorShape()

Returns the integer property that defines the current shapes of the source edges extremities (see Shapes of graph elements).

Return type:tulip.tlp.IntegerProperty
getElementSrcAnchorSize()

Returns the size property that defines the current sizes of the source edges extremities (see Sizes of graph elements).

Return type:tulip.tlp.SizeProperty
getElementTexture()

Returns the string property that defines the current image files used to texture the shapes of graph elements (see Applying a texture to nodes or edges).

Return type:tulip.tlp.StringProperty
getElementTgtAnchorShape()

Returns the integer property that defines the current shapes of the target edges extremities (see Shapes of graph elements).

Return type:tulip.tlp.IntegerProperty
getElementTgtAnchorSize()

Returns the size property that defines the current sizes of the target edges extremities (see Sizes of graph elements).

Return type:tulip.tlp.SizeProperty
getGraph()

Returns the graph associated to these data.

Return type:tulip.tlp.Graph
reloadGraphProperties()

Restores all default graph visual properties (whose name is prefixed by “view”) as rendering input data.

setElementBorderColor(property)

Sets the color property that defines the current borders colors of graph elements (see Colors of graph elements and labels).

Parameters:property (tulip.tlp.ColorProperty) – a color property attached to the graph associated to these data.
setElementBorderWidth(property)

Sets the double property that defines the current borders widths of graph elements (see Border width of graph elements and labels).

Parameters:property (tulip.tlp.DoubleProperty) – a double property attached to the graph associated to these data.
setElementColor(property)

Sets the color property that defines the current colors of graph elements (see Colors of graph elements and labels).

Parameters:property (tulip.tlp.ColorProperty) – a color property attached to the graph associated to these data.
setElementFont(property)

Sets the string property that defines the current font files used to render the labels of graph elements (see Labels of graph elements).

Parameters:property (tulip.tlp.StringProperty) – a string property attached to the graph associated to these data.
setElementFontSize(property)

Sets the integer property that defines the current font size for labels of graph elements (see Labels of graph elements).

Parameters:property (tulip.tlp.IntegerProperty) – an integer property attached to the graph associated to these data.
setElementLabel(property)

Sets the string property that defines the current labels of graph elements (see Labels of graph elements).

Parameters:property (tulip.tlp.StringProperty) – a string property attached to the graph associated to these data.
setElementLabelBorderColor()

Sets the color property that defines the current labels borders colors of graph elements (see Colors of graph elements and labels).

Parameters:property (tulip.tlp.ColorProperty) – a color property attached to the graph associated to these data.
setElementLabelBorderWidth(property)

Sets the double property that defines the current labels borders widths of graph elements (see Border width of graph elements and labels).

Parameters:property (tulip.tlp.DoubleProperty) – a double property attached to the graph associated to these data.
setElementLabelColor(property)

Sets the color property that defines the current labels colors of graph elements (see Colors of graph elements and labels).

Parameters:property (tulip.tlp.ColorProperty) – a color property attached to the graph associated to these data.
setElementLabelPosition(property)

Sets the integer property that defines the current labels positions of graph elements (see Labels of graph elements).

Parameters:property (tulip.tlp.IntegerProperty) – an integer property attached to the graph associated to these data.
setElementLayout(property)

Sets the layout property that defines the current layout of graph elements (see Graph layout).

Parameters:property (tulip.tlp.LayoutProperty) – a layout property attached to the graph associated to these data.
setElementRotation(property)

Sets the double property that defines the current rotations graph nodes (see Rotations of the nodes).

Parameters:property (tulip.tlp.DoubleProperty) – a double property attached to the graph associated to these data.
setElementSelected(property)

Sets the boolean property that defines the current selection of graph elements (see Selection).

Parameters:property (tulip.tlp.BooleanProperty) – a boolean property attached to the graph associated to these data.
setElementShape(property)

Sets the integer property that defines the current shapes of graph elements (see Shapes of graph elements).

Parameters:property (tulip.tlp.IntegerProperty) – an integer property attached to the graph associated to these data.
setElementSize(property)

Sets the size property that defines the current sizes of graph elements (see Sizes of graph elements).

Parameters:property (tulip.tlp.SizeProperty) – a size property attached to the graph associated to these data.
setElementSrcAnchorShape(property)

Sets the integer property that defines the current shapes of the source edges extremities (see Shapes of graph elements).

Parameters:property (tulip.tlp.IntegerProperty) – an integer property attached to the graph associated to these data.
setElementSrcAnchorSize(property)

Sets the size property that defines the current sizes of the source edges extremities (see Shapes of graph elements).

Parameters:property (tulip.tlp.SizeProperty) – a size property attached to the graph associated to these data.
setElementTexture(property)

Sets the string property that defines the current image files used to texture the shapes of graph elements (see Applying a texture to nodes or edges).

Parameters:property (tulip.tlp.StringProperty) – a string property attached to the graph associated to these data.
setElementTgtAnchorShape(property)

Sets the integer property that defines the current shapes of the target edges extremities (see Shapes of graph elements).

Parameters:property (tulip.tlp.IntegerProperty) – an integer property attached to the graph associated to these data.
setElementTgtAnchorSize(property)

Sets the size property that defines the current sizes of the target edges extremities (see Shapes of graph elements).

Parameters:property (tulip.tlp.SizeProperty) – a size property attached to the graph associated to these data.