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 =========================================================================*/
44 #ifndef vtkSMSILModel_h
45 #define vtkSMSILModel_h
46 
47 #include "vtkRemotingServerManagerModule.h" //needed for exports
48 #include "vtkSMObject.h"
49 #include <set> // required for vtkset
50 
51 class vtkGraph;
53 class vtkSMProxy;
54 
56 {
57 public:
58  static vtkSMSILModel* New();
59  vtkTypeMacro(vtkSMSILModel, vtkSMObject);
60  void PrintSelf(ostream& os, vtkIndent indent) override;
61 
63  {
64  UNCHECKED = 0,
65  PARTIAL = 1,
66  CHECKED = 2
67  };
68 
70 
80  void Initialize(vtkGraph* sil);
81  vtkGetObjectMacro(SIL, vtkGraph);
83 
85 
101  void Initialize(vtkSMProxy*, vtkSMStringVectorProperty*);
102  vtkGetObjectMacro(Proxy, vtkSMProxy);
103  vtkGetObjectMacro(Property, vtkSMStringVectorProperty);
105 
111  int GetNumberOfChildren(vtkIdType vertexid);
112 
117  vtkIdType GetChildVertex(vtkIdType parentid, int child_index);
118 
124  vtkIdType GetParentVertex(vtkIdType parent);
125 
129  const char* GetName(vtkIdType vertex);
130 
134  int GetCheckStatus(vtkIdType vertex);
135 
137 
141  bool SetCheckState(vtkIdType vertex, int status);
142  bool SetCheckState(const char* name, int status)
143  {
144  vtkIdType vertex = this->FindVertex(name);
145  if (vertex != -1)
146  {
147  return this->SetCheckState(vertex, status);
148  }
149  vtkErrorMacro("Failed to locate " << name);
150  return false;
151  }
153 
155 
158  void CheckAll();
159  void UncheckAll();
161 
165  void UpdatePropertyValue(vtkSMStringVectorProperty*);
166 
171  void UpdateStateFromProperty(vtkSMStringVectorProperty*);
172 
176  vtkIdType FindVertex(const char* name);
177 
178  void GetLeaves(std::set<vtkIdType>& leaves, vtkIdType root, bool traverse_cross_edges);
179 
180 protected:
181  vtkSMSILModel();
182  ~vtkSMSILModel() override;
183 
184  void UpdateProperty();
185  void OnPropertyModified();
186  void OnDomainModified();
187 
189  void Check(vtkIdType vertexid, bool checked, vtkIdType inedgeid = -1);
190 
194  void UpdateCheck(vtkIdType vertexid);
195 
197 
198  void SetSIL(vtkGraph*);
199 
205 
206 private:
207  vtkSMSILModel(const vtkSMSILModel&) = delete;
208  void operator=(const vtkSMSILModel&) = delete;
209 
210  class vtkInternals;
211  vtkInternals* Internals;
212 };
213 
214 #endif
bool SetCheckState(const char *name, int status)
Set the check state for a vertex.
#define VTKREMOTINGSERVERMANAGER_EXPORT
property representing a vector of strings
vtkSMProxy * Proxy
int vtkIdType
is a helper for to work with SILs.
Definition: vtkSMSILModel.h:55
name
superclass for most server manager classes
Definition: vtkSMObject.h:29
vtkCommand * PropertyObserver
vtkSMStringVectorProperty * Property
vtkCommand * DomainObserver
static vtkSMObject * New()
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:152
void PrintSelf(ostream &os, vtkIndent indent) override
vtkGraph * SIL