1. 01 May, 2020 40 commits
  2. 30 Apr, 2020 40 commits
  3. 29 Apr, 2020 40 commits
    • Sean McBride's avatar
      Fixed #17832: Observe NSView frame changes even for NSViews VTK didn't create · 7789697d
      Sean McBride authored
      Usually VTK creates its own NSViews, and in that case we were already observing NSViewFrameDidChangeNotification and reacting appropriately.
      
      But VTK can also be used in a different way, were clients create their own NSViews and point VTK to them. The SimpleCocoaVTK example does this.  In this case, VTK was not observing for NSVIew frame changes. That was ok unitl b75bc715.  But now that VTK creates its own framebuffer, it really needs to know when the NSView frame changes size.  So now we observe frame changes even for NSViews we didn't create.  In response, GetSize/SetSize will be invoked and do some necessary work. They will not however change the size of the NSView/NSWindow becuase a new 'if' contition limits that to happening only for NSViews created by VTK.
      7789697d
    • Sean McBride's avatar
      Fixed CAOpenGLLayer example being rendered as solid red · 4a0b3b0a
      Sean McBride authored
      The SimpleCocoaVTK example project has two kinds of NSViews, one being based on CAOpenGLLayer. That one has been broken in master for some time now, rendering as solid red. Fixed by invoking InitializeFromCurrentContext(). Bypassed vtkCocoaRenderWindow's implementation though because it mutates the NSView and NSWindow ivars, which is undesirable in this case. Instead, invoke super's implementation.
      4a0b3b0a
    • Sean McBride's avatar
      Create the NSOpenGLPixelFormat and NSOpenGLContext before the NSView/NSWindow · 36350987
      Sean McBride authored
      The motivation here is that if we switch to NSOpenGLView, we'll need the NSOpenGLPixelFormat to construct it. Seems to make no difference creating it before or after currently.
      
      Also moved the code that sets the NSWindow title higher up where the NSWindow is created.
      36350987
    • Sean McBride's avatar
      a12cdb6a
    • Sean McBride's avatar
      Review of vtkCocoaRenderWindow SetSize and SetPosition · 75a4aa97
      Sean McBride authored
      - fixed error in vtkCocoaRenderWindow::SetPosition() where it was unconditionally setting the NSWindow position to 0,0
      - eliminated recursion/reentry into viewFrameDidChange: by adding checks in SetSize() and SetPosition()
      - slightly tweaked vtkCocoaRenderWindow::GetSize implementation to return 0,0 if somehow there is no NSView, which is an unlikely (impossible?) edge case
      - rearranged some tests so the faster ones are first
      - improved some comments
      75a4aa97
    • Sean McBride's avatar
    • Sean McBride's avatar
      Fixed/improved a few incorrect comments · 3b14eb34
      Sean McBride authored
      3b14eb34
    • Sean McBride's avatar
      Cleanup SetSize and SetPosition methods · 71a3fa44
      Sean McBride authored
      Moved some implementations into the .h, so that all subclasses are the same.
      
      Document that vtkWindow::SetSize invokes vtkCommand::WindowResizeEvent. Other doc improvements.
      
      Added override keyword where it was missing.
      
      Made the parameter names uniform in all classes: width and height, and x and y.
      
      Other minor cleanup, such as using Superclass instead of naming the superclass.
      71a3fa44