MCPcopy Create free account
hub / github.com/Kitware/VTK / CompositeFunction

Method CompositeFunction

Rendering/Volume/vtkUnstructuredGridVolumeZSweepMapper.cxx:4061–4233  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

4059
4060//------------------------------------------------------------------------------
4061void vtkUnstructuredGridVolumeZSweepMapper::CompositeFunction(double zTarget)
4062{
4063 int y = this->YBounds[0];
4064 vtkIdType i = y * this->ImageInUseSize[0] + this->XBounds[0];
4065
4066 vtkIdType index = (y * this->ImageMemorySize[0] + this->XBounds[0]) << 2; // *4
4067 vtkIdType indexStep = this->ImageMemorySize[0] << 2; // *4
4068
4069 vtkPixelListEntry* current;
4070 vtkPixelListEntry* next;
4071 double zBuffer = 0;
4072
4073 int newXBounds[2];
4074 int newYBounds[2];
4075
4076 newXBounds[0] = this->ImageInUseSize[0];
4077 newXBounds[1] = 0;
4078 newYBounds[0] = this->ImageInUseSize[1];
4079 newYBounds[1] = 0;
4080
4081 int xMin = this->XBounds[0];
4082 int xMax = this->XBounds[1];
4083 int yMax = this->YBounds[1];
4084
4085 vtkPixelList* pixel;
4086 int x;
4087 vtkIdType j;
4088 vtkIdType index2;
4089 int done;
4090 int doIntegration;
4091 double length;
4092 float* color;
4093
4094 // for each pixel in the bounding box
4095 while (y <= yMax)
4096 {
4097 x = xMin;
4098 j = i;
4099 index2 = index;
4100 while (x <= xMax)
4101 {
4102 pixel = this->PixelListFrame->GetList(j);
4103 // we need at least two entries per pixel to perform compositing
4104 if (pixel->GetSize() >= 2)
4105 {
4106 current = pixel->GetFirst();
4107 next = current->GetNext();
4108#ifdef BACK_TO_FRONT
4109 done = current->GetZview() <= zTarget || next->GetZview() <= zTarget;
4110#else
4111 done = current->GetZview() >= zTarget || next->GetZview() >= zTarget;
4112#endif
4113
4114 if (!done && this->ZBuffer != nullptr)
4115 {
4116 // value of the z buffer at the current pixel.
4117 zBuffer = this->GetZBufferValue(x, y);
4118 }

Callers 1

MainLoopMethod · 0.95

Calls 13

GetZBufferValueMethod · 0.95
GetExitFaceMethod · 0.80
RemoveFirstMethod · 0.80
sqrtFunction · 0.50
maxFunction · 0.50
GetListMethod · 0.45
GetSizeMethod · 0.45
GetFirstMethod · 0.45
GetNextMethod · 0.45
GetZviewMethod · 0.45
GetValuesMethod · 0.45
SetValueMethod · 0.45

Tested by

no test coverage detected