opensourceBIM / bimvie.ws

Javascript client for Building Information Modelling, using open standards like IFC, BCF and BIMSie. Using Bootstrap, BIM Surfer, etc..
GNU Affero General Public License v3.0
171 stars 87 forks source link

How to light more than one object #71

Open shiwenna opened 7 years ago

shiwenna commented 7 years ago

I add a button on the page The expected result is that multiple objects can be highlighted by clicking the button How can I get multiple nodes at the same time when I click the button? default

rubendel commented 7 years ago

Multiselect is not supported in BIMvie.ws (which is using BIMserver 1.0). BIMsurfer V2 will support multiselect (and will at some point be used by BIMvie.ws)

shiwenna commented 7 years ago

Click this button, how to find an object and highlight it ? Not by clicking on the project tree.

mansch commented 7 years ago

You need to know the gid of the object you want to highlight (object.gid). Then you search the SceneJS scene for the structure with that id, like scene.findNode(gid).

As Ruben said the BimViewer does not support highlighting of multiple objects so you have to implement the generation of additional SceneJS (geometry) layers for the highlight object yourself.

multiselect

shiwenna commented 7 years ago

can you provide a demo - a jsfiddle perhaps?

mansch commented 7 years ago

Sorry, no. Whats your problem exactly? You extend BIMview.ws? You need a reference to the BIM objects andalso to the SceneJS scene. The BIM objects to get the gid of the object(s) you want to highlight. Then have a look to the BIM viewer how it handle the selection (tip: look for 'pick'). Thats where you need the access to the SceneJS scene.

shiwenna commented 7 years ago

Thank you for your answer, I want to know how to get multiple objects and theit gid

mansch commented 7 years ago

And you use standard BIMvie.ws? The project tree and also the 3D viewer downloading the model objects from the BIMserver. This is done via BimServerClient instance which provides a method getModel. The result (via callback) is a object with all the objects part of the project. There you identify your target objects by the object id and there is your gid. The getModel result look somewhat like { 123: { gid: "aabbcc1122", ...}, 324134: {gid: "hh21h2"}, ... } where 123 is the object id and aabbcc1122 the gid of that object. Then you find the SceneJS structure in the scene with scene.findNode("aabbcc1122"). HTH

shiwenna commented 7 years ago

I get the getModel result like this qq 20161115194634 the "revisions" is gid?

mansch commented 7 years ago

You're not using the BimServerJS API? I'll call it like instanceBimServerClient.getModel(poid, roid, strSchema, bDeep, function(model) { ... /* model is 'nearly' the JS object as seen in the screenshot */ .. }

gid

model contains a key 'objects' - a list with all the objects of the model. Key is the obejct id (oid). Some of the entries are only structural references, some reference real objects. Real objects will have a key "gid" which is the id you want (to find it in the Scene and modify the SceneJS scene).

shiwenna commented 7 years ago

I using the BimServerClient.getModel(poid, roid, schema, deep, callback){} , get the result like this qq 20161121101347 the objects result is empty.I request parameters wrong? poid : project.oid; roid : project.lastRevisionId; schema : project.schema.

mansch commented 7 years ago

Params seem to be okay. Does BIMvie.ws show the model correctly for that project? You should check what BIMvie.ws does - attach the debugger to the functions in the 3dview.html and check parameters/result.

shiwenna commented 7 years ago

This project is able to load successfully. I found the getModel() in project.html and debugging it ,get the above results. The 3dview.html not found getModel(). Are you sure in 3dview.html?

mansch commented 7 years ago

Of course you are right. Andalso after calling the getModel method you need to init the download of the objects - then you'll get the model.objects. The model of the result above provides you with a query method (it was renamed from queryNew to query), you will find the progress and the parameters for the query in the preloadModel. Sorry for my misleading.

RicoLiu commented 7 years ago

@mansch

you need to init the download of the objects

Can you explain more in detail?

dbarthelemy commented 7 years ago

@rubendel I am still using an old release (0.0.75) based on BIMsurfer v1 and I am facing the same issue as I also want to support multi-selection. Does the latest release still use v1 ? Do you have any plan to share in regards of v2 usage ? Thanks

rubendel commented 7 years ago

It's still using V1, there are still a few quirks in V2 that I want to be solved before using it in BIMvie.ws