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
|
/*=========================================================================
Program: ParaView
Module: vtkSMProxyIterator.h
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.
=========================================================================*/
/**
* @class vtkSMProxyIterator
* @brief iterates over all registered proxies (and groups)
*
* vtkSMProxyIterator iterates over all proxies registered with the
* proxy manager. It can also iterate over groups.
* @sa
* vtkSMProxy vtkSMProxyManager
*/
#ifndef vtkSMProxyIterator_h
#define vtkSMProxyIterator_h
#include "vtkPVServerManagerCoreModule.h" //needed for exports
#include "vtkSMObject.h"
struct vtkSMProxyIteratorInternals;
class vtkSMProxy;
class vtkSMSession;
class vtkSMSessionProxyManager;
class VTKPVSERVERMANAGERCORE_EXPORT vtkSMProxyIterator : public vtkSMObject
{
public:
static vtkSMProxyIterator* New();
vtkTypeMacro(vtkSMProxyIterator, vtkSMObject);
void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
/**
* Override the set sesssion so the SessionProxyManager could be cache for
*/
void SetSessionProxyManager(vtkSMSessionProxyManager*);
/**
* Convenience method. Internally calls
* this->SetSessionProxyManager(session->GetSessionProxyManager());
*/
void SetSession(vtkSMSession* session);
/**
* Go to the beginning of the collection.
*/
void Begin();
/**
* Go to the beginning of one group, and set mode to iterate over one group.
*/
void Begin(const char* groupName);
/**
* Is the iterator pointing past the last element?
*/
int IsAtEnd();
/**
* Move to the next property.
*/
void Next();
/**
* Get the group at the current iterator location.
*/
const char* GetGroup();
/**
* Get the key (proxy name) at the current iterator location.
*/
const char* GetKey();
/**
* Get the proxy at the current iterator location.
*/
vtkSMProxy* GetProxy();
//@{
/**
* The traversal mode for the iterator. If the traversal mode is
* set to GROUPS, each Next() will move to the next group, in
* ONE_GROUP mode, all proxies in one group are visited and finally
* in ALL mode, all proxies are visited.
*/
vtkSetMacro(Mode, int);
vtkGetMacro(Mode, int);
void SetModeToGroupsOnly() { this->SetMode(GROUPS_ONLY); }
void SetModeToOneGroup() { this->SetMode(ONE_GROUP); }
void SetModeToAll() { this->SetMode(ALL); }
//@}
//@{
/**
* When set to true (default), the iterator will skip prototype proxies.
*/
vtkSetMacro(SkipPrototypes, bool);
vtkGetMacro(SkipPrototypes, bool);
vtkBooleanMacro(SkipPrototypes, bool);
//@}
enum TraversalMode
{
GROUPS_ONLY = 0,
ONE_GROUP = 1,
ALL = 2
};
protected:
vtkSMProxyIterator();
~vtkSMProxyIterator();
bool SkipPrototypes;
int Mode;
void NextInternal();
private:
vtkSMProxyIteratorInternals* Internals;
vtkSMProxyIterator(const vtkSMProxyIterator&) VTK_DELETE_FUNCTION;
void operator=(const vtkSMProxyIterator&) VTK_DELETE_FUNCTION;
};
#endif
|