vtkSMDataAssemblyDomain.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
112 #ifndef vtkSMDataAssemblyDomain_h
113 #define vtkSMDataAssemblyDomain_h
114 
115 #include "vtkRemotingServerManagerModule.h" // needed for exports
116 #include "vtkSMDomain.h"
117 #include "vtkSmartPointer.h" // needed for vtkSmartPointer
118 
119 #include <string> // for std::string
120 
121 class vtkDataAssembly;
123 {
124 public:
125  static vtkSMDataAssemblyDomain* New();
127  void PrintSelf(ostream& os, vtkIndent indent) override;
128 
132  const char* GetDataAssemblyName() const
133  {
134  return this->Name.empty() ? nullptr : this->Name.c_str();
135  }
136 
140  vtkDataAssembly* GetDataAssembly() const;
141 
142  void Update(vtkSMProperty* requestingProperty) override;
143 
144  enum Modes
145  {
146  ALL = 0,
147  LEAVES = 1,
148  };
149 
151 
156  vtkGetMacro(Mode, int);
158 
159  int SetDefaultValues(vtkSMProperty* prop, bool use_unchecked_values) override;
160 
161 protected:
163  ~vtkSMDataAssemblyDomain() override;
164 
165 private:
167  void operator=(const vtkSMDataAssemblyDomain&) = delete;
168 
169  void ChooseAssembly(const std::string& name, vtkDataAssembly* assembly);
170  void FetchAssembly(int tag);
171 
177  int ReadXMLAttributes(vtkSMProperty* prop, vtkPVXMLElement* element) override;
178 
179  void OnDomainModified();
180 
181  int LastTag = 0;
182 
184  std::string AssemblyXMLContents;
185  std::string Name;
186  int EntityType = -1;
187  int Mode = ALL;
188 };
189 
190 #endif
#define VTKREMOTINGSERVERMANAGER_EXPORT
virtual void Update(vtkSMProperty *requestingProperty)
Update self based on the "unchecked" values of all required properties.
superclass for all SM properties
virtual int SetDefaultValues(vtkSMProperty *, bool vtkNotUsed(use_unchecked_values))
A vtkSMProperty is often defined with a default value in the XML itself.
Definition: vtkSMDomain.h:92
represents the possible values a property can have
Definition: vtkSMDomain.h:38
void PrintSelf(ostream &os, vtkIndent indent) override
virtual int ReadXMLAttributes(vtkSMProperty *prop, vtkPVXMLElement *elem)
Set the appropriate ivars from the xml element.
const char * GetDataAssemblyName() const
Returns the name for the chosen assembly, if any.
a domain that uses vtkDataAssembly
static vtkSMDomain * New()
This is used by vtkPVXMLParser to represent an XML document starting at the root element.