Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • VTK VTK
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 740
    • Issues 740
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 196
    • Merge requests 196
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • VTK
  • VTKVTK
  • Issues
  • #3098
Closed
Open
Created Apr 04, 2006 by Kitware Robot@kwrobotOwner

vtkProjectedTetrahedraMapper does not properly support IndependantComponents with 2 components

This issue was created automatically from an original Mantis Issue. Further discussion may take place here.


When using a 2-component scalar with IndependantComponents, the two components are not processed through the color/opacity functions provided.

The "Map2DependantComponents" needs to be modified to be more like the following:

template<class ColorType, class ScalarType> void Map2DependentComponents(ColorType *colors, ScalarType *scalars, vtkIdType num_scalars, vtkVolumeProperty *property) { ColorType *c = colors; ScalarType *s = scalars; vtkIdType i;

if (property-&gt;GetColorChannels() == 1)
  {
  vtkPiecewiseFunction *gray = property-&gt;GetGrayTransferFunction();
  vtkPiecewiseFunction *alpha = property-&gt;GetScalarOpacity();

  for (i = 0; i &lt; num_scalars; i++, c += 4, s += 2)
    {
    c[0] = c[1] = c[2] = static_cast&lt;ColorType&gt;(gray-&gt;GetValue(s[0]));
    c[3] = static_cast&lt;ColorType&gt;(alpha-&gt;GetValue(s[1]));
    }
  }
else
  {
  vtkColorTransferFunction *rgb = property-&gt;GetRGBTransferFunction();
  vtkPiecewiseFunction *alpha = property-&gt;GetScalarOpacity();

  for (i = 0; i &lt; num_scalars; i++, c += 4, s += 2)
    {
    double trgb[3];
    rgb-&gt;GetColor(s[0], trgb);
    c[0] = static_cast&lt;ColorType&gt;(trgb[0]);
    c[1] = static_cast&lt;ColorType&gt;(trgb[1]);
    c[2] = static_cast&lt;ColorType&gt;(trgb[2]);
    c[3] = static_cast&lt;ColorType&gt;(alpha-&gt;GetValue(s[1]));
    }
  }

}

Assignee
Assign to
Time tracking