1. 06 Nov, 2017 1 commit
  2. 01 Nov, 2017 3 commits
  3. 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
  4. 29 Oct, 2017 1 commit
  5. 28 Oct, 2017 3 commits
  6. 26 Oct, 2017 1 commit
  7. 25 Oct, 2017 1 commit
    • Bryn Lloyd's avatar
      Speed-up and improved meaning of index image · adcf0f3a
      Bryn Lloyd authored
      Added SamplingRate parameter. Now this filter can run faster, by initially sampling the colors at a coarser level. For a sampling rate of (5,5,1), i.e. 25 fewer voxels to build the octree, I got an overall factor of 10-15 speed-up.
      
      Added SortIndexByLuminance parameter. The "index-image" viewed as a greyscale image, is usually quite arbitrary, accentuating contrast where none can be perceived in the original color image. To make the index image more meaningful (e.g. for image segmentation operating on scalar images), we sort the mean colors by luminance and re-map the indices accordingly. This option does not introduce any computational complexity and has no impact on actual colors in the lookup table (only their order).
      adcf0f3a
  8. 20 Oct, 2017 1 commit
  9. 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
  10. 11 Oct, 2017 1 commit
  11. 10 Oct, 2017 1 commit
    • David Gobbi's avatar
      Use memcpy for pixel copies in vtkImageReslice. · 2503a6c6
      David Gobbi authored
      For all the compilers supported by VTK, if the optimization level
      is -O2 or higher, then memcpy is an intrinsic that is inlined when
      the copy size is a constant.  This patch uses memcpy to simplify
      some of the code.
      2503a6c6
  12. 09 Oct, 2017 1 commit
  13. 05 Oct, 2017 1 commit
    • Sean McBride's avatar
      Improved performance of vtkLookupTable a bit · 30acb904
      Sean McBride authored
      Did a few things to speed things up:
      - eliminated some double<->integer conversions.
      - repeated the last colour in the lut as a 4th "special" colour, eliminating need for a test in very hot function. Improved shift & scale calculations against pathological cases.
      - use memcpy() (with fixed size) instead of manual copying byte by byte. Modern compilers optimize this well, as verified with godbolt.
      
      Did some other cleanup while investigating my performance issues: added more const safety, fixed comments, etc.
      30acb904
  14. 04 Oct, 2017 1 commit
  15. 02 Oct, 2017 2 commits
  16. 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
  17. 26 Jul, 2017 1 commit
    • Kitware Robot's avatar
      Replace many NULL and 0 occurances with nullptr · a855cab0
      Kitware Robot authored
      This topic is the result of running clang-tidy to
      modernize our usage of NULL and 0 to nullptr. It also
      includes some manual and semi manual changes where
      clang-tidy would not be expected to work (such as in
      comments, or classes not compiled on this build)
      
      There are definitely many comments and occurances that
      this topic misses that we will need to fix over time.
      a855cab0
  18. 08 Jul, 2017 1 commit
    • Bill Lorensen's avatar
      COMP: Mac issues with odd-sized baseline images · 36a75873
      Bill Lorensen authored
      NSWindow's behaviour round sizes *up* to even integral sizes.
      
      This seems to be related to the limitation for Macs with retina
      display - they can only create windows with width and height with even
      number of pixels.
      
      If you try to create a window with height or width
      with odd number of pixels you end up with height or width with even
      number of pixels.
      36a75873
  19. 29 Jun, 2017 1 commit
  20. 03 Jun, 2017 1 commit
  21. 04 May, 2017 1 commit
    • Sean McBride's avatar
      Change bitwise to logical OR · 01ad8d5d
      Sean McBride authored
      Semantically, logical OR is what is desired here.
      I suspect the use of bitwise was a performance hack for old hardware.
      Logical OR can short circuit, giving the compiler an optimisation opportunity.
      01ad8d5d
  22. 27 Apr, 2017 1 commit
  23. 02 Apr, 2017 1 commit
    • David Gobbi's avatar
      Remove special characters from VTK source files. · 03647e64
      David Gobbi authored
      The source was searched with "grep -l [^ -~]" to find characters outside
      of the printable ASCII range 0x20 to 0x7e.  The worst offender is the
      en-dash character, which is visually indistinguishable from the minus
      character in most code editors.  Several tabs were also found, which
      is surprising since they should be blocked by the commit hooks.
      03647e64
  24. 17 Mar, 2017 1 commit
  25. 14 Mar, 2017 2 commits
  26. 02 Feb, 2017 1 commit
    • David Gobbi's avatar
      In vtkImageResliceToColors, call Build() on table · 198fd938
      David Gobbi authored
      This ensures that the table is up-to-date before it is applied to
      the image.  Note that is change is needed for the correct behavior
      of vtkImageResliceMapper.  Also note that the vtkImageMapToColors
      class correctly calls Build() on the table.
      198fd938
  27. 22 Jan, 2017 1 commit
    • Sean McBride's avatar
      const improvements to APIs and internal usage · 8b32854b
      Sean McBride authored
      - Made a few APIs' params const
      - Changed many usages of the evil GetBounds() to expect a const
        return value, even though it does not (yet?) return const
      - Slightly changed return values of vtkTextActor3D::GetBounds()
        to return its own ivar instead of its ImageActor's
      8b32854b
  28. 20 Jan, 2017 1 commit
    • David Gobbi's avatar
      Remove duplicate "OutputSpacing" member. · 03272ddd
      David Gobbi authored
      The class vtkImageResample declared a member called OutputSpacing, even
      though that member was already present in the superclass vtkImageReslice.
      In order to ensure that the SetOutputSpacing() method (in vtkImageReslice)
      can be used with vtkImageResample, it is necessary that vtkImageResample
      does not redeclare this member.
      
      Note that vtkImageResample uses a spacing of [0,0,0] as a signal that the
      spacing is "undefined", whereas vtkImageReslice does not (it uses a default
      spacing of [1,1,1] and a flag called ComputeOutputSpacing to indicate
      whether the filter should use these values or compute new ones).  This
      doesn't cause a bug since the OutputSpacing member only used in
      RequestInformation, and each class has its own RequestInformation
      implementation.
      03272ddd
  29. 19 Jan, 2017 1 commit
  30. 16 Jan, 2017 1 commit
  31. 12 Jan, 2017 1 commit
  32. 05 Jan, 2017 3 commits