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

VCS 2D Interaction (round 2) #1081

Closed
wants to merge 196 commits into from

Conversation

chaosphere2112
Copy link
Contributor

Here's the rebased and reshaped VCS 2D Interaction PR.
(replacement for #1058)
@doutriaux1 @dlonie @aashish24 @williams13

chaosphere2112 and others added 30 commits February 25, 2015 12:43
	vtk_ui package included in install
	buttons now set state correctly on copy
Configurator intercepts click events on the canvas
It then determines what DP template attribute was
clicked on.

It logs double clicks, and then will "activate" that member.
Removed old configurable code for template

Changing tactics on how to approach configuration;
moved configurable logic out of template, will move to
attributes directly.
Can now detect clicks in arbitrary fillarea polygons
UI Widgets now render on their own renderer; not quite ironed out the
issues with that technique yet, but the renderer is contained by the
manager class, which is a singleton per render window. Also created the
editors subpackage, which integrates vtk_ui elements directly with the
things they that can configure, starting with the fillarea.
UI widgets will now show up on the top most layer, and will actually
persist between canvas.update() calls. Woo!
Allows editing of color and fill style, though that appears to not work
properly currently.
Extracted click/drag logic into mixin classes. Other editors will be
able to use the exact same logic, woohoo. Interacting with a toolbar is
still a bit fiddly, and there's tons of flashing; what's that all about?
Integrated into editors.fillarea and editors.line
Renders box on each tick of drag, decreased drag buffer zone
@doutriaux1
Copy link
Contributor

@chaosphere2112 please take a look at: https://open.cdash.org/viewTest.php?onlyfailed&buildid=3711698 it's a Darwin 10.10 build but at least some of the failures seem to come from your stuff e.g:

Traceback (most recent call last):
  File "/git/uvcdat/testing/vcs/test_vcs_interact_no_open.py", line 5, in <module>
    x.interact()
  File "/lgm/uvcdat/2015-02-26/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/vcs/Canvas.py", line 471, in interact
    self.configurator.show()
  File "/lgm/uvcdat/2015-02-26/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/vcs/configurator.py", line 272, in show
    self.toolbar.show()
AttributeError: 'NoneType' object has no attribute 'show'

@doutriaux1
Copy link
Contributor

@chaosphere2112 did you tweak the size of the markers?

@doutriaux1
Copy link
Contributor

@chaosphere2112 compare to: https://open.cdash.org/viewTest.php?onlyfailed&buildid=3711795
which is same w/o your branch in.

@aashish24
Copy link
Contributor

@chaosphere2112 I would argue that we write test first and then do the development 😄 but I understand what you are saying here. I would suggest adding the tests as soon as possible. You may want to look into the QtTesting framework to see if we can enable some sort of GUI testing with your code additions. I will review the branch today and get it merged.

@chaosphere2112
Copy link
Contributor Author

@aashish24 @doutriaux1 OK– things on my list before merging:

  1. Make marker tests pass – I definitely moved around the marker code to expose some of the functionality so I could use it from the marker editor; may have accidentally tweaked something, I'll dig into this.
  2. Make test_vcs_interact_no_open pass – no idea why this is happening, I'm sure I just did something dumb
  3. Make the UI show up in the GUI (weird).

I'll absolutely start churning out tests next week.

@chaosphere2112
Copy link
Contributor Author

Thankfully, the markers were easy to fix, as was test_vcs_interact_no_open. Running tests really quickly, and I'll start sorting out why the UI doesn't show up in the GUI.

@chaosphere2112
Copy link
Contributor Author

@aashish24 I've fixed all of the issues above, if you've got a sec to review.

@chaosphere2112
Copy link
Contributor Author

@dlonie @doutriaux1 I can reproduce the bug you mentioned over in #1043, Charles. When I run UV-CDAT in the debugger, it looks like the segfault is happening in libfreetype, triggered by vtkFreeTypeTools::RenderCharacter, presumably from a call to vtkRenderWindow.Render(). I might have an idea what's causing this, I'll take a quick look at some function calls. Also, let's move this conversation to what I assume is the PR you meant 😄

@chaosphere2112
Copy link
Contributor Author

@doutriaux1 I'm not getting a segfault on the animation, though it does sit and spin forever when I try and quit. I still need to rewrite the play button to use vtk timers to thread it instead of your run() function. I'll do that tonight; I need to head out of the office for my appointment.

@doutriaux1
Copy link
Contributor

No worries. Thanks!

From: Sam Fries <[email protected]mailto:[email protected]>
Reply-To: UV-CDAT/uvcdat <[email protected]mailto:[email protected]>
Date: Friday, February 27, 2015 at 1:46 PM
To: UV-CDAT/uvcdat <[email protected]mailto:[email protected]>
Cc: "Doutriaux, Charles" <[email protected]mailto:[email protected]>
Subject: Re: [uvcdat] VCS 2D Interaction (round 2) (#1081)

@doutriaux1https://github.com/doutriaux1 I'm not getting a segfault on the animation, though it does sit and spin forever when I try and quit. I still need to rewrite the play button to use vtk timers to thread it instead of your run() function. I'll do that tonight; I need to head out of the office for my appointment.


Reply to this email directly or view it on GitHubhttps://github.com//pull/1081#issuecomment-76477889.

@chaosphere2112
Copy link
Contributor Author

@doutriaux1 Ugh, this bug is terrible. I'll try and get it and the animation segfault fixed by Monday. Gotta stop staring at it now.

@chaosphere2112
Copy link
Contributor Author

Alright, I've updated the animation controls. The text segfault is a really gnarly beast; still working on figuring it out.

@chaosphere2112
Copy link
Contributor Author

@dlonie

David, I've done a lot of debugger spelunking on this bug.

This is the line that triggers the segfault.

The segfault looks like it's probably being triggered on this line in the freetype library (I can't seem to get debugging symbols to show up, so I'm only pretty sure this is the right line)

(from ftobjs.c, starting at line 2963)

  FT_Get_Kerning( FT_Face     face,
                  FT_UInt     left_glyph,
                  FT_UInt     right_glyph,
                  FT_UInt     kern_mode,
                  FT_Vector  *akerning )
  {
    FT_Error   error = FT_Err_Ok;
    FT_Driver  driver;


    if ( !face )
      return FT_Err_Invalid_Face_Handle;

    if ( !akerning )
      return FT_Err_Invalid_Argument;

    driver = face->driver;

    akerning->x = 0;
    akerning->y = 0;

    if ( driver->clazz->get_kerning )
    {
      error = driver->clazz->get_kerning( face,
                                          left_glyph,
                                          right_glyph,
                                          akerning );
      if ( !error )
      {
        if ( kern_mode != FT_KERNING_UNSCALED )
        {
          akerning->x = FT_MulFix( akerning->x, face->size->metrics.x_scale ); //this is the problem line
          akerning->y = FT_MulFix( akerning->y, face->size->metrics.y_scale );

I'm guessing this is the line at fault because face->size is NULL, and I've tested every other pointer dereference up to that point.

So, I'm trying to figure out why face->size is NULL. Looking in vtkFreeTypeTools, I noticed that FTC_Manager_LookupFace is being used to retrieve the face for the metadata, and in the docs it does mention that size may be 0 for the face returned from here. Is there a chance that this is a VTK bug?

@aashish24 aashish24 closed this Mar 2, 2015
@alliepiper
Copy link
Contributor

@chaosphere2112 It may be a VTK bug -- the custom font stuff is rather new and largely untested, especially with kerned fonts since the VTK default fonts aren't kerned.

By any chance, is the text that triggers the segfault rotated?

@chaosphere2112
Copy link
Contributor Author

@dlonie It only happens when there is text rotated into a certain range, and then a bunch of custom fonts are loaded.

@alliepiper
Copy link
Contributor

@chaosphere2112 Can you see if the commit I just pushed to CDAT/VTK@bae414a fixes it? This is a bugfix for rotated kerned fonts that hasn't made it into VTK master yet.

@chaosphere2112
Copy link
Contributor Author

@dlonie Looks like it doesn't fix the issue... still getting a segfault, same place, and face->size is still NULL.

@doutriaux1
Copy link
Contributor

@dlonie is that commit in uvcdat/vtk master repo? I just built with it.

@chaosphere2112
Copy link
Contributor Author

Made #1093 to track this issue. Let's move the discussion over there.

@chaosphere2112 chaosphere2112 added this to the 2.2 milestone May 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants