1 /*=========================================================================
3 Program: Visualization Toolkit
4 Module: $RCSfile: vtkInputPort.h,v $
6 Date: $Date: 2002/05/17 01:50:34 $
7 Version: $Revision: 1.8 $
9 Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen
11 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
13 This software is distributed WITHOUT ANY WARRANTY; without even
14 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 PURPOSE. See the above copyright notice for more information.
17 =========================================================================*/
18 // .NAME vtkInputPort - Receives data from another process.
19 // .SECTION Description
20 // InputPort connects the pipeline in this process to one in another
21 // processes. It communicates all the pipeline protocol so that
22 // the fact you are running in multiple processes is transparent.
23 // An input port is used as a source (input to a process).
24 // One is placed at the start of a pipeline, and has a single
25 // corresponding output port in another process
26 // (specified by RemoteProcessId).
29 // vtkOutputPort vtkMultiProcessController
31 #ifndef __vtkInputPort_h
32 #define __vtkInputPort_h
34 #include "vtkSource.h"
37 class vtkUnstructuredGrid;
38 class vtkStructuredGrid;
39 class vtkRectilinearGrid;
40 class vtkStructuredPoints;
42 class vtkMultiProcessController;
44 class VTK_PARALLEL_EXPORT vtkInputPort : public vtkSource
47 static vtkInputPort *New();
48 vtkTypeRevisionMacro(vtkInputPort,vtkSource);
49 void PrintSelf(ostream& os, vtkIndent indent);
52 // Note: You have to ask for the right type, and it has to match
53 // the type of the up stream port input, or you will get an error.
54 // We have to live with the fact that the error will not occur until
55 // an update is called.
56 vtkPolyData *GetPolyDataOutput();
57 vtkUnstructuredGrid *GetUnstructuredGridOutput();
58 vtkStructuredGrid *GetStructuredGridOutput();
59 vtkRectilinearGrid *GetRectilinearGridOutput();
60 vtkStructuredPoints *GetStructuredPointsOutput();
61 vtkImageData *GetImageDataOutput();
64 // The matching OutputPort is specified by the output port's process
65 // and a tag. There can be more than one output port per process.
66 // THE TAG MUST BE EVEN BECAUSE TWO RMIs ARE CREATED FROM IT!!!
67 vtkSetMacro(RemoteProcessId, int);
68 vtkGetMacro(RemoteProcessId, int);
69 vtkSetMacro(Tag, int);
70 vtkGetMacro(Tag, int);
73 // Need to override to propagate across port.
74 void UpdateInformation();
77 // Need to override to propagate across port.
78 void PropagateUpdateExtent(vtkDataObject *vtkNotUsed(output)) {};
81 // Need to override to propagate across port
82 void UpdateData( vtkDataObject *out );
85 // Need to override to trigger the update across the port
86 void TriggerAsynchronousUpdate();
89 // Access to the controller used for communication. By default, the
90 // global controller is used.
91 vtkMultiProcessController *GetController() {return this->Controller;}
92 virtual void SetController(vtkMultiProcessController*);
95 // If DoUpdateInformation if false (it is true by default),
96 // UpdateInformation is not performed during Update. This can
97 // be used to avoid unnecessary communication once the data
98 // has been transferred. However, if the pipeline changes
99 // upstream, DoUpdateInformation has to be set to true again.
100 // Otherwise, Updata will not occur.
101 vtkSetMacro(DoUpdateInformation, int);
102 vtkGetMacro(DoUpdateInformation, int);
106 // Arbitrary tags used by the ports for communication.
108 DOWN_DATA_TIME_TAG = 98970,
109 UPDATE_EXTENT_TAG = 98971,
110 TRANSFER_NEEDED_TAG = 98972,
111 INFORMATION_TRANSFER_TAG = 98973,
112 DATA_TRANSFER_TAG = 98974,
113 NEW_DATA_TIME_TAG = 98975
122 vtkMultiProcessController *Controller;
126 unsigned long DataTime;
127 unsigned long UpStreamMTime;
129 int DoUpdateInformation;
131 vtkInputPort(const vtkInputPort&); // Not implemented.
132 void operator=(const vtkInputPort&); // Not implemented.