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 136 137 138 139 140 141 142 143
|
/*=========================================================================
Program: ParaView
Module: vtkSIProperty.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 vtkSIProperty
*
* Basic ServerImplementation property used to call a method with no argument
* on a VTK object. If overriden, we naturally allow to call a method either
* to set or get a set of values.
*/
#ifndef vtkSIProperty_h
#define vtkSIProperty_h
#include "vtkObject.h"
#include "vtkPVServerImplementationCoreModule.h" //needed for exports
#include "vtkSMMessageMinimal.h" // needed for vtkSMMessage
#include "vtkWeakPointer.h" // needed for vtkWeakPointer.
class vtkClientServerStream;
class vtkSIObject;
class vtkSIProxy;
class vtkPVXMLElement;
class VTKPVSERVERIMPLEMENTATIONCORE_EXPORT vtkSIProperty : public vtkObject
{
public:
static vtkSIProperty* New();
vtkTypeMacro(vtkSIProperty, vtkObject);
void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
//@{
/**
* The name assigned by the xml parser. Used to get the property
* from a proxy.
*/
vtkGetStringMacro(XMLName);
//@}
//@{
/**
* The command name used to set the value on the server object.
* For example: SetThetaResolution
*/
vtkGetStringMacro(Command);
//@}
//@{
/**
* Is InformationOnly is set to true, this property is used to
* get information from server instead of setting values.
*/
vtkGetMacro(InformationOnly, bool);
//@}
//@{
/**
* If repeatable, a property can have 1 or more values of the same kind.
* This ivar is configured when the xml file is read and is mainly useful
* for information (for example from python).
*/
vtkGetMacro(Repeatable, bool);
//@}
//@{
/**
* This ivar is configured when the xml file is read and is mainly useful
* to trigger a method call.
* Internal properties are not saved in state
*/
vtkSetMacro(IsInternal, bool);
vtkGetMacro(IsInternal, bool);
//@}
protected:
vtkSIProperty();
~vtkSIProperty();
friend class vtkSIProxy;
/**
* Convenience method to obtain a vtkSIObject subclass given its global id.
*/
vtkSIObject* GetSIObject(vtkTypeUInt32 globalid);
/**
* Push a new state to the underneath implementation
*/
virtual bool Push(vtkSMMessage*, int);
/**
* Pull the current state of the underneath implementation
*/
virtual bool Pull(vtkSMMessage*);
/**
* Parse the xml for the property.
*/
virtual bool ReadXMLAttributes(vtkSIProxy* proxyhelper, vtkPVXMLElement* element);
//@{
/**
* Interprets the message.
*/
bool ProcessMessage(vtkClientServerStream& stream);
const vtkClientServerStream& GetLastResult();
vtkObjectBase* GetVTKObject();
//@}
vtkSetStringMacro(Command);
vtkSetStringMacro(XMLName);
char* XMLName;
char* Command;
bool InformationOnly;
bool Repeatable;
bool IsInternal;
vtkWeakPointer<vtkSIProxy> SIProxyObject;
// Allow subclass to save the property value as a state part
void SaveValueToCache(vtkSMMessage* proxyStateUpdate, int offset);
private:
vtkSIProperty(const vtkSIProperty&) VTK_DELETE_FUNCTION;
void operator=(const vtkSIProperty&) VTK_DELETE_FUNCTION;
class vtkInternals;
vtkInternals* Internals;
};
#endif
|