Skip to content

Commit

Permalink
Rebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
xeolabs committed Sep 2, 2024
1 parent f993669 commit aa97680
Show file tree
Hide file tree
Showing 6 changed files with 169 additions and 168 deletions.
136 changes: 68 additions & 68 deletions dist/xeokit-sdk.cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ class ContextMenu {
'</li>');
if (!((groupIdx === groupLen - 1) || (j < lenj - 1))) {
html.push(
'<li id="' + item.id + '" class="xeokit-context-menu-item-seperator"></li>'
'<li id="' + item.id + '" class="xeokit-context-menu-item-separator"></li>'
);
}

Expand All @@ -700,7 +700,7 @@ class ContextMenu {
'</li>');
if (!((groupIdx === groupLen - 1) || (j < lenj - 1))) {
html.push(
'<li id="' + item.id + '" class="xeokit-context-menu-item-seperator"></li>'
'<li id="' + item.id + '" class="xeokit-context-menu-item-separator"></li>'
);
}
}
Expand Down Expand Up @@ -900,12 +900,10 @@ class ContextMenu {
const shown = getShown(this._context);
item.shown = shown;
if (!shown) {
itemElement.classList.remove("xeokit-context-menu-item-visible");
itemElement.classList.add("xeokit-context-menu-item-hidden");
itemElement.style.display = "none";
continue;
} else {
itemElement.classList.remove("ceokit-context-menu-item-hidden");
itemElement.classList.add("xeokit-context-menu-item-visible");
itemElement.style.display = "";

}
const enabled = getEnabled(this._context);
Expand Down Expand Up @@ -88172,6 +88170,16 @@ class DistanceMeasurement extends Component {
const scene = this.plugin.viewer.scene;

if (this._wpDirty) {
const delta = math.subVec3(
this._targetWorld,
this._originWorld,
tmpVec3
);

/**
* The length detected for each measurement axis.
*/
this._factors = math.transformVec3(this._axesBasis, delta);

this._measurementOrientation = determineMeasurementOrientation(this._originWorld, this._targetWorld, 0);
if(this._measurementOrientation === 'Vertical' && this.useRotationAdjustment){
Expand All @@ -88196,16 +88204,6 @@ class DistanceMeasurement extends Component {
this._wp[15] = 1.0;
}
else {
const delta = math.subVec3(
this._targetWorld,
this._originWorld,
tmpVec3
);

/**
* The length detected for each measurement axis.
*/
this._factors = math.transformVec3(this._axesBasis, delta);

this._wp[0] = this._originWorld[0];
this._wp[1] = this._originWorld[1];
Expand Down Expand Up @@ -126039,12 +126037,15 @@ class RenderService {
return element.checked;
}

setCheckbox(nodeId, checked) {
setCheckbox(nodeId, checked, indeterminate = false) {
const checkbox = document.getElementById(`checkbox-${nodeId}`);
if (checkbox) {
if (checked !== checkbox.checked) {
checkbox.checked = checked;
}
if (indeterminate !== checkbox.indeterminate) {
checkbox.indeterminate = indeterminate;
}
}
}

Expand Down Expand Up @@ -126432,6 +126433,7 @@ class TreeViewPlugin extends Plugin {
* vertical World axis. For all hierarchy types, other node types will be ordered in the ascending alphanumeric order of their titles.
* @param {Boolean} [cfg.pruneEmptyNodes=true] When true, will not contain nodes that don't have content in the {@link Scene}. These are nodes whose {@link MetaObject}s don't have {@link Entity}s.
* @param {RenderService} [cfg.renderService] Optional {@link RenderService} to use. Defaults to the {@link TreeViewPlugin}'s default {@link RenderService}.
* @param {Boolean} [cfg.showIndeterminate=false] When true, will show indeterminate state for checkboxes when some but not all child nodes are checked
*/
constructor(viewer, cfg = {}) {

Expand Down Expand Up @@ -126483,6 +126485,7 @@ class TreeViewPlugin extends Plugin {
this._pruneEmptyNodes = cfg.pruneEmptyNodes;
this._showListItemElementId = null;
this._renderService = cfg.renderService || new RenderService();
this._showIndeterminate = cfg.showIndeterminate ?? false;

if (!this._renderService) {
throw new Error('TreeViewPlugin: no render service set');
Expand Down Expand Up @@ -126524,8 +126527,10 @@ class TreeViewPlugin extends Plugin {
} else {
parent.numVisibleEntities--;
}

this._renderService.setCheckbox(parent.nodeId, (parent.numVisibleEntities > 0));
const indeterminate = this._showIndeterminate
&& parent.numVisibleEntities > 0
&& parent.numVisibleEntities < parent.numEntities;
this._renderService.setCheckbox(parent.nodeId, (parent.numVisibleEntities > 0), indeterminate);

parent = parent.parent;
}
Expand Down Expand Up @@ -126607,8 +126612,10 @@ class TreeViewPlugin extends Plugin {
} else {
parent.numVisibleEntities -= numUpdated;
}

this._renderService.setCheckbox(parent.nodeId, (parent.numVisibleEntities > 0));
const indeterminate = this._showIndeterminate
&& parent.numVisibleEntities > 0
&& parent.numVisibleEntities < parent.numEntities;
this._renderService.setCheckbox(parent.nodeId, (parent.numVisibleEntities > 0), indeterminate);

parent = parent.parent;
}
Expand Down Expand Up @@ -126848,8 +126855,8 @@ class TreeViewPlugin extends Plugin {
collapse() {
for (let i = 0, len = this._rootNodes.length; i < len; i++) {
const rootNode = this._rootNodes[i];
const objectId = rootNode.objectId;
this._collapseNode(objectId);
const nodeId = rootNode.nodeId;
this._collapseNode(nodeId);
}
}

Expand Down Expand Up @@ -139495,8 +139502,8 @@ class DotBIMDefaultDataSource {
* set ````true```` and will be registered by {@link Entity#id} in {@link Scene#objects}.
* * When loading, can set the World-space position, scale and rotation of each model within World space,
* along with initial properties for all the model's {@link Entity}s.
* * Allows to mask which IFC types we want to load.
* * Allows to configure initial viewer state for specified IFC types (color, visibility, selection, highlighted, X-rayed, pickable, etc).
* * Allows to mask which types we want to load.
* * Allows to configure initial viewer state for specified types (color, visibility, selection, highlighted, X-rayed, pickable, etc).
*
* ## Usage
*
Expand Down Expand Up @@ -139566,9 +139573,9 @@ class DotBIMDefaultDataSource {
* });
* ````
*
* ## Including and excluding IFC types
* ## Including and excluding types
*
* We can also load only those objects that have the specified IFC types. In the example below, we'll load only the
* We can also load only those objects that have the specified types. In the example below, we'll load only the
* objects that represent walls.
*
* ````javascript
Expand All @@ -139579,7 +139586,7 @@ class DotBIMDefaultDataSource {
* });
* ````
*
* We can also load only those objects that **don't** have the specified IFC types. In the example below, we'll load only the
* We can also load only those objects that **don't** have the specified types. In the example below, we'll load only the
* objects that do not represent empty space.
*
* ````javascript
Expand All @@ -139590,13 +139597,13 @@ class DotBIMDefaultDataSource {
* });
* ````
*
* # Configuring initial IFC object appearances
* # Configuring initial object appearances
*
* We can specify the custom initial appearance of loaded objects according to their IFC types.
* We can specify the custom initial appearance of loaded objects according to their types.
*
* This is useful for things like:
*
* * setting the colors to our objects according to their IFC types,
* * setting the colors to our objects according to their types,
* * automatically hiding ````IfcSpace```` objects, and
* * ensuring that ````IfcWindow```` objects are always transparent.
* <br>
Expand Down Expand Up @@ -139628,7 +139635,7 @@ class DotBIMDefaultDataSource {
* });
* ````
*
* When we don't customize the appearance of IFC types, as just above, then IfcSpace elements tend to obscure other
* When we don't customize the appearance of types, as just above, then IfcSpace elements tend to obscure other
* elements, which can be confusing.
*
* It's often helpful to make IfcSpaces transparent and unpickable, like this:
Expand Down Expand Up @@ -139828,36 +139835,36 @@ class DotBIMLoaderPlugin extends Plugin {

const dbMeshLoaded = {};

const ifcProjectId = math.createUUID();
const ifcSiteId = math.createUUID();
const ifcBuildingId = math.createUUID();
const ifcBuildingStoryId = math.createUUID();
const projectId = math.createUUID();
const siteId = math.createUUID();
const buildingId = math.createUUID();
const buildingStoryId = math.createUUID();

const metaModelData = {
metaObjects: [
{
id: ifcProjectId,
name: "IfcProject",
type: "IfcProject",
id: projectId,
name: "Project",
type: "Project",
parent: null
},
{
id: ifcSiteId,
name: "IfcSite",
type: "IfcSite",
parent: ifcProjectId
id: siteId,
name: "Site",
type: "Site",
parent: projectId
},
{
id: ifcBuildingId,
name: "IfcBuilding",
type: "IfcBuilding",
parent: ifcSiteId
id: buildingId,
name: "Building",
type: "Building",
parent: siteId
},
{
id: ifcBuildingStoryId,
name: "IfcBuildingStorey",
type: "IfcBuildingStorey",
parent: ifcBuildingId
id: buildingStoryId,
name: "BuildingStorey",
type: "BuildingStorey",
parent: buildingId
}
],
propertySets: []
Expand Down Expand Up @@ -140024,30 +140031,23 @@ class DotBIMLoaderPlugin extends Plugin {
});
}

let properties = [];
for (let infoKey in info) {
let properties;
if (infoKey.startsWith("IFC_Pset_")) {
if (!properties) {
properties = [];
}
properties.push({
name: infoKey,
value: info[infoKey]
});
}
if (properties) {
metaModelData.propertySets.push({
id: objectId,
properties
});
}
properties.push({
name: infoKey,
value: info[infoKey]
});
}
metaModelData.propertySets.push({
id: objectId,
properties
});

metaModelData.metaObjects.push({
id: objectId,
name: info && info.Name && info.Name !== "None" ? info.Name : `${element.type} ${objectId}`,
type: element.type,
parent: ifcBuildingStoryId,
parent: buildingStoryId,
propertySetIds: [objectId]
});
}
Expand Down
Loading

0 comments on commit aa97680

Please sign in to comment.