vtkPVPluginsInformation.h 3.77 KB
Newer Older
1
2
3
/*=========================================================================

  Program:   ParaView
Sebastien Jourdain's avatar
Sebastien Jourdain committed
4
  Module:    vtkPVPluginsInformation.h
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

  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.

=========================================================================*/
// .NAME vtkPVPluginsInformation - information about plugins tracked by
// vtkPVPluginTracker.
// .SECTION Description
// vtkPVPluginsInformation is used to collect information about plugins tracked
// by vtkPVPluginTracker.

#ifndef __vtkPVPluginsInformation_h
#define __vtkPVPluginsInformation_h

#include "vtkPVInformation.h"

class VTK_EXPORT vtkPVPluginsInformation : public vtkPVInformation
{
public:
  static vtkPVPluginsInformation* New();
  vtkTypeMacro(vtkPVPluginsInformation, vtkPVInformation);
  void PrintSelf(ostream& os, vtkIndent indent);

  // Description:
  // API to iterate over the information collected for each plugin.
  unsigned int GetNumberOfPlugins();
  const char* GetPluginName(unsigned int);
37
  const char* GetPluginFileName(unsigned int);
38
39
40
41
42
43
44
  const char* GetPluginVersion(unsigned int);
  bool GetPluginLoaded(unsigned int);
  const char* GetRequiredPlugins(unsigned int);
  bool GetRequiredOnServer(unsigned int);
  bool GetRequiredOnClient(unsigned int);
  bool GetAutoLoad(unsigned int);

45
46
47
48
49
  // Description:
  // Note that unlike other properties, this one is updated as a consequence of
  // calling PluginRequirementsSatisfied().
  const char* GetPluginStatusMessage(unsigned int);

Utkarsh Ayachit's avatar
Utkarsh Ayachit committed
50
51
52
53
  // Description:
  // API to change auto-load status.
  void SetAutoLoad(unsigned int cc, bool);

54
55
56
57
58
59
60
61
62
  // Description:
  // This is a hack. When the user sets an auto-load option from  the GUI to
  // avoid that choice being overwritten as the information object is updated
  // over time as new plugins are loaded/unloaded, the pqPluginDialog uses this
  // method to set the auto-load flag. This flag is not communicated across
  // processes, but when called, GetAutoLoad() will return the value set using
  // this method.
  void SetAutoLoadAndForce(unsigned int cc, bool);

63
64
65
66
67
68
69
70
  // Description:
  // Transfer information about a single object into this object.
  virtual void CopyFromObject(vtkObject*);

  // Description:
  // Merge another information object.
  virtual void AddInformation(vtkPVInformation*);

Utkarsh Ayachit's avatar
Utkarsh Ayachit committed
71
72
73
74
75
  // Description:
  // Updates the local information with elements from other without overriding
  // auto-load state.
  void Update(vtkPVPluginsInformation* other);

76
77
78
79
80
81
82
  //BTX
  // Description:
  // Manage a serialized version of the information.
  virtual void CopyToStream(vtkClientServerStream*);
  virtual void CopyFromStream(const vtkClientServerStream*);
  //ETX

83
84
85
  // Description:
  // Get the plugin search path.
  vtkGetStringMacro(SearchPaths);
86
87
88
89
90
91
92
93
94

  // Description:
  // Method to validate if the plugin requirements are met across processes.
  // This also updated the "StatusMessage" for all the plugins. If StatusMessage
  // is empty for a loaded plugin, it implies that everything is fine. If some
  // requirement is not met, the StatusMessage includes the error message.
  static bool PluginRequirementsSatisfied(
    vtkPVPluginsInformation* client_plugins,
    vtkPVPluginsInformation* server_plugins);
95
96
97
98
99
//BTX
protected:
  vtkPVPluginsInformation();
  ~vtkPVPluginsInformation();

100
101
102
  char* SearchPaths;
  vtkSetStringMacro(SearchPaths);

103
104
105
106
107
108
109
110
111
112
private:
  vtkPVPluginsInformation(const vtkPVPluginsInformation&); // Not implemented
  void operator=(const vtkPVPluginsInformation&); // Not implemented

  class vtkInternals;
  vtkInternals* Internals;
//ETX
};

#endif