Workspace 6.21.5
|
An abstract base class for the types of scene items or 'nodes' that make up the scene interaction tree. More...
#include <Rendering/SceneInteraction/sceneitemtype.h>
Public Types | |
enum | Category { AllCategories , Scene , SceneItem , MeshData , Shader , Glypher , Texture , Overlay , LastCategory = 999 } |
enum | Flags { UserCanAdd = (1 << 0) , UserCanRemove = (1 << 1) , UserCanFocus = (1 << 2) } |
using | SceneInteractionWidgetItemList = QVector< SceneInteractionWidgetItem * > |
Public Member Functions | |
virtual | ~SceneItemType ()=default |
virtual DataExecution::Operation * | addSingleItemToScene (DataExecution::Workspace &root, const QString &sceneIdPath) const |
virtual DataExecution::Operation * | addToScene (DataExecution::Workspace &root, const QString &sceneIdPath) const =0 |
virtual bool | allowMultipleConnection (QString inputName) const |
virtual SceneInteractionWidgetItem * | createSceneInteractionWidgetItem (QTreeWidgetItem *parent, const QStringList &text, DataExecution::Operation &op) const |
virtual SceneInteractionWidgetItemList | createSceneInteractionWidgetItems (QTreeWidgetItem *parent, const QStringList &text, DataExecution::Operation &op) const |
virtual unsigned int | getFlags () const |
virtual QString | getIcon () const =0 |
virtual DataExecution::Input * | getInput (DataExecution::Operation &primaryOperation, const QString &inputName) const |
virtual QStringList | getInputNameForType (unsigned int category) const |
virtual QString | getMenuPath () const |
virtual QString | getName () const =0 |
virtual QString | getOperationKey () const =0 |
virtual unsigned int | getOutputType () const |
virtual QString | getSceneItemOutputName () const =0 |
virtual QString | getTooltipForWrongPositionInTree (const SceneInteractionWidgetItem *currentlySelectedItem) const |
virtual bool | isValidUnderTreeItem (const SceneInteractionWidgetItem *currentlySelectedItem) const |
virtual void | labelChanged (DataExecution::Workspace &root, const QString &sceneIdPath) const |
virtual DataExecution::Operation * | promptAndAddToScene (DataExecution::Workspace &root, const QString &sceneIdPath) const |
virtual void | removeFromScene (DataExecution::Workspace &root, const QString &sceneIdPath) const |
virtual void | sceneItemTypeAdded (const SceneItemType &typeJustAddedToWorkflow, DataExecution::Operation *primaryOperationJustAdded, DataExecution::Workspace &rootWorkspace, const QString &parentIdPath) const |
virtual void | sceneItemTypeRemoved (const SceneItemType &typeJustRemovedFromWorkflow, const SceneInteractionWidgetItem &treeItemRemoved, DataExecution::Operation *primaryOperationJustAdded, DataExecution::Workspace &rootWorkspace, const QString &parentIdPath) const |
Corresponding remove method. | |
Static Public Member Functions | |
static void | repositionOperation (DataExecution::Operation &op, DataExecution::Operation &anchor, QUndoStack &undoStack) |
** | |
template<typename T > | |
static void | setOperationInput (DataExecution::Operation &op, const QString &name, const T &value) |
Protected Member Functions | |
SceneItemType ()=default | |
DataExecution::Operation * | addExternalWorkspace (DataExecution::Workspace &rootWorkspace, const QString &workspaceUrl, const QString &opOutputStr, const QString &destOpIdPath) const |
DataExecution::Operation * | addExternalWorkspace (DataExecution::Workspace &rootWorkspace, const QString &workspaceUrl, const QString &opOutputStr, DataExecution::Operation &destOp, const QString &destOpInputStr, const SceneItemType *itemType) const |
DataExecution::Operation * | addOperation (DataExecution::Workspace &rootWorkspace, const QString &pluginStr, const QString &opStr, const QString &opOutputStr, const QString &destOpIdPath) const |
Static Protected Member Functions | |
static bool | addConnection (DataExecution::Operation &sourceOp, const QString &sourceOutputStr, DataExecution::Operation &destOp, const QString &destInputStr) |
static bool | connectMeshModelSource (DataExecution::Operation &op, const QString &opInputName, DataExecution::Operation &meshInstanceOp) |
static DataExecution::Operation * | findOperationWithGlobalName (DataExecution::Workspace &parent, const QString &globalName) |
static QPointF | getOperationPosition (DataExecution::Operation &op) |
static DataExecution::Output * | traceBackToRealOperationOutput (DataExecution::InputScalar *input) |
Some items in the scene interaction tree may have a 1:1 relationship with an actual scene item. For example a camera 'node' in the tree may represent the concept of a Camera output and the CameraBuilder that creates it. However some items are more complex such as a mesh. A mesh node in the tree may actually represent the MeshModelSourceAndProxy as well as the MeshReader and perhaps even a SurfaceSpecifier. The user interacting with the tree doesn't need to be concerned with all the parts (Operations and Connections) that make up this concept of a mesh.
using SceneInteractionWidgetItemList = QVector<SceneInteractionWidgetItem*> |
enum Category |
enum Flags |
|
virtualdefault |
|
protecteddefault |
|
staticprotected |
Helper function to be used by derived classes to add a new connection between operations.
sourceOp | The source operation for the connection. |
sourceOutputStr | The name of the output on the source operation. |
destOp | The destination operation for the connection. |
destInputStr | The name of the input on the destination operation. |
|
protected |
Helper function to be used by derived classes to add a new external workspace operation.
rootWorkspace | Root workspace of the hierarchy. |
workspaceUrl | The workspace URL of the new external workspace we're adding. |
opOutputStr | The id path of the output of the new operation we're connecting. |
destOpIdPath | The id path of the existing operation we're connecting the new operation to. |
|
protected |
Helper function to be used by derived classes to add a new external workspace operation.
rootWorkspace | Root workspace of the hierarchy. |
workspaceUrl | The workspace URL of the new external workspace we're adding. |
opOutputStr | The id path of the output of the new operation we're connecting. |
destOp | The existing operation we're connecting the new operation to. |
destOpInputStr | The input name of the dest Operation we're connecting the new operation to. |
itemType | The itemtype of the existing operation or the downstream operation that we know. |
|
protected |
Helper function to be used by derived classes to add a new operation.
rootWorkspace | Root workspace of the hierarchy. |
pluginStr | The name of the plug-in that contains the new operation. |
opStr | The operation's name in the plug-ins operation catalog. |
opOutputStr | The id path of the output of the new operation we're connecting. |
destOpIdPath | The id path of the existing operation we're connecting the new operation to. |
|
virtual |
Reimplemented in MeshModelItemType.
|
pure virtual |
Adds this type to an existing scene, without requiring any user input. Depending on the type of SceneItem being created, all of the necessary inputs may not have been set on the operation, so it is up to the caller to assign values to these inputs before the returned operation is used.
root | Root workspace of the hierarchy. |
sceneIdPath | Workspace id path of the transform parent this type should be added to. |
Implemented in AmbientLightItemType, AxesOverlayItemType, AxisModelItemType, AxisScaleItemType, BlinnPhongShaderItemType, CameraItemType, ClipPlaneItemType, ClipPlaneItemTypeDeprecated, ColorStateShaderItemType, ControlPointMeshItemType, DirectionalLightItemType, DynamicMeshModelItemType, ElementColoringShaderItemType, ElementToNodeColoringShaderItemType, GridScaleItemType, ImageOverlayItemType, LambertShaderItemType, MeshModelInstanceItemType, MeshModelItemType, MeshModelSequenceItemType, MultiModelNodeColoringShaderItemType, MultiModelNodeColoringShaderPreprocessItemType, NodeColoringShader2ItemType, NodeColoringShaderItemType, PointLightItemType, RadialGridItemType, RodGlypherItemType, SceneRootItemType, SphereGlypherItemType, SpotLightItemType, StreakGlypherItemType, SuperQuadGlypherItemType, TextOverlayItemType, Texture2dItemType, TransformItemType, and VectorGlypherItemType.
|
virtual |
inputName | The name of the input. |
The base implementation returns false (ie. keep scalar input connect one child)
Reimplemented in MultiModelNodeColoringShaderPreprocessItemType.
|
staticprotected |
op | The op you want the MeshModelSource connected to. |
opInputName | The name of the InputScalar on the operation you want the MeshModelSource connected to. |
meshInstanceOp | The MeshModelInstance operation corresponding to the source |
Helper function that, given a MeshModelInterface operation, will connect the corresponding operation that outputs the MeshModelInterface
The scene editor assumes the operation that outputs the MeshModelInterface also has an output call "Mesh" allowing it to get the source. This is the case for meshmodel.xml, meshmodelsequence.xml and meshmodelpassthrough.xml which is what the scene editor, or any workflow using the scene interaction widget, should be using.
|
virtual |
|
virtual |
|
staticprotected |
Helper function to find an operation from it's global name and parent.
|
virtual |
The base implementation returns UserCanAdd | UserCanRemove | UserCanFocus.
Reimplemented in AxesOverlayItemType, BlinnPhongShaderItemType, ClipPlaneItemTypeDeprecated, ColorStateShaderItemType, DynamicMeshModelItemType, ElementColoringShaderItemType, ElementToNodeColoringShaderItemType, ImageOverlayItemType, LambertShaderItemType, MeshModelInstanceItemType, MeshModelItemType, MeshModelSequenceItemType, MultiModelNodeColoringShaderItemType, MultiModelNodeColoringShaderPreprocessItemType, NodeColoringShader2ItemType, NodeColoringShaderItemType, RodGlypherItemType, SceneRootItemType, SphereGlypherItemType, StreakGlypherItemType, SuperQuadGlypherItemType, TextOverlayItemType, Texture2dItemType, and VectorGlypherItemType.
|
pure virtual |
Implemented in AmbientLightItemType, AxesOverlayItemType, AxisModelItemType, AxisScaleItemType, BlinnPhongShaderItemType, CameraItemType, ClipPlaneItemType, ClipPlaneItemTypeDeprecated, ColorStateShaderItemType, ControlPointMeshItemType, DirectionalLightItemType, DynamicMeshModelItemType, ElementColoringShaderItemType, ElementToNodeColoringShaderItemType, GridScaleItemType, ImageOverlayItemType, LambertShaderItemType, MeshModelInstanceItemType, MeshModelItemType, MeshModelSequenceItemType, MultiModelNodeColoringShaderItemType, MultiModelNodeColoringShaderPreprocessItemType, NodeColoringShader2ItemType, NodeColoringShaderItemType, PointLightItemType, RadialGridItemType, RodGlypherItemType, SceneRootItemType, SphereGlypherItemType, SpotLightItemType, StreakGlypherItemType, SuperQuadGlypherItemType, TextOverlayItemType, Texture2dItemType, TransformItemType, and VectorGlypherItemType.
|
virtual |
Return the input for the given inputName. Derived classes may need to return an Input not on the primary operation
Reimplemented in MultiModelNodeColoringShaderPreprocessItemType.
|
virtual |
category | The category to get the input for or AllCategories to return the input names of all supported categories names. |
The base implementation returns an empty QStringList (ie. does not support any item types as inputs.)
Reimplemented in BlinnPhongShaderItemType, ControlPointMeshItemType, LambertShaderItemType, MeshModelInstanceItemType, MultiModelNodeColoringShaderPreprocessItemType, SceneRootItemType, and TransformItemType.
|
inlinevirtual |
Reimplemented in AmbientLightItemType, AxesOverlayItemType, AxisModelItemType, AxisScaleItemType, BlinnPhongShaderItemType, ClipPlaneItemType, ClipPlaneItemTypeDeprecated, ColorStateShaderItemType, ControlPointMeshItemType, DirectionalLightItemType, DynamicMeshModelItemType, ElementColoringShaderItemType, ElementToNodeColoringShaderItemType, GridScaleItemType, ImageOverlayItemType, LambertShaderItemType, MeshModelItemType, MeshModelSequenceItemType, MultiModelNodeColoringShaderItemType, MultiModelNodeColoringShaderPreprocessItemType, NodeColoringShader2ItemType, NodeColoringShaderItemType, PointLightItemType, RadialGridItemType, RodGlypherItemType, SphereGlypherItemType, SpotLightItemType, StreakGlypherItemType, SuperQuadGlypherItemType, TextOverlayItemType, Texture2dItemType, and VectorGlypherItemType.
|
pure virtual |
Implemented in AmbientLightItemType, AxesOverlayItemType, AxisModelItemType, AxisScaleItemType, BlinnPhongShaderItemType, CameraItemType, ClipPlaneItemType, ClipPlaneItemTypeDeprecated, ColorStateShaderItemType, ControlPointMeshItemType, DirectionalLightItemType, DynamicMeshModelItemType, ElementColoringShaderItemType, ElementToNodeColoringShaderItemType, GridScaleItemType, ImageOverlayItemType, LambertShaderItemType, MeshModelInstanceItemType, MeshModelItemType, MeshModelSequenceItemType, MultiModelNodeColoringShaderItemType, MultiModelNodeColoringShaderPreprocessItemType, NodeColoringShader2ItemType, NodeColoringShaderItemType, PointLightItemType, RadialGridItemType, RodGlypherItemType, SceneRootItemType, SphereGlypherItemType, SpotLightItemType, StreakGlypherItemType, SuperQuadGlypherItemType, TextOverlayItemType, Texture2dItemType, TransformItemType, and VectorGlypherItemType.
|
pure virtual |
Implemented in AmbientLightItemType, AxesOverlayItemType, AxisModelItemType, AxisScaleItemType, BlinnPhongShaderItemType, CameraItemType, ClipPlaneItemType, ClipPlaneItemTypeDeprecated, ColorStateShaderItemType, ControlPointMeshItemType, DirectionalLightItemType, DynamicMeshModelItemType, ElementColoringShaderItemType, ElementToNodeColoringShaderItemType, GridScaleItemType, ImageOverlayItemType, LambertShaderItemType, MeshModelInstanceItemType, MeshModelItemType, MeshModelSequenceItemType, MultiModelNodeColoringShaderItemType, MultiModelNodeColoringShaderPreprocessItemType, NodeColoringShader2ItemType, NodeColoringShaderItemType, PointLightItemType, RadialGridItemType, RodGlypherItemType, SceneRootItemType, SphereGlypherItemType, SpotLightItemType, StreakGlypherItemType, SuperQuadGlypherItemType, TextOverlayItemType, Texture2dItemType, TransformItemType, and VectorGlypherItemType.
|
staticprotected |
Helper function to get the bounding box of an operation on the workspace canvas.
|
virtual |
The scene interaction code uses the category returned by this function when calling getInputNameForType() to determine if some exising item accepts this item as an input.
Clients may return other types of their own as long as they don't clash with the names of the above types. If this is done it is expected that a client has also defined one or more types that return a valid input when the new type is passed to getInputNameForType().
The base implementation returns SceneItem.
Reimplemented in AxesOverlayItemType, BlinnPhongShaderItemType, ColorStateShaderItemType, DynamicMeshModelItemType, ElementColoringShaderItemType, ElementToNodeColoringShaderItemType, ImageOverlayItemType, LambertShaderItemType, MeshModelItemType, MeshModelSequenceItemType, MultiModelNodeColoringShaderItemType, MultiModelNodeColoringShaderPreprocessItemType, NodeColoringShader2ItemType, NodeColoringShaderItemType, RodGlypherItemType, SceneRootItemType, SphereGlypherItemType, StreakGlypherItemType, SuperQuadGlypherItemType, TextOverlayItemType, Texture2dItemType, and VectorGlypherItemType.
|
pure virtual |
Implemented in AmbientLightItemType, AxesOverlayItemType, AxisModelItemType, AxisScaleItemType, BlinnPhongShaderItemType, CameraItemType, ClipPlaneItemType, ClipPlaneItemTypeDeprecated, ColorStateShaderItemType, ControlPointMeshItemType, DirectionalLightItemType, DynamicMeshModelItemType, ElementColoringShaderItemType, ElementToNodeColoringShaderItemType, GridScaleItemType, ImageOverlayItemType, LambertShaderItemType, MeshModelInstanceItemType, MeshModelItemType, MeshModelSequenceItemType, MultiModelNodeColoringShaderItemType, MultiModelNodeColoringShaderPreprocessItemType, NodeColoringShader2ItemType, NodeColoringShaderItemType, PointLightItemType, RadialGridItemType, RodGlypherItemType, SceneRootItemType, SphereGlypherItemType, SpotLightItemType, StreakGlypherItemType, SuperQuadGlypherItemType, TextOverlayItemType, Texture2dItemType, TransformItemType, and VectorGlypherItemType.
|
virtual |
Return a string to display as a tooltip when the item is not available to add to the scene tree. This will appear in the context menu, when hovering over an entry. This can provide the user some useful information as to why the entry is greyed-out.
|
virtual |
Allows the user to inform the caller that this item is valid to be placed under currentlySelectedItem
For example, a user may want their derived SceneItemType to only be addable under a Transform if that Transform is under a specific scene tree item.
currentlySelectedItem | The item that is currently selected in the scene tree. See also SceneInteractionWidgetItem::acceptsItemTypeAsChild. |
|
virtual |
The label of this item changed
root | Root workspace of the hierarchy. |
sceneIdPath | Workspace id path of the item we want to update. |
Reimplemented in CameraItemType.
|
virtual |
root | Root workspace of the hierarchy. |
sceneIdPath | Workspace id path of the transform parent this type should be added to. |
Adds this type to an existing scene, prompting the user for any inputs it cannot automatically determine. Operations returned by this function are guaranteed to be ready to use after the function has returned.
Most subclasses will not need to override this function - its default implementation simply invokes addToScene. Only those operations that require user input in the form of dialogs will need to override this function.
E.g. Adding a MeshModel to a scene can be done in code using the addToScene function, but adding a MeshModel to a scene via the SceneInteractionWidget requires some user input for the fileName and fileType. This can be done with dialogs created in the version of this function overridden in a subclass.
Reimplemented in MeshModelItemType, MeshModelSequenceItemType, and Texture2dItemType.
|
virtual |
Remove this type from an existing scene.
root | Root workspace of the hierarchy. |
sceneIdPath | Workspace id path of the item that should be removed. |
Reimplemented in MeshModelInstanceItemType.
|
static |
Helper function to move a newly added operation to a nice offset from an existing operation it's connected to.
For now we just look at each operation that is connected as an input to the operation we're connecting to. We then select the lowest of these and offset ourselves from there.
|
virtual |
Called when the workflow under
typeJustAddedToWorkflow | The type that has just been added |
primaryOperationJustAdded | The operation that was just added as a result of adding typeJustAddedToWorkflow scene item |
rootWorkspace | The root workspace |
parentIdPath | The id path of the (primary) operation that represents typeJustAddedToWorkflow |
|
virtual |
|
inlinestatic |
Helper function to set the value of an operation input
|
staticprotected |
Helper function the finds the input connected to a source. It traces back up WorkspaceInputs to find the real output, not just the output of the first WorkspaceInput.