Skip to content

Commit

Permalink
Lables and configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
aalavandhaann committed Jul 17, 2019
1 parent fef52b3 commit b6d453e
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
4 changes: 4 additions & 0 deletions build/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,10 @@ function datGUI(three, floorplanner)
f.add(BP3DJS.wallInformation, 'exterior').name('Exterior');
f.add(BP3DJS.wallInformation, 'interior').name('Interior');
f.add(BP3DJS.wallInformation, 'midline').name('Midline');
f.add(BP3DJS.wallInformation, 'labels').name('Labels');
f.add(BP3DJS.wallInformation, 'exteriorlabel').name('Label for Exterior');
f.add(BP3DJS.wallInformation, 'interiorlabel').name('Label for Interior');
f.add(BP3DJS.wallInformation, 'midlinelabel').name('Label for Midline');

cameraPropFolder = getCameraRangePropertiesFolder(gui, aCameraRange);
wallPropFolder = getWallAndFloorPropertiesFolder(gui, aWall);
Expand Down
11 changes: 7 additions & 4 deletions build/js/bp3djs.js
Original file line number Diff line number Diff line change
Expand Up @@ -48982,7 +48982,7 @@ var BP3DJS = (function (exports) {

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

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

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

/** */
Expand All @@ -117918,7 +117919,8 @@ var BP3DJS = (function (exports) {
return;
}
if (wallInformation.exterior) {
this.drawTextLabel('e:' + Dimensioning.cmToMeasure(length), this.viewmodel.convertX(pos.x), this.viewmodel.convertY(pos.y + 40));
var label = !wallInformation.labels ? '' : wallInformation.exteriorlabel;
this.drawTextLabel('' + label + Dimensioning.cmToMeasure(length), this.viewmodel.convertX(pos.x), this.viewmodel.convertY(pos.y + 40));
}
}

Expand All @@ -117934,7 +117936,8 @@ var BP3DJS = (function (exports) {
return;
}
if (wallInformation.interior) {
this.drawTextLabel('i:' + Dimensioning.cmToMeasure(length), this.viewmodel.convertX(pos.x), this.viewmodel.convertY(pos.y - 40));
var label = !wallInformation.labels ? '' : wallInformation.interiorlabel;
this.drawTextLabel('' + label + Dimensioning.cmToMeasure(length), this.viewmodel.convertX(pos.x), this.viewmodel.convertY(pos.y - 40));
}
}
}, {
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/core/configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const configSystemUI = 'systemUI';

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

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

/** Global configuration to customize the whole system. */
export class Configuration
Expand Down
9 changes: 6 additions & 3 deletions src/scripts/floorplanner/floorplanner_view.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,8 @@ export class FloorplannerView2D
// dont draw labels on walls this short
return;
}
this.drawTextLabel(`m:${Dimensioning.cmToMeasure(length)}` ,this.viewmodel.convertX(pos.x),this.viewmodel.convertY(pos.y));
var label = (!wallInformation.labels)?'':wallInformation.midlinelabel;
this.drawTextLabel(`${label}${Dimensioning.cmToMeasure(length)}` ,this.viewmodel.convertX(pos.x),this.viewmodel.convertY(pos.y));
}

/** */
Expand All @@ -220,7 +221,8 @@ export class FloorplannerView2D
}
if(wallInformation.exterior)
{
this.drawTextLabel(`e:${Dimensioning.cmToMeasure(length)}` ,this.viewmodel.convertX(pos.x),this.viewmodel.convertY(pos.y+40));
var label = (!wallInformation.labels)?'':wallInformation.exteriorlabel;
this.drawTextLabel(`${label}${Dimensioning.cmToMeasure(length)}` ,this.viewmodel.convertX(pos.x),this.viewmodel.convertY(pos.y+40));
}
}

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

}
Expand Down

0 comments on commit b6d453e

Please sign in to comment.