00001
00002
00003 #ifndef __vtkPolyDataInputPortClient_h
00004 #define __vtkPolyDataInputPortClient_h
00005
00010 #include <vtkDataSetAlgorithm.h>
00011 #include <string>
00012
00013 class vtkMultiProcessController;
00014 class vtkSocketCommunicator;
00015
00016
00033 class VTK_PARALLEL_EXPORT vtkPolyDataInputPortClient : public vtkDataSetAlgorithm
00034 {
00035
00036 public:
00037
00043 static vtkPolyDataInputPortClient *New();
00044
00045 vtkTypeRevisionMacro(vtkPolyDataInputPortClient, vtkDataSetAlgorithm);
00046
00052 void PrintSelf(ostream& os, vtkIndent indent);
00053
00060 void Controller(vtkMultiProcessController *controller);
00061
00066 vtkMultiProcessController *Controller() const;
00067
00073 void RemoteHostName(std::string name);
00074
00080 std::string RemoteHostName() const;
00081
00086 void PortNumber(int port);
00087
00092 int PortNumber() const;
00093
00098 bool Connect();
00099
00103 void Disconnect();
00104
00109 unsigned long GetMTime();
00110
00120 void SetDoUpdateInformation(int boolean);
00121
00127 int GetDoUpdateInformation() const;
00128
00129
00130
00134 enum Tags
00135 {
00136 DOWN_DATA_TIME_TAG = 98970,
00137 UPDATE_EXTENT_TAG = 98971,
00138 TRANSFER_NEEDED_TAG = 98972,
00139 INFORMATION_TRANSFER_TAG = 98973,
00140 DATA_TRANSFER_TAG = 98974,
00141 NEW_DATA_TIME_TAG = 98975,
00142 DATA_TYPE_TAG = 98976
00143 };
00144
00145
00146
00147
00148 protected:
00149
00153 vtkPolyDataInputPortClient();
00154
00158 virtual ~vtkPolyDataInputPortClient();
00159
00160 std::string remoteHostName;
00161 int port;
00162
00163 unsigned long dataTime;
00164 unsigned long upStreamMTime;
00165 int doUpdateInformation;
00166
00167 int lastUpdatePiece;
00168 int lastUpdateNumberOfPieces;
00169 int lastUpdateGhostLevel;
00170
00175 virtual void SetLastUpdateExtent(int extent[6]);
00176
00177 int lastUpdateExtent[6];
00178
00179 int UpdateExtentIsOutsideOfTheExtent(vtkDataObject *output);
00180
00181
00182
00183 virtual int RequestDataObject(vtkInformation *request,
00184 vtkInformationVector **inputVector,
00185 vtkInformationVector *outputVector);
00186 virtual int RequestInformation(vtkInformation *request,
00187 vtkInformationVector **inputVector,
00188 vtkInformationVector *outputVector);
00189 virtual int RequestData(vtkInformation *request,
00190 vtkInformationVector **inputVector,
00191 vtkInformationVector *outputVector);
00192
00196 virtual int FillOutputPortInformation(int port, vtkInformation *info);
00197
00201 void TriggerRMI(int tag);
00202
00206 vtkSocketCommunicator *datacomm;
00207
00211 vtkSocketCommunicator *upstcomm;
00212
00216 vtkSocketCommunicator *dnstcomm;
00217
00218
00219 private:
00223 vtkPolyDataInputPortClient(const vtkPolyDataInputPortClient&);
00224 void operator=(const vtkPolyDataInputPortClient&);
00225 vtkMultiProcessController *controller;
00226 int remoteProcessId;
00227 int tag;
00228
00235 bool TryConnection(vtkSocketCommunicator *comm, int port);
00236 };
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254
00258 #endif
00259
00260