-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optional vtkjs #893
Optional vtkjs #893
Conversation
The problem is that we will have to transform every vtkPoints to destination gcs (like geotransform in vtk) and then we can have reasonable near and far and also proper radius
The changes include: - Create an alias `vtk` to the compiled `vtk.js` in the `vtk.js/dist` director. - Comment out passing the whole code-base through Uglify.js.
Comment out passing through UglifyJs
The caveat is that geojs needs to call resetCamera and setClippingRange on vtk-js camera.
Needs code cleanup
This was erroneously removed during conflict resolution
@zachmullen I'm reworking how the camera class allows setting the clip bounds (including near and far). I hope to have a PR for that soon. This PR ultimately won't change |
The latest (v7) did not import properly.
To fix the pan issue, I'm guessing that the |
@aashish24 @sankhesh @manthey I've pushed changes that now make the vtk.js example that @sankhesh wrote load into the list and have access to the data, but as I mentioned before, the vtkjs renderer is only showing the background, no map or points. Is this expected? Did this ever work, or was it just not completed? Something is clearly wrong in the renderer implementation itself. |
@zachmullen It did work at one point. However, I must admit that it was all hacked together back then. My understanding was that between the changes to vtk-js and this branch, it should all work. I can take a look if you like. |
7448f43
to
f469a01
Compare
f469a01
to
85fd89e
Compare
See the several TODO comments for things that need fixing.
@zachmullen I just pushed some changes that make it so that when I use the simple_point tutorial I see points in the appropriate spots. You can zoom and pan via the console: There are a bunch of points in the code I've marked as TODO. At the very least, we need to use the non-fullscreen vtk.js renderer so we don't break interaction. I don't know why vtk.js renders a background color once but then not again -- we'd rather it never do so. |
@aashish24 I think, at the very least, we have to resolve the initial color overlay and the mouse interaction issue before we could merge this. There are many other smaller issues which we could defer or wait until they are resolved before merging. I'd also like to see us using the latest vtk.js version (the latest version doesn't import the same way, so we have to figure that out). |
+1, yes that is the right thing to do.
What is the initial color overlay issue is? just wanted to make sure I understand.
Are we still having some interaction issues? I believe @sankhesh fixed some but wondering if there are more. |
For whatever reason, the vtkjs renderer fills its background with a color. As @zachmullen just commented, we can ask for transparent to avoid this.
Yes -- the vtkjs render window is the full screen renderer, which makes a div on top of everything. This is wrong for two reasons: (1) the map may not be the full windows, and (2) the div eats the mouse events. I crudely switched to the vtkGenericRenderWindow, and set its container to the layer div. This fixed the interaction issue, but the vtk renderer had the wrong resolution (and may have had other issues), so I assume we just need to not use the full screen renderer and configure a partial screen renderer properly. However, if I manually pan, zoom, etc., the drawn points are all in the correct spots. |
Perhaps, we could use the |
I believe that is what David did. David, with these two fixes, do you still think we need to address these issues in depth before we approve this PR? Perhaps, we can list all of these issues and check if they can be addressed in another PR? |
This removes the duplicate capitals.json and just references the file from the reprojection example. This adds a very basic test for the vtkjs point feature. It really only tests that the canvas is created.
Ideally this would be an option that multiple renderers could honor.
a8686f7
to
79f3a98
Compare
This required a lighting change to the actor.
@zachmullen, @aashish24 There are still a pile of "TODO" issues, but this is superficially working. It even has coverage of much of the new code. I recommend that we merge this and fix issues in future PRs. The biggest defect, in my opinion, is that it uses a single value for radius, color, and opacity for all points (and doesn't distinguish between fill and stroke values at all). I don't (yet) know enough about vtkjs to know how to color and size each point distinctly in an efficient manner. |
I agree, lets merge this if it is okay with @zachmullen and @sankhesh as well. |
b738bd2
to
4fbcabf
Compare
4fbcabf
to
154bb5f
Compare
This merges latest master with the changes on @sankhesh 's vtk branch, as well merging the dual-builds branch.
@sankhesh @manthey during the merge there was one conflict I wasn't sure about -- are the changes in
src/camera.js
to the far and near camera bounds still necessary?