-
Notifications
You must be signed in to change notification settings - Fork 176
Developer notes
#0K Srinivasan Ramachandran edited this page Jun 19, 2019
·
5 revisions
There are events to notify the UI to act upon. These events convey the selection of various entities in the floorplan. As far as the 3D scene is concerned the following event are important. But one needs to instantiate the blueprint instance to address any events.
var opts =
{
floorplannerElement:'floorplanner-canvas',
threeElement: '#viewer',
threeCanvasElement: 'three-canvas',
textureDir:"models/textures/",
widget: false
}
var blueprint3d = new BP3DJS.BlueprintJS(opts);
Then events can be added to the member instance three.
var three = blueprint3d.three;
three.addEventListener(BP3DJS.EVENT_ITEM_SELECTED, function(o){//o.item: item reference to furniture in the room});
three.addEventListener(BP3DJS.EVENT_ITEM_UNSELECTED, function(o){//o.item that was unselected reference to the furniture in the room});
three.addEventListener(BP3DJS.EVENT_WALL_CLICKED, (o)=>{//o.item is a wall that has been selected;});
three.addEventListener(BP3DJS.EVENT_FLOOR_CLICKED, (o)=>{//o.item is a floor that has been selected;});
three.addEventListener(BP3DJS.EVENT_FPS_EXIT, ()=>{//fps mode exit and automatically enters 3d design mode});