Skip to content

Commit fef52b3

Browse files
committed
Adding GUI options to configure what is shown for the wall measurement(exterior/interior/midline) information
1 parent 99f94ea commit fef52b3

File tree

5 files changed

+47
-15
lines changed

5 files changed

+47
-15
lines changed

build/js/app.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -698,15 +698,23 @@ function datGUI(three, floorplanner)
698698
aCameraRange = new CameraProperties();
699699
aWall = new WallProperties();
700700
anItem = new ItemProperties(gui);
701-
701+
702702
aCameraRange.three = three;
703703

704-
globalPropFolder = getGlobalPropertiesFolder(gui, aGlobal);
704+
globalPropFolder = getGlobalPropertiesFolder(gui, aGlobal);
705705
carbonPropsFolder = getCarbonSheetPropertiesFolder(gui, floorplanner.carbonSheet, aGlobal);
706+
707+
var f = gui.addFolder('Wall Measurements');
708+
f.add(BP3DJS.wallInformation, 'exterior').name('Exterior');
709+
f.add(BP3DJS.wallInformation, 'interior').name('Interior');
710+
f.add(BP3DJS.wallInformation, 'midline').name('Midline');
706711

707712
cameraPropFolder = getCameraRangePropertiesFolder(gui, aCameraRange);
708713
wallPropFolder = getWallAndFloorPropertiesFolder(gui, aWall);
709714
itemPropFolder = getItemPropertiesFolder(gui, anItem);
715+
716+
717+
710718
}
711719

712720

