1. 08 Feb, 2016 1 commit
  2. 25 Jan, 2016 1 commit
  3. 15 Jan, 2016 1 commit
    • Cory Quammen's avatar
      BUG 15903: Fix race condition in setting special colors in table · e3a8a1ec
      Cory Quammen authored
      In vtkLookupTableMapData(), the special colors were set in the lookup
      table prior to doing the mapping. This can lead to a race condition if
      multiple threads call this function at the same time. Normally, this
      shouldn't be a problem, because if the vtkLookupTable used to fill in
      the table values is the same, each thread will write the same values
      to each entry in the table. Some verification tools, however, will
      note that more than one thread is writing to the same memory location
      at a time.
      
      Avoid this by setting the special colors when the lookup table is built
      or when custom table values are set.
      e3a8a1ec
  4. 10 Jul, 2015 1 commit
  5. 26 Mar, 2015 2 commits
    • Cory Quammen's avatar
      BUG 15365: Fixed crash in function called from multiple threads · dac748ae
      Cory Quammen authored
      vtkLookupTableMapData() was not thread safe and could lead to
      crashes when accessed from multiple threads. Added a mutex around
      the logic to determine if the color table size needed to be
      increased.
      
      Added a multi-threaded test that crashes on occasion prior
      to this patch, but does not crash with this patch applied.
      dac748ae
    • Sean McBride's avatar
      Changed many int to vtkIdType · 418c62c6
      Sean McBride authored
      Fixes many -Wconversion warnings.
      Changes made where it makes sense, ex to match return type of method.
      418c62c6
  6. 11 Dec, 2014 1 commit
    • Cory Quammen's avatar
      Enable coloring by indexed lookup for vtkStringArrays · 94498364
      Cory Quammen authored
      This change makes it possible to map vtkStringArrays to colors using
      indexed lookup mode. The vtkStringArrays may be associated with
      points, cells, or neither (field data). A slew of changes were
      required to give this capability:
      
      - Changed signature of vtkScalarsToColors::MapScalars(...) and
        vtkDiscretizableColorTransferFunction::MapScalars(...)  to take a
        vtkAbstractArray instead of a vtkDataArray. This enables mapping
        non-vtkDataArray arrays, such as vtkStringArrays. These changes are
        backwards compatible because vtkAbstractArray is the parent class of
        vtkDataArray.
      
      - Changed vtkLookupTable::MapScalarsThroughTable2(...) to handle
        vtkStringArrays.
      
      - Changed vtkColorTransferFunction::MapScalarsThroughTable2(...) to handle
        vtkStringArrays.
      
      - Added vtkAbstractMapper::GetAbstractScalars(...) that returns a data
        array as a vtkAbstractArray - needed to retrieve vtkStringArray
        scalars.
      
      - Added some error reporting when unhandled array type is encountered
        in vtkScalarsToColors::MapScalarsThroughTable2.
      
      - Enabled use of vtkStringArrays for coloring in the surface mappers.
      
      - Added some tests for mapping vtkStringArrays with
        vtkColorTransferFunction and vtkDiscretizableColorTransferFunction.
      
      - Added some tests for coloring objects by vtkStringArrays in cell data
        and point data.
      
      - Added logic to vtkMapper and vtkPolyDataMapper2D that generates a
        reasonable default lookup table when a vtkStringArray or other
        non-numeric array is selected for coloring by scalars. This requires
        making the vtkRenderingCore module depend on vtkCommonColor. Added
        tests for this feature.
      
      Change-Id: I91e2e451217139a7daabd7f4a63de0b8ff707ad4
      94498364
  7. 28 Nov, 2014 1 commit
    • Sean McBride's avatar
      Suppress numerous warnings about using uninitialized memory · 9d6d565c
      Sean McBride authored
      Many callers of this API pass an initialized buffer to the
      second param, and assume this method fills it. But there’s
      a branch where the buffer is not filled, yet no return value
      to know it wasn’t filled.  So as to not change this public
      API’s behaviour, I just added an assert to tell the analyzer
      that the error branch is “impossible”.
      
      Change-Id: Ic77437170af76a2f964333a988cc6ba69eb78a46
      9d6d565c
  8. 18 Sep, 2014 1 commit
    • Cory Quammen's avatar
      6657: Add out-of-range colors to color maps · 238163f9
      Cory Quammen authored
      This change adds special colors to color maps that can optionally be
      used for scalar values outside the range of the color map. It touches
      a number of classes in VTK.
      
      vtkLookupTable
      
      - Added AboveRangeColor for values above the lookup table range.
      
      - Added UseAboveRangeColor option to control whether the
        AboveRangeColor or the color that maps to the highest value is used
        for values above the range.
      
      - Added BelowRangeColor for values below the lookup table range.
      
      - Added UseBelowRangeColor option to control whether the
        BelowRangeColor or the color that maps to the lowest value is used
        for values below the range.
      
      - Made GetColorAsUnsignedChars() a static member so that other classes
        can use it.
      
      TestLookupTable
      
      - Modified test to include testing of {Above|Below}RangeColors
        functionality.
      
      TestOutOfRangeColorTransferFunction.py
      
      - Test of out-of-range color functionality in
        vtkColorTransferFunction.
      
      TestOutOfRangeDiscretizableColorTransferFunction.py
      
      - Test of out-of-range color functionality in
        vtkDiscretizableColorTransferFunction.
      
      vtkScalarsToColors
      
      - Made RGBABytes member protected so subclasses can use it.
      
      vtkColorTransferFunction
      
      - Added {Above|Below}RangeColor and Use{Above|Below}RangeColor member
        variables that function the same as the members with the same name
        in vtkLookupTable. These colors are specified as RGB colors instead
        of RGBA colors, as they are in vtkLookupTable. For better or worse,
        this is for consistency with how NanColor is specified in each of
        these classes.
      
      - Above and BelowRangeColor are used only if the Clamping option is
        enabled.
      
      vtkDiscretizableColorTransferFunction
      
      - Forwards {Above|Below}RangeColor and Use{Above|Below}RangeColor to
        the internal vtkLookupTable in the Build() method.
      
      - Fixed a bug that caused the internal vtkLookupTable to allocate
        3 times the amount of colors needed to hold the table.
      
      vtkScalarsToColorsPainter
      
      - Added two colors for {Above|Below}RangeColors in the lookup table
        texture map. The color map class fills in these colors appropriately
        based on the {Above|Below}RangeColors settings.
      
      - Fixed the texture coordinate calculation to accommodate out-of-range
        colors.
      
      Performance-wise, this change increases the time to map an array with
      10 million scalars to colors by 5.5% using
      vtkLookupTable::MapScalarsThroughTable2().
      
      Change-Id: Ia3535fae175e991c0d1a4cf70752845193b4166d
      238163f9
  9. 24 Aug, 2014 1 commit
    • Johan Andruejol's avatar
      Refactor parts of vtkLookupTable · f8eee620
      Johan Andruejol authored and Cory Quammen's avatar Cory Quammen committed
      - Refactor GetNaNColorAsUnsignedChars function to make it useful to
        retrieve other colors as unsigned char
      
      - Refactor the index lookup in vtkLookupTable
      
      - Refactor shift and scale computation throughout vtkLookupTable
      
      - Put internal functions into anonymous namespace to avoid
        potential duplicate symbol errors when linking
      
      - Stuff lookup table parameters into struct and pass it around the
        internal functions
      
      - Copy NanColor in DeepCopy()
      
      These changes result in up to 6% performance improvement in
      vtkLookupTable::MapScalarsThroughTable2().
      
      Change-Id: If6147725ac80d929d475fefacdcd787ea4568eb8
      f8eee620
  10. 01 Sep, 2013 1 commit
  11. 09 Apr, 2013 1 commit
    • David Thompson's avatar
      Use scalar annotations on interval-mode scalar bar. · 55cb7e11
      David Thompson authored
      This commit renders user-provided notes associated with specific
      scalar values on the interval-mode scalar bar. Previously, only
      the categorical mode rendered these annotations.
      
      Also, provide the scalar bar with an optional swatch
      to illustrate the color assigned to NaN values.
      
      Add an option to color leader lines from the scalar bar to
      the annotation labels by the corresponding scalar value.
      
      This commit also breaks the process of rebuilding the scalar bar
      into several virtual methods so that subclasses (particularly
      ParaView's `vtkPVScalarBarActor`) can reuse more of the base class
      functionality. The process is now separated into 2 phases: layout,
      where bounding boxes for scalar bar components are placed; and
      configuration, where actors are positioned and geometry is created.
      This includes some changes to text actor to support constrained
      placement and text size queries.
      
      Add a test for the new scalar bar options.
      There are now many more options controlling how the scalar bar behaves.
      In particular many settings interact with the way geometry is rendered:
      the lookup table may be indexed or not (thus tick marks may not be
      rendered); the orientation may be horizontal or vertical; annotations
      may be rendered or not; the NaN annotation may be omitted; leader lines
      to annotations may be colored by the scalar they annotate or by the label
      color; and the tick marks may precede or succeed the scalar bar.
      Also, we must test how empty labels are handled and how even vs odd
      numbers of labels affect placement (since the algorithm for placement
      behaves differently in these cases).
      
      We cannot perform a full factorial test, but do test independent
      configurations.
      
      Finally, this commit improves the performance of prominent value
      detection for primitive-type arrays (e.g., int, double) by avoiding
      the use of vtkVariant instances to hold the working set of distinct
      values during sampling.
      
      Change-Id: I852f9b497d5e6ab619d9d7b763f641c44e4869cf
      55cb7e11
  12. 14 Mar, 2013 1 commit
  13. 12 Mar, 2013 1 commit
  14. 26 Sep, 2012 2 commits
    • David Gobbi's avatar
      BUG: Negative range for log scale lookup produced no results. · 2bb06f6d
      David Gobbi authored
      The log lookup table was designed to work with negative values,
      as long as both ends of the range were negative.  Apparently this
      feature was untested (it wasn't working).
      
      Change-Id: Ie088e22679eeef62234cb16818063c9d63d2639c
      2bb06f6d
    • David Gobbi's avatar
      Fix vtkLookupTableLogRange clamping for missing condition. · c5980de7
      David Gobbi authored
      The vtkLookupTableLogRange function had conditions for when
      rmax and rmin were both positive or both negative, but not for
      when they spanned zero or were both equal to zero.  This was
      caught by clang's static analyzer.  Values are clamped to
      VTK_DBL_MIN (absolute) or 1e-6 (relative).
      
      Change-Id: I02a52a574e7bcff8c364fb40ea21bea84f37e518
      c5980de7
  15. 21 Aug, 2012 1 commit
  16. 20 Aug, 2012 4 commits
    • David Thompson's avatar
      Move most annotation stuff to `vtkScalarsToColors`. · de162c7b
      David Thompson authored
      ... which is where it belongs. The only parts remaining
      in `vtkLookupTable` are the changes to `MapValue` and
      `MapScalarsThroughTable2` which are table-specific.
      
      Change-Id: I47da9d3fb7478d37a560f7019f917952103df9e2
      de162c7b
    • David Thompson's avatar
      Make annotation API more consistent. · dd7fe488
      David Thompson authored
      + Make `GetIndex()` work consistently whether `IndexedLookup`
        is true or false.
      + Make `GetIndex()` and `MapValue()` properly handle NaN values
        when `IndexedLookup` is false.
      + Return a `vtkIdType` for the number of annotated values.
        (The previous `vtkVariant` was a cut-and-paste error.)
      
      Change-Id: I4586ab117200cca73b021ce0d01782a7da958b45
      dd7fe488
    • David Thompson's avatar
      Color mapping using only annotated values. · ee78433e
      David Thompson authored
      This patch implements an "indexed" color mode for `vtkLookupTable`.
      When `IndexedLookup` is true, the scalar range and log/linear settings are disabled;
      `MapScalars` and `MapValue` require an exact match to an annotated value
      in order to return a valid color.
      All other values are mapped to `NanColor`.
      
      Change-Id: I9805ab6b4398db479c0ae6b0d239886850c2e187
      ee78433e
    • David Thompson's avatar
      Add categorical data to vtkLookupTable. · 649a62b1
      David Thompson authored
      Change-Id: I123e0eb3833a8c5dd5d1c399e70ecffe8ba7ec5c
      649a62b1
  17. 31 May, 2012 1 commit
  18. 09 Apr, 2012 2 commits
    • VTK Developers's avatar
      Remove trailing whitespace from all source files · 2d323fc4
      VTK Developers authored and Brad King's avatar Brad King committed
      Exclude ThirdParty, Utilities/MetaIO, and Utilities/KWSys as these
      are maintained outside VTK.
      
      Co-Author: Marcus D. Hanwell <marcus.hanwell@kitware.com>
      Co-Author: Chris Harris <chris.harris@kitware.com>
      Co-Author: Brad King <brad.king@kitware.com>
      2d323fc4
    • VTK Developers's avatar
      Modularize VTK tree layout · cdd4d6fd
      VTK Developers authored and Brad King's avatar Brad King committed
      Move source files from their former monolithic VTK location to their new
      location in modular VTK without modification.  This preserves enough
      information for "git blame -M" and "git log --follow" to connect
      modularized VTK files to their original location and history.
      
      Co-Author: Marcus D. Hanwell <marcus.hanwell@kitware.com>
      Co-Author: Chris Harris <chris.harris@kitware.com>
      Co-Author: Brad King <brad.king@kitware.com>
      Co-Author: Nikhil Shetty <nikhil.shetty@kitware.com>
      cdd4d6fd
  19. 19 Jun, 2011 1 commit
    • David Gobbi's avatar
      ENH: Improvements to Vector modes of vtkScalarsToColors. · f1606fc5
      David Gobbi authored
      Remove the duplicated vector magnitude code from the subclasses and
      consolidate it in the base class.  Add the ability to treat just some
      of the available components as the vector quantity and ignore the rest.
      
      Change-Id: I528371510386365a156290ff7fb0bb41b36dd0c9
      f1606fc5
  20. 21 Apr, 2011 1 commit
    • David Gobbi's avatar
      ENH: Make vtkScalarsToColors into a concrete class. · 39343497
      David Gobbi authored
      This patch enhances vtkScalarsToColors so that it can be used as a
      simple way to do scalar range mapping.  It is meant to be used
      when you have RGB scalars and want to map them to "unsigned char"
      RGB or RGBA colors, or if you have single-component scalars and
      simply want to map them to greyscale.
      
      Basically, it maps scalars directly to colors without the use of a
      CTF or a lookup table, all it does is rescale the values.  It also
      does the job faster than vtkLookupTable and vtkColorTransferFunction.
      
      Change-Id: I24fa8a1545a969c2ee5202bd8eca76b52842fbf4
      39343497
  21. 20 Mar, 2011 1 commit
    • David Gobbi's avatar
      ENH: Faster lookup index clamping. · e8f1d9ba
      David Gobbi authored
      This is a small change to improve performance, it causes
      the clamping code to compile into minsd/maxsd instructions
      instead of branching (tested on gcc 4.2 x86 with sse2).
      e8f1d9ba
  22. 01 Mar, 2011 1 commit
  23. 30 Jan, 2011 1 commit
    • David Gobbi's avatar
      PERF: Increase color mapping speed, by 40% in some cases. · 1c348fcb
      David Gobbi authored
      Use array indexing instead of postincrement: 5% speed increase.
      Skip isnan() check for integer data: 35% speed increase.
      Use isnan() instead of vtkMath::IsNan() for float data: 12%
      Total integer speed increase: 40%
      Total float speed increase: 18%
      Note that using aligned 32-bit memory copies for RGBA instead
      of using four 8-bit memory copies would provide a further 35%
      speed increase, at the cost of code readability.
      1c348fcb
  24. 21 Jan, 2011 1 commit
  25. 21 Oct, 2010 1 commit
    • Andy Bauer's avatar
      Changing the amount of colors shown for lookup tables. · 46e01f50
      Andy Bauer authored
      There was a number of colors limit (256 in v3.8, and currently 1024)
      set in vtkScalarsToColorsPainter which is now changed to be
      limited by the nubmer of opengl texture colors.  The changes to the
      other files are for specifying the amount of available colors
      in those lookup tables.
      
      Change-Id: Ic0d7f4fa660380627804ad0e891fceab3af773b1
      46e01f50
  26. 25 Aug, 2010 1 commit
  27. 20 Aug, 2010 1 commit
  28. 20 May, 2010 1 commit
    • Mark Olesen's avatar
      Remove vtk(Cxx|Type)RevisionMacro · ecbbf7f7
      Mark Olesen authored and Brad King's avatar Brad King committed
      The CVS $Revision$ keyword replacement will no longer maintain these
      macros automatically.  They were used only to implement CollectRevisions
      and vtkObjectBase::PrintRevisions, an API that was never used.
      
      Automated as follows:
      
        pass 0:
        catch templates
        ---------------
        $ git grep 'vtk\(Cxx\|Type\)RevisionMacro' | grep '<'
      
        pass 1:
        main changes
        ---------------
        $ git grep -l '^vtkCxxRevisionMacro' | while read file; do
          echo "$file" 1>&2
          perl -i -ne 'print unless (/^vtkCxxRevisionMacro/ and /\)/)' $file
        done
        $ git grep -l -e 'vtkTypeRevisionMacro(' | while read file; do
          echo "$file" 1>&2
          perl -i -pe 's/vtkTypeRevisionMacro/vtkTypeMacro/g' $file
        done
      
        pass 2:
        verify
        ---------------
        $ git grep 'vtk\(Cxx\|Type\)RevisionMacro'
      
      Fixed multi-line vtkCxxRevisionMacro and templates by hand.
      ecbbf7f7
  29. 23 Apr, 2010 1 commit
    • Mark Olesen's avatar
      Remove vtk(Cxx|Type)RevisionMacro · 19c55e0e
      Mark Olesen authored and Brad King's avatar Brad King committed
      The CVS $Revision$ keyword replacement will no longer maintain these
      macros automatically.  They were used only to implement CollectRevisions
      and vtkObjectBase::PrintRevisions, an API that was never used.
      
      Automated as follows:
      
        pass 0:
        catch templates
        ---------------
        $ git grep 'vtk\(Cxx\|Type\)RevisionMacro' | grep '<'
      
        pass 1:
        main changes
        ---------------
        $ git grep -l '^vtkCxxRevisionMacro' | while read file; do
          echo "$file" 1>&2
          perl -i -ne 'print unless (/^vtkCxxRevisionMacro/ and /\)/)' $file
        done
        $ git grep -l -e 'vtkTypeRevisionMacro(' | while read file; do
          echo "$file" 1>&2
          perl -i -pe 's/vtkTypeRevisionMacro/vtkTypeMacro/g' $file
        done
      
        pass 2:
        verify
        ---------------
        $ git grep 'vtk\(Cxx\|Type\)RevisionMacro'
      
      Fixed multi-line vtkCxxRevisionMacro and templates by hand.
      19c55e0e
  30. 24 Sep, 2009 2 commits
  31. 16 Mar, 2009 1 commit
    • Utkarsh Ayachit's avatar
      BUG: Fixed BUG #8445. When using log scaled lookup tables, scalar mapping wasn't · f9de6b0f
      Utkarsh Ayachit authored
      correct when InterpolateScalarsBeforeMapping was ON. This was due to the fact
      that vtkScalarsToColorsPainter did not consider the log mapping at all when
      generating the texture coordinates. Fixed that.
      
      This patch also exposes some static API from vtkLookupTable to make it easy to
      compute log values from vtkScalarsToColorsPainter without code duplication
      between vtkScalarsToColorsPainter and vtkLookupTable.
      f9de6b0f
  32. 01 May, 2008 1 commit
  33. 27 Oct, 2007 1 commit
    • Francois Bertel's avatar
      BUG: Address reopened bug 2347. As premultiplication by alpha was there only... · e606aa32
      Francois Bertel authored
      BUG: Address reopened bug 2347. As premultiplication by alpha was there only for compositing of framebuffers, only use it if the framebuffer has some alpha bits and the OpenGL driver does not support glBlendFuncSeparate(). Use glBlendFuncSeparate() as much as possible since it does a better job when translucent textures are involved. It also conflicted with improvement on depth peeling.
      BUG: Fixed depth peeling with ImageActor (used also internally by TextActor3D).
      ENH: Add coverage for translucent ImageActor (with alpha blending or depth peeling)
      ENH: Add coverage for TextActor3D (with alpha blending or depth peeling).
      ENH: Add coverage for translucent texture on an Actor with depth peeling.
      BUG: Fixed coverage for translucent texture on an Actor with alpha blending, testing code was using some texture on the property instead of thetexture on the actor.
      BUG: Fixed rendering of translucent LookupTable
      ENH: Added coverage for translucent LookupTable with alpha blending or depth peeling and with color interpolation or 1D texture interpolation.
      e606aa32