Skip to content

Commit

Permalink
upgrade to 2023 SP2 U2
Browse files Browse the repository at this point in the history
  • Loading branch information
techsoftrick committed Oct 24, 2023
1 parent 484c56b commit e168fe0
Show file tree
Hide file tree
Showing 14 changed files with 2,166 additions and 2,098 deletions.
1,381 changes: 691 additions & 690 deletions engine-asmjs.js

Large diffs are not rendered by default.

1,258 changes: 630 additions & 628 deletions engine-wasm.js

Large diffs are not rendered by default.

Binary file modified engine.wasm
Binary file not shown.
1,250 changes: 628 additions & 622 deletions hoops_web_viewer.js

Large diffs are not rendered by default.

83 changes: 62 additions & 21 deletions typescript/hoops_web_viewer.d.ts

Large diffs are not rendered by default.

6 changes: 0 additions & 6 deletions typescript/operators/CuttingPlaneOperator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ namespace Communicator.Operator {
public readonly origPlaneD: number;
}

/** @hidden */
export class CuttingPlaneOperator extends OperatorBase {
private _cuttingManager: CuttingManager;

Expand All @@ -37,13 +36,11 @@ namespace Communicator.Operator {
*/
private _context: CuttingPlaneOperatorContext | null = null;

/** @hidden */
public constructor(viewer: WebViewer, cuttingManager: CuttingManager) {
super(viewer);
this._cuttingManager = cuttingManager;
}

/** @hidden */
public async onMouseDown(event: Event.MouseInputEvent): Promise<void> {
super.onMouseDown(event);

Expand All @@ -57,7 +54,6 @@ namespace Communicator.Operator {
}
}

/** @hidden */
public async onMouseMove(event: Event.MouseInputEvent): Promise<void> {
super.onMouseMove(event);

Expand Down Expand Up @@ -107,7 +103,6 @@ namespace Communicator.Operator {
}
}

/** @hidden */
public async onMouseUp(event: Event.MouseInputEvent): Promise<void> {
const context = this._context;
if (this.isActive() && context !== null) {
Expand All @@ -119,7 +114,6 @@ namespace Communicator.Operator {
super.onMouseUp(event);
}

/** @hidden */
public setHandled(): boolean {
return this.isActive() && this._context !== null;
}
Expand Down
4 changes: 1 addition & 3 deletions typescript/operators/Measure/PointCursor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ namespace Communicator.Operator.Common {
const invW = 1 / sp4.w;
const screenPosition = new Point2(sp4.x * invW, sp4.y * invW);

const dims = viewer.model.getClientDimensions();
const w = dims[0];
const h = dims[1];
const { x: w, y: h } = viewer.view.getCanvasSize();

screenPosition.x = 0.5 * w * (screenPosition.x + 1);
screenPosition.y = 0.5 * h * (screenPosition.y + 1);
Expand Down
20 changes: 11 additions & 9 deletions typescript/operators/SelectionOperator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ namespace Communicator.Operator {
private _getSelectionOrParentIfSelected(
selection: Selection.NodeSelectionItem,
): Selection.NodeSelectionItem {
const selectionManager = this._viewer.selectionManager;
if (!selectionManager.getSelectParentIfSelected()) {
// If we're not propagating selection to parents just skip this whole thing
return selection;
}

const model = this._viewer.model;
const nodeId = selection.getNodeId();

Expand All @@ -150,16 +156,12 @@ namespace Communicator.Operator {
return selection;
}

const selectionManager = this._viewer.selectionManager;
let parent: Selection.NodeSelectionItem | null = null;

if (selectionManager.getSelectParentIfSelected()) {
parent = selectionManager.containsParent(selection);
}

if (parent !== null) {
const parentSelectionItem = selectionManager.containsParent(selection);
if (parentSelectionItem !== null) {
// if the parent is already selected, select the parent of the parent
const out = Selection.SelectionItem.create(model.getNodeParent(parent.getNodeId()));
const out = Selection.SelectionItem.create(
model.getNodeParent(parentSelectionItem.getNodeId()),
);
return out.isNodeSelection() ? out : selection;
} else if (selectionManager.contains(selection)) {
// if the item is already selected, select it's parent
Expand Down
7 changes: 7 additions & 0 deletions typescript/tcc.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,11 @@ declare module SC {
Toon,
}

export const enum DrawStrategy {
FixedFramerate,
OcclusionCulling,
}

// Mirrors C++ `TC::Web::ElementType`
export const enum ElementType {
Faces,
Expand Down Expand Up @@ -1357,6 +1362,7 @@ declare module SC {
setBoundingPreviewUnderdraw(points: Vector3[]): void;
setBoundingPreviewTested(points: Vector3[]): void;
setBoundingPreviewEjected(points: Vector3[]): void;
setBoundingDebugLevel(level: number): void;
setCamera(camera: Camera): void;
setCappingIdleHookEnabled(enable: boolean): Promise<boolean>;
setClumpingEnabled(value: boolean): void;
Expand All @@ -1370,6 +1376,7 @@ declare module SC {
setDisplayIncompleteFrames(value: boolean): void;
setDrawIdleDelay(delay: number): void;
setDrawMode(drawMode: DrawMode): void;
setDrawStrategy(strategy: DrawStrategy): void;
setEyeDomeLightingBlurEdgeDistance(value: number): void;
setEyeDomeLightingBlurInterval(value: number): void;
setEyeDomeLightingBlurSamples(value: number): void;
Expand Down
126 changes: 76 additions & 50 deletions typescript/ui/Desktop/Tree/CADViewTree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,16 @@
/// <reference path="ViewTree.ts"/>

namespace Communicator.Ui {
interface View {
name: string;
nodeId: NodeId;
}

export class CadViewTree extends ViewTree {
private readonly _annotationViewsString: string = "annotationViews";
private readonly _annotationViewsLabel: string = "Annotation Views";
private readonly _combineStateViewsString: string = "combineStateViews";
private readonly _combineStateViewsLabel: string = "Combine State Views";
private _viewFolderCreated: boolean = false;

private _lastSelectedhtmlId: string | null = null;
Expand Down Expand Up @@ -103,6 +110,7 @@ namespace Communicator.Ui {

this._tree.expandInitialNodes(this._internalId);
this._tree.expandInitialNodes(this._internalId + this._annotationViewsString);
this._tree.expandInitialNodes(this._internalId + this._combineStateViewsString);
}

private _allowView(viewNodeId: NodeId): boolean {
Expand Down Expand Up @@ -134,70 +142,87 @@ namespace Communicator.Ui {
);
};

// non-annotated views
const regularViews: View[] = [];
const annotationViews: View[] = [];
const combineStateViews: View[] = [];

cadViews.forEach((name: string, nodeId: NodeId) => {
if (
!this._cadViewIds.has(nodeId) &&
allowView(nodeId) &&
!model.isAnnotationView(nodeId)
) {
if (!this._cadViewIds.has(nodeId) && allowView(nodeId)) {
this._cadViewIds.add(nodeId);
this._tree.addChild(
name,
this._cadViewId(nodeId),
this._internalId,
"view",
false,
Desktop.Tree.CadView,
);
if (model.isAnnotationView(nodeId)) {
annotationViews.push({ name, nodeId });
} else if (model.isCombineStateView(nodeId)) {
combineStateViews.push({ name, nodeId });
} else {
regularViews.push({ name, nodeId });
}
}
});

// annotation view folder
cadViews.forEach((_name: string, nodeId: NodeId) => {
if (
!this._cadViewIds.has(nodeId) &&
allowView(nodeId) &&
model.isAnnotationView(nodeId)
) {
if (
document.getElementById(this._internalId + this._annotationViewsString) ===
null
) {
this._tree.addChild(
this._annotationViewsLabel,
this._internalId + this._annotationViewsString,
this._internalId,
"viewfolder",
true,
Desktop.Tree.CadView,
);
}
}
// regular views
regularViews.forEach((view: View) => {
this._tree.addChild(
view.name,
this._cadViewId(view.nodeId),
this._internalId,
"view",
false,
Desktop.Tree.CadView,
);
});

// annotation views
cadViews.forEach((name: string, nodeId: NodeId) => {
if (
!this._cadViewIds.has(nodeId) &&
allowView(nodeId) &&
model.isAnnotationView(nodeId)
) {
this._cadViewIds.add(nodeId);
// the folder is already called Annotation Views, remove the annotation view text from the name
const parsedValue = name.split("# Annotation View")[0];
// Annotation views
if (annotationViews.length > 0) {
this._tree.addChild(
this._annotationViewsLabel,
this._internalId + this._annotationViewsString,
this._internalId,
"viewfolder",
true,
Desktop.Tree.CadView,
true,
false,
this._annotationViewsLabel,
);

// add to annotation view folder
annotationViews.forEach((view: View) => {
const parsedValue = view.name.split("# Annotation View")[0];
this._tree.addChild(
parsedValue,
this._cadViewId(nodeId),
this._cadViewId(view.nodeId),
this._internalId + this._annotationViewsString,
"view",
false,
Desktop.Tree.CadView,
);
}
});
});
}

// Combine state views
if (combineStateViews.length > 0) {
this._tree.addChild(
this._combineStateViewsLabel,
this._internalId + this._combineStateViewsString,
this._internalId,
"viewfolder",
true,
Desktop.Tree.CadView,
true,
false,
this._combineStateViewsLabel,
);

combineStateViews.forEach((view: View) => {
this._tree.addChild(
view.name,
this._cadViewId(view.nodeId),
this._internalId + this._combineStateViewsString,
"view",
false,
Desktop.Tree.CadView,
);
});
}
}

private async _onTreeSelectItem(htmlId: HtmlId): Promise<void> {
Expand All @@ -221,7 +246,8 @@ namespace Communicator.Ui {
if (
thisElement.tagName === "LI" &&
htmlId !== this._internalId &&
htmlId !== this._internalId + this._annotationViewsString
htmlId !== this._internalId + this._annotationViewsString &&
htmlId !== this._internalId + this._combineStateViewsString
) {
thisElement.classList.add("selected");
this._lastSelectedhtmlId = htmlId;
Expand Down
Loading

0 comments on commit e168fe0

Please sign in to comment.