vtkIntersectFragments.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: $RCSfile$
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 =========================================================================*/
22 #ifndef vtkIntersectFragments_h
23 #define vtkIntersectFragments_h
24 
26 #include "vtkPVVTKExtensionsFiltersMaterialInterfaceModule.h" //needed for exports
27 #include <string> //
28 #include <vector> //
29 
30 class vtkPolyData;
31 // class vtkMultiBlockDataSet;
32 class vtkPoints;
33 class vtkDoubleArray;
34 class vtkIntArray;
38 class vtkCutter;
39 
42 {
43 public:
44  static vtkIntersectFragments* New();
46  void PrintSelf(ostream& os, vtkIndent indent) override;
47 
49 
50 
53  virtual void SetCutFunction(vtkImplicitFunction*);
54  vtkGetObjectMacro(CutFunction, vtkImplicitFunction);
56 
59  void SetGeometryInputConnection(vtkAlgorithmOutput* algOutput);
63  void SetStatisticsInputConnection(vtkAlgorithmOutput* algOutput);
67  vtkMTimeType GetMTime() override;
68 
69 protected:
71  ~vtkIntersectFragments() override;
72 
75  int FillInputPortInformation(int port, vtkInformation* info) override;
76  int FillOutputPortInformation(int port, vtkInformation* info) override;
78  // Make list of what we own
79  int IdentifyLocalFragments();
80  // Copy structure from multi block of polydata.
81  int CopyInputStructureStats(vtkMultiBlockDataSet* dest, vtkMultiBlockDataSet* src);
82  // Copy structure from multi block of multi piece
83  int CopyInputStructureGeom(vtkMultiBlockDataSet* dest, vtkMultiBlockDataSet* src);
84  //
85  int PrepareToProcessRequest();
86  //
87  int Intersect();
88  // Build arrays that describe which fragment
89  // intersections are not empty.
90  void BuildLoadingArray(std::vector<vtkIdType>& loadingArray, int blockId);
91  int PackLoadingArray(vtkIdType*& buffer, int blockId);
92  int UnPackLoadingArray(
93  vtkIdType* buffer, int bufSize, std::vector<vtkIdType>& loadingArray, int blockId);
94  //
95  void ComputeGeometricAttributes();
96  // Send my geometric attribuites to a single process.
97  int SendGeometricAttributes(const int recipientProcId);
98  // size buffers & new containers
99  int PrepareToCollectGeometricAttributes(std::vector<vtkMaterialInterfaceCommBuffer>& buffers,
100  std::vector<std::vector<vtkDoubleArray*> >& centers, std::vector<std::vector<int*> >& ids);
101  // Free resources.
102  int CleanUpAfterCollectGeometricAttributes(std::vector<vtkMaterialInterfaceCommBuffer>& buffers,
103  std::vector<std::vector<vtkDoubleArray*> >& centers, std::vector<std::vector<int*> >& ids);
104  // Receive all geometric attributes from all other
105  // processes.
106  int CollectGeometricAttributes(std::vector<vtkMaterialInterfaceCommBuffer>& buffers,
107  std::vector<std::vector<vtkDoubleArray*> >& centers, std::vector<std::vector<int*> >& ids);
108  // size local copy to hold all.
109  int PrepareToMergeGeometricAttributes(std::vector<std::vector<int> >& unique);
110  // Gather geometric attributes on a single process.
111  int GatherGeometricAttributes(const int recipientProcId);
112  // Copy attributes from input to output
113  int CopyAttributesToStatsOutput(const int controllingProcId);
114  //
115  int CleanUpAfterRequest();
116 
118  //
120  // Global ids of what we own before the intersection.
121  std::vector<std::vector<int> > FragmentIds;
122  // Centers, and global fragment ids.
123  // an array for each block.
124  std::vector<vtkDoubleArray*> IntersectionCenters;
125  std::vector<std::vector<int> > IntersectionIds;
126  //
128  // data in/out
133  int NBlocks;
134  // only used on controller.
135  std::vector<int> NFragmentsIntersected;
136 
139  double Progress;
141 
142 private:
144  void operator=(const vtkIntersectFragments&) = delete;
145 };
146 
147 #endif
std::vector< std::vector< int > > FragmentIds
vtkMultiBlockDataSet * StatsOut
#define VTKPVVTKEXTENSIONSFILTERSMATERIALINTERFACE_EXPORT
int vtkIdType
vtkMultiBlockDataSet * StatsIn
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
vtkMultiBlockDataSet * GeomIn
vtkTypeUInt64 vtkMTimeType
static vtkMultiBlockDataSetAlgorithm * New()
virtual int FillOutputPortInformation(int port, vtkInformation *info)
Geometry intersection operations.
virtual vtkMTimeType GetMTime()
vtkMultiProcessController * Controller
data
std::vector< vtkDoubleArray * > IntersectionCenters
virtual int FillInputPortInformation(int port, vtkInformation *info)
vtkMultiBlockDataSet * GeomOut
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
void operator=(const vtkObjectBase &)
std::vector< std::vector< int > > IntersectionIds
vtkImplicitFunction * CutFunction
PARAVIEW interface data.
std::vector< int > NFragmentsIntersected