To improve performance we have implemented a cache for picking in 3d. This means the cost of calling objectsAt
multiple times on the same mouseline is greatly reduced. This means we can make the call to objectsAt
when it is guaranteed that the result will be used instead of doing it once and passing the result along to where it perhaps will be used.
Old: extend public void move(View3D view, Object[] objectsAtPos) { New: extend public void move(View3D view, WindowViewMouseInfo mi) {
In this case, the argument objectsAtPos
was computed as follows:
Object[] objects = view.objectsAt(mi.pos, selectionOnTop=true, onlySelectable=true); view.removeObjects(objects, [Class: ViewFocusPoint, DropArea]);
Consider if there are cases when you don't need objectsAt
, e.g., during animations.
Old: extend public void updateCheckedState(TreeViewItem item = null, bool disabled = false, Object[] picked = null) { New: extend public void updateCheckedState() {
Removed: extend public void setParentCheckState(TriStateComboTreeViewItem item) {
Old: public bool cpp_rayMeshToleranceIntersect(pointF& rayOrigin, pointF& rayDirection, fix float[] verts, int vc, fix int[] triangles, int tc, TransformF transform, pointF& ip, int& triangle, angle tolerance, pointF& cameraLoc); New: public bool cpp_rayMeshToleranceIntersect(pointF& rayOrigin, pointF& rayDirection, fix float[] verts, int vc, fix int[] triangles, int tc, TransformF transform, pointF& ip, int& triangle, angle tolerance);
Old: public bool rayMeshToleranceIntersect(pointF& rayOrigin, pointF& rayDirection, fix float[] verts, int vc, fix int[] triangles, int tc, TransformF transform, pointF& ip, int& triangle, angle tolerance, pointF& cameraLoc) { New: public bool rayMeshToleranceIntersect(pointF& rayOrigin, pointF& rayDirection, fix float[] verts, int vc, fix int[] triangles, int tc, TransformF transform, pointF& ip, int& triangle, angle tolerance) {
A new argument, o
, has been added to the intersection
function. o
is the origin/owner of the red shape z
and is required for caching purposes.
Old: final public REDPick intersection(REDShape z, lineF ln, REDShape[] path, pointF lineOriginInWC, bool xtrace=false, angle coneAngle=0deg, pointF cameraLoc=pointF(), REDPick[] intersections=null) { New: final public REDPick intersection(Object o, REDShape z, lineF ln, REDShape[] path, pointF lineOriginInWC, bool xtrace=false, angle coneAngle=0deg, pointF cameraLoc=pointF(), REDPick[] intersections=null) {
This class has been removed. As replacement, use a combination of CopyInstruction
, CutInstruction
, PasteInstruction
and PasteSelectionInstruction
. These new instructions more closely mimic the default behaviour of the copy, cut and paste actions in CET.
Removed: class CopySnapperInstruction Added: class CopyInstruction Added: class CutInstruction Added: class PasteInstruction Added: class PasteSelectionInstruction
Since the default copy, cut and paste behaviour use the active selection and animations, you may also want to combine them with SelectSnapperInstruction
and SimulateAnimationClickInstruction
.
All fields have been changed from public
to private
. The reason for this is that all of them can already be assigned via the constructors, and TestInstruction fields are in general not intended to be changeable afterwards.
Old: public Snapper snapper; New: private Snapper snapper; Old: public line mouseLine; New: private line[] mouseLines; Old: public str outputKey; New: private str outputKey; Old: public bool skipSnap; New: private bool skipSnap;
InsertSnapperInstruction now supports simulating multiple clicks when inserting snappers, making it possible to insert things like lines that require both a start pos and end pos. To handle this, the line mouseLine
field has been changed to a sequence, and the following constructors have been added:
Added: public constructor(Snapper snapper, line[] mouseLines, str outputKey=null, bool skipSnap=false) Added: public constructor(SnapperSpawner spawner, line[] mouseLines, str outputKey=null, bool skipSnap=false) Added: public constructor(Snapper snapper, point2D[] pos, str outputKey=null, bool skipSnap=false) Added: public constructor(SnapperSpawner spawner, point2D[] pos, str outputKey=null, bool skipSnap=false)
This class has been removed. Instead use the more general InsertSnapperInstruction.
Removed: class InsertSimpleWallLineInstruction
Example:
Old: InsertSimpleWallLineInstruction((0.0, 0.0, 0.0), (2.0, 0.0, 0.0), outputKey="wall"); New: InsertSnapperInstruction(SimpleWallLine(), [(0.0, 0.0), (2.0, 0.0)], outputKey="wall");
This class has been removed. Instead use the more general InsertSnapperInstruction.
Removed: class InsertWallLineInstruction
Example:
Old: InsertWallLineInstruction((0.0, 0.0, 0.0), (2.0, 0.0, 0.0), outputKey="wall"); New: InsertSnapperInstruction(WallLine(), [(0.0, -0.1), (2.0, -0.1)], outputKey="wall", skipSnap=true);
To set the thickness and height of the wall, use the new PutQuickPropInstruction
.
PutQuickPropInstruction("wall", "d", Distance(0.2.distance)); // Set thickness to 0.2 PutQuickPropInstruction("wall", "h", Distance(1.8.distance), ensureValidProps=true); // Set thickness to 1.8
Please note that the insert position may vary slightly because the InsertSnapperInstruction
utilizes the standard insert animation, whereas InsertWallLineInstruction
did not. Normally, you need to offset the position by the thickness of the wall to end up at the same position as before.
Since InsertWallLineInsruction
did not use an insert animation, it also ignored snapping. To get the same behaviour, set the parameter skipSnap=true
.
This class has been deprecated and should be replaced with the new, more general, SwitchToViewInstruction.
A 1 to 1 replacement would look like this:
SwitchToView2DInstruction()
-> SwitchToViewInstruction(viewOption.splitHorizontal, viewType.view2DType)
But if the test doesn't require a split view, the following is sufficient SwitchToViewInstruction(viewOption.threeD)
This class has been deprecated and should be replaced with the new, more general, SwitchToViewInstruction.
A 1 to 1 replacement would look like this:
SwitchToView3DInstruction()
-> SwitchToViewInstruction(viewOption.splitHorizontal, viewType.view3DType)
But if the test doesn't require a split view, the following is sufficient SwitchToViewInstruction(viewOption.twoD)
This class has been removed. Instead, use GetFieldValueInstruction
followed by ValidateValueInstruction
.
Removed: class ValidateFieldValueInstruction Added: class GetFieldValueInstruction
This class has been removed. Instead, use ToggleFreezeInstruction
.
ToggleFreezeInstruction
freezes or unfreezes items in the active selection (same as using the ctrl+e shortcut). If you need to update the active selection, use SelectSnapperInstruction
.
Removed: class FreezeSnappersInstruction Added: class ToggleFreezeInstruction
This class has been removed. Instead, use ToggleFreezeInstruction
.
ToggleFreezeInstruction
freezes or unfreezes items in the active selection (same as using the ctrl+e shortcut). If you need to update the active selection, use SelectSnapperInstruction
.
Removed: class UnfreezeSnappersInstruction Added: class ToggleFreezeInstruction
This class has been removed. Instead use InsertSnapperInstruction.
Removed: class K2InsertWallLineInstruction
This class has been changed from public to package. Instead use InsertSnapperInstruction.
Old: public class K2InsertWallBumpInstruction extends TestInstruction : deprecated { New: package class K2InsertWallBumpInstruction extends TestInstruction : deprecated {
This class has been changed from public to package. Instead use InsertSnapperInstruction.
Old: public class K2InsertWallWindowInstruction extends TestInstruction { New: package class K2InsertWallWindowInstruction extends TestInstruction {