ParaView
vtkSMSILModel.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkSMSILModel.h
5 
6  Copyright (c) Kitware, Inc.
7  All rights reserved.
8  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
36 #ifndef vtkSMSILModel_h
37 #define vtkSMSILModel_h
38 
39 #include "vtkPVServerManagerCoreModule.h" //needed for exports
40 #include "vtkSMObject.h"
41 #include <set> // required for vtkset
42 
43 class vtkGraph;
45 class vtkSMProxy;
46 
47 class VTKPVSERVERMANAGERCORE_EXPORT vtkSMSILModel : public vtkSMObject
48 {
49 public:
50  static vtkSMSILModel* New();
51  vtkTypeMacro(vtkSMSILModel, vtkSMObject);
52  void PrintSelf(ostream& os, vtkIndent indent);
53 
55  {
56  UNCHECKED = 0,
57  PARTIAL = 1,
58  CHECKED = 2
59  };
60 
62 
72  void Initialize(vtkGraph* sil);
73  vtkGetObjectMacro(SIL, vtkGraph);
75 
77 
93  void Initialize(vtkSMProxy*, vtkSMStringVectorProperty*);
94  vtkGetObjectMacro(Proxy, vtkSMProxy);
95  vtkGetObjectMacro(Property, vtkSMStringVectorProperty);
97 
103  int GetNumberOfChildren(vtkIdType vertexid);
104 
109  vtkIdType GetChildVertex(vtkIdType parentid, int child_index);
110 
116  vtkIdType GetParentVertex(vtkIdType parent);
117 
121  const char* GetName(vtkIdType vertex);
122 
126  int GetCheckStatus(vtkIdType vertex);
127 
129 
133  bool SetCheckState(vtkIdType vertex, int status);
134  bool SetCheckState(const char* name, int status)
135  {
136  vtkIdType vertex = this->FindVertex(name);
137  if (vertex != -1)
138  {
139  return this->SetCheckState(vertex, status);
140  }
141  vtkErrorMacro("Failed to locate " << name);
142  return false;
143  }
145 
147 
150  void CheckAll();
151  void UncheckAll();
153 
157  void UpdatePropertyValue(vtkSMStringVectorProperty*);
158 
163  void UpdateStateFromProperty(vtkSMStringVectorProperty*);
164 
168  vtkIdType FindVertex(const char* name);
169 
170  void GetLeaves(std::set<vtkIdType>& leaves, vtkIdType root, bool traverse_cross_edges);
171 
172 protected:
173  vtkSMSILModel();
174  virtual ~vtkSMSILModel();
175 
176  void UpdateProperty();
177  void OnPropertyModified();
178  void OnDomainModified();
179 
181  void Check(vtkIdType vertexid, bool checked, vtkIdType inedgeid = -1);
182 
186  void UpdateCheck(vtkIdType vertexid);
187 
189 
190  void SetSIL(vtkGraph*);
191 
194  vtkGraph* SIL;
195  vtkCommand* PropertyObserver;
196  vtkCommand* DomainObserver;
197 
198 private:
199  vtkSMSILModel(const vtkSMSILModel&) VTK_DELETE_FUNCTION;
200  void operator=(const vtkSMSILModel&) VTK_DELETE_FUNCTION;
201 
202  class vtkInternals;
203  vtkInternals* Internals;
204 };
205 
206 #endif
bool SetCheckState(const char *name, int status)
Set the check state for a vertex.
void PrintSelf(ostream &os, vtkIndent indent)
property representing a vector of strings
vtkSMProxy * Proxy
is a helper for to work with SILs.
Definition: vtkSMSILModel.h:47
superclass for most server manager classes
Definition: vtkSMObject.h:31
vtkCommand * PropertyObserver
vtkSMStringVectorProperty * Property
vtkCommand * DomainObserver
static vtkSMObject * New()
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:152
vtkGraph * SIL