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

Method ProcessSelectorPixelBuffers

Rendering/OpenGL2/vtkOpenGLPolyDataMapper.cxx:4657–4873  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

4655
4656//------------------------------------------------------------------------------
4657void vtkOpenGLPolyDataMapper::ProcessSelectorPixelBuffers(
4658 vtkHardwareSelector* sel, std::vector<unsigned int>& pixeloffsets, vtkProp* prop)
4659{
4660 vtkPolyData* poly = this->CurrentInput;
4661
4662 if (!this->PopulateSelectionSettings || !poly)
4663 {
4664 return;
4665 }
4666
4667 // which pass are we processing ?
4668 int currPass = sel->GetCurrentPass();
4669
4670 // get some common useful values
4671 vtkPointData* pd = poly->GetPointData();
4672 vtkCellData* cd = poly->GetCellData();
4673 unsigned char* rawplowdata = sel->GetRawPixelBuffer(vtkHardwareSelector::POINT_ID_LOW24);
4674 unsigned char* rawphighdata = sel->GetRawPixelBuffer(vtkHardwareSelector::POINT_ID_HIGH24);
4675
4676 // handle process pass
4677 if (currPass == vtkHardwareSelector::PROCESS_PASS)
4678 {
4679 vtkDataArray* processArray = nullptr;
4680
4681 if (sel->GetUseProcessIdFromData())
4682 {
4683 processArray = this->ProcessIdArrayName ? pd->GetArray(this->ProcessIdArrayName) : nullptr;
4684 }
4685
4686 // do we need to do anything to the process pass data?
4687 unsigned char* processdata = sel->GetRawPixelBuffer(vtkHardwareSelector::PROCESS_PASS);
4688 if (processdata && (processArray && processArray->GetDataType() == VTK_UNSIGNED_INT) &&
4689 rawplowdata)
4690 {
4691 using UIntArrays =
4692 vtkTypeList::Create<vtkAOSDataArrayTemplate<unsigned int>, vtkConstantArray<unsigned int>>;
4693 using Dispatcher = vtkArrayDispatch::DispatchByArray<UIntArrays>;
4694 ProcessFunctor functor;
4695 if (!Dispatcher::Execute(
4696 processArray, functor, processdata, rawplowdata, rawphighdata, pixeloffsets))
4697 {
4698 functor(processArray, processdata, rawplowdata, rawphighdata, pixeloffsets);
4699 }
4700 }
4701 }
4702
4703 if (currPass == vtkHardwareSelector::POINT_ID_LOW24)
4704 {
4705 vtkIdTypeArray* pointArrayId = this->PointIdArrayName
4706 ? vtkArrayDownCast<vtkIdTypeArray>(pd->GetArray(this->PointIdArrayName))
4707 : nullptr;
4708
4709 // do we need to do anything to the point id data?
4710 if (rawplowdata && pointArrayId)
4711 {
4712 unsigned char* plowdata = sel->GetPixelBuffer(vtkHardwareSelector::POINT_ID_LOW24);
4713
4714 for (auto pos : pixeloffsets)

Callers

nothing calls this directly

Calls 15

GetVertsMethod · 0.80
GetPolysMethod · 0.80
GetStripsMethod · 0.80
GetRepresentationMethod · 0.80
ExecuteFunction · 0.50
GetPointDataMethod · 0.45
GetCellDataMethod · 0.45
GetArrayMethod · 0.45
GetDataTypeMethod · 0.45
GetValueMethod · 0.45
GetLinesMethod · 0.45

Tested by

no test coverage detected