![]() |
Workspace 7.0.2
|
All workspace operations must derive from this class. More...
#include <Workspace/DataExecution/Operations/operation.h>
Classes | |
struct | IOBaseAccessor |
struct | IOBaseAccessor< Input, IsConst > |
struct | IOBaseAccessor< Output, IsConst > |
class | IOBaseIteratorRange |
begin/end range for Input/Output iterators. Needed because Operations supply a range of both inputs and outputs. More... | |
Public Types | |
enum | ConfigStatus { GoodConfig = 0x00 , UnknownConfig = 0x01 , InvalidConfig = 0x02 } |
using | difference_type = ptrdiff_t |
enum | GraphicsSize { Default = 100 , Small = 65 } |
Options for the graphical size of an operation, able to be changed by derived classes. Values are percentages. More... | |
enum | IndexCountingOption { SkipNone = 0x0 , SkipInvisible = 0x1 , SkipDependencies = 0x2 } |
using | size_type = size_t |
Public Member Functions | |
~Operation () override | |
bool | addInput (Input &input, bool modifiedInPlace=false) |
bool | addOutput (Output &output) |
template<typename T > | |
bool | assignInput (const QString &inputName, const T &value) |
bool | canSerialize () const override |
bool | connectProgressEvents (QProgressBar *progressBar) |
virtual Presentation::CustomOperationProperties * | createCustomPropertiesHandler () |
virtual void | ensureHasData () |
bool | getBroadcastUpdateEvents () const |
QColor | getColor () const |
virtual QString | getDefaultIconPath () const |
QString | getDefaultUiPath () const |
QString | getDeprecationMessage () const |
const QString & | getDescription () const |
SerializedItem | getExtras () |
const OperationFactory & | getFactory () const |
Operation * | getFromPath (const QString &path, Workspace &relativeTo, QStringList &errors) const override |
virtual GraphicsSize | getGraphicsSize () const |
virtual QString | getHelpPage () const |
QString | getIconPath () const |
const QUuid & | getId () const |
QString | getIdPath (bool scoped=true) const override |
QString | getIdPath (const Workspace &relativeTo) const |
difference_type | getIndex (const Input &input, IndexCountingOptions options=SkipNone) const |
difference_type | getIndex (const Output &output, IndexCountingOptions options=SkipNone) const |
void | getIndexPair (InputScalar &input, difference_type &mainIndex, difference_type &arrayIndex) |
Input * | getInput (const QString &name) |
const Input * | getInput (const QString &name) const |
Input * | getInput (size_type index) |
const Input * | getInput (size_type index) const |
InputArray * | getInputArray (const QString &name) |
const InputArray * | getInputArray (const QString &name) const |
IOBaseIteratorRange< Input, false > | getInputs () |
IOBaseIteratorRange< Input, true > | getInputs () const |
InputScalar * | getInputScalar (const QString &name) |
const InputScalar * | getInputScalar (const QString &name) const |
template<typename T > | |
T & | getInputValue (const QString &inputName) |
template<typename T > | |
const T & | getInputValue (const QString &inputName) const |
const QString & | getLabel () const |
QString | getLabelRelativeToRoot () const |
Output * | getOutput (const QString &name) |
const Output * | getOutput (const QString &name) const |
Output * | getOutput (size_type index) |
const Output * | getOutput (size_type index) const |
IOBaseIteratorRange< Output, false > | getOutputs () |
IOBaseIteratorRange< Output, true > | getOutputs () const |
template<typename T > | |
T & | getOutputValue (const QString &outputName) |
template<typename T > | |
const T & | getOutputValue (const QString &outputName) const |
bool | getProfilingEnabled () const |
int | getProgress () const |
int | getProgressContribution () const |
bool | getProgressResetByNotUpToDate () const |
virtual SchedulerFeatures | getRequiredSchedulerFeatures () const |
InputScalar * | getScalarInput (size_type mainIndex, difference_type arrayIndex) |
QString | getShortLabel () const |
QString | getTagName () const |
bool | getTerminateExecution () const |
QString | getUiPath () const |
bool | getUpToDate () const override |
virtual bool | hasRequiredSchedulerFeatures () const |
void | idPathChanged () override |
virtual bool | inputRebuilt (InputScalar &input) |
virtual bool | isAsynchronous () const |
virtual bool | isAtomicUpdate () const |
bool | isConnectedToAsynchronous () const override |
bool | isDeprecated () const |
bool | isEditable () const |
bool | isIdPathCachingEnabled () const |
virtual bool | isPolymorphicType () const |
virtual bool | isRunningAsynchronously () const |
virtual bool | isThreadSafe () const |
template<typename T > | |
bool | isType () const |
bool | isType (const OperationFactory &type) const |
bool | isUpdating () const |
virtual bool | isUserConfigurable () |
bool | isUsingDefaultColor () const |
bool | isUsingDefaultIconPath () const |
bool | isUsingDefaultUiPath () const |
bool | isWaitingForAsynchronousUpdate () const override |
bool | isWorkspaceType () const |
bool | load (const SerializedItem &item) override |
void | markUpToDateWhereSafe () |
bool | matchesType (const Operation &otherOperation) const |
size_type | numInputs (IndexCountingOptions=SkipNone) const |
size_type | numOutputs (IndexCountingOptions=SkipNone) const |
bool | removeInput (const QString &name) |
bool | removeInput (Input &input) |
bool | removeOutput (const QString &name) |
bool | removeOutput (Output &output) |
virtual void | resetExecutionDependencies () |
bool | save (SerializedItem &item) const override |
virtual bool | saveWithData (SerializedItem &item) const |
virtual void | setAtomicUpdate (bool atomic) |
void | setBroadcastUpdateEvents (bool enable) |
void | setColor (const QColor &c) |
void | setDescription (const QString &description) |
void | setEditable (bool b) |
void | setIconPath (const QString &path) |
void | setId (const QUuid &id) |
virtual void | setIdPathCachingEnabled (bool b) |
virtual void | setInputNotUpToDate (InputScalar &input) |
virtual void | setIsAsynchronous (bool asynchronous) |
virtual void | setIsRunningAsynchronously (bool asynchronous) |
void | setLabel (const QString &label) |
virtual void | setOutputNotUpToDate (Output &output) |
void | setProfilingEnabled (bool enable) |
virtual void | setProgress (int percent) |
void | setProgressContribution (int percent) |
void | setProgressResetByNotUpToDate (bool b) |
virtual void | setRequiredSchedulerFeatures (const SchedulerFeatures &) |
void | setTerminateExecution (bool b) |
void | setUiPath (const QString &path) |
void | setUpToDate (bool b) override |
bool | update (Updater *updater=nullptr) override |
![]() | |
~WorkspaceElement () override | |
const Workspace * | getWorkspace () const override |
Workspace * | getWorkspace () override |
virtual void | workspaceChanged (Workspace *oldWorkspace) |
![]() | |
~Updatable () override | |
virtual bool | comesFromExternal () const |
QString | getEnclosingScope () const |
virtual Updatable * | getFromPath (const QString &path, Workspace &relativeTo, QStringList &errors) const =0 |
const QString & | getGlobalName () const |
virtual QString | getIdPath (bool scoped=true) const =0 |
virtual Workspace * | getRootWorkspace () |
virtual const Workspace * | getRootWorkspace () const |
QString | getScopedGlobalName () const |
virtual bool | getUpToDate () const =0 |
virtual const Workspace * | getWorkspace () const =0 |
virtual Workspace * | getWorkspace ()=0 |
virtual void | idPathChanged () |
virtual bool | isConnectedToAsynchronous () const =0 |
virtual bool | isWaitingForAsynchronousUpdate () const =0 |
void | setGlobalName (const QString &name) |
virtual void | setUpToDate (bool b)=0 |
virtual bool | update (Updater *updater=nullptr)=0 |
![]() | |
virtual | ~Observable () |
void | attachObserver (Observer &observer) |
void | destroy () |
void | detachObserver (Observer &observer) |
void | notifyEvent (const ObservableEvent &event) |
![]() | |
virtual | ~Serialize ()=default |
virtual bool | canSerialize () const =0 |
virtual bool | load (const SerializedItem &item)=0 |
virtual bool | save (SerializedItem &item) const =0 |
![]() | |
TextLogger () | |
TextLogger (const DataExecution::IOBase &io) | |
TextLogger (const DataExecution::Operation &operation) | |
TextLogger (const TextLogger &logger) | |
TextLogger (TextLogger &&logger) | |
virtual | ~TextLogger () |
void | logLine (const Application::LogManager::MessageCategory &category, const QString &msg) const |
void | logLine (const QString &msg) const |
void | logText (const Application::LogManager::MessageCategory &category, const QString &msg) const |
void | logText (const QString &msg) const |
TextLogger & | operator= (TextLogger) |
Protected Member Functions | |
Operation (const OperationFactory &factory, const QString &label) | |
bool | bringArrayOfInputsUpToDate (Input *&array, size_type arraySize) |
bool | bringArrayOfInputsUpToDate (std::vector< Input * > &array) |
virtual bool | bringInputsUpToDate () |
bool | bringInputUpToDate (Input &input) |
virtual void | cancelExecution (bool b) |
virtual bool | execute ()=0 |
virtual bool | finishInputsOutputsAfterLoad (const SerializedItem &item) |
Updater * | getCurrentUpdater () |
virtual const Input * | getRenamedInput (const QString &name) const |
virtual const Output * | getRenamedOutput (const QString &name) const |
virtual bool | inputsAreUpToDate () const |
virtual bool | makeOutputsValid () |
virtual void | markOutputsUpToDate () |
void | pauseUpdate () |
virtual bool | postSave (SerializedItem &item) const |
virtual bool | prepareInputsOutputsForLoad (const SerializedItem &item) |
void | saveExtras (SerializedItem &item) const |
virtual bool | shouldPutInExtras (const QString &tagName) const |
![]() | |
WorkspaceElement () | |
![]() | |
Updatable () | |
Updatable (const Updatable &up) | |
void | notifyUpdated () |
Updatable & | operator= (const Updatable &up) |
![]() | |
Observable () | |
Observable (const Observable &) | |
Additional Inherited Members | |
![]() | |
static InputScalar * | findInputScalarGlobalName (const QString &scopedGlobalName, Workspace &relativeTo) |
static IOBase * | findIOBaseGlobalName (const QString &scopedGlobalName, Workspace &relativeTo) |
static Operation * | findOperationGlobalName (const QString &scopedGlobalName, Workspace &relativeTo) |
Subclasses must, at a minimum, override the execute() function. They will usually set up their inputs and outputs in their constructor and not add or remove any more thereafter.
For many operations, this is all that is needed. The serialization of the operation and all its inputs is fully automated, and handling the up-to-date status dependencies between inputs and outputs is also implemented by the Operation class. Therefore, subclasses should just be able to concentrate on implementing the specific functionality it provides.
Over time, it is possible that subclass implementors may wish to rename an input or an output. This can be done in a backwards compatible way by implementing the getRenamedInput() and getRenamedOutput() functions.
using difference_type = ptrdiff_t |
using size_type = size_t |
enum ConfigStatus |
enum GraphicsSize |
enum IndexCountingOption |
|
override |
Clean up private implementation.
|
protected |
factory | The operation factory responsible for creating and destroying operations of this type. |
label | The label for this operation. Labels can be changed with the setLabel function, but operations should always be created with a default label. |
Operations should generally add all their inputs and outputs in their constructors. Implementers of Operation subclasses should think of inputs and outputs as static properties of an operation. Only special kinds of operations would generally add or remove inputs or outputs dynamically (such as a workspace operation).
The label of an operation is only informational. There is no requirement that a label be unique, nor is it used for anything other than user information. A typical use of an operation's label is to display it in the GUI view of a workspace.
bool addInput | ( | Input & | input, |
bool | modifiedInPlace = false |
||
) |
input | The input to add to the operation. |
modifiedInPlace | If the operation will modify the data held by this input, then modifiedInPlace must be set to true. This allows the operation to ensure that when the operation is marked as no longer up to date, the input is also marked not up to date. This ensures that the data on the input is provided by its source again. For most inputs, modifiedInPlace will be false. Only if the input can be modified directly should this parameter be set to true or else unnecessary workspace updates will be triggered and potentially slow down performance. |
Note that the Operation does not take ownership of input, since the caller will almost certainly want to retain its own reference to the input object so it can retrieve the input's value when needed. It will, however, associate input with this operation by calling its setOperation function.
Clients would not normally need to call this function directly. The constructors for InputScalar and InputArray already do this for you.
bool addOutput | ( | Output & | output | ) |
output | The output to add to the operation. |
Note that the Operation does not take ownership of output, since the caller will almost certainly want to retain its own reference to the output object so it can set or retrieve the output's value when needed. It will, however, associate output with this operation by calling its setOperation function.
|
inline |
inputName | The name of the scalar input to assign to. |
value | The value to assign to the specified input. The underlying type of value must support the assignment operator or else the code will not compile. |
This is a convenience function. It allows callers to set the value of an operation's input as long as the input's underlying type has an assignment operator. Checks are performed to ensure that the type of the value supplied matches the underlying type of the input. If the input's data object does not have any data at the time of the call, it will have data created by this function. Thus, it does not matter if the input does not yet have data when using this function.
array | An array of (pointers to) inputs to bring up to date. |
arraySize | The number of items in the array |
This function is responsible for bringing all inputs in the specified array up to date. All subclasses which override bringInputsUpToDate() should call this function when they want to update more than one input, since this function may handle automatic multi-threading in a future implementation. For the best performance, as many of the required inputs as possible should be included in a single array rather than making repeated calls to it with smaller arrays.
|
inlineprotected |
|
protectedvirtual |
This function is responsible for first bringing the dependency input up to date, then determining all the inputs required to update the operation's outputs and bring those inputs up to date as well.
The default implementation assumes all inputs need to be brought up to date, but some operations may only require some of the inputs to be up to date in order to calculate the outputs. Indeed, some of the inputs may need to be up to date, their values checked and then some combination of the rest brought up to date. An example where this could be useful is where an operation should behave differently for different iterations of a loop.
Subclasses which choose to override this function should call the other overloaded version of this function as necessary to actually bring the inputs it needs up to date, since it will handle multi-threading in a future implementation. It must update the dependency input first on its own before anything else.
Reimplemented in PlotItemBuilder, MeshModelSource, MeshModelDiskCache, MqttSubscribeLoop, AddToPackageContainer, ScheduleWorkflow, MeshModelInstanceBuilder, CacheData, ConditionalLoop, DecomposeGroup, FileIterator, IteratingWorkspaceBase< Derived, Parallel >, IteratingWorkspaceBase< ConditionalLoop, false >, IteratingWorkspaceBase< FileLoop, true >, IteratingWorkspaceBase< ForLoop, true >, IteratingWorkspaceBase< Derived, false >, IteratingWorkspaceBase< ObjectArrayLoop, false >, IteratingWorkspaceBase< Derived, true >, IteratingWorkspaceBase< TranslateObjectDictionary, true >, IteratingWorkspaceBase< MqttSubscribeLoop, false >, IteratingWorkspaceBase< ZeroMQReplyLoop, false >, IteratingWorkspaceBase< ZeroMQSubscribeLoop, false >, ObjectArrayAccessor, ObjectArrayLoop, ParallelIterationControlOperation< Derived >, ParallelIterationControlOperation< CountedLoop >, RunOperationsInParallel, SelectInput, SetSelectedStringByString, TryInputs, UpdateBarrier, WhileLoop, WorkspaceInput, ZeroMQReplyLoop, ZeroMQSubscribeLoop, and ZmqReplyLoop.
|
protected |
input | A single input to bring up to date. |
Subclasses can call this function if they only need to update a single input but they are better off calling bringArrayOfInputsUpToDate() if more than one input needs updating. Note, however, that bringInputUpToDate() must be called directly or indirectly when an input is updated as part of a call to update(). This is so that update() can ensure that previously updated inputs don't become not up to date while other inputs are being brought up to date. This situation is most commonly observed when widgets are interacting with a workspace while it is running and some input updates are time consuming.
|
protectedvirtual |
b | If true, then execution should be cancelled. If false, the function should reset any internal data from a previous reset. A false parameter must be passed to this function at some point after a cancelled execution so that subclasses have a chance to reset any internal data used to implement the last cancellation. |
It is not compulsory for operations to support a specific cancel event. They can choose to do nothing in this function (which is the default implementation) or they can override this function to take some action to enact the cancellation during execution. If the function does nothing, then the operation will finish any currently running call to update(), but any subsequent calls to update() will fail. This is controlled by the workspace execution system and need not be implemented in subclasses.
If the cancellation might take some time to happen, then something should be done to indicate to the currently running update() and cancelExecution() should then return immediately without waiting for the cancellation to finish. In other words, cancelExecution() should "schedule" the cancellation rather than block waiting for it to happen.
Subclass implementors should note that the call to cancelExecution() is very likely to come from a different thread, so special care needs to be taken to avoid race conditions. It should also be noted that this function may be called when an operation is not actually executing, in which case it should do nothing.
Reimplemented in AnimateDataSeriesChange, IgesReaderOperation, NastranReaderOperation, StlReaderOperation, ScheduleWorkflow, and Workspace.
|
overridevirtual |
bool connectProgressEvents | ( | QProgressBar * | progressBar | ) |
|
virtual |
Reimplemented in CreateChart, CreateChartObjectDictionary, RunMatLabScript, RunPythonScript, SceneItemLibraryBuilder, ShaderLibraryBuilder, CreateObjectDictionary, DecomposeObjectDictionary, FilePathBuilder, ModifyGroup, ModifyObjectDictionary, PolymorphicDataOperation, RunQtScript, FormatString, TreeSelectionBuilder, Workspace, and CustomInputsOutputsOperation.
|
virtual |
This function is for convenience only. Its purpose is to ensure that all the inputs to the operation have valid data objects. This can be useful, for example, just before saving the workspace to which the operation belongs, since it would ensure that values are saved for each input. If there is no valid data object, no value is saved for an input. Subclasses are permitted to override this function if they need to do specialised processing, but this would not normally be necessary. If they do, they must obey the post condition.
Reimplemented in Workspace.
|
protectedpure virtual |
Subclasses need to implement this function to do the actual processing of the operation. Clients should not call this function directly, but should instead call the update() function, since it ensures all inputs are updated first and all outputs have setUpToDate called on each one.
Implemented in ChartToImage, ChartToSvgString, CreateChart, CreateChartObjectDictionary, WriteChartToSvgFile, WriteChartToWebPage, ColorScaleBuilder, ColorToGrayscale, AnimateDataSeriesChange, Array3dInfo, AverageArrayNd, CreateDataSeriesMapFromScript, CreateSqlTableFromCsvFile, CreateTransferFunction2dFromColorSpectrum, DataSeriesBuilder, DataSeriesInfo, FilterArrayNdDimensions, FindArrayNdRange, GetAllArrayNdDimensions, GetArrayNdDimension, GetDataSeriesFromArrayNd, GetDataSeriesValue, GetSqlResultSetColumn, InsertColumnIntoSqlTable, MapDataSeries, NdTo3dArray, ObjectDictionaryLogger, ObjectDictionaryStructure, OpenSqlDatabase, QuerySqlDatabase, ReduceArrayNdWithScript, SliceArrayNd, TransferFunction2dBuilder, WriteSqlResultSetToCsvFile, WriteSqlTableToCsvFile, CsvReader, RawVoxelReader, CsvWriter, CreateGridPlot, Array3dScalarToImage3d, CropImage, GetImage3dSlice, GetImageFromArrayNd, ImageBuilder, ImageComposition, ImageInfo, ImageReader, ImageSequenceToAnimation, ImageToBase64, ImageWriter, ResizeImage, StringToImage, PlotBuilder, PlotImageBuilder, PlotInfo, PlotItemBuilder, PlotRecolor, RunExternalScript, RunMatLabScript, RunRScript, CreateImageTileSet, Hdf5MeshModelReader, Hdf5MeshModelWriter, Hdf5SceneReader, Hdf5SceneWriter, OpenCLDataSeriesSum, OpenCLJuliaSet, QueryOpenCLDevices, AccumulateNodeValues, AddMeshModelState, AppendToModelTimeline, CopyElementState, CopyNodeState, CreateHeightMeshFromArrayNd, CreateMeshModelFromDataSeries, ElementScriptMapperBuilder, ElementStateMapperBuilder, EnsureElementStateExists, EnsureNodeStateExists, Extrude2dMesh, FindStateAverage, FindStateRange, GetModelFromSource, GetModelIdFromSource, GetSourceFromMeshModelLibrary, MapScalarNodeStateToRgbaState, MeshModelInfo, CalculateMultiNodeNormals, CalculateSurfaceArea, CreateMeshModelInterface, EnsureMeshUnorganised, FilterMeshModel, GetMeshNodeStateAsDataSeries, GetMeshNodeStateAsObjectArray, GetMeshNodeStates, LodMeshModel, MeshModelInterfaceInfo, SetMeshModelInterfaceMetaData, SmoothMeshModel, MeshModelLibraryBuilder, MeshModelLibraryInfo, MeshModelSource, MeshModelStateInfo, NodeScriptMapperBuilder, NodeStateHistogram, NodeStateMapperBuilder, NodeTextureMapperBuilder, PointModel, RenameNodeStates, VectorNodeStateMapperBuilder, VectorNodeTextureMapperBuilder, VectorToScalarArray3d, MeshModelDiskCache, AscReader, BinaryMeshModelReader, IgesReaderOperation, NasReader, NastranReaderOperation, ObjReaderOperation, PlyReader, SelectableMeshReader, StlReaderOperation, VtkReaderOperation, BinaryMeshModelWriter, EnsightWriter, NastranWriterOperation, PlyWriterOperation, StlWriter, VtkWriterOperation, BoundingBoxBuilder, BoundingBoxOfModels, BoundingCylinderBuilder, BoundingPlaneBuilder, BoundingSphereBuilder, CreateMeshModelFromCylinder, CreateTruncatedConeMeshModel, InvertTransformMatrix, MeshFromBoundingBox, MeshFromBoundingPlane, MeshFromBoundingSphere, NodeIdCriterionBuilder, NodeIdCriterionFromModel, RegionAsElementCriterion, RegionAsNodeCriterion, RegionIntersectionOperation, RegionNegateOperation, RegionTransformOperation, RegionUnionOperation, SphericalToCartesian, TransformMatrixBuilder, TransformMatrixMultiply, TransformVector, AddNodesToMesh, AddScalarStateToMesh, AddVectorStateToMesh, CenterMeshModel, CreateRgbaState, ExtractRgbaState, InvertNormals, MapElementStatesToNodes, MapNodeStatesToElements, MergeModels, RemoveStatesFromMesh, SplitTriangleFaces, TransformModel, TriangulateMesh, GetBsonItem, GridfsRead, GridfsWrite, MongoDbAggregate, MongoDbInsert, MongoDbInsertMany, MongoDbRead, MongoDbRemove, MongoDbSchedulerSettings, MongoDbUpdate, MongoDbUpdateMany, MqttPublish, MqttSubscribe, AddToPackageContainer, CreateInstaller, GeneratePrePostInstallScripts, PackageDesktopIconItem, PackageDirectoryItem, PackageEnvironmentVariableItem, PackageExecutableItem, PackageFileItem, PackageIconItem, PackageSharedLibraryItem, PackageStaticLibraryItem, PackageThirdParty, PackageWorkspaceDependencies, GetPythonVersion, RunPythonScript, HasFeature, ScheduleWorkflow, StopWorkflow, WaitWorkflow, ObjSceneReader, FindDisplay, WSGLOffscreenRender, RenderImageToScreen, CalculateSceneBoundingBox, CameraBuilder, CreateAnnotation, FitCameraViewToMesh, GetModelsFromScene, GetModelsUnderTransform, GetSceneItemTransform, GetVisibleModelsFromScene, GridScaleBuilder, AxesImageBuilder, CreateCircleImage, AmbientLightBuilder, DirectionalLightBuilder, PointLightBuilder, SpotLightBuilder, CheckerImage2D, ClipRegionBuilder, CreateAxesModel, CreateClipRegion, CreateControlPointMesh, CreateSuperquadricMesh, GenerateProjectiveTextureCoordinates, GetMeshModelInstanceLod, MeshModelInstanceBuilder, NoiseImage2D, ProjectTexture2D, RodGlypherBuilder, SphereGlypherBuilder, SquareGlypherBuilder, StreakGlypherBuilder, StretchToSphereTexture, SuperquadricGlypherBuilder, Texture2DBuilder, Texture3DBuilder, VectorGlypherBuilder, PlotGrid3dBuilder, RadialGridBuilder, RenderViewFrustumToMesh, SceneBuilder, SceneItemInstanceBuilder, SceneItemLibraryBuilder, BillboardImageShaderBuilder, BlinnPhongShaderBuilder, CreateColorStateShader, DepthShaderBuilder, ElementColoringShaderBuilder, LambertShaderBuilder, NodeColoringShaderBuilder, NormalShaderBuilder, OctreeShaderBuilder, ShaderLibraryBuilder, TextureCoordShaderBuilder, TextureProjectionShaderBuilder, VolumeShaderBuilder, SplitAndLodPointCloudOp, TransformBuilder, SshGetFile, SshLogin, SshSendCommand, SshSendFile, CompareTwoGlobalsFiles, CompareTwoWorkflows, CreateWorkspaceContext, MergeThreeWorkflows, MergeWorkflowWithBase, ModifyMergedDifferences, CompileWorkflowHistory, ExtractSVNLog, SummariseWorkflowHistory, WorkflowComparisonAnalyser, WorkflowValidator, Assertion, CacheData, CaptureLogToFile, Compare, ComposeGroup, ConfigureFile, ConfigureNewlines, ConvertFromByteArray, ConvertToByteArray, CreateObjectDictionary, CreateTemporaryFileName, DecomposeGroup, DecomposeObjectDictionary, DeepConvertQVariant, DeleteFromDirectory, GetHostInfo, GetWorkflowFileName, Exists, FileInfo, FileIterator, FilePathBuilder, FileWatcher, FilterObjectDictionary, GenerateUuid, GetCurrentTime, GetEnvironment, GetFile, GetItemFromJson, GetItemFromObjectDictionary, GetWorkspaceLabel, HttpRequest, Incrementer, InitializedVariable, InsertIntoObjectDictionary, IteratingWorkspaceBase< Derived, Parallel >, IteratingWorkspaceBase< ConditionalLoop, false >, IteratingWorkspaceBase< FileLoop, true >, IteratingWorkspaceBase< ForLoop, true >, IteratingWorkspaceBase< Derived, false >, IteratingWorkspaceBase< ObjectArrayLoop, false >, IteratingWorkspaceBase< Derived, true >, IteratingWorkspaceBase< TranslateObjectDictionary, true >, IteratingWorkspaceBase< MqttSubscribeLoop, false >, IteratingWorkspaceBase< ZeroMQReplyLoop, false >, IteratingWorkspaceBase< ZeroMQSubscribeLoop, false >, ListDirectory, LoadDataFromFile, Logical< T, Op, Multi >, MergeObjectDictionaries, ModifyGroup, ModifyObjectDictionary, Multiplier, ObjectArrayAccessor, ObjectArrayBuilder, ObjectArrayInfo, ObjectDictionaryInfo, ObjectDictionaryItemInfo, ParallelIterationControlOperation< Derived >, ParallelIterationControlOperation< CountedLoop >, Pause, PlaceHolder, PlatformInfo, PlaySoundEffect, PluginInfo, PostFile, QtInfo, ReadBinaryFile, ReadJsonFile, ResetDependency, ResolveAbsoluteFilePath, RunOperationsInParallel, RunQtScript, SaveDataToFile, SelectInput, SetWorkingDirectory, SharedInfo, SimpleFileWatcher, ConcatenateStrings, ConvertQStringListToStringSelection, DoubleToString, FileSeriesFormat, FormatString, IntToString, JoinStrings, LogText, ReadFileToString, ReplaceString, ReplaceStrings, SetSelectedStringByIndex, SetSelectedStringByString, StringContains, StringLength, StringListBuilder, StringListItem, StringSelectionBuilder, StringSelectionFilter, StringSelectionInfo, StringToDouble, StringToInt, TextProvider, WriteStringToFile, SystemCommand, Throttle, TimeDifference, TreeSelectionBuilder, TryInputs, UpdateBarrier, Variable, WhileLoop, WorkspaceInput, WorkspaceOutput, WriteByteArrayToFile, Workspace, CreateLocalReporter, CreatePromsReporter, GenerateProvenanceReport, PostFileToDIDS, ReportExternalInput, ReportExternalOutput, ReportInternalResult, StoreProvenanceData, ZmqPing, ZmqPublish, ZmqReplyLoop, ZmqRequest, ZmqRequestMany, ZmqSubscribe, and CustomInputsOutputsOperation.
|
protectedvirtual |
item | The serialized item that will be loaded. |
This function is called just before load() returns (if no errors were encountered during loading). The default implementation simply returns true to indicate that loading completed successfully. Subclasses may override this function to perform any required tasks that must be done after all other loading tasks have completed. Typical uses usually revolve around tasks that rename inputs or outputs, such as setting the data name of data sources or requesters.
Most subclasses will not need to override this function.
Reimplemented in MqttSubscribeLoop, ZeroMQReplyLoop, ZeroMQSubscribeLoop, CreateChart, MeshModelInstanceBuilder, LambertShaderBuilder, RunMatLabScript, FileLoop, ForLoop, IteratingWorkspaceBase< Derived, Parallel >, IteratingWorkspaceBase< ConditionalLoop, false >, IteratingWorkspaceBase< FileLoop, true >, IteratingWorkspaceBase< ForLoop, true >, IteratingWorkspaceBase< Derived, false >, IteratingWorkspaceBase< ObjectArrayLoop, false >, IteratingWorkspaceBase< Derived, true >, IteratingWorkspaceBase< TranslateObjectDictionary, true >, IteratingWorkspaceBase< MqttSubscribeLoop, false >, IteratingWorkspaceBase< ZeroMQReplyLoop, false >, IteratingWorkspaceBase< ZeroMQSubscribeLoop, false >, ObjectArrayLoop, PlaceHolder, RunQtScript, TranslateObjectDictionary, and Workspace.
bool getBroadcastUpdateEvents | ( | ) | const |
QColor getColor | ( | ) | const |
|
protected |
|
virtual |
It is not required that getDefaultIconPath() always returns the same value. In fact, it can be a useful way of showing visual differences based on some property of the operation. For example, the Workspace class overrides this function and provides two different icons; one for regular workspaces and different icon for when the workspace comes from an external source.
Reimplemented in OpenCLJuliaSet, QueryOpenCLDevices, MqttSubscribeLoop, CreateColorStateShader, SshGetFile, SshLogin, SshSendCommand, SshSendFile, ConditionalLoop, FileLoop, ForLoop, ObjectArrayLoop, TranslateObjectDictionary, Workspace, ZeroMQReplyLoop, and ZeroMQSubscribeLoop.
QString getDefaultUiPath | ( | ) | const |
QString getDeprecationMessage | ( | ) | const |
const QString & getDescription | ( | ) | const |
SerializedItem getExtras | ( | ) |
Typically, the extra state information would include things like the operation's position and size in a workspace window when used in a graphical environment. How this information is used is up to the subclass and/or clients.
Even though the return value is by value, not by reference, any changes made to the return value directly affect the data held within the operation. This is because SerializedItem acts as a handle to the real data (somewhat like a pointer) rather than holding the data itself.
const OperationFactory & getFactory | ( | ) | const |
|
overridevirtual |
path | The global path for which an updatable object should be found. |
relativeTo | The workspace where the search for path should begin. If path is relative, then it will be treated as relative to relativeTo. |
errors | Upon exit, this will hold any errors encountered when trying to find an updatable object that matches path. |
Implements Updatable.
|
virtual |
Returns the size of the operation as it is meant to be drawn on the canvas.
Reimplemented in Incrementer, and Logical< T, Op, Multi >.
|
virtual |
\page helpmyoperation MyOperation
In this case, getHelpPage() should return the string "helpmyoperation".
Reimplemented in VtkReaderOperation, CacheData, ComposeGroup, CountedLoop, DecomposeGroup, GetEnvironment, ModifyGroup, ObjectArrayBuilder, PlaceHolder, RunQtScript, UpdateBarrier, WorkspaceInput, and WorkspaceOutput.
QString getIconPath | ( | ) | const |
const QUuid & getId | ( | ) | const |
|
overridevirtual |
scoped | If true then return full scope of the item. If false, only return identifier local to its workflow. |
Implements Updatable.
QString getIdPath | ( | const Workspace & | relativeTo | ) | const |
Operation::difference_type getIndex | ( | const Input & | input, |
IndexCountingOptions | options = SkipNone |
||
) | const |
input | The input to find. |
options | Index counting options |
Operation::difference_type getIndex | ( | const Output & | output, |
IndexCountingOptions | options = SkipNone |
||
) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
void getIndexPair | ( | InputScalar & | input, |
difference_type & | mainIndex, | ||
difference_type & | arrayIndex | ||
) |
input | The input whose indices are required |
mainIndex | Upon exit, this will hold the main index of the input. If input is a regular input, the main index is the result of getIndex(input). If instead input is an element of an array input, the main index is the index of the array input, not of input. |
arrayIndex | Upon exit, if input is an element of an array input, arrayIndex will hold the index of input within that array input. If arrayIndex is negative upon exit, this indicates that input is not an element of an array input. |
Input * getInput | ( | const QString & | name | ) |
name | The name of the input to retrieve. |
This version is safer than the indexed version, but it is slower since it checks for the existence of name. Most clients will, however, generally use the named version unless iterating over the whole list of inputs.
If name is not found in the list of the operation's inputs, then this function calls getRenamedInput(). This allows subclass implementors to rename inputs and still maintain backwards compatibility. Note, however, that this also means that the input returned from getInput() could have a name different to the one passed as its parameter.
const Input * getInput | ( | const QString & | name | ) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
index | The index of the input to retrieve. |
This function would generally only be used by connection objects to update an input. Most clients should call the const version of this function, which will return a non-modifiable reference to the input. Except for connections, no object should try to modify an input.
index | The index of the input to retrieve. |
InputArray * getInputArray | ( | const QString & | name | ) |
name | The name of the array input to retrieve. |
This function is essentially just a wrapper around getInput to make type safety easier to handle.
const InputArray * getInputArray | ( | const QString & | name | ) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Operation::IOBaseIteratorRange< Input, false > getInputs | ( | ) |
Operation::IOBaseIteratorRange< Input, true > getInputs | ( | ) | const |
InputScalar * getInputScalar | ( | const QString & | name | ) |
name | The name of the scalar input to retrieve. |
This function is essentially just a wrapper around getInput to make type safety easier to handle.
const InputScalar * getInputScalar | ( | const QString & | name | ) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
inputName | The name of the scalar input from which we are retrieving a value. |
This is a convenience function. It allows callers to retrieve the raw data value assigned to a named input. Checks are performed to ensure that the type requested matches the type of the input. If no data exists on the input at the time this function is invoked, it will create the data.
|
inline |
inputName | The name of the scalar input from which we are retrieving a value. |
This is a convenience function. It allows callers to retrieve the raw data value assigned to a named input. Checks are performed to ensure that the type requested matches the type of the input. If no data exists on the input at the time this function is invoked, it will create the data.
const QString & getLabel | ( | ) | const |
QString getLabelRelativeToRoot | ( | ) | const |
Output * getOutput | ( | const QString & | name | ) |
name | The name of the output to retrieve. |
This version is safer than the indexed version, but it is slower since it checks for the existence of name. Most clients will, however, generally use the named version unless iterating over the whole list of outputs.
If name is not found in the list of the operation's outputs, then this function calls getRenamedOutput(). This allows subclass implementors to rename outputs and still maintain backwards compatibility. Note, however, that this also means that the output returned from getOutput() could have a name different to the one passed as its parameter.
const Output * getOutput | ( | const QString & | name | ) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
index | The index of the output to retrieve. |
index | The index of the output to retrieve. |
Operation::IOBaseIteratorRange< Output, false > getOutputs | ( | ) |
Operation::IOBaseIteratorRange< Output, true > getOutputs | ( | ) | const |
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
outputName | The name of the output from which we are retrieving a value. |
This is a convenience function. It allows callers to retrieve the raw data value assigned to a named output. Checks are performed to ensure that the type requested matches the type of the output. If no data exists on the output at the time this function is invoked, zero will be returned.
|
inline |
outputName | The name of the output from which we are retrieving a value. |
This is a convenience function. It allows callers to retrieve the raw data value assigned to a named output. Checks are performed to ensure that the type requested matches the type of the output. If no data exists on the output at the time this function is invoked, zero will be returned.
bool getProfilingEnabled | ( | ) | const |
int getProgress | ( | ) | const |
int getProgressContribution | ( | ) | const |
bool getProgressResetByNotUpToDate | ( | ) | const |
|
protectedvirtual |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Reimplemented in CreateImageTileSet, Hdf5MeshModelWriter, Hdf5SceneWriter, FindStateRange, PlyReader, BoundingBoxOfModels, ScheduleWorkflow, WaitWorkflow, SplitAndLodPointCloudOp, ModifyObjectDictionary, ObjectDictionaryInfo, and WhileLoop.
|
protectedvirtual |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Reimplemented in ElementStateMapperBuilder, SelectableMeshReader, HasFeature, ModifyObjectDictionary, and WhileLoop.
|
virtual |
Reimplemented in Workspace.
InputScalar * getScalarInput | ( | size_type | mainIndex, |
difference_type | arrayIndex | ||
) |
mainIndex | The main index of the input to retrieve. If the input at this index is a scalar input, then arrayIndex must be negative (this is only checked by an assertion, so in non-debug builds this won't be checked). If the input at mainIndex is an array input, then arrayIndex must have a non-negative value. |
arrayIndex | If mainIndex refers to an array input, then arrayIndex specifies the index within the input array of the scalar input to be retrieved. Otherwise, the value of arrayIndex can be arbitrary. |
QString getShortLabel | ( | ) | const |
QString getTagName | ( | ) | const |
bool getTerminateExecution | ( | ) | const |
See setTerminateExecution() for details regarding when such a request might be active and how clients should use execution termination functions.
QString getUiPath | ( | ) | const |
|
overridevirtual |
Implements Updatable.
|
virtual |
Returns true if the operation has required scheduler features.
|
overridevirtual |
|
virtual |
input | The input for which the connection was rebuilt. |
Normally, an operation doesn't need to do anything when a connection is rebuilt. The input's underlying data object may have changed, but operations generally don't cache it and only retrieve it inside its execute() function. If, however, the input is also being passed directly through as an output for the operation, as would be common for an operation which modifies its input directly and passes the modified version on as an output, the operation needs to make sure the ouput is marked as no longer up to date and is therefore itself no longer up to date.
|
protectedvirtual |
Reimplemented in ScheduleWorkflow, and RunOperationsInParallel.
|
virtual |
Reimplemented in Workspace.
|
virtual |
When an atomic operation has one of it's inputs or one of its outputs that are using 'in place data' marked out of date, then all outputs are marked out of date. When this happens the operation needs to be executed to guarantee each output is back up to date.
For a normal operation with a single execute function or a nested workspace providing some sort of atomic functionality this makes sense.
However it is possible for a Workspace operation to be acting as a logical grouping of other operations. In this case a nested workspace may contain independent execution paths that don't affect each other meaning some inputs and in-place outputs may have nothing to do with some outputs.
A non-atomic workspace does not get updated as a whole. Instead the updater traverses into the workspace for the given output it's trying to update and brings only that output up to date. This means when an input is marked out of date only outputs actually connected to that input need to be marked out of date.
Reimplemented in Workspace.
|
overridevirtual |
bool isDeprecated | ( | ) | const |
bool isEditable | ( | ) | const |
bool isIdPathCachingEnabled | ( | ) | const |
|
virtual |
Reimplemented in PolymorphicDataOperation.
|
virtual |
Reimplemented in Workspace.
|
virtual |
Returns true if the operation is thread safe.
|
inline |
Template function for testing the type of the Operation. Shorthand for:
&operation.getFactory() == &OperationFactoryTraits<T>::getInstance()
|
inline |
Utility function for testing the type of the operation. Shorthand for:
&operation.getFactory() == &type
bool isUpdating | ( | ) | const |
|
virtual |
Reimplemented in RunMatLabScript, RunPythonScript, CreateObjectDictionary, DecomposeObjectDictionary, FilePathBuilder, PolymorphicDataOperation, RunQtScript, and TreeSelectionBuilder.
bool isUsingDefaultColor | ( | ) | const |
Client code should call this function rather than testing against what it believes is the default color. The default color might change in the future and using isUsingDefaultColor() will ensure the client code is robust to such a change.
bool isUsingDefaultIconPath | ( | ) | const |
bool isUsingDefaultUiPath | ( | ) | const |
|
overridevirtual |
bool isWorkspaceType | ( | ) | const |
|
overridevirtual |
item | Supplies the state to be loaded into this object. |
This function will load the state of this object from item. For many object types, this is most easily implemented in terms of the object's input operator (>>).
It would be reasonable for subclass implementations to assume that the data provided in item is in the same form as would have been saved from a call to save.
Implements Serialize.
Reimplemented in PostFileToDIDS, StoreProvenanceData, and Workspace.
|
protectedvirtual |
By default, before an operation executes, it updates its inputs and it also ensures that all of its outputs hold valid data objects. Therefore, by the time the execute() function is called, it can be assumed that all inputs are up to date and all outputs have valid data objects.
The makeOutputsValid() function normally takes care of ensuring that the outputs hold valid data objects. A subclass may choose to override this behaviour if it wants to delay the creation of the outputs until somewhere in its execute() function. There are two requirements on the subclass' implementation if it overrides makeOutputsValid():
Strictly speaking, this function is not actually necessary. It exists to make the creation of all operation outputs before execute() is called the default behaviour, since most operations want to do this. Putting that part of the update process in a separate function removes the burden on subclasses from having to do this for themselves, but since it is a virtual function the subclass can implement alternative behaviour. The most common reason for doing this is to delay the creation of the outputs until sometime in execute().
Reimplemented in MeshModelSource, MeshModelInstanceBuilder, DecomposeGroup, and ObjectArrayAccessor.
|
protectedvirtual |
Reimplemented in TranslateObjectDictionary, and Workspace.
void markUpToDateWhereSafe | ( | ) |
Mark as up to date every input which has data and is not connected to an output. Calling this function is most useful after an operation has been created or loaded. It allows things to access the data where those entities require an input to be up to date before access is allowed. Workspace widgets are a prime example of this (and indeed are the main motivation for this function's existence).
It is not safe to mark an operation's outputs as up to date except by executing the operation itself. This is because an operation is allowed to update its output in any way it sees fit, including a process with side effects. Thus, to preserve any assumptions made by the operation's author, we do not alter the up to date status of outputs in this function. We also do not alter the up to date status of the operation itself for the same reasons.
|
inline |
Utility function for testing whether the type of two operations matches. Shorthand for:
&operation.getFactory() == &otherOperation.getFactory()
Operation::size_type numInputs | ( | IndexCountingOptions | options = SkipNone | ) | const |
options | Options for how the count is performed. |
Operation::size_type numOutputs | ( | IndexCountingOptions | options = SkipNone | ) | const |
options | Options for how the count is performed. |
|
protected |
Called by the default implementation of update() for an Operation. If subclasses override update(), they must call pauseUpdate() at least once at a time when it is safe for their inputs and/or outputs to change. Long-running operations should call pauseUpdate() periodically to allow other threads to process their requests to modify or read data in the workspace's inputs or outputs.
It must be safe for the caller to continue after calling this function, even if the data in the Operation inputs changes arbitrarily. It is even possible for the input data to be no longer up to date, hence it may not be safe to even read the inputs when pauseUpdate() returns. The caller should locally cache anything it needs or else explicitly test the status of inputs it still wants to use. The caller can, however, rely on the connectivity of the workspace remaining the same, so none of its inputs will have any connections added or removed (but they might get rebuilt). Similarly, no input elements will be added to or removed from an input array held by the operation.
|
protectedvirtual |
item | The item into which data should be saved. |
This function is called as the last step in save() to allow subclasses to save any further information specific to them. It differs from the extras data in that the extras are meant for clients outside the inheritence heirachy and may change depending on what clients use the class. The postSave() function, on the other hand, is meant for subclasses to use to save data that is always needed and used internally by the subclass.
The default implementation saves no additional information and simply returns true to indicate success.
Reimplemented in RunPythonScript, CreateChart, SceneItemLibraryBuilder, ShaderLibraryBuilder, CustomInputsOutputsOperation, ModifyGroup, ModifyObjectDictionary, PostFileToDIDS, StoreProvenanceData, RunMatLabScript, PolymorphicDataOperation, RunQtScript, ReplaceString, and Workspace.
|
protectedvirtual |
item | The serialized item that will be loaded. |
This function is called just before load() attempts to load the data for inputs and outputs from item. The default implementation simply returns true to indicate that loading can proceed. Subclasses may override this function to perform any required tasks that must be done before the inputs or outputs can be accessed. Typical uses usually revolve around tasks that create inputs and outputs, such as populating a nested workspace, setting the data type of a polymorphic data operation, etc.
Most subclasses will not need to override this function.
Reimplemented in MqttSubscribeLoop, RunPythonScript, ScheduleWorkflow, ZeroMQReplyLoop, ZeroMQSubscribeLoop, Array3dInfo, GetSqlResultSetColumn, InsertColumnIntoSqlTable, AddMeshModelState, CreateClipRegion, SceneItemLibraryBuilder, ShaderLibraryBuilder, CustomInputsOutputsOperation, GetItemFromJson, GetItemFromObjectDictionary, ModifyObjectDictionary, RunExternalScript, RunRScript, ComposeGroup, ConditionalLoop, ConvertFromByteArray, ConvertToByteArray, DecomposeGroup, InsertIntoObjectDictionary, IteratingWorkspaceBase< Derived, Parallel >, IteratingWorkspaceBase< ConditionalLoop, false >, IteratingWorkspaceBase< FileLoop, true >, IteratingWorkspaceBase< ForLoop, true >, IteratingWorkspaceBase< Derived, false >, IteratingWorkspaceBase< ObjectArrayLoop, false >, IteratingWorkspaceBase< Derived, true >, IteratingWorkspaceBase< TranslateObjectDictionary, true >, IteratingWorkspaceBase< MqttSubscribeLoop, false >, IteratingWorkspaceBase< ZeroMQReplyLoop, false >, IteratingWorkspaceBase< ZeroMQSubscribeLoop, false >, LoadDataFromFile, ModifyGroup, ObjectArrayBuilder, ObjectArrayLoop, PlaceHolder, PolymorphicDataOperation, RunQtScript, SaveDataToFile, ReplaceString, Variable, WhileLoop, WorkspaceInput, WorkspaceOutput, and Workspace.
bool removeInput | ( | const QString & | name | ) |
name | The name of the input to remove from the operation. |
This function does not delete the input, it only removes the association between the input and this operation. The input could even be subsequently added to a different operation if desired. The dependency input for an operation cannot be removed.
bool removeInput | ( | Input & | input | ) |
input | The input to remove from the operation. |
This function does not delete the input, it only removes the association between the input and this operation. The input could even be subsequently added to a different operation if desired. The dependency input for an operation cannot be removed.
bool removeOutput | ( | const QString & | name | ) |
name | The name of the output to remove from the operation. |
This function does not delete the output, it only removes the association between the output and this operation. The output could even be subsequently added to a different operation if desired. The dependency output for an operation cannot be removed.
bool removeOutput | ( | Output & | output | ) |
output | The output to remove from the operation. |
This function does not delete the output, it only removes the association between the output and this operation. The output could even be subsequently added to a different operation if desired. The dependency output for an operation cannot be removed.
|
virtual |
When a workspace is being updated continuously, it notifies interested clients each time. The usual arrangement is for an observer to call resetExecutionDependencies for each notification.
Reimplemented in Workspace.
|
overridevirtual |
item | Where to save the state of this object. |
This function will serialise the object by saving it to item. For most object types, this is most easily implemented in terms of the object's output operator (<<).
It is allowable for an object to only serialize part of itself. This would be useful if the data it represents has a set of defaults and only those values different to the defaults need to be serialized. Such an implementation then needs to be careful how it handles the complimentary load member function.
Implements Serialize.
|
protected |
item | Where to save the extra state data of this operation. |
This function is responsible for saving any extra state information associated with the operation that is not managed by Operation or its subclass. External clients of Operation can use this to add their own data to the operation and have it included when the operation is serialized, such as when saved to a workspace file. Clients can access these extras at any time using getExtras() and they may modify those extras to suit their own purposes. It is highly advisable that clients doing this should work with a child below the top level extras item where the name of that child is somehow related to what they are doing with the data. This will help minimize the chances of a name clash with other clients who might also be putting their own data into the extras information.
|
virtual |
Reimplemented in Workspace.
|
virtual |
This method is overridden for Workspace operations.
Reimplemented in PlaceHolder, and Workspace.
void setBroadcastUpdateEvents | ( | bool | enable | ) |
void setColor | ( | const QColor & | c | ) |
c | The color to use as the background for this operation when a background color is needed, typically by the workflow editor. |
void setDescription | ( | const QString & | description | ) |
description | A description for human users of what this Operation does (for tooltips etc) |
void setEditable | ( | bool | b | ) |
b | Whether or not the properties of this operation should be editable. |
void setIconPath | ( | const QString & | path | ) |
path | The path for the icon to be used for this operation where such an icon is required (typically in the workflow editor window). The icon would normally be 48x48 pixels and must be one of the formats supported by Qt. If in doubt, use PNG. |
Note that setting the icon path to the same as the result of getDefaultIconPath() effectively reverts the icon back to the default. If the result of getDefaultIconPath() later changes, the icon path used by this operation will change along with it. This is to support operations which change their default icon based on things like operation properties, the most notable of which is Workspace which has a different default icon when its external source URL is set.
void setId | ( | const QUuid & | id | ) |
id | The universally unique id of the operation. |
|
virtual |
b | Whether or not to enable IdPath caching. |
If enabled, the operation will cache its IdPath both in memory and in serialised form. If the operation is going to be executed in a distributed environment away from its in-memory parent workflow, a cached ID path is necessary, however, rather than imposing this memory / file size encumbrance on all operations, we make it an opt-in.
Reimplemented in Workspace.
|
virtual |
input | The input making the requested status change. |
This function is provided so that operations can take special action when a particular input is marked as not up to date. The default implementation marks the whole operation as not up to date by calling setUpToDate(false), but subclasses (notably Workspace) may want to do something more interesting.
Reimplemented in MqttSubscribeLoop, ZeroMQReplyLoop, ZeroMQSubscribeLoop, AnimateDataSeriesChange, DataSeriesBuilder, GetImageFromArrayNd, MeshModelSource, MeshModelDiskCache, MergeModels, SceneBuilder, SplitAndLodPointCloudOp, TransformBuilder, ModifyMergedDifferences, DecomposeGroup, ZmqPing, ZmqReplyLoop, ZmqRequest, ZmqRequestMany, CacheData, ConditionalLoop, CountedLoop, DataAccumulatingOperation, FileIterator, ForLoop, Incrementer, InitializedVariable, InsertIntoObjectDictionary, IteratingWorkspaceBase< Derived, Parallel >, IteratingWorkspaceBase< ConditionalLoop, false >, IteratingWorkspaceBase< FileLoop, true >, IteratingWorkspaceBase< ForLoop, true >, IteratingWorkspaceBase< Derived, false >, IteratingWorkspaceBase< ObjectArrayLoop, false >, IteratingWorkspaceBase< Derived, true >, IteratingWorkspaceBase< TranslateObjectDictionary, true >, IteratingWorkspaceBase< MqttSubscribeLoop, false >, IteratingWorkspaceBase< ZeroMQReplyLoop, false >, IteratingWorkspaceBase< ZeroMQSubscribeLoop, false >, ObjectArrayBuilder, ObjectArrayLoop, ParallelIterationControlOperation< Derived >, ParallelIterationControlOperation< CountedLoop >, SelectInput, ConcatenateStrings, TryInputs, UpdateBarrier, WhileLoop, and Workspace.
|
virtual |
This method is overridden for Workspace operations.
Reimplemented in Workspace.
|
virtual |
This method is overridden for Workspace operations.
Reimplemented in Workspace.
void setLabel | ( | const QString & | label | ) |
label | The label to assign to this operation. |
An operation's label is mostly just for users to be able to identify them. They are not used for anything meaningful internally, so the user can pretty much relabel operations to anything they like.
|
virtual |
output | The output making the requested status change. |
This function is provided so that operations can take special action when a particular output is marked as not up to date. The default implementation marks the whole operation as not up to date by calling setUpToDate(false), but subclasses (notably Workspace) may want to do something more interesting.
Reimplemented in GetItemFromJson, GetItemFromObjectDictionary, TryInputs, and Workspace.
void setProfilingEnabled | ( | bool | enable | ) |
|
virtual |
percent | The progress of the operation expressed as a percentage. |
If percent is different from the currently stored progress value, a ProgressEvent will be raised and all entities observing this operation for progress events will be notified in the current thread.
This function is public so that private implementation classes can forward progress notifications. Client code would not normally call this under other circumstances.
Not all operations support progress notifications. Even so, when an operation is about to execute, it will always have its progress set to zero and if/when it completes successfully it will have its progress set to 100. If execution fails for some reason, the up to date status handling will ensure that a progress of zero will be set.
void setProgressContribution | ( | int | percent | ) |
percent | The percentage of the containing workspace's progress that this operation represents. It must be in the range 0 to 100. If set to zero, it indicates that this operation does not meaningfully contribute to the parent's overall progress, in which case any progress notifications on this operation would not be forwarded to the parent. |
Not all operations support progress notifications. In that case, the progress contribution should remain at the default value of zero.
The last thing this function does before returning is raise a ProgressContributionChangeEvent notification. The containing workspace would normally be the only thing responding to that event.
void setProgressResetByNotUpToDate | ( | bool | b | ) |
b | If true (the default), calls to setUpToDate() should also reset the progress to zero. |
|
virtual |
Sets the features required in order to run this operation.
void setTerminateExecution | ( | bool | b | ) |
b | If true, any attempt to execute the operation will fail. |
To prevent an operation from executing, the parameter can be set to true. This is normally part of a top-level process setting this to true for all operations to halt workspace execution. Once that top level process has confirmed that execution has stopped, it should then subsequently reset the status by passing a false parameter to this function for all operations.
The Workspace class overrides this function to make it behave recursively. No other subclass should override it.
void setUiPath | ( | const QString & | path | ) |
|
overridevirtual |
b | Boolean value specifying the operation's new up-to-date status. |
If b is false, the call will also try to propagate forward the not up-to-date status for all the operation's outputs. Anything connected to one of the outputs is also marked as not up to date, following all connections and operations as far as possible until something is encountered which was already not up to date, or until all connections are exhausted.
This function also explicitly sets the progress to zero if b is false or to 100 if b is true.
Implements Updatable.
Reimplemented in Workspace.
|
protectedvirtual |
tagName | The tag of the item being queried. |
During a call to Operation::load(), the function iterates over all direct children of the serialized item being loaded. For those it recognises, it processes. For the rest, it calls shouldSaveInExtras() with its tag name and if shouldSaveInExtras() returns true, the item will be added to the operation's serialized "extras". Some special subclasses (notably Workspace and PolymorphicDataOperation) add their own specific tags to serialized items and because they process these tags in prepareForLoad(), etc., the tags do not need to be put into the extras (indeed it could involve considerable unnecessary storage if those tags were added).
The default implementation returns true, implying that all unrecognized items will be added to the extras data.
Reimplemented in RunPythonScript, and Workspace.
|
overridevirtual |
This function first ensures that all required inputs are brought up to date and all outputs hold valid data objects. It then executes the operation by calling execute() and if that is successful, it will mark all outputs as up to date. If subclasses want to customise how the inputs are updated, they should override bringInputsUpToDate(), but this should only be necessary if only a subset of the inputs may be needed for the operation to update itself.
It should be explicitly noted that because inputs may need to be brought up to date, calling an operation's update() function could be expensive, depending on how costly it is to update each of its inputs. There is no restriction on how costly that might be, since users could create an arbitrary combination of operations and connections to supply an input.
In very rare cases, it may be necessary for subclasses to override update() to implement some special sort of update behaviour. One example is the for loop operation, where the inputs and outputs are updated in a specific order and usually more than once until a certain input holds a true value. Only then will the update() function actually return. Overriding update() is, however, not necessary in most instances. Authors of Operation subclasses are strongly advised not to override it.
Implements Updatable.
Reimplemented in Workspace.