1. 06 Nov, 2017 1 commit
  2. 31 Oct, 2017 1 commit
    • Sean McBride's avatar
      General review and cleanup of vtkLookupTable and friends · 63366102
      Sean McBride authored
      - made vtkScalarsToColors::SetRange(double[2]) virtual, since the other SetRange() is.  Likewise vtkLookupTable::SetTableRange(double[2]).
      - changed most uses of dangerous GetTableValue() (that returns inner buffer) in favour of version that copies the values out.
      - use fixed-size memcpy in a few places for a potential speedup
      - improved some comments
      - added a few consts, especially with buffers
      - removed const on plain old ints
      - moved a nan check earlier, saving work when true
      - moved some variable declarations closer to initialization
      - removed some unneeded semi colons
      - removed some useless casts, added others for clarity
      63366102
  3. 19 Oct, 2017 1 commit
  4. 15 Oct, 2017 1 commit
    • Sean McBride's avatar
      Fixed numerous warnings from the new cppcheck 1.81 · 442381f5
      Sean McBride authored
      Specifically:
      
      very strange braces!
      syntaxError,Common/DataModel/vtkHyperTreeGrid.cxx:699,error,syntax error
      
      changed size()>0 to !empty()
      stlSize,Filters/General/vtkLoopBooleanPolyDataFilter.cxx:1426,performance,Possible inefficient checking for 'nocellregion' emptiness.
      
      This useless flag has been there since code was added in 2000 in f50b0909
      knownConditionTrueFalse,Common/DataModel/vtkPointLocator.cxx:323,style,Condition 'flag' is always true
      knownConditionTrueFalse,Common/DataModel/vtkPointLocator.cxx:415,style,Condition 'flag' is always true
      knownConditionTrueFalse,Common/DataModel/vtkStaticPointLocator.cxx:788,style,Condition 'flag' is always true
      knownConditionTrueFalse,Common/DataModel/vtkStaticPointLocator.cxx:879,style,Condition 'flag' is always true
      
      This useless 'result' has been there since code was added in 2003 in dd39b9e4
      knownConditionTrueFalse,IO/XML/vtkXMLRectilinearGridReader.cxx:236,style,Condition 'result' is always true
      knownConditionTrueFalse,IO/XML/vtkXMLRectilinearGridReader.cxx:245,style,Condition 'result' is always true
      knownConditionTrueFalse,IO/XML/vtkXMLRectilinearGridReader.cxx:254,style,Condition 'result' is always true
      
      New check in cppcheck 1.81, block is indeed dead code:
      oppositeInnerCondition,Rendering/OpenGL/vtkXOpenGLRenderWindow.cxx:272,warning,Opposite inner 'if' condition leads to a dead code block.
      oppositeInnerCondition,Rendering/OpenGL/vtkXOpenGLRenderWindow.cxx:293,warning,Opposite inner 'if' condition leads to a dead code block.
      oppositeInnerCondition,Rendering/OpenGL/vtkXOpenGLRenderWindow.cxx:349,warning,Opposite inner 'if' condition leads to a dead code block.
      
      false positive, suppressed with zero initialization:
      uninitvar,Filters/Statistics/vtkKMeansStatistics.cxx:810,error,Uninitialized variable: curDistance
      uninitvar,Filters/Statistics/vtkKMeansStatistics.cxx:812,error,Uninitialized variable: curDistance
      
      free(NULL) is allowed, so just remove null check
      knownConditionTrueFalse,IO/Geometry/Testing/Cxx/TestIncrementalOctreePointLocator.cxx:920,style,Condition 'truthIds' is always false
      knownConditionTrueFalse,IO/Geometry/Testing/Cxx/TestIncrementalOctreePointLocator.cxx:956,style,Condition 'diskFile' is always false
      
      Simplified the calculation, verified same codegen on x86_64 with godbolt
      shiftTooManyBitsSigned,Rendering/Volume/vtkHAVSVolumeMapper.cxx:53,error,Shifting signed 32-bit value by 31 bits is undefined behaviour
      
      These have all been thus since their inception, but a global search find the same pattern in TestDijkstraGraphGeodesicPath.cxx, from which I copied the apparent solution
      knownConditionTrueFalse,Interaction/Widgets/Testing/Cxx/TestPolygonalRepresentationHandleWidget.cxx:119,style,Condition 'distanceOffsetSpecified' is always false
      knownConditionTrueFalse,Interaction/Widgets/Testing/Cxx/TestPolygonalRepresentationHandleWidget.cxx:199,style,Condition 'distanceOffsetSpecified' is always false
      knownConditionTrueFalse,Interaction/Widgets/Testing/Cxx/TestPolygonalSurfaceConstrainedDistanceWidget.cxx:244,style,Condition 'distanceOffsetSpecified' is always false
      knownConditionTrueFalse,Interaction/Widgets/Testing/Cxx/TestPolygonalSurfaceConstrainedDistanceWidget.cxx:325,style,Condition 'distanceOffsetSpecified' is always false
      knownConditionTrueFalse,Interaction/Widgets/Testing/Cxx/TestSurfaceConstrainedHandleWidget.cxx:117,style,Condition 'distanceOffsetSpecified' is always false
      knownConditionTrueFalse,Interaction/Widgets/Testing/Cxx/TestSurfaceConstrainedHandleWidget.cxx:189,style,Condition 'distanceOffsetSpecified' is always false
      
      Toggle with #if instead
      knownConditionTrueFalse,Imaging/Hybrid/vtkSurfaceReconstructionFilter.cxx:300,style,Condition 'orientationPropagation' is always true
      
      Added parens
      clarifyCalculation,Common/DataModel/vtkLagrangeWedge.cxx:906,style,Clarify calculation precedence for '/' and '?'.
      442381f5
  5. 09 Oct, 2017 1 commit
  6. 04 Oct, 2017 3 commits
  7. 02 Oct, 2017 2 commits
  8. 29 Sep, 2017 1 commit
    • Andrew Bauer's avatar
      Improvements for vtkNew for stl containers and comparison operations · fd04b442
      Andrew Bauer authored
      Adding in functionality to allow inserting vtkNew objects into
      stl containers of vtkSmartPointer objects as well as comparisons
      between vtkNew objects and raw pointers. Also removing Get() and
      GetPointer() calls from vtkNew objects since in most instances we
      can just pass in the vtkNew<> object instead of having to use the
      Get() or GetPointer() methods to get the raw pointer.
      fd04b442
  9. 28 Sep, 2017 1 commit
  10. 21 Sep, 2017 1 commit
  11. 15 Sep, 2017 1 commit
  12. 07 Sep, 2017 1 commit
  13. 30 Aug, 2017 1 commit
    • Cory Quammen's avatar
      Augment vtkTexture to color directly by more scalar types · 71bfc13d
      Cory Quammen authored
      Deprecated MapColorScalarsThroughLookupTable and setters/getters in
      favor of new ColorMode that is analagous to the color mode in
      vtkMapper, i.e., it adds a mode where additional scalar types such as
      float and double can be used for direct coloring.
      71bfc13d
  14. 21 Aug, 2017 1 commit
  15. 16 Aug, 2017 1 commit
  16. 15 Aug, 2017 8 commits
  17. 01 Aug, 2017 1 commit
  18. 27 Jul, 2017 1 commit
    • Ken Martin's avatar
      update widget representations to handle 3D events · 735a85e5
      Ken Martin authored
      The old event signatures were limited to X Y mouse
      events and not flexible enough for general event handling.
      These updated signatures allow for much more flexibility.
      
      This topic also switches the distance withget to use a
      double representation for the glyph to avoid float
      resolution issues with large coordinate systems.
      
      This topic adds handling for 3D events to the point handle
      and distance representations and widgets.
      735a85e5
  19. 26 Jul, 2017 2 commits
  20. 24 Jul, 2017 1 commit
    • Ken Martin's avatar
      add vtkEventData class and support · 408a876e
      Ken Martin authored
      This topic introduces support for events in VTK to pass a
      vtkEventData instance as their calldata. This instance can
      be used to hold event specific data that would otherwise
      complicate the render window interactor. The event specific
      data also allows us to have fewer vtkCommands as we do not
      need a specific command for each button on a controller but
      rather can include the controller button as data in the
      appropriate vtkEventData subclass.
      
      Currently this is only implemented for 3D events but it could
      be updated to handle mouse, keyboard or events as desired.
      408a876e
  21. 18 Jul, 2017 1 commit
    • Utkarsh Ayachit's avatar
      Cleanup offscreen rendering support in VTK. · d0e7aab3
      Utkarsh Ayachit authored
      This commit cleans up offscreen rendering support in VTK. This includes
      several changes.
      
      1. It makes EGL support independent of onscreen GL
         support. It's now possible to enable EGL and GLX in same build of
         VTK, for example, so long as the two use shared GL-dispatch
         mechanism.  Previously, EGL could not be enabled together with GLX
         (i.e.  `VTK_USE_X` set to ON). These changes allow for that
         configuration.
      
      2. `VTK_USE_OFFSCREEN_EGL` is replaced by `VTK_OPENGL_HAS_EGL`.
          This is consistent with `VTK_OPENGL_HAS_OSMESA` flag. And also
          in similar vein to changes to `FindOpenGL.cmake` where EGL
          becomes a component of `find_package(OpenGL)`.
      
      3. `VTK_EGL_DEVICE_INDEX` has been replaced by
         `VTK_DEFAULT_EGL_DEVICE_INDEX` since it only affect the default
         value, and doesn't preclude users from manually specifying the
         device index.
      
      4. `VTK_USE_OFFSCREEN` has been replaced by
         `VTK_DEFAULT_RENDER_WINDOW_OFFSCREEN`, since similar to `3`
         this option was only intended to affect the default value.
      
      5. Simplified `FindEGL.cmake`. Apps don't need to link against
         `gldispatch` library and hence removed it and created an
         imported target to simplify use.
      
      6. For all changes to CMake variables, we put out `DEPRECATION`
         messages if old variables are used.
      
      7. When `VTK_USE_X` and `VTK_OPENGL_HAS_EGL` or
         `VTK_OPENGL_HAS_OSMESA` in ON, following things happen:
         i.   The object-factory simply returns the X-based (or
              onscreen) render window i.e. `vtkXOpenGLRenderWindow`.
         ii.  To create one of the offscreen render windows, one can
              manually instantiate them e.g. by explicitly
              instantiating `vtkEGLRenderWindow`.
              `vtkXOpenGLRenderWindow` has implementation to swap to
              OSMesa if `SetUseOffscreen(true)` is called.
         iii. As soon any off-screen features are enabled, `glew`
              uses the offscreen library APIs to get OpenGL function pointers
              irrespective of how the active context was initialized.
      d0e7aab3
  22. 05 Jul, 2017 1 commit
  23. 04 Jul, 2017 1 commit
    • Utkarsh Ayachit's avatar
      Improvements to rubber-band-zoom. · bef6d0f5
      Utkarsh Ayachit authored
      vtkInteractorStyleRubberBandZoom is highly unreliable
      (paraview/paraview#17511). Added new options to make it a little easier
      to use and more consistent.
      
      1. Added option to lock aspect ratio of the box to that of the viewport.
         Thus user get a better understanding of what would actually be zoomed
         to.
      2. Added option to center the box at the start position rather than
         having the start position be one of the corners of the box. This
         makes it easier to focus on point of interest.
      3. Added option to use "zoom" instead of "dolly" for perspective camera.
         This avoid cases where the camera travels into the dataset when
         zooming into small regions.
      4. When not dollying, instead changing camera view angle to zoom in
         perspective mode, we reorient the camera to point to the center of
         the target box rather than panning which ends up giving more reliable
         results in real world scenarios.
      5. The code has been cleaned up to use vtkVector, vtkRect to make it
         more readable.
      
      The default behavior is left unchanged.
      bef6d0f5
  24. 29 Jun, 2017 2 commits
  25. 03 Jun, 2017 1 commit
  26. 02 Jun, 2017 1 commit
    • Sean McBride's avatar
      Converted the last remaining sprintf to snprintf · 5c238b17
      Sean McBride authored
      These changes are more invasive than my previous conversions.
      a) Some private/protected method signatures now take a size parameter.
      b) Deleted vtkMPEG2Writer entirely, because 1) it uses sprintf and I can’t find the size of the buffer, I think it’s been removed. 2) The class hasn’t been built in years.
      c) some new defines introduced to avoid copy-pasting magic numbers.
      
      The only remaining sprintf, I think, are in third party or C code.
      5c238b17
  27. 30 May, 2017 2 commits