vtkSMRepresentationProxy.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
64 #ifndef vtkSMRepresentationProxy_h
65 #define vtkSMRepresentationProxy_h
66 
67 #include "vtkRemotingViewsModule.h" //needed for exports
68 #include "vtkSMSourceProxy.h"
69 
72 {
73 class vtkCloningVectorOfRepresentations;
74 }
75 
76 class VTKREMOTINGVIEWS_EXPORT vtkSMRepresentationProxy : public vtkSMSourceProxy
77 {
78 public:
79  static vtkSMRepresentationProxy* New();
81  void PrintSelf(ostream& os, vtkIndent indent) override;
82 
87  virtual vtkPVDataInformation* GetRepresentedDataInformation();
88 
104  virtual vtkPVProminentValuesInformation* GetProminentValuesInformation(std::string name,
105  int fieldAssoc, int numComponents, double uncertaintyAllowed = 1e-6, double fraction = 1e-3,
106  bool force = false);
107 
112  void UpdatePipeline() override;
113 
118  void UpdatePipeline(double time) override;
119 
123  void PostUpdateData(bool) override;
124 
128  virtual void ViewUpdated(vtkSMProxy* view);
129 
133  vtkTypeUInt32 GetGlobalID() override;
134 
136 
144  virtual bool SetRepresentationType(const char* type);
145  static bool SetRepresentationType(vtkSMProxy* repr, const char* type)
146  {
148  return self ? self->SetRepresentationType(type) : false;
149  }
150  const char* GetRepresentationType();
151  static const char* GetRepresentationType(vtkSMProxy* repr)
152  {
154  return self ? self->GetRepresentationType() : nullptr;
155  }
157 
159 
163  static bool IsVolumeRendering(vtkSMProxy* repr)
164  {
166  return self ? self->IsVolumeRendering() : false;
167  }
168  bool IsVolumeRendering();
170  {
172  return self ? self->GetUsing2DTransferFunction() : false;
173  }
174  bool GetUsing2DTransferFunction();
176 
177  void MarkDirty(vtkSMProxy* modifiedProxy) override;
178 
179 protected:
181  ~vtkSMRepresentationProxy() override;
182 
190  vtkSMProxy* modifiedProxy, vtkSMProxy* producer, vtkSMProperty* property) override;
191 
192  // Unlike subproxies in regular proxies, subproxies in representations
193  // typically represent internal representations e.g. label representation,
194  // representation for selection etc. In that case, if the internal
195  // representation is modified, we need to ensure that any of our consumers is
196  // a consumer of all our subproxies as well.
197  void AddConsumer(vtkSMProperty* property, vtkSMProxy* proxy) override;
198  void RemoveConsumer(vtkSMProperty* property, vtkSMProxy* proxy) override;
199  void RemoveAllConsumers() override;
200 
201  void CreateVTKObjects() override;
202  void OnVTKRepresentationUpdated();
203  void OnVTKRepresentationUpdateSkipped();
204  void OnVTKRepresentationUpdateTimeChanged();
205 
206  virtual void UpdatePipelineInternal(double time, bool doTime);
207 
211  void InvalidateDataInformation() override;
212 
216  int LoadXMLState(vtkPVXMLElement* element, vtkSMProxyLocator* locator) override;
217 
218 private:
220  void operator=(const vtkSMRepresentationProxy&) = delete;
221 
222  bool RepresentedDataInformationValid;
223  vtkPVDataInformation* RepresentedDataInformation;
224 
225  bool ProminentValuesInformationValid;
226  vtkPVProminentValuesInformation* ProminentValuesInformation;
227  double ProminentValuesFraction;
228  double ProminentValuesUncertainty;
229 
230  friend class vtkPVComparativeViewNS::vtkCloningVectorOfRepresentations;
231  void ClearMarkedModified() { this->MarkedModified = false; }
232  bool MarkedModified;
233  bool VTKRepresentationUpdated;
234  bool VTKRepresentationUpdateSkipped;
235  bool VTKRepresentationUpdateTimeChanged;
236 
237  std::string DebugName;
238 };
239 
240 #endif
vtkSMProxy::LoadXMLState
virtual int LoadXMLState(vtkPVXMLElement *element, vtkSMProxyLocator *locator)
Loads the proxy state from the XML element.
vtkPVProminentValuesInformation
Prominent values a data array takes on.
Definition: vtkPVProminentValuesInformation.h:32
type
type
vtkSMRepresentationProxy::GetUsing2DTransferFunction
static bool GetUsing2DTransferFunction(vtkSMProxy *repr)
Convenient method to check if this representation is currently rendering volumes, using 2D Transfer f...
Definition: vtkSMRepresentationProxy.h:169
vtkSMProxy::RemoveAllConsumers
virtual void RemoveAllConsumers()
Remove all consumers.
vtkSMRepresentationProxy
Proxy for a representations.
Definition: vtkSMRepresentationProxy.h:76
vtkSMSourceProxy::InvalidateDataInformation
virtual void InvalidateDataInformation()
Mark the data information as invalid.
vtkSMSourceProxy.h
vtkSMProperty
superclass for all SM properties
Definition: vtkSMProperty.h:144
vtkPVComparativeViewNS
Definition: vtkSMRepresentationProxy.h:71
vtkSMRepresentationProxy::SafeDownCast
static vtkSMRepresentationProxy * SafeDownCast(vtkObject *o)
vtkSMProxy
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:140
vtkSMRepresentationProxy::GetRepresentationType
static const char * GetRepresentationType(vtkSMProxy *repr)
Set the representation type.
Definition: vtkSMRepresentationProxy.h:151
vtkSMSourceProxy::CreateVTKObjects
void CreateVTKObjects() override
Call superclass' and then assigns a new executive (vtkCompositeDataPipeline)
vtkSMSourceProxy
proxy for a VTK source on a server
Definition: vtkSMSourceProxy.h:37
vtkSMSourceProxy::PostUpdateData
void PostUpdateData(bool) override
Overwritten from superclass to invoke.
vtkIndent
vtkSMSourceProxy::MarkDirty
void MarkDirty(vtkSMProxy *modifiedProxy) override
Marks the selection proxies dirty as well as chain to superclass.
vtkSMSourceProxy::New
static vtkSMSourceProxy * New()
vtkSMProxy::RemoveConsumer
virtual void RemoveConsumer(vtkSMProperty *property, vtkSMProxy *proxy)
Remove the property,proxy pair from the list of consumers.
vtkPVDataInformation
provides meta data about a vtkDataObject subclass.
Definition: vtkPVDataInformation.h:42
vtkSMProxy::MarkDirtyFromProducer
virtual void MarkDirtyFromProducer(vtkSMProxy *modifiedProxy, vtkSMProxy *producer, vtkSMProperty *property)
MarkConsumersAsDirty calls this method on each consumer, instead of directly calling MarkDirty on the...
vtkPVXMLElement
Definition: vtkPVXMLElement.h:23
vtkSMSourceProxy::GetGlobalID
vtkTypeUInt32 GetGlobalID() override
Overridden to reserve additional IDs for use by "ExtractSelection" proxies.
vtkSMRepresentationProxy::IsVolumeRendering
static bool IsVolumeRendering(vtkSMProxy *repr)
Convenient method to check if this representation is currently rendering volumes, using 2D Transfer f...
Definition: vtkSMRepresentationProxy.h:163
vtkSMRepresentationProxy::SetRepresentationType
static bool SetRepresentationType(vtkSMProxy *repr, const char *type)
Set the representation type.
Definition: vtkSMRepresentationProxy.h:145
vtkSMSourceProxy::UpdatePipeline
virtual void UpdatePipeline()
Calls Update() on all sources.
vtkSMProxyLocator
is used to locate proxies referred to in state xmls while loading state files.
Definition: vtkSMProxyLocator.h:24
vtkSMProxy::AddConsumer
virtual void AddConsumer(vtkSMProperty *property, vtkSMProxy *proxy)
Called by a proxy property, this adds the property,proxy pair to the list of consumers.
vtkSMSourceProxy::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override