Skip to content
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

ViewportControl and floating window #249

Open
corbane opened this issue Jan 15, 2020 · 5 comments
Open

ViewportControl and floating window #249

corbane opened this issue Jan 15, 2020 · 5 comments
Labels
.NET Pull requests that update .net code

Comments

@corbane
Copy link

corbane commented Jan 15, 2020

I am experimenting RhinoInside with the WinFormsApp example.

The RhinoWindows.Forms.Controls.ViewportControl behaves unexpectedly.

It opens floating windows saved in the file.
Being able to have floating windows is good enough, but it uses the inputs entry as Rhino.
We can select an object with a left click and translation comes with ctrl/right click.

image

@sbaer
Copy link
Member

sbaer commented Jan 16, 2020

I don't understand this bug report. Could you elaborate on what the issue is?

@corbane
Copy link
Author

corbane commented Jan 16, 2020

Yes of course,

when we open a Rhino file saved without floating windows in a ViewportControl, it defines its own event handler

when we open a Rhino file saved with floating windows in a ViewportControl it defines its own event handler, and, it opens a floating window at the dimensions save in the file.
For this second window, it keeps the Rhinoceros event managers.

ViewportControl flotting viewport
Selectable object no Left click
can move objects no yes
Translation view Left right Maj + Left click
Rotation view Left click Left click
Zoom view no Ctrl/Alt + Left click
Middle click nothing Error "No toolbar or group named 'default.Popup' found to pop-up"
Contextual menu no yes
Can access to the Rhino properties page no yes (I changed the persistent settings of Rhino with this control)
Shortcuts no yes (Ctrl+X, Ctrl+S works)

ViewportControl Should Not Open Floating Windows.
Or else, both must have the same event handlers.
we currently have the first non editable and the second editable (Rhino settings included)

@tongbong
Copy link

tongbong commented Nov 25, 2020

@corbane Do you still have the code?
I don't know about you but I would expect the viewport control to always behave like described in the "floating viewport" column.

/!\ Edit, after having loaded the file, run this command
RhinoApp.RunScript(@"-NewFloatingViewport Projection=CopyActive Perspective", true);

@corbane
Copy link
Author

corbane commented Nov 25, 2020

Hello @tongbong,
My code is https://github.com/mcneel/rhino.inside/tree/master/DotNet/WinFormsApp

I have a doubt with RhinoApp.RunScript
Indeed, in Rhino, there is no problem with a floating window, but this is not the behavior of the Rhino floating viewport.

In the screenshot you can see a classic "Windows.Forms" that embed Rhino.Inside and RhinoWindows.Forms.Controls.ViewportControl (RhinoWindows.dll).

When we open a Rhino file in this standalone ViewportControl.
if this file is saved with a Rhino floating viewport, a floating viewport is also opened with the standalone window .
The second column corresponds to the events of this floating viewport.

ViewportControl and floating window

@tongbong
Copy link

Thanks @corbane for reacting quickly.

I understand that in your case the floating viewport is saved inside the file.
With the command I run, I feel I suffer the same behavior than you.
May I ask what you are trying to achieve / or goals ?

In my case, I am looking for a full featured 3D viewer with a strong 3D geometric kernel to display data inside a standalone application. And I see Rhino Inside as a promising package.

@fraguada fraguada added the .NET Pull requests that update .net code label Dec 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
.NET Pull requests that update .net code
Projects
None yet
Development

No branches or pull requests

4 participants