Envision 3.0
November 14, 2024 - SHA: 4dfe82aa
CEETRON Envision 3.0 is a major release which means it contains breaking changes. The main focus this release has been to upgrade our toolkit to use TypeScript’s strict mode, which enforces more rigorous type-checking and ensures higher code reliability and safety.
Note
Breaking changes in this release only affects Envision Web. There are no breaking changes for Envision Desktop.
See Breaking Changes at the bottom for a full description of changes.
CEETRON Envision for Web
CEETRON Envision for Desktop
Fixed Bugs
CAE-1415 VTU/VTM: Added support for “frequency”
Added support for PVD files containing the “frequency” attribute also. Earlier, only “timestep” was handled.
CAE-1425 QueryElementInfo: validate user’s index against the valid index range
Fixed a crash with cee.ug.QueryElementInfo when using index identification
elementIdentType = RemoteQueryInputIdentType.INDEX
and querying an invalid element index.
CAE-1432 Fixed crash when opening file using the OpenFoam Data Provider
Fixed issue with crash due to non-threadsafe code in OpenFoam data provider plugin.
CAE-1415 VTU: Improved file identification
Expand file identification to validate VTU files with attributes in both single(’) and double(”) quotes.
New Features
CAE-1396 Viridis Color Scheme
This feature adds the popular Viridis color scheme to the list of available built-in color schemes within Envision.
CAE-1426 Support interpolated node results for QueryNodeInfo
cee.ug.QueryNodeInfo now retrieves the node averaged scalar results when these are available, unifying the
logic with the node result from picking.
Added a new property scalarResultIsInterpolated to
cee.ug.QueryNodeInfoData.
CAE-871 Relative displacement scaling
Added an option to scale displacement results with a factor relative to the size of the model. A relative scaling factor of 1 means that the length of the largest currently loaded displacement will be equal to the maximum bounding box extent of the model.
In Envision Desktop:
void DisplacementSettings::setScaleFactor(double scaleFactor, ScaleMode mode):
ScaleMode DisplacementSettings::scaleMode() const;
where mode is ABSOLUTE_SCALING or RELATIVE_SCALING.
In Envision Web (an accessor):
get scaleMode(): DisplacementScaleMode
set scaleMode(scaleMode: DisplacementScaleMode)
where mode is DisplacementScaleMode.ABSOLUTE_SCALING or DisplacementScaleMode.RELATIVE_SCALING.
Breaking Changes
CAE-1370 Operators are the new default for handling user input
We are deprecating the older user input handling and fully embracing Operators for all user interaction with the viewer. We are still keeping backwards compatibility for the time being, but in practice, the use of Operators is now opt-out, that means they are turned on by default. In case you are not ready to make the transition yet, you can disable the use of operators. We strongly recommend the use of Operators as it is the cleaner, more sustainable and modular approach to user-input handling in the viewer. Read more about Operator integration here: https://docs.techsoft3d.com/hoops/latest/envision-web/operators.html.
CAE-1397 Strict mode in TypeScript
With this release, our toolkit has been upgraded to use TypeScript’s strict mode, which enforces more rigorous type-checking and ensures higher code reliability and safety. In turn, this will help with catching potential bugs early in development and prevent many common errors, like using variables before they are defined or failing to handle null and undefined cases. Adopting strict mode was for us essential to improve code robustness, encourage best practices, and provide you with a more reliable and efficient toolkit in the long run.
We have clarified many scenarios where nullish values occur and unified the use of null and undefined across the board. As a general rule of thumb, we have adopted the usage of null for objects and undefined for value types.
What does that mean for you? If your application is not using strict mode, you can safely ignore the “Typing changes clarifying current behavior” section, as those changes are adding nullish types purely for clarifying how the method/member worked before. On the other hand if you were using strict mode already, you might see some errors pop up with regards to null and undefined types. We have clarified the documentation in the effort to explain the reason why those falsy values occur in that place.
In all cases, be sure to check out the “Possibly breaking behavioral changes” sections to see the changes that do not necessarily have to show up in the output of the TypeScript transpiler.
Global (cee)
Possibly breaking behavioral changes
PlaneprojectVector: changed failure return value fromundefinedtonull
ScalarMapperContinuousDomainaboveRangeColor: now accepts and returnsnullinstead ofundefinedbelowRangeColor: now accepts and returnsnullinstead ofundefined
ViewerrayFromCssCoordinate: now returnsnullon failure instead of returning a defunctRayobject
Typing changes clarifying current behavior:
Backgroundimage: addednullto return type
CamerafieldOfViewYDeg: addedundefinedto return type
CloudSessionaddViewer: addednullto return type
NavigationOperatorrotationAxis: addednullto return typeminWalkTargetDistance: addedundefinedto input and output type
NavigationminWalkTargetDistance: addedundefinedto input and output type
OperatorStackhotKeyOperator: addednullto return typeget: addednullto return type
ScalarMapperContinuousrangeMinimum: addedundefinedto return typerangeMaximum: addedundefinedto return type
ScalarMapperContinuousPiecewiserangeMinimum: addedundefinedto return typerangeMaximum: addedundefinedto return type
ScalarMapperFilledContoursrangeMinimum: addedundefinedto return typerangeMaximum: addedundefinedto return type
ScalarMapperFilledContoursUniformrangeMinimum: addedundefinedto return typerangeMaximum: addedundefinedto return type
ViewrayIntersect: addednullto return typegetRayThroughPoint: addednullto return type
Remote Model (cee.ug)
Possibly breaking behavioral changes
ClientSideHitItem- use
nullinsteadundefinedif theintersectionPointproperty is invalid
- use
LegendColorMarker- now an interface (previously was a class)
QueryAllElementResultsForFramePartDataelementIds: is nownullwhen id’s are not available (previouslyundefined)nodeIds: is nownullwhen id’s are not available (previouslyundefined)
QueryBulkCalculationValuesregionTriangleVerticesis nownullwhen not including region triangles in the query (previouslyundefined)
RemoteModelmodelSpecandmodelDirectoryare now always non-null, even before opening a model. Accessing the setters ofmodelSpecbefore the model is opened, will result in an error being thrown. Also please note that the references of the two objects will change after opening the model. This requires no change in your code ifmodelSpecandmodelDirectoryis accessed in the usual way, inside or after the callback of theopenModelmethod. A new methodisOpenhas been introduced to check whether the model has been opened.createVisibleObjectPicker: now returnsnullinstead of a partially created picker on failurecreateTrianglePicker: now returnsnullinstead of a partially created picker on failure
ScalarSettingsaboveRangeColorandbelowRangeColorchanged their unset type tonull(previouslyundefined)
VectorSettingsanisotropicScaleFactor: unset type changed tonull(previouslyundefined)
Server callback changes
We have clarified the typing when it comes to server callbacks. In practice, all the error arguments in the callback
functions now add null to their types. Additionally, the type of the main data argument in callbacks is never
defined as possibly falsy, but in case there is an error, the user of the function is responsible for handling it and
not accessing the data. In such case, the data argument will be falsy, even though the type contract is not specifying
falsy values. This is not a change in the current behavior and requires, besides updating the error typings, no further
changes.
Example:
const query = new ug.ElementInfoQuery();
query.executeQuery(/* arguments */, (error: Error | null, data: QueryElementInfoData[]) => {
if (error) {
console.error(error);
return;
}
// If there is an error and we would decide not to return after the error, data will be null here,
// even though it is not typed as such.
console.log(data);
});
List of callbacks where we added null to the type of the error argument:
ServerUpdateCompletedCallbackPollForDataSourceChangesCallbackDataSourceRequestCallbackSendToCloudCallbackCreateResultCalculatorCallbackQueryBulkCalculationCallbackQueryElementInfoCallbackQueryPartResultsCallback
Typing changes clarifying current behavior:
CuttingPlanefilterScalarRangeMinimum: addedundefinedto the return typefilterScalarRangeMaximum: addedundefinedto the return type
CuttingPlanePropertiesfilterScalarRangeMinimum: addedundefinedto the typefilterScalarRangeMaximum: addedundefinedto the type
ModelDirectorygetStateNameById: addednullto the return typegetStateReferenceValueById: addedundefinedto the return typegetScalarNameById: addednullto the return typegetVectorNameById: addednullto the return typegetDisplacementNameById: addednullto the return typegetSetNameById: addednullto the return typegetPartNameById: addednullto the return typegetResultInfoByIdString: changed the “not found” type on return fromundefinedtonullgetResultIdStringById: changed the “not found” type on return fromundefinedtonull
ModelSettingsPropertiestransformationMatrix: addednullto the type
ProgressDatadebugMessage: addednullto the type
QueryElementInfoDatascalarResult: addedundefinedto the typeelementNodes.scalarResult: addedundefinedto the type
QueryNodeInfoDatascalarResult: addedundefinedto the type
RemoteModelgetScalarResultMinimumValue: addedundefinedto the return typegetScalarResultMaximumValue: addedundefinedto the return typegetVectorResultMinimumLength: addedundefinedto the return typegetDisplacementResultMinimumLength: addedundefinedto the return typegetDisplacementResultMaximumLength: addedundefinedto the return typegetPartSettingsById: addednullto the return typegetScalarSettingsById: addednullto the return typegetVectorSettingsById: addednullto the return typegetDisplacementSettingsById: addednullto the return typegetCuttingPlaneById: addednullto the return typeaddIsosurface: addednullto the return typegetIsosurfaceById: addednullto the return typeaddIsovolume: addednullto the return typegetIsovolumeById: addednullto the return typegetParticleTraceGroupById: addednullto the return typeclientSideRayIntersect: addednullto the return typesetResultRangeChangedHandler: added null to the type of the callback argument to allow for a cleanup of the callback
ScalarSettingsfilteringRangeMinimum: addedundefinedto the typefilteringRangeMaximum: addedundefinedto the type
ScalarSettingsPropertiesfilteringRangeMinimum: addedundefinedto the typefilteringRangeMaximum: addedundefinedto the typeaboveRangeColor: addednullto the typebelowRangeColor: addednullto the type
VectorSettingsscaleFactor: addedundefinedto the typeclampingRangeMinimum: addedundefinedto the typeclampingRangeMaximum: addedundefinedto the typefilteringRangeMinimum: addedundefinedto the typefilteringRangeMaximum: addedundefinedto the type
VectorSettingsPropertiesscaleFactor: addedundefinedto the typeanisotropicScaleFactor: addednullto the typeclampingRangeMinimum: addedundefinedto the typeclampingRangeMaximum: addedundefinedto the typefilteringRangeMinimum: addedundefinedto the typefilteringRangeMaximum: addedundefinedto the type
Constant Remote Model (cee.cug)
Possibly breaking behavioral changes:
ConstantRemoteModelgetBoundingBoxForPart: now returns an invalid bounding box instead of undefined if no bounding box is found
ColorLegend- Removed from the public API of the cug module
Typing changes clarifying current behavior:
InitializationCompleteCallback- added
nullto typing forerrparameter
- added
RayIntersectCallback- added
nullto typing for thehitItemparameter to the callback function
- added
ConstantRemoteModelsimulationInfo: addednullto return typemodelSpec: addednullto return typeanimation: addednullto return typegetResultInfo: addednullto return typerayIntersect: addednullto return typesetMasterModelForSyncAnimation: addednullto parameter typing
FrameInfo- added
undefinedto return type forreferenceValue,fringesMinimumValueandfringesMaximumValue
- added
HitItem- now exposed as an interface instead of a class
- added
nullto typing for thenodePositionandintersectionPointNormalproperties - added
undefinedto typing for thenodeScalarResultandelementScalarResultproperties
Unstruct Surface Grid (cee.usg)
Possibly breaking behavioral changes:
HitItem- now an interface
PartScalarsgetValueRangenow has the range min:Number.MAX_VALUEand max:-Number.MAX_VALUEwhen no meaningful values can be determined from the supplied value array.
PartVectorsgetVectorLengthRangenow has the range min:Number.MAX_VALUEand max:-Number.MAX_VALUEwhen no meaningful values can be determined from the supplied vectors array.
Typing changes clarifying current behavior:
HitItem- added
undefinedto the typing of the propertieselementIdandclosestNodeId
- added
Mesh- added
nullto the typing ofelementTypeArrayproperty
- added
ScalarSettings- added
nullto the typing ofscalarMapperproperty
- added
State- added
undefinedto the typing ofreferenceValueproperty - added
nullto the typing ofgeometryproperty - added
nullto the typing of the return type of thegetPartFringesAtmethod - added
nullto the typing of the return type of thegetPartDisplacementsAtmethod - added
nullto the typing of the return type of thegetPartTransformationAtmethod - setters for Fringes, Vectors, Displacements and Transforms are now typed so that they accept
null
- added
UnstructGridModel- added
nullto the typing ofcurrentStateproperty - added
nullto the typing of the return type of therayIntersectmethod
- added
Geometry (cee.geo)
Typing changes clarifying current behavior:
GeometryModeltransformationMatrix: addednullto typingrayIntersect: addednullto return type
HitItemintersectionPoint: addednullto typing
MeshHitItemintersectionPoint: addednullto typing
MeshIndexedLinestextureCoordinates: addednullto typing
MeshIndexedTrianglesconstructor: addednullto constructor parameteroptionalVertexDatainput typetextureCoordinates: addednullto typing
Partmesh: addednullto typingtransformationMatrix: addednullto typing
PartSettingsspecularIntensity: addedundefinedto typingtexture: addednullto typing
Markup Model (cee.mrk)
Possibly breaking behavioral changes:
PartLabelsgetLabelOffsetPosition: now returnsnullinstead ofundefinedif no offset position is setgetLabelOffsetDirection: now returnsnullinstead ofundefinedif no offset position is set
Typing changes clarifying current behavior:
PartHitItem- added
nullto typing forintersectionPointproperty
- added
PartPointscolorArray: addednullto return type
Utilities (cee.utils)
Possibly breaking behavioral changes:
PathGeneratorgenerateVerticesForCircleThrough3Points: changed error return value fromundefinedtonullgenerateVerticesForCircularSegmentBetween2Lines: changed error return value fromundefinedtonull
Typing changes clarifying current behavior:
ManipulatorTrackballsetRotationAxis: addednullto input type