Toggle a mixin in CesiumJS - cesiumjs

in order to have a better overview over the performance of a Cesium project, I would like to be able to toggle Cesium's inspector panel.
Now I can add the Mixin with the following code
viewer.extend(Cesium.viewerCesiumInspectorMixin);
but how can I remove it from the Viewer?
Cannot seem to find a method in the viewer documentation.
Thanks!

Related

How can i create 3d pushpin extension for autodesk forge?

I want to create 3d pushpin extension for Autodesk forge v7.*. I tried to use this article`
3D Markup with icons and Info-Card.
But some functions are not working correctly. How can i use it correctly?
I got this errors in console
Now all functions are working correctly, in data i got undefined for parent. Pushpins are not appeared yet.
Apparently there were a few issues with your code:
Since Viewer v7 and onwards overlay scenes are managed so you'd need to add custom geometry with:
this.viewer.overlays.addScene('custom-scene');
this.viewer.overlays.addMesh(this.line3d, 'custom-scene');
Use arrow functions or bind for your callbacks to window and document events such as mousemove or click otherwise they'd lose their contexts and throw errors
Necessary styling was not set for the markups to persist their relative positions ...
See here with corrections to all of the above:

forge Viewer - cant below markups be rotated?

I was checking example https://forge-rcdb.autodesk.io/configurator?id=598d7ec14cabf2c1f4dec948
Not sure while I see markups in View state, the model cannot be rotated? Is this by design? Or markups drawn using different shapes cannot be viewed using camera events? If this is possible, show me an example which shows this.
I exactly need similar example where I can have an editor where markups mode can be selected and draw?
It is by design but you can try below to enable navigation when in view mode:
Autodesk.Viewing.Extensions.Markups.Core.Utils.showLmvToolsAndPanels(viewer)
markExt.allowNavigation(true)
viewer.navTools.orbittoolsbutton.container.style.display='block'
// then pick the desired tool from toolbar and navigate
Note this is NOT officially supported (since navigation is suppressed by design) and might not work with future releases (works as of 7.12).
You might be interested by this example for 3d markup using the Forge Viewer even though it doesn't have a configuration mode.
https://github.com/apprentice3d/ForgeViewerExtensions

Is it possible with Autodesk Forge?

Is it possible with Autodesk Forge?
Upload the DWG file and view it on the web. Maybe I can use Forge's viwer API. Is that right?
And the web has a button. Can I move the focus to a specific object when I click that button? Using Javascript.
(I will assign ID values to objects while working in Autodesk CAD.)
Similar to Question 2. Can I change the color of a specific object using JavaScript?
I'm not good at English. Please politely understand.
Help!
Upload the DWG file and view it on the web. Maybe I can use Forge's viwer API. Is that right?
Yes follow the tutorial here
And the web has a button. Can I move the focus to a specific object when I click that button? Using Javascript.
Try viewer.isolate(dbid) or viewer.fitToView(dbid)
Can I change the color of a specific object using JavaScript?
Try viewer.setThemingColor
You can find doc/usage details for these methods on our official website

Autodesk Forge Viewer - show markups all the time

We are using the Forge viewer to show both 2D and 3D models. For the 2D models, we would like to be able to show markups all the time, like you can with the viewer inside BIM360.
I tried the solution mentioned here: Forge Viewer: Show bottom toolbar and markups at the same time - but I have not been able to get that to work. It seems like when I call:
Autodesk.Viewing.Extensions.Markups.Core.Utils.showLmvToolsAndPanels(viewer)
It hides the markups.
How is this done in BIM360? - are they using a custom viewer, where this has been enabled somehow?
Unfortunately I was able to get it to work with:
Autodesk.Viewing.Extensions.Markups.Core.Utils.showLmvToolsAndPanels(viewer)
See live sample here:

Autodesk Forge Viewer - Inaccurate Pushpin Location

I am following the tutorial available here, in order to add Pushpins to a clicked location on the Forge viewer. My issue is that the pushpin is drawn on a different location to where I clicked on the viewer. I am using the exact same code that as available in the tutorial, although I have implemented it as a separate extension.
Following is a screenshot of where the Pushpin was drawn, and where the mouse pointer was at the time it was clicked.
I have been trying to play around with the code by even manually changing the location to get the correct position, but wasn't really successful. Any help on this regard would be appreciated.
Thanks in Advance!
I have this problem when my app was doing components size changes with css, and I solve this calling the method resize of the viewer, after the visual size changes, and before the pushpin creation, like above:
viewer.resize()
Link: https://forge.autodesk.com/en/docs/viewer/v7/reference/Viewing/Viewer3D/#resize
I hope this can help you!