ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
vtkPVCompositeDataPipeline.cxx
Go to the documentation of this file.
1 /*=========================================================================
2 
3 Program: Visualization Toolkit
4 Module: vtkPVCompositeDataPipeline.cxx
5 
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
16 
17 #include "vtkAlgorithm.h"
18 #include "vtkAlgorithmOutput.h"
19 #include "vtkDataObject.h"
20 #include "vtkInformation.h"
21 #include "vtkInformationIntegerVectorKey.h"
22 #include "vtkInformationKey.h"
23 #include "vtkInformationObjectBaseKey.h"
24 #include "vtkInformationVector.h"
25 #include "vtkObjectFactory.h"
27 
28 #include <assert.h>
29 
31 //----------------------------------------------------------------------------
33 {
34 }
35 
36 //----------------------------------------------------------------------------
38 {
39 }
40 
41 //----------------------------------------------------------------------------
42 void vtkPVCompositeDataPipeline::CopyDefaultInformation(vtkInformation* request, int direction,
43  vtkInformationVector** inInfoVec, vtkInformationVector* outInfoVec)
44 {
45  this->Superclass::CopyDefaultInformation(request, direction, inInfoVec, outInfoVec);
46 
47  if (request->Has(REQUEST_UPDATE_EXTENT()))
48  {
49  vtkInformation* algorithmInfo = this->Algorithm->GetInformation();
50 
51  // All SetInputArrayToProcess() calls result in updating this algorithmInfo
52  // object.
53  vtkInformationVector* inArrayVec = algorithmInfo->Get(vtkAlgorithm::INPUT_ARRAYS_TO_PROCESS());
54  int num_arrays = inArrayVec ? inArrayVec->GetNumberOfInformationObjects() : 0;
55  int informationIndex = 0;
56  for (int array_index = 0; array_index < num_arrays; array_index++)
57  {
58  vtkInformation* arrayInfo = this->Algorithm->GetInputArrayInformation(array_index);
59  // currently, we only support conversion for array set using FIELD_NAME().
60  if (arrayInfo->Has(vtkDataObject::FIELD_NAME()) &&
61  arrayInfo->Has(vtkAlgorithm::INPUT_PORT()) &&
62  arrayInfo->Has(vtkAlgorithm::INPUT_CONNECTION()) &&
63  arrayInfo->Has(vtkDataObject::FIELD_ASSOCIATION()))
64  {
65  int port = arrayInfo->Get(vtkAlgorithm::INPUT_PORT());
66  int connection = arrayInfo->Get(vtkAlgorithm::INPUT_CONNECTION());
67  if (port < 0 || port >= this->GetNumberOfInputPorts() || connection < 0 ||
68  connection >= this->GetNumberOfInputConnections(port))
69  {
70  continue;
71  }
72  vtkExecutive* input_executive = this->GetInputExecutive(port, connection);
73  vtkPVPostFilterExecutive* pvpfe = vtkPVPostFilterExecutive::SafeDownCast(input_executive);
74  if (pvpfe)
75  {
76  assert(this->Algorithm->GetInputConnection(port, connection)->GetIndex() == 0);
77  pvpfe->SetPostArrayToProcessInformation(informationIndex, arrayInfo);
78  informationIndex++;
79  }
80  }
81  }
82  }
83 }
84 
85 //----------------------------------------------------------------------------
86 void vtkPVCompositeDataPipeline::ResetPipelineInformation(int port, vtkInformation* info)
87 {
88  this->Superclass::ResetPipelineInformation(port, info);
89 }
90 
91 //----------------------------------------------------------------------------
92 void vtkPVCompositeDataPipeline::PrintSelf(ostream& os, vtkIndent indent)
93 {
94  this->Superclass::PrintSelf(os, indent);
95 }
void PrintSelf(ostream &os, vtkIndent indent) override
void CopyDefaultInformation(vtkInformation *request, int direction, vtkInformationVector **inInfoVec, vtkInformationVector *outInfoVec) override
void ResetPipelineInformation(int port, vtkInformation *) override
void SetPostArrayToProcessInformation(int idx, vtkInformation *inInfo)
vtkStandardNewMacro(vtkPVCompositeDataPipeline)