LookupTable¶
Inheritance diagram¶
Classes¶
LookupTable¶
-
class
ORSModel.ors.LookupTable¶ Bases:
ORSModel.ors.Nodebrief_description: A Lookup Table that can adopt predefined and/or custom looks. author: Eric Fournier. All other members of ORS participated. version: 1.0 date: August 2005 see: VisualMesh::setLookupTable(), Vector3::setLookupTable()
A Lookup Table that can adopt predefined and/or custom looks.It contains the ambiant, power, diffuse, emissive and specular properties.
-
appendColor(self, IColor: ORSModel.ors.Color) → None¶ Add a color at the end of the table.
Parameters: IColor (ORSModel.ors.Color) –
-
build(self) → None¶ Builds the LUT according to its settings.
-
buildDiscreteLUT(self) → None¶ Build Discrete lut color and alpha control point arrays from color table.
Note
User-defined LUTs use color and alpha control points.
-
copyColorSettingsFrom(self, ILookupTable: ORSModel.ors.LookupTable) → None¶ Copy color settings from the given lookup table.
Note
Copies only the color settings, leaving the object attributes unchanged.
Parameters: ILookupTable (ORSModel.ors.LookupTable) –
-
copyFrom(self, ILookupTable: ORSModel.ors.LookupTable) → None¶ Copy internal parameters from the given lookup table.
Note
Copies everything (color settings and object attributes).
Parameters: ILookupTable (ORSModel.ors.LookupTable) –
-
fillColorFromMultiROI(self, aMultiROI: ORSModel.ors.MultiROI) → None¶ Fill a LUT fromMultiROI label Color.
Parameters: aMultiROI (ORSModel.ors.MultiROI) – a MultiROI (a MultiROI)
-
fillRGBAColorArray(self, startIndex: int, endIndex: int, colorsArray: int, subtractFactors: int) → None¶ Dump the lut in arrays.
Parameters: - startIndex (int) – startIndex
- endIndex (int) – endIndex
- colorsArray (bytes) – colorsArray an unsigned char* array of size 4*getTableSize()
- subtractFactors (bytes) – subtractFactors an unsigned char* array of size getTableSize()
-
findAlphaControlPointIndexForPosition(self, pX: float) → int¶ Searches for an alpha control point according to its position.
Note
The returned value is the index of the first alpha control point having a higher position than the provided position, or the index of the last alpha control point plus 1 if the provided position is greater than or equal to the position of the last alpha control point.
Note
The returned value may be used to determine the insertion index of a new control point at a given position.
Parameters: pX (float) – the X coordinate of the alpha control point (a double) Returns: output (int) – the index alpha control point (a uint32_t).
-
findColorControlPointIndexForPosition(self, pX: float) → int¶ Searches for a color control point according to its position.
Note
The returned value is the index of the first color control point having a higher position than the provided position, or the index of the last color control point plus 1 if the provided position is greater than or equal to the position of the last color control point.
Note
The returned value may be used to determine the insertion index of a new control point at a given position.
Parameters: pX (float) – the X coordinate of the color control point (a double) Returns: output (int) – the index color control point (a uint32_t).
-
getAlphaControlPointAlphaValueHigh(self, index: int) → float¶ Retrieves the alpha value (higher portion) of an alpha control point. This alpha value is used only when the alpha control point is split.
Parameters: index (int) – the alpha control point index (a uint32_t) Returns: output (float) – the alpha value (a double)
-
getAlphaControlPointAlphaValueLow(self, index: int) → float¶ Retrieves the alpha value (lower portion) of an alpha control point. This is the alpha value used also in the higher portion when the alpha control point is not split.
Parameters: index (int) – the alpha control point index (a uint32_t) Returns: output (float) – the alpha value (a double)
-
getAlphaControlPointCount(self) → int¶ Retrieves the total number of alpha control points in the LUT.
Returns: output (int) – the number of alpha control points (a uint32_t)
-
getAlphaControlPointIsSplit(self, index: int) → bool¶ Retrieves if the alpha control point is split.
Parameters: index (int) – the alpha control point index (a uint32_t) Returns: output (bool) – the split value (a bool)
-
getAlphaControlPointPositionX(self, index: int) → float¶ Retrieves the X coordinate of an alpha control point.
Parameters: index (int) – the alpha control point index (a uint32_t) Returns: output (float) – the X coordinate of the alpha control point (a double)
-
getClassNameStatic() → str¶ getClassNameStatic
Returns: output (str) –
-
getColorAtIndex(self, inValue: int) → Color¶ Get color at a given index.
Parameters: inValue (int) – the color index (in range [0, getTableSize()-1] ) (a uint32_t) Returns: output (ORSModel.ors.Color) –
-
getColorAtPosition(self, position: float) → Color¶ Gets the color at a given position.
Note
This method returns a color at a position normalized between 0 and 1. If the position does not exactly match an existing color control point, the returned color will be an interpolation of the two closest colors.
Parameters: position (float) – the position (a double, see note) Returns: output (ORSModel.ors.Color) – the color (a Color)
-
getColorControlPointColorHigh(self, index: int) → Color¶ Retrieves the color (higher portion) of a color control point. This color is used only when the color control point is split.
Parameters: index (int) – the color control point index (a uint32_t) Returns: output (ORSModel.ors.Color) – the color (an Color)
-
getColorControlPointColorLow(self, index: int) → Color¶ Retrieves the color (lower portion) of a color control point. This is the color used also in the higher portion when the color control point is not split.
Parameters: index (int) – the color control point index (a uint32_t) Returns: output (ORSModel.ors.Color) – the color (an Color)
-
getColorControlPointCount(self) → int¶ Retrieves the total number of color control points in the LUT.
Returns: output (int) – the number of color control points (a uint32_t)
-
getColorControlPointIsSplit(self, index: int) → bool¶ Retrieves if the color control point is split.
Parameters: index (int) – the color control point index (a uint32_t) Returns: output (bool) – the split value (a bool)
-
getColorControlPointPositionX(self, index: int) → float¶ Retrieves the X coordinate of a color control point.
Parameters: index (int) – the color control point index (a uint32_t) Returns: output (float) – the X coordinate of the color control point (a double)
-
getColorFromPosition(self, position: float, aColor: ORSModel.ors.Color) → None¶ Gets the color at a given position.
Note
This method returns the color at a position normalized between 0 and 1. If the position does not exactly match an existing color control point, the returned color will be an interpolation of the two closest colors.
Parameters: - position (float) – the position (a double, see note)
- aColor (ORSModel.ors.Color) – a Color object
-
getIsDiscrete(self) → bool¶ Gets if the lookup table is discrete.
Returns: output (bool) –
-
getQtLinearGradientFromORSLut(rangeInPixelMin, rangeInPixelMax, isXGradient=True, useAlphaValue=True)¶ Creates and return a QtGui.QLinearGradient object from the current lookupTable
Parameters: - rangeInPixelMin (float) – starting value (pixel value) of the interpolation area
- rangeInPixelMax (float) – final value (pixel value) of the interpolation area
- isXGradient (bool) – if True, the linear the gradient will be along x direction, False for y. X gradient by default
- useAlphaValue (bool) – if True, alpha value will be considered, false to not playing with the opacity.
-
getRampUsesControlPoints(self) → bool¶ Gets if the LUT is using control points to build his ramp.
Returns: output (bool) – true if the LUTs uses color and alpha control points, false otherwise (a bool)
-
getTableSize(self) → int¶ Get the table size.
Returns: output (int) – the table size (a uint32_t)
-
insertAlphaControlPointAt(self, index: int, x: float, alphaValueL: float, alphaValueH: float, bIsSplit: bool) → None¶ Inserts an alpha control point.
Parameters: - index (int) – the alpha control point index (a uint32_t)
- x (float) – the X coordinate of the alpha control point (a double)
- alphaValueL (float) – the alpha value of the lower portion (a double)
- alphaValueH (float) – the alpha value of the higher portion (a double). This alpha value will be considered only if this alpha control point is split.
- bIsSplit (bool) – the split value (a bool)
-
insertColorControlPointAt(self, index: int, x: float, IColorLow: ORSModel.ors.Color, IColorHigh: ORSModel.ors.Color, bIsSplit: bool) → None¶ Inserts a color control point.
Parameters: - index (int) – the color control point index (a uint32_t)
- x (float) – the X coordinate of the color control point (a double)
- IColorLow (ORSModel.ors.Color) – the color of the lower portion (a Color)
- IColorHigh (ORSModel.ors.Color) – the color of the higher portion (a Color). This color will be considered only if this color control point is split.
- bIsSplit (bool) – the split value (a bool)
-
none() → LookupTable¶ Returns a none object, equivalent to a non-existent object (or null).
Returns: output (LookupTable) –
-
removeAllAlphaControlPoints(self) → None¶ Removes all LUT alpha control points.
-
removeAllColorControlPoints(self) → None¶ Removes all LUT color control points.
-
removeAllControlPoints(self) → None¶ Removes all LUT control points (color and alpha).
-
removeAlphaControlPointAt(self, index: int) → None¶ Removes an alpha control point.
Parameters: index (int) – the alpha control point index (a uint32_t)
-
removeColorAtIndex(self, nIndex: int) → bool¶ Removes the color at the given index.
Parameters: nIndex (int) – Returns: output (bool) –
-
removeColorControlPointAt(self, index: int) → None¶ Removes a color control point.
Parameters: index (int) – the color control point index (a uint32_t)
-
setAlphaControlPointAlphaValueHigh(self, index: int, alphaValue: float) → None¶ Changes the alpha value of an alpha control point (higher portion).
Parameters: - index (int) – the alpha control point index (a uint32_t)
- alphaValue (float) – the alpha value (a double). Should be in the range [0, 1].
-
setAlphaControlPointAlphaValueLow(self, index: int, alphaValue: float) → None¶ Changes the alpha value of an alpha control point (lower portion).
Parameters: - index (int) – the alpha control point index (a uint32_t)
- alphaValue (float) – the alpha value (a double). Should be in the range [0, 1].
-
setAlphaControlPointIsSplit(self, index: int, bIsSplit: bool) → None¶ Specifies if the alpha control point is splitted. If false, only the alpha value of the lower portion will be considered.
Parameters: - index (int) – the alpha control point index (a uint32_t)
- bIsSplit (bool) – the split value (a bool)
-
setAlphaControlPointPosition(self, index: int, pX: float) → None¶ Changes the position of an alpha control point.
Parameters: - index (int) – the alpha control point index (a uint32_t)
- pX (float) – the new X coordinate of the alpha control point (a double)
-
setColorAtIndex(self, nIndex: int, IColor: ORSModel.ors.Color) → None¶ Sets the color at the given index.
Parameters: - nIndex (int) –
- IColor (ORSModel.ors.Color) –
-
setColorAtPosition(self, position: float, IColor: ORSModel.ors.Color) → None¶ Sets the color at a given position.
Note
The position is normalized between 0 and 1. The color that will be changed will be the closest color control point color.
Parameters: - position (float) – the position (a double, see note)
- IColor (ORSModel.ors.Color) –
-
setColorControlPointColorHigh(self, index: int, IColor: ORSModel.ors.Color) → None¶ Changes the color of a color control point (higher portion).
Parameters: - index (int) – the color control point index (a uint32_t)
- IColor (ORSModel.ors.Color) – the color (a Color)
-
setColorControlPointColorLow(self, index: int, IColor: ORSModel.ors.Color) → None¶ Changes the color of a color control point (lower portion).
Parameters: - index (int) – the color control point index (a uint32_t)
- IColor (ORSModel.ors.Color) – the color (a Color)
-
setColorControlPointIsSplit(self, index: int, bIsSplit: bool) → None¶ Specifies if the color control point is splitted. If false, only the color of the lower portion will be considered.
Parameters: - index (int) – the color control point index (a uint32_t)
- bIsSplit (bool) – the split value (a bool)
-
setColorControlPointPosition(self, index: int, pX: float) → None¶ Changes the position of a color control point.
Parameters: - index (int) – the color control point index (a uint32_t)
- pX (float) – the new X coordinate of the color control point (a double)
-
setColorForIndexRange(self, nStartIndex: int, nEndIndex: int, IColor: ORSModel.ors.Color) → None¶ Set color at a given index range.
Parameters: - nStartIndex (int) – the color start index (in range [0, getTableSize()-1] ) (a uint32_t)
- nEndIndex (int) – the color end index (in range [0, getTableSize()-1] ) (a uint32_t)
- IColor (ORSModel.ors.Color) – the color (a Color)
-
setIsDiscrete(self, bDiscrete: bool) → None¶ Sets the lookup table as discrete.
Parameters: bDiscrete (bool) –
-
setRampBMPFile(self, filepath: str) → None¶ Sets the LUT to BMP file.
Parameters: filepath (str) –
-
setRampGrayScale(self) → None¶ Sets the LUT to be gray scale.
Note
Gray scale LUTs divide the color range in 256 gray tones.
-
setRampRainbow(self) → None¶ Sets the LUT to be rainbow.
Note
Rainbow LUTs divide the color range in 4 sections.
-
setRampUserDefined(self) → None¶ Sets the LUT to be user-defined.
Note
User-defined LUTs use color and alpha control points.
-
setTableSize(self, size: int) → None¶ Sets the table size.
Parameters: size (int) –
-
Node¶
-
class
ORSModel.ors.Node Bases:
ORSModel.ors.Managedbrief_description: An abstract class for any object that can be a node in the visualization flow. author: Eric Fournier. All other members of ORS participated. version: 1.0 date: Jan 2005
-
addTransformationToStack(matrix, registrationMethod=None)
-
attachChild(self, anINode: ORSModel.ors.Node) → bool Attaches a child node.
Note
Certain parent-child relationships are forbidden, hence the need to verify the result.
Note
Calling this method several times will still result in the child node only appearing once in its parent.
Parameters: anINode (ORSModel.ors.Node) – the node to attach (a Node) Returns: output (bool) – true if child was attached, false otherwise
-
attachChildAtIndex(self, anINode: ORSModel.ors.Node, index: int) → bool Attaches a child node at a given index.
Note
Certain parent-child relationships are forbidden, hence the need to verify the result.
Note
Calling this method several times will still result in the child node only appearing once in its parent.
Parameters: - anINode (ORSModel.ors.Node) – the node to attach (a Node)
- index (int) – the index (a uint32_t)
Returns: output (bool) – true if child was attached, false otherwise
-
copyGraph(self) → Node Returns a copy of the node, including its graph.
Note
You can type the return value of this method to any subclass of ORSNode, if you know the class of the object being retrieved. If its class doesn’t match the type specified the return will be none().
Returns: output (ORSModel.ors.Node) – a new node (a Node)
-
detachChild(self, anINode: ORSModel.ors.Node) → bool Detaches a child node.
Parameters: anINode (ORSModel.ors.Node) – the node to detach (a Node) Returns: output (bool) – true if child was detached, false otherwise
-
getAllChildrenNodes(self) → List Returns a flattened list of the child hierarchy of the node.
Note
The child hierarchy is flattened.
Note
Expect no particular ordering of the nodes.
Returns: output (ORSModel.ors.List) – a list of all nodes below the node (a List)
-
getAllChildrenOfClass(self, pProgId: str) → List Returns all the nodes of the specified class found in the child hierarchy.
Note
Result will be an empty list if no match is found.
Note
The search is done breadth-first.
Note
Use constants defined in ORS_def.h for ProgIds (ex: ORSFrameProgId).
Parameters: pProgId (str) – the ProgId of the class to test against (a string) Returns: output (ORSModel.ors.List) – a list of nodes (a List)
-
getAllChildrenOfClassReachableByRenderer(self, pProgId: str) → List Returns a flattened list of all the child nodes, of the given class, that are renderable.
Note
The list contains only Managed objects (they will need to be typecast to the appropriate class).
Parameters: pProgId (str) – the ProgId of the class to test against (a string) Returns: output (ORSModel.ors.List) – a list of all child nodes that can be rendered (an List)
-
getAllParentNodes(self) → List Returns a flattened list of the parent hierarchy of the node.
Note
The parent hierarchy is flattened.
Note
Expect no particular ordering of the nodes.
Returns: output (ORSModel.ors.List) – a list of all nodes above the node (an List)
-
getAllParentsOfClass(self, pProgId: str) → List Returns all the nodes of the specified class found in the parent hierarchy.
Note
Result will be an empty list if no match is found.
Note
The search is done breadth-first.
Note
Use constants defined in ORS_def.h for ProgIds (ex: ORSFrameProgId).
Parameters: pProgId (str) – the ProgId of the class to test against (a string) Returns: output (ORSModel.ors.List) – a list of nodes (an List)
-
getChildWithGUID(self, aGUID: str) → Node Gets an immediate child node with the given GUID.
Note
Only immediate children are searched.
Note
You can type the return value of this method to any subclass of ORSNode, if you know the class of the object being retrieved. If its class doesn’t match the type specified the return will be none().
Parameters: aGUID (str) – a GUID (a string) Returns: output (ORSModel.ors.Node) – a child node if found (a Node), none() otherwise
-
getChildWithTitle(self, aTitle: str) → Node Gets an immediate child node with the given title.
Note
Only immediate children are searched.
Note
You can type the return value of this method to any subclass of ORSNode, if you know the class of the object being retrieved. If its class doesn’t match the type specified the return will be none().
Parameters: aTitle (str) – a string (a string) Returns: output (ORSModel.ors.Node) – a child node if found (a Node), none() otherwise
-
getChildrenNodes(self) → List Returns the list of immediate child nodes.
Returns: output (ORSModel.ors.List) – a list of nodes (an List)
-
getChildrenOfClass(self, pProgId: str) → List Returns the nodes of the specified class found in the immediate children.
Note
Result will be an empty list if no match is found.
Note
Use constants defined in ORS_def.h for ProgIds (ex: ORSFrameProgId).
Parameters: pProgId (str) – the ProgId of the class to test against (a string) Returns: output (ORSModel.ors.List) – a list of nodes (an List)
-
getClassNameStatic() → str getClassNameStatic
Returns: output (str) –
-
getFirstChildOfClass(self, pProgId: str) → Node Returns the first object of the specified class found in the child hierarchy.
Note
The search is done breadth-first.
Note
You can type the return value of this method to any subclass of ORSNode, if you know the class of the object being retrieved. If its class doesn’t match the type specified the return will be none().
Note
Use constants defined in ORS_def.h for ProgIds (ex: ORSFrameProgId).
Parameters: pProgId (str) – the ProgId of the class to test against (a string) Returns: output (ORSModel.ors.Node) – a node if one exists (a Node), none() otherwise
-
getFirstChildOfClassAndPrivateTitle(self, pProgId: str, privateTitle: str) → Node Searches the hierarchy for a child node with the specified class and private title.
Note
You can type the return value of this method to any subclass of ORSNode, if you know the class of the object being retrieved. If its class doesn’t match the type specified the return will be none().
Note
Use constants defined in ORS_def.h for ProgIds (ex: ORSFrameProgId).
Parameters: - pProgId (str) – the ProgId of the class to test against (a string)
- privateTitle (str) – some text (a string)
Returns: output (ORSModel.ors.Node) – a node if it exists (a Node), none() otherwise
-
getFirstFrameTowardsNode(self, anINode: ORSModel.ors.Node) → ReferenceFrame Gets the first frame found going up the hierarchy towards a given object.
Parameters: anINode (ORSModel.ors.Node) – the target node (an Node) Returns: output (ORSModel.ors.ReferenceFrame) – a frame (an ReferenceFrame) or none if no frame is found
-
getFirstNodeWithClassNameTowardsNode(self, pProgId: str, anINode: ORSModel.ors.Node) → Node Searches the hierarchy for a parent node with the specified class toward a specific parent nopde.
Note
You can type the return value of this method to any subclass of ORSNode, if you know the class of the object being retrieved. If its class doesn’t match the type specified the return will be none().
Note
Use constants defined in ORS_def.h for ProgIds (ex: ORSFrameProgId).
Parameters: - pProgId (str) – the ProgId of the class to test against (a string)
- anINode (ORSModel.ors.Node) – a target node
Returns: output (ORSModel.ors.Node) – a node if it exists (a Node), none() otherwise
-
getFirstParentOfClass(self, pProgId: str) → Node Returns the first object of the specified class found in the parent hierarchy.
Note
The search is done breadth-first.
Note
You can type the return value of this method to any subclass of ORSNode, if you know the class of the object being retrieved. If its class doesn’t match the type specified the return will be none().
Note
Use constants defined in ORS_def.h for ProgIds (ex: ORSFrameProgId).
Parameters: pProgId (str) – the ProgId of the class to test against (a string) Returns: output (ORSModel.ors.Node) – a node if one exists (a Node), none() otherwise
-
getFirstParentOfClassAndPrivateTitle(self, pProgId: str, privateTitle: str) → Node Searches the hierarchy for a parent node with the specified class and private title.
Note
You can type the return value of this method to any subclass of ORSNode, if you know the class of the object being retrieved. If its class doesn’t match the type specified the return will be none().
Note
Use constants defined in ORS_def.h for ProgIds (ex: ORSFrameProgId).
Parameters: - pProgId (str) – the ProgId of the class to test against (a string)
- privateTitle (str) – some text (a string)
Returns: output (ORSModel.ors.Node) – a node if it exists (a Node), none() otherwise
-
getFrameTransformationFromNode(self, towardNode: ORSModel.ors.Node, pTimeStep: int) → Matrix4x4 Parameters: - towardNode (ORSModel.ors.Node) –
- pTimeStep (int) –
Returns: output (ORSModel.ors.Matrix4x4) –
-
getImmediateChildOfClass(self, pProgId: str) → Node Searches for a child node with the specified class.
Note
Only the immediate children are searched, not the hierarchy.
Note
You can type the return value of this method to any subclass of ORSNode, if you know the class of the object being retrieved. If its class doesn’t match the type specified the return will be none().
Note
Use constants defined in ORS_def.h for ProgIds (ex: ORSFrameProgId).
Parameters: pProgId (str) – the ProgId of the class to test against (a string) Returns: output (ORSModel.ors.Node) – a node if it exists (a Node), none() otherwise
-
getImmediateParentOfClass(self, pProgId: str) → Node Searches for a parent node with the specified class.
Note
Only the immediate parents are searched, not the hierarchy.
Note
You can type the return value of this method to any subclass of ORSNode, if you know the class of the object being retrieved. If its class doesn’t match the type specified the return will be none().
Note
Use constants defined in ORS_def.h for ProgIds (ex: ORSFrameProgId).
Parameters: pProgId (str) – the ProgId of the class to test against (a string) Returns: output (ORSModel.ors.Node) – a node if it exists (a Node), none() otherwise
-
getImmediateParentWithGUID(self, pGUID: str) → Node Gets a parent node with the given GUID.
Note
Only immediate parents are searched.
Note
You can type the return value of this method to any subclass of ORSNode, if you know the class of the object being retrieved. If its class doesn’t match the type specified the return will be none().
Parameters: pGUID (str) – a GUID (a string) Returns: output (ORSModel.ors.Node) – a parent node if found (a Node), none() otherwise
-
getIsNodeOneOfMyAscendants(self, anINode: ORSModel.ors.Node) → bool Checks to see if a specified node is in the parent hierarchy of the node.
Note
The parent hierarchy is searched in its entirety for the specified node.
Note
The search is conducted depth-first.
Parameters: anINode (ORSModel.ors.Node) – Returns: output (bool) – true if the specified node in the parent hierarchy, false otherwise
-
getIsNodeOneOfMyDescendants(self, anINode: ORSModel.ors.Node) → bool Checks to see if a specified node is in the child hierarchy of the node.
Note
The child hierarchy is searched in its entirety for the specified node.
Note
The search is conducted depth-first.
Parameters: anINode (ORSModel.ors.Node) – Returns: output (bool) – true if the specified node in the child hierarchy, false otherwise
-
getMaxTSizeOfChilden(self) → int Get Maximum T Size of all children node of this node.
Returns: output (int) –
-
getParentNodes(self) → List Gets the immediate parent nodes.
Returns: output (ORSModel.ors.List) – a list of nodes (a List)
-
getParentWithGUID(self, pGUID: str) → Node Gets a parent node (from the hierarchy) with the given GUID.
Note
The whole parent hierarchy is searched.
Note
The search is done breadth-first.
Note
You can type the return value of this method to any subclass of ORSNode, if you know the class of the object being retrieved. If its class doesn’t match the type specified the return will be none().
Parameters: pGUID (str) – a GUID (a string) Returns: output (ORSModel.ors.Node) – a parent node if found (a Node), none() otherwise
-
getParentsOfClass(self, pProgId: str) → List Returns the nodes of the specified class found in the immediate parents.
Note
Result will be an empty list if no match is found.
Note
Use constants defined in ORS_def.h for ProgIds (ex: ORSFrameProgId).
Parameters: pProgId (str) – the ProgId of the class to test against (a string) Returns: output (ORSModel.ors.List) – a list of nodes (a List)
-
getVisual(self) → Visual Gets the visual of a model. Some models have a visual, e.g.Channel has VisualChannel as Visual.
Returns: output (ORSModel.ors.Visual) – the visual of a model (a Visual)
-
none() → Node Returns a none object, equivalent to a non-existent object (or null).
Returns: output (Node) –
-
propagateChildrenNodesOrganizationDirty(includeSelf=False) Calls for a propagateDirty with the flag OrsChildrenNodesOrganizationDirty
Parameters: includeSelf (bool) – True includes the receiver in the propagation, False doesn’t
-
propagateDataDirty(includeSelf=False) Calls for a propagateDirty with the flag OrsDataDirty
Parameters: includeSelf (bool) – True includes the receiver in the propagation, False doesn’t
-
propagateDirty(self, dirtyFlag: str, includeSelf: bool) → None Causes a dirty message to be sent to all children nodes.
Note
See ORS_def.h for default dirty flag (ex: ORSDataDirty).
Note
A dirty message has different results for different objects, but generally causes a refresh on the data.
Note
Message propagation is done depth-first.
Parameters: - dirtyFlag (str) – a string dirty flag (a string)
- includeSelf (bool) – should set this dirty (a bool)
-
propagateGeometryDirty(includeSelf=False) Calls for a propagateDirty with the flag OrsGeometryDirty
Parameters: includeSelf (bool) – True includes the receiver in the propagation, False doesn’t
-
propagateHighlightDirty(includeSelf=False) Calls for a propagateDirty with the flag OrsHighlightDirty
Parameters: includeSelf (bool) – True includes the receiver in the propagation, False doesn’t
-
propagatePropertyDirty(includeSelf=False) Calls for a propagateDirty with the flag OrsPropertyDirty
Parameters: includeSelf (bool) – True includes the receiver in the propagation, False doesn’t
-
propagateVisibilityDirty(includeSelf=False) Calls for a propagateDirty with the flag OrsVisibilityDirty
Parameters: includeSelf (bool) – True includes the receiver in the propagation, False doesn’t
-
refresh() Refreshes the views related to the current object
-
refreshAll2DParentViews(self) → None Causes all 3D views in the parent hierarchy of the node to be refreshed.
-
refreshAll2DParentViewsIfVisible(self) → None Causes all 2D views in the parent hierarchy of the node to be refreshed if it is a model and it visuals are visible in the views.
-
refreshAll3DParentViews(self) → None Causes all 3D views in the parent hierarchy of the node to be refreshed.
-
refreshAll3DParentViewsIfVisible(self) → None Causes all 3D views in the parent hierarchy of the node to be refreshed if it is a model and it visuals are visible in the views.
-
refreshAllParentViews(self) → None Causes all views in the parent hierarchy of the node to be refreshed.
-
refreshAllParentViewsIfVisible(self) → None Causes all views in the parent hierarchy of the node to be refreshed if it is a model and it visuals are visible in the views.
-
setAllowRenderingInAllParentViews(self, bValue: bool) → None Allows or prevents rendering in the views affected by a node.
Parameters: bValue (bool) – true to allow rendering, false to disallow it.
-
switchOrderOfPrecedenceOfChildrenNodes(self, anINode1: ORSModel.ors.Node, anINode2: ORSModel.ors.Node) → bool Rearranges the order of child nodes.
Note
When child nodes are not in the desired order, they can be switched with this method (for example, the order in which they are rendered can be undesired).
Note
Both nodes are swapped in the list of nodes. For example, if nodes are A B C D and this call is made switchOrderOfPrecedenceOfChildrenNodes(A, C), the nodes are then in this order: C B A D.
Note
This method dives down in the child hierarchy until it finds a node where both arguments appear, then performs the switch at that level.
Parameters: - anINode1 (ORSModel.ors.Node) – a child node (a Node)
- anINode2 (ORSModel.ors.Node) – a child node (a Node)
Returns: output (bool) – true if successful, false otherwise
-
switchOrderOfPrecedenceOfParentNodes(self, anINode1: ORSModel.ors.Node, anINode2: ORSModel.ors.Node) → bool Rearranges the ordering of immediate parent nodes.
Note
When parent nodes are not in the desired order, they can be switched with this method.
Note
Both nodes are swapped in the list of nodes. For example, if nodes are A B C D and this call is made switchOrderOfPrecedenceOfParentNodes(A, C), the nodes are then in this order: C B A D.
Note
This method acts only on immediate parent nodes, not the entire parent hierarchy.
Parameters: - anINode1 (ORSModel.ors.Node) – a parent node (a Node)
- anINode2 (ORSModel.ors.Node) – a parent node (a Node)
Returns: output (bool) – true if successful, false otherwise
-
Managed¶
-
class
ORSModel.ors.Managed Bases:
ORSModel.ors.ORSBaseClassbrief_description: An abstract class that implements all the default behavior of managed objects. author: Eric Fournier. All other members of ORS participated. version: 1.0 date: Jan 2005
-
addCallbackToEvent(self, anEventName: str, sCallbackName: str, callbackData: int) → bool Adds a callback subscription to an event.
Note
The callback name for a given event needs to be unique for that event, i.e. no two callbacks for a given event can have the same name.
Parameters: - anEventName (str) – name of the event to subscribe to (a string)
- sCallbackName (str) – callback name (a string)
- callbackData (int) – a pointer to a ORS_EVENT_CALLBACK_INFO structure
Returns: output (bool) – true if subscription succeeded, false otherwise
-
addToDeleteSet(self, anIObject: ORSModel.ors.Managed) → None Add an object to the delete set.
Note
All objects have a delete set, which designates those objects that should also be deleted when the receiver gets deleted.
Parameters: anIObject (ORSModel.ors.Managed) – an object (a Managed)
-
addToSelection(contextInstance) Adds the instance to the selection of a context
Parameters: contextInstance (plugin instance) – context instance Note
Only representable object can be selected
-
applyPreferences() Helper for setting the attribute of the object following the preferences
-
atomicLoad(sFilename: str, bPreserveIdentity: bool) → Managed Creates an object from a file where an object was save.
Parameters: - sFilename (str) – path of the file to load
- bPreserveIdentity (bool) – if true, preserves the identity of the object, false otherwise
Returns: output (Managed) – a managed object, or none() if the load fails
-
atomicLoadFrom(self, anXML: str) → None Loads an object from an XML string.
Parameters: anXML (str) – Managed.atomicLoadFrom(self, buffer: int, nBytes: int) -> None
Loads an object from a buffer. Used for python pickling.
Parameters: - buffer (bytes) – the buffer
- nBytes (int) – the number of bytes in the buffer (a 64 bit unsigned int)
-
atomicLoadSpecificNode(self, aFilename: str, aXPathOfTheNodeToLoad: str) → bool Loads an object from a file containing several objects.
Parameters: - aFilename (str) –
- aXPathOfTheNodeToLoad (str) –
Returns: output (bool) –
-
atomicSave(self, aFilename: str, isTemporary: bool) → int Saves the object to a file.
Parameters: - aFilename (str) – path of the file to save
- isTemporary (bool) – if true, try to keep file in memory
Returns: output (int) – 0 if successful, otherwise an error code
-
copy(self) → Managed Returns a copy of the managed.
Note
Only the immediate attributes of the managed are copied. The graph surrounding the new managed is the same one as the source managed.
Note
You can type the return value of this method to any subclass of Managed, if you know the class of the object being retrieved. If its class doesn’t match the type specified the return will be NULL.
Returns: output (ORSModel.ors.Managed) – a new managed (a Managed)
-
createScalarValuesCollection(self) → None
-
deleteObject(self) → None Explicitly deletes the core object wrapped by this Interface object.
-
deleteObjectAndAllItsChildren(self) → None Explicitly deletes the core object wrapped by this Interface object, along with all its children.
-
getAllGroupsContaining(self, anIObject: ORSModel.ors.Managed) → List Gets all the groups that contain the given object.
Parameters: anIObject (ORSModel.ors.Managed) – Returns: output (ORSModel.ors.List) –
-
classmethod
getAllInstances()
-
getAllInstancesOf(pProgId: str) → List Gathers all existing objects of the specified class.
Parameters: pProgId (str) – Returns: output (ORSModel.ors.List) –
-
classmethod
getAllObjectsOfClass(cls_name)
-
getAllObjectsOfClassAndPrivateTitle(pProgId: str, pPrivateTitle: str) → List Gathers all existing objects of the specified class, that have a matching private title.
Parameters: - pProgId (str) – name of the class (a string)
- pPrivateTitle (str) – private title to search for (a string)
Returns: output (ORSModel.ors.List) – all the objects that match the search criteria (a List)
-
getAllObjectsOfClassAndTitle(pProgId: str, pTitle: str) → List Gathers all existing objects of the specified class, that have a matching title.
Parameters: - pProgId (str) – name of the class (a string)
- pTitle (str) – title to search for (a string)
Returns: output (ORSModel.ors.List) – all the objects that match the search criteria (a List)
-
getAllObjectsOfClassAndUserData(pProgId: str, userDataKey: str, userDataValue: str) → List Gathers all existing objects of the specified class, that have a matching user data.
Parameters: - pProgId (str) – name of the class (a string)
- userDataKey (str) – key of the user data (a string)
- userDataValue (str) – value to look for (a string)
Returns: output (ORSModel.ors.List) – all the objects that match the search criteria (a List)
-
classmethod
getAllRepresentableInstances()
-
getAllRepresentableInstancesOf(pProgId: str) → List Gathers all existing objects of the specified class that are representable.
Parameters: pProgId (str) – Returns: output (ORSModel.ors.List) –
-
getAllRepresentableObjects(self) → List Gets all the representable objects of the world.
Returns: output (ORSModel.ors.List) – a list containing all the representable objects
-
classmethod
getAllSubclasses(outputCollection=None)
-
getAtomicTextRepresentation(self, bSelfContained: bool) → str Retrieves the object’s atomic text representation.
Parameters: bSelfContained (bool) – Returns: output (str) –
-
getBinaryUserInfo(self, pTag: str) → None Retrieves a user defined binary value. Typed as void* for sip, but it’s in reality an unsigned char*.
Note
If the key doesn’t exist, nullptr is returned
Parameters: pTag (str) – key of the data (a string)
-
getBinaryUserInfoAsBytes(name)
-
getBinaryUserInfoSize(self, pTag: str) → int Retrieves the size of a user defined binary value.
Note
If the key doesn’t exist, 0 is returned
Parameters: pTag (str) – key of the data (a string) Returns: output (int) – the size of the data (a uint32_t)
-
getCallbacksEnabled(self) → bool Queries the object to know if its callbacks are enabled or disabled.
Returns: output (bool) – true if callbacks are enabled, false otherwise
-
getChildrenNodesOrganizationDirtySignature() Gets the current dirty signature for the flag OrsChildrenNodesOrganizationDirty
Returns: childrenNodesOrganizationDirtySignature (int) – the dirty signature
-
classmethod
getClassDenomination()
-
static
getClassFromProgId(progId)
-
getClassName(self) → str Retrieves the class name of the core object wrapped by this Interface object.
Returns: output (str) – the class name (a string)
-
getClassNameStatic() → str getClassNameStatic
Returns: output (str) –
-
getCreationTime(self) → int Returns the time Number of seconds since Jan 1 2000 of creation of this object.
Returns: output (int) – a uint32_t
-
getDataChecksum(self) → str Returns: output (str) –
-
getDataDirtySignature() Gets the current dirty signature for the flag OrsDataDirty
Returns: dataDirtySignature (int) – the dirty signature
-
getDirtySignature(self, dirtyFlag: str) → int Gets the current dirty signature.
Note
Objects can be dirty for several aspects, see the ors_def.h file for the different dirty aspects.
Parameters: dirtyFlag (str) – dirty flag name (a string, see note below) Returns: output (int) – dirty signature (a uint64_t)
-
getEntireDirtySignature(self) → int Gets the current dirty signature for all aspects, added up.
Note
Objects can be dirty for several aspects, see the ors_def.h file for the different dirty aspects.
Returns: output (int) – entire dirty signature (a uint64_t)
-
getEventCallbackEnabled(self, sEventName: str, sCallbackName: str) → bool Gets the enabled state of a callback subscription to an event.
Parameters: - sEventName (str) – event name (a string)
- sCallbackName (str) – callback name (a string)
Returns: output (bool) – true if callback is enabled, false if disabled or if the callback subscription did not exist
-
getGUID(self) → str Retrieves the GUID of the core object.
Note
The GUID is the unique identifier of the object. No two objects can have the same GUID. Once you have an object’s GUID, at any time you can obtain a reference to that object via its GUID, given that the object is still alive.
Returns: output (str) –
-
getGeometryDirtySignature() Gets the current dirty signature for the flag OrsGeometryDirty
Returns: geometryDirtySignature (int) – the dirty signature
-
getHasCallbacksForEvent(self, anEventName: str) → bool Checks if the receiver has any callbacks for an event.
Parameters: anEventName (str) – name of the event (a string) Returns: output (bool) –
-
getHighlightDirtySignature() Gets the current dirty signature for the flag OrsHighlightDirty
Returns: highlightDirtySignature (int) – the dirty signature
-
getIsAllowedToBeDeletedInContext(pluginInstance=None)
-
getIsAvailableInContext(pluginInstance=None)
-
getIsDirty(self, dirtyFlag: str) → bool Gets if the object is dirty for a specific dirty flag.
Parameters: dirtyFlag (str) – dirty flag name (a string, see note below) Returns: output (bool) – true if object is dirty, false otherwise
-
getIsDirtyAnyDirtyFlag(self) → bool Gets if the object is dirty for any of the dirty flags.
Returns: output (bool) – true if object is dirty, false otherwise
-
getIsEqualTo(self, aManaged: ORSModel.ors.Managed) → bool Checks if the two objects are equal.
Parameters: aManaged (ORSModel.ors.Managed) – an object to compare with (a Managed) Returns: output (bool) – true if the receiver and the argument are equal (class dependent), false otherwise
-
getIsExclusiveToContext(pluginInstance=None)
-
getIsIdentityPreservedForPickling(self) → bool Returns True if the GUID is preserved when pickling and unpickling an object.
Returns: output (bool) – Returns True if the GUID is preserved when pickling and unpickling an object
-
getIsInDeleteSet(self, anIObject: ORSModel.ors.Managed) → bool Gets if an object is included in the receiver delete set.
Note
The delete set is a list of objects that are to be deleted when the receiver is deleted.
Parameters: anIObject (ORSModel.ors.Managed) – object to look for in the receiver delete set (a Managed) Returns: output (bool) – true if the object is in the delete set of the receiver, false otherwise
-
getIsInstanceOf(self, pProgId: str) → bool Queries the object to know if it is an instance of a certain class.
Parameters: pProgId (str) – Returns: output (bool) –
-
getIsInstanceOfAtLeastOneClasses(progIdList)
-
getIsModifiedAnyAspect()
-
getIsPrivateInContext(pluginInstance=None)
-
getIsPublicInAllContexts()
-
getIsRepresentable(self) → bool Queries the object to know if it is representable.
Returns: output (bool) –
-
getIsSameObjectAs(self, anObject: ORSModel.ors.Managed) → bool Checks to see if the receiver wraps the same underlying object as the supplied argument.
Parameters: anObject (ORSModel.ors.Managed) – an object to compare with (a Managed) Returns: output (bool) – true if underlying object is the same for both the receiver and the argument, false otherwise
-
classmethod
getIsSubclassOf(parentClass)
-
getIsToBeKeptAliveUntilExit(self) → bool Queries the object to know if it is permanent for the life of the application.
Note
Permanent objects survive a new session, i.e. they live until the application is terminated.
Returns: output (bool) – true if object is permanent, false otherwise
-
getIsToBeSaved(self) → bool Queries the object to know if it should be saved in a session file.
Returns: output (bool) – true if object should be saved, false otherwise
-
getMetadataChecksum(self) → str Returns: output (str) –
-
getObjectWithGUID(guid: str) → Managed Retrieves an object from its GUID.
Parameters: guid (str) – a GUID (a string) Returns: output (ORSModel.ors.Managed) – An object or none if object is not found
-
getPrivateTitle(self) → str Gets the private title of the object.
Note
The private title is never shown in the application, but is a means by which an object can be found (getAllObjectsOfClassAndPrivateTitle for example).
Returns: output (str) – private title of the object (a string)
-
getPropertyDirtySignature() Gets the current dirty signature for the flag OrsPropertyDirty
Returns: propertyDirtySignature (int) – the dirty signature
-
getPythonRepresentation(self) → str Gets a Python evaluable string representation.
Returns: output (str) – The object’s representation (a string)
-
getReferenceCount(self) → int Returns the count of references to the object.
Returns: output (int) – the count of references (an int)
-
getScalarValuesCollection(self) → ScalarValuesCollection Returns: output (ORSModel.ors.ScalarValuesCollection) –
-
getTitle(self) → str Gets the title of the object.
Returns: output (str) – the title (a string)
-
getUserInfo(self, pTag: str) → str Retrieves a user defined value.
Note
If the key doesn’t exist an empty string is returned.
Parameters: pTag (str) – key of the data (a string) Returns: output (str) – the data (a string)
-
getUserInfoAsArray(self) → ArrayString Retrieves the user info as a string array.
Note
The user info data is flattened into an array of string pairs, for the key and the value.
Returns: output (ORSModel.ors.ArrayString) – the data (an ArrayString, see note below)
-
getUserInfoPickledObject(name)
-
getVisibilityDirtySignature() Gets the current dirty signature for the flag OrsVisibilityDirty
Returns: visibilityDirtySignature (int) – the dirty signature
-
isManaged(self) → bool Returns: output (bool) –
-
isNone(self) → bool check if the object is none
Returns: output (bool) –
-
isNotNone(self) → bool check if the object is Not none
Returns: output (bool) –
-
none() → Managed Returns a none object, equivalent to a non-existent object (or null).
Returns: output (Managed) –
-
publish() Sets an object as representable and notifies the Dragonfly UI of a new available object
-
removeBinaryUserInfo(self, pTag: str) → None Removes a user defined binary value.
Parameters: pTag (str) – key name of the binary value (a string)
-
removeCallbackFromEvent(guid: str, sEventName: str, sCallbackName: str, bRemoveInDeletedObject: bool) → bool Removes a callback subscription to an event.
Parameters: - guid (str) – object GUID (a string)
- sEventName (str) – name of the callback event (a string)
- sCallbackName (str) – name of the callback (a string)
- bRemoveInDeletedObject (bool) – if true, the callback will be removed from the object even if that object is in the process of being deleted (a boolean)
Returns: output (bool) – true callback existed, false otherwise
-
removeFromDeleteSet(self, anIObject: ORSModel.ors.Managed) → None Remove an object from the delete set.
Note
The delete set is a list of objects that are to be deleted when the receiver is deleted.
Parameters: anIObject (ORSModel.ors.Managed) – object to be removed from the delete set (a Managed)
-
removeUserInfo(self, pTag: str) → None Removes a user defined value.
Parameters: pTag (str) – key of the data (a string)
-
selectExclusively(contextInstance) Selects only the current instance for a context
Parameters: contextInstance (plugin instance) – context instance Note
Only representable object can be selected
-
setAsTemporaryObject(isTemporaryObject=True) Helper for setting useful properties when marking an object as a (non-)temporary object.
Parameters: isTemporaryObject (bool) – if True, the object will be set as temporary (not representable, not to be saved, callbacks disabled). Otherwise, these properties are set as the opposite.
-
setBinaryUserInfo(self, pTag: str, pValue: int, iDataSize: int) → None Sets a user defined binary value.
Note
Objects can carry user defined data in the form of strings or binary data.
Parameters: - pTag (str) – key of the data (a string)
- pValue (bytes) – the data (an unsigned char* buffer)
- iDataSize (int) – the size of the data (a uint32_t)
-
setCallbacksEnabled(self, enabled: bool) → None Sets the object’s callbacks to be enabled or not.
Note
When an object’s callbacks are disabled, absolutely no callbacks are triggered from the receiver.
Parameters: enabled (bool) – true to enable callbacks, false otherwise
-
setChildrenNodesOrganizationDirty() Calls for a setDirty with the flag OrsChildrenNodesOrganizationDirty
-
setDataDirty() Calls for a setDirty with the flag OrsDataDirty
-
setDirty(self, dirtyFlag: str) → None Sets the object as being dirty for a given aspect.
Note
A dirty object is an object that has changed, giving its observers a chance to refresh their view on the object. Several aspects of an object can be dirty, see ORS_def.h for dirty signature flags.
Parameters: dirtyFlag (str) – dirty flag name (a string)
-
setEventCallbackEnabled(self, sEventName: str, sCallbackName: str, bValue: bool) → bool Enables/disables a callback subscription to an event.
Note
Works for all callback types (object, class and global)
Parameters: - sEventName (str) – event name (a string)
- sCallbackName (str) – callback name (a string)
- bValue (bool) – true to enable the callback, false to disable it
Returns: output (bool) – true if callback subscription existed, false otherwise
-
setExclusiveToContext(pluginInstance=None)
-
setGeometryDirty() Calls for a setDirty with the flag OrsGeometryDirty
-
setHighlightDirty() Calls for a setDirty with the flag OrsHighlightDirty
-
setIdentityIsPreservedForPickling(self, value: bool) → None Set to True if the GUID is to be preserved when pickling and unpickling an object.
Parameters: value (bool) –
-
setIsNotDirty(self) → None Sets the object as not being dirty for all dirty flags.
-
setIsRepresentable(self, isRepresentable: bool) → None Sets the object to be representable or not.
Note
Non representable objects don’t appear in lists and such, the implicit meaning is that these objects are transient and temporary.
Parameters: isRepresentable (bool) – true to make the object representable, false otherwise
-
setIsToBeKeptAliveUntilExit(self, pFlag: bool) → None Sets the object to be permanent for the life of the application.
Note
Permanent objects survive a new session, i.e. they live until the application is terminated.
Parameters: pFlag (bool) – true to make the object permanent, false otherwise
-
setIsToBeSaved(self, pIsToBeSaved: bool) → None Sets the object to be saved to session files or not.
Parameters: pIsToBeSaved (bool) – true to cause the object to be saved to session files, false otherwise
-
setPrivateTitle(self, newPrivateTitle: str) → None Sets the private title of the object.
Note
The private title can later be used to find a reference to that object, given that it’s still alive.
Parameters: newPrivateTitle (str) – a title (a string)
-
setPropertyDirty() Calls for a setDirty with the flag OrsPropertyDirty
-
setPublicInAllContexts()
-
setTitle(self, newVal: str) → None Sets the title of the object.
Parameters: newVal (str) –
-
setUserInfo(self, pTag: str, pValue: str) → None Sets a user defined value.
Note
Stores the key/value pair in an internal dictionary. If the key already exists its previous value is overwritten.
Parameters: - pTag (str) – a key name (a string)
- pValue (str) – a value (a string)
-
setUserInfoPickledObject(name: str, picklable_object)
-
setVisibilityDirty() Calls for a setDirty with the flag OrsVisibilityDirty
-
switchAvailabilityToContext(oldContextID, newContextID) Switches the availability of the object from an old context to a new context. This will be done only if the old context ID is found in the set of available contexts and the new context ID is not already in the set of available contexts. The availability for all other contexts remains unchanged.
The arguments oldContextID and newContextID are used as strings instead of plugin instances to support the situation where the old or new context is not existing (for example, to perform a copy of the objects).
Parameters: - oldContextID (str) – old context ID
- newContextID (str) – new context ID
-
triggerClassEvent(self, sEventName: str) → bool Triggers a class event.
Parameters: sEventName (str) – Returns: output (bool) –
-
unpublish() Sets an object as non-representable and notifies the Dragonfly UI of a loss of the availability of the object.
-
unselect(contextInstance) Unselects the instance for a context
Parameters: contextInstance (plugin instance) – context instance
-
ORSBaseClass¶
-
class
ORSModel.ors.ORSBaseClass brief_description: An abstract class from which all objects issued from the author: Eric Fournier. All other members of ORS participated. version: 1.0 date: Jan 2005
-
getPythonTraceBack() → typing.List[str] Set the python traceback for a call from python.
Returns: output (typing.List[str]) –
-
isManaged(self) → bool Returns: output (bool) –
-
isNone(self) → bool Returns: output (bool) –
-
setPythonTraceBack(tb: ORSModel.ors.typing.List[str]) → None Set the python traceback for a call from python.
Parameters: tb (typing.List[str]) –
-