Skip to content

Commit

Permalink
Merge pull request #184 from xeokit/dont-slice-sections
Browse files Browse the repository at this point in the history
Don't allow user to slice SectionPlane Controls
  • Loading branch information
xeolabs authored Apr 18, 2024
2 parents 044699c + 8208938 commit acced39
Show file tree
Hide file tree
Showing 7 changed files with 162 additions and 92 deletions.
111 changes: 73 additions & 38 deletions dist/xeokit-bim-viewer.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -11988,7 +11988,7 @@ class AngleMeasurementsMouseControl extends AngleMeasurementsControl {
* start, corner or end point will cause the point to snap to the nearest vertex or edge. A quick
* touch-release will immediately set the point at the tapped position on the object surface.
*
* [[Run example](/examples/measurement/#angle_createWithTouch_snapping)]
* [[Run example](https://xeokit.github.io/xeokit-sdk/examples/measurement/#angle_createWithTouch_snapping)]
*
* ````javascript
* import {Viewer, XKTLoaderPlugin, AngleMeasurementsPlugin, AngleMeasurementsTouchControl} from "xeokit-sdk.es.js";
Expand Down Expand Up @@ -79887,7 +79887,7 @@ class DistanceMeasurementsMouseControl extends DistanceMeasurementsControl {
* start or end point will cause the point to snap to the nearest vertex or edge. A quick
* touch-release will immediately set the point at the tapped position on the object surface.
*
* [[Run example](/examples/measurement/#distance_createWithTouch_snapping)]
* [[Run example](https://xeokit.github.io/xeokit-sdk/examples/measurement/#distance_createWithTouch_snapping)]
*
* ````javascript
* import {Viewer, XKTLoaderPlugin, DistanceMeasurementsPlugin, DistanceMeasurementsTouchControl} from "xeokit-sdk.es.js";
Expand Down Expand Up @@ -99278,7 +99278,8 @@ class Control {

this._rootNode = new Node$2(scene, {
position: [0, 0, 0],
scale: [5, 5, 5]
scale: [5, 5, 5],
isObject: false
});

const rootNode = this._rootNode;
Expand Down Expand Up @@ -99469,7 +99470,8 @@ class Control {
collidable: true,
clippable: false,
visible: false,
scale: [2.4, 2.4, 1]
scale: [2.4, 2.4, 1],
isObject: false
}), NO_STATE_INHERIT),

planeFrame: rootNode.addChild(new Mesh(rootNode, { // Visible frame
Expand Down Expand Up @@ -99500,7 +99502,8 @@ class Control {
clippable: false,
visible: false,
scale: [1, 1, .1],
rotation: [0, 0, 45]
rotation: [0, 0, 45],
isObject: false
}), NO_STATE_INHERIT),

//----------------------------------------------------------------------------------------------------------
Expand All @@ -99519,7 +99522,8 @@ class Control {
collidable: true,
clippable: false,
backfaces: true,
visible: false
visible: false,
isObject: false
}), NO_STATE_INHERIT),

xCurveHandle: rootNode.addChild(new Mesh(rootNode, { // Red hoop about Y-axis
Expand All @@ -99534,7 +99538,8 @@ class Control {
collidable: true,
clippable: false,
backfaces: true,
visible: false
visible: false,
isObject: false
}), NO_STATE_INHERIT),

xCurveArrow1: rootNode.addChild(new Mesh(rootNode, {
Expand All @@ -99549,7 +99554,8 @@ class Control {
pickable: true,
collidable: true,
clippable: false,
visible: false
visible: false,
isObject: false
}), NO_STATE_INHERIT),

xCurveArrow2: rootNode.addChild(new Mesh(rootNode, {
Expand All @@ -99564,7 +99570,8 @@ class Control {
pickable: true,
collidable: true,
clippable: false,
visible: false
visible: false,
isObject: false
}), NO_STATE_INHERIT),

//----------------------------------------------------------------------------------------------------------
Expand All @@ -99579,7 +99586,8 @@ class Control {
collidable: true,
clippable: false,
backfaces: true,
visible: false
visible: false,
isObject: false
}), NO_STATE_INHERIT),

yCurveHandle: rootNode.addChild(new Mesh(rootNode, {
Expand All @@ -99590,7 +99598,8 @@ class Control {
collidable: true,
clippable: false,
backfaces: true,
visible: false
visible: false,
isObject: false
}), NO_STATE_INHERIT),

yCurveArrow1: rootNode.addChild(new Mesh(rootNode, {
Expand All @@ -99605,7 +99614,8 @@ class Control {
pickable: true,
collidable: true,
clippable: false,
visible: false
visible: false,
isObject: false
}), NO_STATE_INHERIT),

yCurveArrow2: rootNode.addChild(new Mesh(rootNode, {
Expand All @@ -99620,7 +99630,8 @@ class Control {
pickable: true,
collidable: true,
clippable: false,
visible: false
visible: false,
isObject: false
}), NO_STATE_INHERIT),

//----------------------------------------------------------------------------------------------------------
Expand All @@ -99634,7 +99645,8 @@ class Control {
pickable: false,
collidable: true,
clippable: false,
visible: false
visible: false,
isObject: false
}), NO_STATE_INHERIT),

zCurveHandle: rootNode.addChild(new Mesh(rootNode, {
Expand All @@ -99644,7 +99656,8 @@ class Control {
pickable: true,
collidable: true,
clippable: false,
visible: false
visible: false,
isObject: false
}), NO_STATE_INHERIT),

zCurveCurveArrow1: rootNode.addChild(new Mesh(rootNode, {
Expand All @@ -99658,7 +99671,8 @@ class Control {
pickable: true,
collidable: true,
clippable: false,
visible: false
visible: false,
isObject: false
}), NO_STATE_INHERIT),

zCurveArrow2: rootNode.addChild(new Mesh(rootNode, {
Expand All @@ -99673,7 +99687,8 @@ class Control {
pickable: true,
collidable: true,
clippable: false,
visible: false
visible: false,
isObject: false
}), NO_STATE_INHERIT),

//----------------------------------------------------------------------------------------------------------
Expand All @@ -99688,7 +99703,8 @@ class Control {
pickable: false,
collidable: true,
clippable: false,
visible: false
visible: false,
isObject: false
}), NO_STATE_INHERIT),

//----------------------------------------------------------------------------------------------------------
Expand All @@ -99706,7 +99722,8 @@ class Control {
pickable: false,
collidable: true,
clippable: false,
visible: false
visible: false,
isObject: false
}), NO_STATE_INHERIT),

xAxisArrowHandle: rootNode.addChild(new Mesh(rootNode, {
Expand All @@ -99720,7 +99737,8 @@ class Control {
pickable: true,
collidable: true,
clippable: false,
visible: false
visible: false,
isObject: false
}), NO_STATE_INHERIT),

xAxis: rootNode.addChild(new Mesh(rootNode, {
Expand All @@ -99734,7 +99752,8 @@ class Control {
pickable: false,
collidable: true,
clippable: false,
visible: false
visible: false,
isObject: false
}), NO_STATE_INHERIT),

xAxisHandle: rootNode.addChild(new Mesh(rootNode, {
Expand All @@ -99748,7 +99767,8 @@ class Control {
pickable: true,
collidable: true,
clippable: false,
visible: false
visible: false,
isObject: false
}), NO_STATE_INHERIT),

//----------------------------------------------------------------------------------------------------------
Expand All @@ -99766,7 +99786,8 @@ class Control {
pickable: false,
collidable: true,
clippable: false,
visible: false
visible: false,
isObject: false
}), NO_STATE_INHERIT),

yAxisArrowHandle: rootNode.addChild(new Mesh(rootNode, {
Expand All @@ -99781,7 +99802,8 @@ class Control {
collidable: true,
clippable: false,
visible: false,
opacity: 0.2
opacity: 0.2,
isObject: false
}), NO_STATE_INHERIT),

yShaft: rootNode.addChild(new Mesh(rootNode, {
Expand All @@ -99791,7 +99813,8 @@ class Control {
pickable: false,
collidable: true,
clippable: false,
visible: false
visible: false,
isObject: false
}), NO_STATE_INHERIT),

yShaftHandle: rootNode.addChild(new Mesh(rootNode, {
Expand All @@ -99801,7 +99824,8 @@ class Control {
pickable: true,
collidable: true,
clippable: false,
visible: false
visible: false,
isObject: false
}), NO_STATE_INHERIT),

//----------------------------------------------------------------------------------------------------------
Expand All @@ -99819,7 +99843,8 @@ class Control {
pickable: false,
collidable: true,
clippable: false,
visible: false
visible: false,
isObject: false
}), NO_STATE_INHERIT),

zAxisArrowHandle: rootNode.addChild(new Mesh(rootNode, {
Expand All @@ -99833,7 +99858,8 @@ class Control {
pickable: true,
collidable: true,
clippable: false,
visible: false
visible: false,
isObject: false
}), NO_STATE_INHERIT),


Expand All @@ -99848,7 +99874,8 @@ class Control {
clippable: false,
pickable: false,
collidable: true,
visible: false
visible: false,
isObject: false
}), NO_STATE_INHERIT),

zAxisHandle: rootNode.addChild(new Mesh(rootNode, {
Expand All @@ -99862,7 +99889,8 @@ class Control {
clippable: false,
pickable: true,
collidable: true,
visible: false
visible: false,
isObject: false
}), NO_STATE_INHERIT)
};

Expand Down Expand Up @@ -99894,7 +99922,8 @@ class Control {
clippable: false,
visible: false,
scale: [1, 1, 1],
rotation: [0, 0, 45]
rotation: [0, 0, 45],
isObject: false
}), NO_STATE_INHERIT),

xHoop: rootNode.addChild(new Mesh(rootNode, { // Full
Expand All @@ -99910,7 +99939,8 @@ class Control {
pickable: false,
collidable: true,
clippable: false,
visible: false
visible: false,
isObject: false
}), NO_STATE_INHERIT),

yHoop: rootNode.addChild(new Mesh(rootNode, {
Expand All @@ -99922,7 +99952,8 @@ class Control {
pickable: false,
collidable: true,
clippable: false,
visible: false
visible: false,
isObject: false
}), NO_STATE_INHERIT),

zHoop: rootNode.addChild(new Mesh(rootNode, { // Blue hoop about Z-axis
Expand All @@ -99935,7 +99966,8 @@ class Control {
collidable: true,
clippable: false,
backfaces: true,
visible: false
visible: false,
isObject: false
}), NO_STATE_INHERIT),

xAxisArrow: rootNode.addChild(new Mesh(rootNode, {
Expand All @@ -99949,7 +99981,8 @@ class Control {
pickable: false,
collidable: true,
clippable: false,
visible: false
visible: false,
isObject: false
}), NO_STATE_INHERIT),

yAxisArrow: rootNode.addChild(new Mesh(rootNode, {
Expand All @@ -99963,7 +99996,8 @@ class Control {
pickable: false,
collidable: true,
clippable: false,
visible: false
visible: false,
isObject: false
}), NO_STATE_INHERIT),

zAxisArrow: rootNode.addChild(new Mesh(rootNode, {
Expand All @@ -99977,7 +100011,8 @@ class Control {
pickable: false,
collidable: true,
clippable: false,
visible: false
visible: false,
isObject: false
}), NO_STATE_INHERIT)
};
}
Expand Down Expand Up @@ -110106,7 +110141,7 @@ class SectionTool extends Controller { // XX
pickSurface: true // <<------ This causes picking to find the intersection point on the entity
});

if (pickResult) {
if (pickResult && pickResult.entity && pickResult.entity.isObject) { // Only slice model objects, not 3D UI helpers

const sectionPlane = this._sectionPlanesPlugin.createSectionPlane({
pos: pickResult.worldPos,
Expand Down
4 changes: 2 additions & 2 deletions dist/xeokit-bim-viewer.min.es.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/xeokit-bim-viewer.min.umd.js

Large diffs are not rendered by default.

Loading

0 comments on commit acced39

Please sign in to comment.