OSDN Git Service

FIRST REPOSITORY
[eos/hostdependOTHERS.git] / I686LINUX / util / I686LINUX / include / vtk / vtkInputPort.h
1 /*=========================================================================
2
3   Program:   Visualization Toolkit
4   Module:    $RCSfile: vtkInputPort.h,v $
5   Language:  C++
6   Date:      $Date: 2002/05/17 01:50:34 $
7   Version:   $Revision: 1.8 $
8
9   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
10   All rights reserved.
11   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
12
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.
16
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).
27
28 // .SECTION see also
29 // vtkOutputPort vtkMultiProcessController
30
31 #ifndef __vtkInputPort_h
32 #define __vtkInputPort_h
33
34 #include "vtkSource.h"
35
36 class vtkPolyData;
37 class vtkUnstructuredGrid;
38 class vtkStructuredGrid;
39 class vtkRectilinearGrid;
40 class vtkStructuredPoints;
41 class vtkImageData;
42 class vtkMultiProcessController;
43
44 class VTK_PARALLEL_EXPORT vtkInputPort : public vtkSource
45 {
46 public:
47   static vtkInputPort *New();
48   vtkTypeRevisionMacro(vtkInputPort,vtkSource);
49   void PrintSelf(ostream& os, vtkIndent indent);
50
51   // Description:
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();
62   
63   // Description:
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);
71   
72   // Description:
73   // Need to override to propagate across port.
74   void UpdateInformation();
75
76   // Description:
77   // Need to override to propagate across port.
78   void PropagateUpdateExtent(vtkDataObject *vtkNotUsed(output)) {};
79
80   // Description:
81   // Need to override to propagate across port
82   void UpdateData( vtkDataObject *out );
83
84   // Description:
85   // Need to override to trigger the update across the port
86   void TriggerAsynchronousUpdate();  
87   
88   // Description:
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*);
93   
94   // Description:
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);
103   
104 //BTX
105
106 // Arbitrary tags used by the ports for communication.
107   enum Tags {
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
114   };
115
116 //ETX
117
118 protected:
119   vtkInputPort();
120   ~vtkInputPort();  
121   
122   vtkMultiProcessController *Controller;
123   int RemoteProcessId;
124   int Tag;
125
126   unsigned long DataTime;
127   unsigned long UpStreamMTime;
128   int TransferNeeded;
129   int DoUpdateInformation;
130 private:
131   vtkInputPort(const vtkInputPort&);  // Not implemented.
132   void operator=(const vtkInputPort&);  // Not implemented.
133 };
134
135 #endif
136
137