/usr/include/paraview/vtkLiveInsituLink.h is in paraview-dev 5.0.1+dfsg1-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 | /*=========================================================================
Program: ParaView
Module: $RCSfile$
Copyright (c) Kitware, Inc.
All rights reserved.
See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
/**
* @defgroup LiveInsitu Live Insitu
*
* The Live Insitu module visualizes and controls a remote simulation.
*
* It allows a user to visualize live data, control the visualization
* pipeline, and pause a running simulation that was linked with the
* Catalyst module.
*/
// .NAME vtkLiveInsituLink - link for live-coprocessing.
// .SECTION Description
// vtkLiveInsituLink manages the communication link between Insitu and
// Live visualization servers. vtkLiveInsituLink is created on both
// ends of the live-insitu channel i.e. in Insitu code (by
// instantiating vtkLiveInsituLink directly) and in the Live ParaView
// application (by using a proxy that instantiates the
// vtkLiveInsituLink).
// @ingroup LiveInsitu
#ifndef vtkLiveInsituLink_h
#define vtkLiveInsituLink_h
#include "vtkPVServerManagerCoreModule.h" //needed for exports
#include "vtkSMObject.h"
#include "vtkWeakPointer.h" // Needed for Weak pointer
#include "vtkSmartPointer.h" // Needed for Smart pointer
class vtkMultiProcessController;
class vtkSMSessionProxyManager;
class vtkPVXMLElement;
class vtkPVSessionBase;
class vtkTrivialProducer;
class vtkExtractsDeliveryHelper;
class VTKPVSERVERMANAGERCORE_EXPORT vtkLiveInsituLink : public vtkSMObject
{
public:
static vtkLiveInsituLink* New();
vtkTypeMacro(vtkLiveInsituLink, vtkSMObject);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Set the port number. This is the port on which the root data-server node
// will open a server-socket to accept connections from VTK InSitu Library.
vtkSetMacro(InsituPort, int);
vtkGetMacro(InsituPort, int);
// Description:
// Set the host name.
vtkSetStringMacro(Hostname);
vtkGetStringMacro(Hostname);
// Description:
// Set/Get the link type i.e. whether the current process is the visualization
// process or the insitu process.
enum
{
LIVE=0,
INSITU=1
};
vtkSetClampMacro(ProcessType, int, LIVE, INSITU);
vtkGetMacro(ProcessType, int);
// Description:
// When instantiated on the ParaView visualization server side using a
// vtkSMProxy, ProxyId is used to identify the proxy corresponding to this
// instance. That helps us construct notification messages that the
// visualization server can send to the client.
vtkSetMacro(ProxyId, unsigned int);
vtkGetMacro(ProxyId, unsigned int);
// Description:
// 'SimulationPaused' is set/reset on Paraview Live and sent to Insitu
// every time step.
vtkGetMacro(SimulationPaused, int);
void SetSimulationPaused (int paused);
// Description:
// Initializes the link. For in situ this returns true it there is a
// connection and false otherwise. For live it always returns true.
bool Initialize() { return this->Initialize(NULL); }
bool Initialize(vtkSMSessionProxyManager*);
// **************************************************************************
// *** API to be used from the insitu library ***
// Description:
// Every time Insitu is ready to communicate with ParaView visualization
// engine call this method. The goal of this call is too get the latest
// updates from ParaView including changes to state for the co-processing
// pipeline or changes in what extract the visualization engine is expecting.
// This method's primary goal is to obtain information from ParaView vis
// engine. If no active connection to ParaView visualization engine exists,
// this will make an attempt to connect to ParaView.
void InsituUpdate(double time, vtkIdType timeStep);
// Description:
// Every time Insitu is ready to push extracts to ParaView visualization
// engine, call this method. If no active ParaView visualization engine
// connection exists (or the connection dies), then this method does nothing
// (besides some bookkeeping). Otherwise, this will push any extracts
// requested to the ParaView visualization engine.
void InsituPostProcess(double time, vtkIdType timeStep);
// Description: Wait until something changes on ParaView Live. This
// is called on the catalyst side. Insitu stops until the pipeline
// is edited, an extract is added or removed or the user continues
// the simulation. Returns != 0 if the visualization side disconnected,
// 0 otherwise
int WaitForLiveChange();
/// Description: Called on INSITU side when LIVE has changed
void OnLiveChanged();
// **************************************************************************
// **************************************************************************
// API to be used from the LIVE side.
// Register/unregister a producer for an extract.
void RegisterExtract(vtkTrivialProducer* producer,
const char* groupname, const char* proxyname, int portnumber);
void UnRegisterExtract(vtkTrivialProducer* producer);
void OnInsituUpdate(double time, vtkIdType timeStep);
void OnInsituPostProcess(double time, vtkIdType timeStep);
// Description:
// Signal a change on the ParaView Live side and transmit it to the Insitu
// side. This is called when the state or extracts are changed or when
// the simulation is continued.
void LiveChanged();
// **************************************************************************
enum NotificationTags
{
CONNECTED = 1200,
NEXT_TIMESTEP_AVAILABLE = 1201,
DISCONNECTED = 1202
};
void UpdateInsituXMLState(const char* txt);
// Description:
// This method will remove references to proxy that shouldn't be shared with ParaView
// Return true if something has been removed
static bool FilterXMLState(vtkPVXMLElement* xmlState);
//BTX
// ***************************************************************
// Internal methods, public for callbacks.
void InsituConnect(vtkMultiProcessController* controller);
// Description:
// Called to drop the connection between Insitu and ParaView Live.
void DropLiveInsituConnection();
protected:
vtkLiveInsituLink();
~vtkLiveInsituLink();
enum RMITags
{
UPDATE_RMI_TAG=8800,
POSTPROCESS_RMI_TAG=8801,
INITIALIZE_CONNECTION=8802,
DROP_CAT2PV_CONNECTION=8803,
// Message from LIVE, sent when simulation is paused,
// signalling a change. INSITU wakes up and checks for new
// simulation state, changed extracts or if it should continue the
// simulation
LIVE_CHANGED=8804
};
// Description:
// Called by Initialize() to initialize on a ParaView Live process.
void InitializeLive();
// Description:
// Called by Initialize() to initialize on a Insitu process. Returns
// true if a connection is made.
bool InitializeInsitu();
// Description:
// Callback on Visualization process when a simulation connects to it.
void OnConnectionCreatedEvent();
// Description:
// Callback on Visualization process when a connection dies during
// vtkNetworkAccessManager::ProcessEvents().
void OnConnectionClosedEvent(
vtkObject*, unsigned long eventid, void* calldata);
char* Hostname;
int InsituPort;
int ProcessType;
unsigned int ProxyId;
bool InsituXMLStateChanged;
bool ExtractsChanged;
int SimulationPaused;
char* InsituXMLState;
vtkWeakPointer<vtkPVSessionBase> LiveSession;
vtkSmartPointer<vtkMultiProcessController> Controller;
vtkSmartPointer<vtkExtractsDeliveryHelper> ExtractsDeliveryHelper;
private:
vtkLiveInsituLink(const vtkLiveInsituLink&); // Not implemented
void operator=(const vtkLiveInsituLink&); // Not implemented
vtkWeakPointer<vtkSMSessionProxyManager> InsituProxyManager;
vtkSetStringMacro(URL);
char* URL;
vtkSetStringMacro(InsituXMLState);
class vtkInternals;
vtkInternals* Internals;
//ETX
};
#endif
|