/usr/include/paraview/vtkSMDomain.h is in paraview-dev 5.0.1+dfsg1-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 | /*=========================================================================
Program: ParaView
Module: vtkSMDomain.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.
=========================================================================*/
// .NAME vtkSMDomain - represents the possible values a property can have
// .SECTION Description
//
// vtkSMDomain is an abstract class that describes the "domain" of a
// a widget. A domain is a collection of possible values a property
// can have.
//
// Each domain can depend on one or more properties to compute it's
// values. This are called "required" properties and can be set in
// the XML configuration file.
//
// Every time a domain changes it must fire a vtkCommand::DomainModifiedEvent.
// Applications may decide to update the UI every-time the domain changes. As a
// result, domains ideally should only fire that event when their values change
// for real not just potentially changed.
#ifndef vtkSMDomain_h
#define vtkSMDomain_h
#include "vtkPVServerManagerCoreModule.h" //needed for exports
#include "vtkSMSessionObject.h"
#include "vtkClientServerID.h" // needed for saving animation in batch script
class vtkPVDataInformation;
class vtkPVXMLElement;
class vtkSMProperty;
class vtkSMProxyLocator;
//BTX
struct vtkSMDomainInternals;
//ETX
class VTKPVSERVERMANAGERCORE_EXPORT vtkSMDomain : public vtkSMSessionObject
{
public:
vtkTypeMacro(vtkSMDomain, vtkSMSessionObject);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Is the (unchecked) value of the property in the domain? Overwritten by
// sub-classes.
virtual int IsInDomain(vtkSMProperty* property) = 0;
// Description:
// Update self based on the "unchecked" values of all required
// properties. Subclasses must override this method to update the domain based
// on the requestingProperty (and/or other required properties).
virtual void Update(vtkSMProperty* requestingProperty)
{
(void)requestingProperty;
}
// Description:
// Set the value of an element of a property from the animation editor.
virtual void SetAnimationValue(
vtkSMProperty*, int vtkNotUsed(index), double vtkNotUsed(value)) {}
// Description:
// A vtkSMProperty is often defined with a default value in the
// XML itself. However, many times, the default value must be determined
// at run time. To facilitate this, domains can override this method
// to compute and set the default value for the property.
// Note that unlike the compile-time default values, the
// application must explicitly call this method to initialize the
// property.
// If \c use_unchecked_values is true, the property's unchecked values will be
// changed by this method.
// Returns 1 if the domain updated the property.
// Default implementation does nothing.
virtual int SetDefaultValues(vtkSMProperty*, bool vtkNotUsed(use_unchecked_values))
{return 0; };
// Description:
// Assigned by the XML parser. The name assigned in the XML
// configuration. Can be used to figure out the origin of the
// domain.
vtkGetStringMacro(XMLName);
// Description:
// When the IsOptional flag is set, IsInDomain() always returns true.
// This is used by properties that use domains to provide information
// (a suggestion to the gui for example) as opposed to restrict their
// values.
vtkGetMacro(IsOptional, bool);
// Description:
// Provides access to the vtkSMProperty on which this domain is hooked up.
vtkSMProperty* GetProperty();
protected:
vtkSMDomain();
~vtkSMDomain();
// Description:
// Add the header and creates a new vtkPVXMLElement for the
// domain, fills it up with the common attributes. The newly
// created element will also be added to the parent element as a child node.
// Subclasses can override ChildSaveState() method to fill it up with
// subclass specific values.
void SaveState(vtkPVXMLElement* parent, const char* uid);
virtual void ChildSaveState(vtkPVXMLElement* domainElement);
// Description:
// Load the state of the domain from the XML.
// Subclasses generally have no need to load XML state. In fact, serialization
// of state for domains, in general, is unnecessary for two reasons:
// 1. domains whose values are defined in XML will be populated from the
// configuration xml anyways.
// 2. domains whose values depend on data (at runtime) will be repopulated
// with data values when the XML state is loaded.
// The only exception to this rule is vtkSMProxyListDomain (presently).
// vtkSMProxyListDomain needs to try to restore proxies (with proper ids) for
// the domain.
virtual int LoadState(vtkPVXMLElement* vtkNotUsed(domainElement),
vtkSMProxyLocator* vtkNotUsed(loader)) { return 1; }
// Description:
// Set the appropriate ivars from the xml element. Should
// be overwritten by subclass if adding ivars.
virtual int ReadXMLAttributes(vtkSMProperty* prop, vtkPVXMLElement* elem);
//BTX
friend class vtkSMProperty;
//ETX
// Description:
// Returns a given required property of the given function.
// Function is a string associated with the require property
// in the XML file.
vtkSMProperty* GetRequiredProperty(const char* function);
// Description:
// Remove the given property from the required properties list.
void RemoveRequiredProperty(vtkSMProperty* prop);
// Description:
// Add a new required property to this domain.
// Whenever the \c prop fires vtkCommand::UncheckedPropertyModifiedEvent,
// vtkSMDomain::Update(prop) is called. Also whenever a vtkSMInputProperty is
// added as a required property, vtkSMDomain::Update(prop) will also be called
// the vtkCommand::UpdateDataEvent is fired by the proxies contained in that
// required property.
void AddRequiredProperty(vtkSMProperty *prop, const char *function);
// Description:
// Helper method to get vtkPVDataInformation from input proxy connected to the
// required property with the given function.
virtual vtkPVDataInformation* GetInputDataInformation(
const char* function, int index=0);
// Description:
// When the IsOptional flag is set, IsInDomain() always returns true.
// This is used by properties that use domains to provide information
// (a suggestion to the gui for example) as opposed to restrict their
// values.
vtkSetMacro(IsOptional, bool);
// Description:
// Assigned by the XML parser. The name assigned in the XML
// configuration. Can be used to figure out the origin of the
// domain.
vtkSetStringMacro(XMLName);
// Description:
// Invokes DomainModifiedEvent. Note that this event *must* be fired after the
// domain has changed (ideally, if and only if the domain has changed).
void DomainModified();
void InvokeModified() { this->DomainModified(); }
// Description:
// Gets the number of required properties added.
unsigned int GetNumberOfRequiredProperties();
// Description:
// Set the domain's property. This is called by vtkSMProperty when the domain
// is created.
void SetProperty(vtkSMProperty*);
char* XMLName;
bool IsOptional;
vtkSMDomainInternals* Internals;
private:
vtkSMDomain(const vtkSMDomain&); // Not implemented
void operator=(const vtkSMDomain&); // Not implemented
};
#endif
|