build/js/bp3djs.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48982,6 +48982,8 @@ 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 };
48986+
4898548987
/** Global configuration to customize the whole system. */
4898648988
var Configuration = function () {
4898748989
function Configuration() {
@@ -117892,6 +117894,9 @@ var BP3DJS = (function (exports) {
117892117894
}, {
117893117895
key: 'drawWallLabelsMiddle',
117894117896
value: function drawWallLabelsMiddle(wall) {
117897+
if (!wallInformation.midline) {
117898+
return;
117899+
}
117895117900
var pos = wall.wallCenter();
117896117901
var length = wall.wallLength();
117897117902
if (length < 60) {
@@ -117912,7 +117917,9 @@ var BP3DJS = (function (exports) {
117912117917
// dont draw labels on walls this short
117913117918
return;
117914117919
}
117915-
this.drawTextLabel('e:' + Dimensioning.cmToMeasure(length), this.viewmodel.convertX(pos.x), this.viewmodel.convertY(pos.y + 40));
117920+
if (wallInformation.exterior) {
117921+
this.drawTextLabel('e:' + Dimensioning.cmToMeasure(length), this.viewmodel.convertX(pos.x), this.viewmodel.convertY(pos.y + 40));
117922+
}
117916117923
}
117917117924

117918117925
/** */
@@ -117926,7 +117933,9 @@ var BP3DJS = (function (exports) {
117926117933
// dont draw labels on walls this short
117927117934
return;
117928117935
}
117929-
this.drawTextLabel('i:' + Dimensioning.cmToMeasure(length), this.viewmodel.convertX(pos.x), this.viewmodel.convertY(pos.y - 40));
117936+
if (wallInformation.interior) {
117937+
this.drawTextLabel('i:' + Dimensioning.cmToMeasure(length), this.viewmodel.convertX(pos.x), this.viewmodel.convertY(pos.y - 40));
117938+
}
117930117939
}
117931117940
}, {
117932117941
key: 'drawTextLabel',
@@ -170155,6 +170164,7 @@ var BP3DJS = (function (exports) {
170155170164
exports.wallColor = wallColor;
170156170165
exports.wallColorHover = wallColorHover;
170157170166
exports.wallColorSelected = wallColorSelected;
170167+
exports.wallInformation = wallInformation;
170158170168
exports.wallWidth = wallWidth;
170159170169
exports.wallWidthHover = wallWidthHover;
170160170170
exports.wallWidthSelected = wallWidthSelected;

src/scripts/blueprint.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export {ELogContext, ELogLevel, logContext, isLogging, log} from './core/log.js'
1919
export {dimInch, dimFeetAndInch, dimMeter, dimCentiMeter, dimMilliMeter, dimensioningOptions, decimals, Dimensioning} from './core/dimensioning.js';
2020
export {cmPerFoot, pixelsPerFoot, cmPerPixel, pixelsPerCm} from './core/dimensioning.js';
2121

22-
export {configDimUnit, configWallHeight, configWallThickness, configSystemUI, Configuration} from './core/configuration.js';
22+
export {configDimUnit, configWallHeight, configWallThickness, configSystemUI, wallInformation, Configuration} from './core/configuration.js';
2323
export {VIEW_TOP, VIEW_FRONT, VIEW_RIGHT, VIEW_LEFT, VIEW_ISOMETRY} from './core/constants.js';
2424

2525
//Classes from model module

src/scripts/core/configuration.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ 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};
17+
1618
/** Global configuration to customize the whole system. */
1719
export class Configuration
1820
{

src/scripts/floorplanner/floorplanner_view.js

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {Utils} from '../core/utils.js';
44
import {EVENT_UPDATED} from '../core/events.js';
55

66
import {Dimensioning} from '../core/dimensioning.js';
7+
import {wallInformation} from '../core/configuration.js';
78
import {CarbonSheet} from './carbonsheet.js';
89

910
/** */
@@ -193,14 +194,18 @@ export class FloorplannerView2D
193194

194195
drawWallLabelsMiddle(wall)
195196
{
196-
var pos = wall.wallCenter();
197-
var length = wall.wallLength();
198-
if (length < 60)
199-
{
200-
// dont draw labels on walls this short
201-
return;
202-
}
203-
this.drawTextLabel(`m:${Dimensioning.cmToMeasure(length)}` ,this.viewmodel.convertX(pos.x),this.viewmodel.convertY(pos.y));
197+
if(! wallInformation.midline)
198+
{
199+
return;
200+
}
201+
var pos = wall.wallCenter();
202+
var length = wall.wallLength();
203+
if (length < 60)
204+
{
205+
// dont draw labels on walls this short
206+
return;
207+
}
208+
this.drawTextLabel(`m:${Dimensioning.cmToMeasure(length)}` ,this.viewmodel.convertX(pos.x),this.viewmodel.convertY(pos.y));
204209
}
205210

206211
/** */
@@ -213,7 +218,10 @@ export class FloorplannerView2D
213218
// dont draw labels on walls this short
214219
return;
215220
}
216-
this.drawTextLabel(`e:${Dimensioning.cmToMeasure(length)}` ,this.viewmodel.convertX(pos.x),this.viewmodel.convertY(pos.y+40));
221+
if(wallInformation.exterior)
222+
{
223+
this.drawTextLabel(`e:${Dimensioning.cmToMeasure(length)}` ,this.viewmodel.convertX(pos.x),this.viewmodel.convertY(pos.y+40));
224+
}
217225
}
218226

219227
/** */
@@ -226,7 +234,11 @@ export class FloorplannerView2D
226234
// dont draw labels on walls this short
227235
return;
228236
}
229-
this.drawTextLabel(`i:${Dimensioning.cmToMeasure(length)}` ,this.viewmodel.convertX(pos.x),this.viewmodel.convertY(pos.y-40));
237+
if(wallInformation.interior)
238+
{
239+
this.drawTextLabel(`i:${Dimensioning.cmToMeasure(length)}` ,this.viewmodel.convertX(pos.x),this.viewmodel.convertY(pos.y-40));
240+
}
241+
230242
}
231243

232244
drawTextLabel(label, x, y, textcolor='#000000', strokecolor='#ffffff', style='normal')

0 commit comments

Comments
 (0)