Skip to content

Commit b6d453e

Browse files
committed
Lables and configurations
1 parent fef52b3 commit b6d453e

File tree

4 files changed

+18
-8
lines changed

4 files changed

+18
-8
lines changed

build/js/app.js

+4
Original file line numberDiff line numberDiff line change
@@ -708,6 +708,10 @@ function datGUI(three, floorplanner)
708708
f.add(BP3DJS.wallInformation, 'exterior').name('Exterior');
709709
f.add(BP3DJS.wallInformation, 'interior').name('Interior');
710710
f.add(BP3DJS.wallInformation, 'midline').name('Midline');
711+
f.add(BP3DJS.wallInformation, 'labels').name('Labels');
712+
f.add(BP3DJS.wallInformation, 'exteriorlabel').name('Label for Exterior');
713+
f.add(BP3DJS.wallInformation, 'interiorlabel').name('Label for Interior');
714+
f.add(BP3DJS.wallInformation, 'midlinelabel').name('Label for Midline');
711715

712716
cameraPropFolder = getCameraRangePropertiesFolder(gui, aCameraRange);
713717
wallPropFolder = getWallAndFloorPropertiesFolder(gui, aWall);

build/js/bp3djs.js

+7-4
Original file line numberDiff line numberDiff line change
@@ -48982,7 +48982,7 @@ var BP3DJS = (function (exports) {
4898248982

4898348983
var config = { dimUnit: dimCentiMeter, wallHeight: 250, wallThickness: 10, systemUI: false };
4898448984

48985-
var wallInformation = { exterior: true, interior: true, midline: true };
48985+
var wallInformation = { exterior: true, interior: true, midline: true, labels: true, exteriorlabel: 'e:', interiorlabel: 'i:', midlinelabel: 'm:' };
4898648986

4898748987
/** Global configuration to customize the whole system. */
4898848988
var Configuration = function () {
@@ -117903,7 +117903,8 @@ var BP3DJS = (function (exports) {
117903117903
// dont draw labels on walls this short
117904117904
return;
117905117905
}
117906-
this.drawTextLabel('m:' + Dimensioning.cmToMeasure(length), this.viewmodel.convertX(pos.x), this.viewmodel.convertY(pos.y));
117906+
var label = !wallInformation.labels ? '' : wallInformation.midlinelabel;
117907+
this.drawTextLabel('' + label + Dimensioning.cmToMeasure(length), this.viewmodel.convertX(pos.x), this.viewmodel.convertY(pos.y));
117907117908
}
117908117909

117909117910
/** */
@@ -117918,7 +117919,8 @@ var BP3DJS = (function (exports) {
117918117919
return;
117919117920
}
117920117921
if (wallInformation.exterior) {
117921-
this.drawTextLabel('e:' + Dimensioning.cmToMeasure(length), this.viewmodel.convertX(pos.x), this.viewmodel.convertY(pos.y + 40));
117922+
var label = !wallInformation.labels ? '' : wallInformation.exteriorlabel;
117923+
this.drawTextLabel('' + label + Dimensioning.cmToMeasure(length), this.viewmodel.convertX(pos.x), this.viewmodel.convertY(pos.y + 40));
117922117924
}
117923117925
}
117924117926

@@ -117934,7 +117936,8 @@ var BP3DJS = (function (exports) {
117934117936
return;
117935117937
}
117936117938
if (wallInformation.interior) {
117937-
this.drawTextLabel('i:' + Dimensioning.cmToMeasure(length), this.viewmodel.convertX(pos.x), this.viewmodel.convertY(pos.y - 40));
117939+
var label = !wallInformation.labels ? '' : wallInformation.interiorlabel;
117940+
this.drawTextLabel('' + label + Dimensioning.cmToMeasure(length), this.viewmodel.convertX(pos.x), this.viewmodel.convertY(pos.y - 40));
117938117941
}
117939117942
}
117940117943
}, {

src/scripts/core/configuration.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const configSystemUI = 'systemUI';
1313

1414
export var config = {dimUnit: dimCentiMeter, wallHeight: 250, wallThickness: 10, systemUI: false};
1515

16-
export var wallInformation = {exterior: true, interior: true, midline: true};
16+
export var wallInformation = {exterior: true, interior: true, midline: true, labels: true, exteriorlabel:'e:', interiorlabel:'i:', midlinelabel:'m:'};
1717

1818
/** Global configuration to customize the whole system. */
1919
export class Configuration

src/scripts/floorplanner/floorplanner_view.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,8 @@ export class FloorplannerView2D
205205
// dont draw labels on walls this short
206206
return;
207207
}
208-
this.drawTextLabel(`m:${Dimensioning.cmToMeasure(length)}` ,this.viewmodel.convertX(pos.x),this.viewmodel.convertY(pos.y));
208+
var label = (!wallInformation.labels)?'':wallInformation.midlinelabel;
209+
this.drawTextLabel(`${label}${Dimensioning.cmToMeasure(length)}` ,this.viewmodel.convertX(pos.x),this.viewmodel.convertY(pos.y));
209210
}
210211

211212
/** */
@@ -220,7 +221,8 @@ export class FloorplannerView2D
220221
}
221222
if(wallInformation.exterior)
222223
{
223-
this.drawTextLabel(`e:${Dimensioning.cmToMeasure(length)}` ,this.viewmodel.convertX(pos.x),this.viewmodel.convertY(pos.y+40));
224+
var label = (!wallInformation.labels)?'':wallInformation.exteriorlabel;
225+
this.drawTextLabel(`${label}${Dimensioning.cmToMeasure(length)}` ,this.viewmodel.convertX(pos.x),this.viewmodel.convertY(pos.y+40));
224226
}
225227
}
226228

@@ -236,7 +238,8 @@ export class FloorplannerView2D
236238
}
237239
if(wallInformation.interior)
238240
{
239-
this.drawTextLabel(`i:${Dimensioning.cmToMeasure(length)}` ,this.viewmodel.convertX(pos.x),this.viewmodel.convertY(pos.y-40));
241+
var label = (!wallInformation.labels)?'':wallInformation.interiorlabel;
242+
this.drawTextLabel(`${label}${Dimensioning.cmToMeasure(length)}` ,this.viewmodel.convertX(pos.x),this.viewmodel.convertY(pos.y-40));
240243
}
241244

242245
}

0 commit comments

Comments
 (0)