vtkSMProxySelectionModel.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkSMProxySelectionModel.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 =========================================================================*/
26 #ifndef vtkSMProxySelectionModel_h
27 #define vtkSMProxySelectionModel_h
28 
29 #include "vtkRemotingServerManagerModule.h" //needed for exports
30 #include "vtkSMMessageMinimal.h" // Needed for vtkSMMessage*
31 #include "vtkSMRemoteObject.h"
32 #include "vtkSmartPointer.h" // needed for vtkSmartPointer.
33 
34 class vtkSMProxySelectionModelInternal;
35 class vtkCollection;
36 class vtkSMProxy;
37 
38 #include <list> // needed for vtkset::list.
39 
41 {
42 public:
43  static vtkSMProxySelectionModel* New();
45  void PrintSelf(ostream& os, vtkIndent indent) override;
46 
51  void SetSession(vtkSMSession*) override;
52 
54 
58  void SetFollowingMaster(bool following);
59  bool IsFollowingMaster();
61 
65  typedef std::list<vtkSmartPointer<vtkSMProxy>> SelectionType;
66 
67  // vtkSMProxy selection flags
69  {
70  NO_UPDATE = 0,
71  CLEAR = 1,
72  SELECT = 2,
73  DESELECT = 4,
74  CLEAR_AND_SELECT = CLEAR | SELECT
75  };
76 
80  vtkSMProxy* GetCurrentProxy();
81 
91  void SetCurrentProxy(vtkSMProxy* proxy, int command);
92 
96  bool IsSelected(vtkSMProxy* proxy);
97 
98  // Returns the number of selected proxies.
99  unsigned int GetNumberOfSelectedProxies();
100 
104  vtkSMProxy* GetSelectedProxy(unsigned int index);
105 
109  const SelectionType& GetSelection() { return this->Selection; }
110 
122  void Select(const SelectionType& proxies, int command);
123 
124  void Select(vtkSMProxy* proxy, int command);
125 
129  void Clear() { this->Select(nullptr, CLEAR); }
130  void Select(vtkSMProxy* proxy) { this->Select(proxy, SELECT); }
131  void Deselect(vtkSMProxy* proxy) { this->Select(proxy, DESELECT); }
132  void ClearAndSelect(vtkSMProxy* proxy) { this->Select(proxy, CLEAR_AND_SELECT); }
133 
140  bool GetSelectionDataBounds(double bounds[6]);
141 
148  const vtkSMMessage* GetFullState() override;
149 
157  void LoadState(const vtkSMMessage* msg, vtkSMProxyLocator* locator) override;
158 
159 protected:
161  ~vtkSMProxySelectionModel() override;
162 
163  void InvokeCurrentChanged(vtkSMProxy* proxy);
164  void InvokeSelectionChanged();
165 
167  SelectionType Selection;
168 
173  void PushStateToSession();
174 
175  // Cached version of State
177 
178 private:
180  void operator=(const vtkSMProxySelectionModel&) = delete;
181 
182  class vtkInternal;
183  friend class vtkInternal;
184  vtkInternal* Internal;
185 };
186 
187 #endif
void SetSession(vtkSMSession *) override
Override the SetSession so if the object already have an ID we automatically register it to the assoc...
virtual void LoadState(const vtkSMMessage *msg, vtkSMProxyLocator *locator)
This method is used to initialise the object to the given state If the definitionOnly Flag is set to ...
#define VTKREMOTINGSERVERMANAGER_EXPORT
vtkSMSession is the default ParaView session.
Definition: vtkSMSession.h:34
const SelectionType & GetSelection()
Returns the selection set.
std::list< vtkSmartPointer< vtkSMProxy > > SelectionType
Type for selection.
void Clear()
Wrapper friendly methods to doing what Select() can do.
vtkSmartPointer< vtkSMProxy > Current
Header class that setup every thing in order to use Protobuf messages in a transparent manner...
void Deselect(vtkSMProxy *proxy)
void ClearAndSelect(vtkSMProxy *proxy)
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:152
is used to locate proxies referred to in state xmls while loading state files.
virtual const vtkSMMessage * GetFullState()
This method return the full object state that can be used to create that object from scratch...
baseclass for all proxy-objects that have counter parts on server as well as client processes...
void Select(vtkSMProxy *proxy)
static vtkSMSessionObject * New()
void PrintSelf(ostream &os, vtkIndent indent) override