vtkSMPVRepresentationProxy.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkSMPVRepresentationProxy.h
5 
6  Copyright (c) Kitware, Inc.
7  All rights reserved.
8  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
33 #ifndef vtkSMPVRepresentationProxy_h
34 #define vtkSMPVRepresentationProxy_h
35 
36 #include "vtkRemotingViewsModule.h" //needed for exports
38 #include "vtkSmartPointer.h" // For LastLUTProxy
39 
41 
43 {
44 public:
47  void PrintSelf(ostream& os, vtkIndent indent) override;
48 
54  virtual bool GetUsingScalarColoring();
55 
57 
61  static bool GetUsingScalarColoring(vtkSMProxy* proxy)
62  {
64  return self ? self->GetUsingScalarColoring() : false;
65  }
67 
75  bool UpdateScalarBarRange(vtkSMProxy* view, bool deleteRange);
76 
83  virtual bool SetScalarColoring(const char* arrayname, int attribute_type);
84 
94  virtual bool SetScalarColoring(const char* arrayname, int attribute_type, int component);
95 
97 
101  static bool SetScalarColoring(vtkSMProxy* proxy, const char* arrayname, int attribute_type)
102  {
104  return self ? self->SetScalarColoring(arrayname, attribute_type) : false;
105  }
107 
109 
113  static bool SetScalarColoring(
114  vtkSMProxy* proxy, const char* arrayname, int attribute_type, int component)
115  {
117  return self ? self->SetScalarColoring(arrayname, attribute_type, component) : false;
118  }
120 
133  virtual bool RescaleTransferFunctionToDataRange(bool extend = false, bool force = true);
134 
150  virtual bool RescaleTransferFunctionToDataRange(
151  const char* arrayname, int attribute_type, bool extend = false, bool force = true);
152 
154 
159  vtkSMProxy* proxy, bool extend = false, bool force = true)
160  {
162  return self ? self->RescaleTransferFunctionToDataRange(extend, force) : false;
163  }
165 
167 
171  static bool RescaleTransferFunctionToDataRange(vtkSMProxy* proxy, const char* arrayname,
172  int attribute_type, bool extend = false, bool force = true)
173  {
175  return self ? self->RescaleTransferFunctionToDataRange(arrayname, attribute_type, extend, force)
176  : false;
177  }
179 
184  virtual bool RescaleTransferFunctionToDataRangeOverTime();
185 
192  virtual bool RescaleTransferFunctionToDataRangeOverTime(
193  const char* arrayname, int attribute_type);
194 
196 
201  {
203  return self ? self->RescaleTransferFunctionToDataRangeOverTime() : false;
204  }
206 
208 
213  vtkSMProxy* proxy, const char* arrayname, int attribute_type)
214  {
216  return self ? self->RescaleTransferFunctionToDataRangeOverTime(arrayname, attribute_type)
217  : false;
218  }
220 
222 
226  virtual bool RescaleTransferFunctionToVisibleRange(vtkSMProxy* view);
227  virtual bool RescaleTransferFunctionToVisibleRange(
228  vtkSMProxy* view, const char* arrayname, int attribute_type);
230 
232 
237  {
239  return self ? self->RescaleTransferFunctionToVisibleRange(view) : false;
240  }
242  vtkSMProxy* proxy, vtkSMProxy* view, const char* arrayname, int attribute_type)
243  {
245  return self ? self->RescaleTransferFunctionToVisibleRange(view, arrayname, attribute_type)
246  : false;
247  }
249 
251 
255  virtual bool SetScalarBarVisibility(vtkSMProxy* view, bool visible);
256  static bool SetScalarBarVisibility(vtkSMProxy* proxy, vtkSMProxy* view, bool visible)
257  {
259  return self ? self->SetScalarBarVisibility(view, visible) : false;
260  }
262 
264 
271  virtual bool HideScalarBarIfNotNeeded(vtkSMProxy* view);
273  {
275  return self ? self->HideScalarBarIfNotNeeded(view) : false;
276  }
278 
280 
284  virtual bool IsScalarBarVisible(vtkSMProxy* view);
285  static bool IsScalarBarVisible(vtkSMProxy* repr, vtkSMProxy* view)
286  {
288  return self ? self->IsScalarBarVisible(view) : false;
289  }
291 
293 
298  virtual vtkPVArrayInformation* GetArrayInformationForColorArray(bool checkRepresentedData = true);
300  vtkSMProxy* proxy, bool checkRepresentedData = true)
301  {
303  return self ? self->GetArrayInformationForColorArray(checkRepresentedData) : nullptr;
304  }
306 
308 
312  virtual vtkPVProminentValuesInformation* GetProminentValuesInformationForColorArray(
313  double uncertaintyAllowed = 1e-6, double fraction = 1e-3, bool force = false);
315  vtkSMProxy* proxy, double uncertaintyAllowed = 1e-6, double fraction = 1e-3, bool force = false)
316  {
318  return self
319  ? self->GetProminentValuesInformationForColorArray(uncertaintyAllowed, fraction, force)
320  : nullptr;
321  }
323 
327  int GetEstimatedNumberOfAnnotationsOnScalarBar(vtkSMProxy* view);
329  {
331  return self ? self->GetEstimatedNumberOfAnnotationsOnScalarBar(view) : -1;
332  }
333 
339  bool SetRepresentationType(const char* type) override;
340 
345  bool GetVolumeIndependentRanges();
346 
348 
357  int IsScalarBarStickyVisible(vtkSMProxy* view);
359 
363  void ViewUpdated(vtkSMProxy* view) override;
364 
365 protected:
367  ~vtkSMPVRepresentationProxy() override;
368 
372  virtual bool RescaleTransferFunctionToDataRange(
373  vtkPVArrayInformation* info, bool extend = false, bool force = true);
374 
379  void CreateVTKObjects() override;
380 
381  // Whenever the "Representation" property is modified, we ensure that the
382  // this->InvalidateDataInformation() is called.
383  void OnPropertyUpdated(vtkObject*, unsigned long, void* calldata);
384 
390  void SetPropertyModifiedFlag(const char* name, int flag) override;
391 
395  int ReadXMLAttributes(vtkSMSessionProxyManager* pm, vtkPVXMLElement* element) override;
396 
401  std::string GetDecoratedArrayName(const std::string& arrayname);
402 
406  virtual bool SetScalarColoringInternal(
407  const char* arrayname, int attribute_type, bool useComponent, int component);
408 
415 
416 private:
418  void operator=(const vtkSMPVRepresentationProxy&) = delete;
419 
420  bool InReadXMLAttributes;
421  class vtkStringSet;
422  vtkStringSet* RepresentationSubProxies;
423 };
424 
425 #endif
Proxy for a representations.
static bool RescaleTransferFunctionToDataRange(vtkSMProxy *proxy, const char *arrayname, int attribute_type, bool extend=false, bool force=true)
Safely call RescaleTransferFunctionToDataRange() after casting the proxy to appropriate type...
void CreateVTKObjects() override
Call superclass' and then assigns a new executive (vtkCompositeDataPipeline)
component
type
#define VTKREMOTINGVIEWS_EXPORT
static bool RescaleTransferFunctionToVisibleRange(vtkSMProxy *proxy, vtkSMProxy *view, const char *arrayname, int attribute_type)
Safely call RescaleTransferFunctionToVisibleRange() after casting the proxy to the appropriate type...
representation for "Render View" like views in ParaView.
info
static bool RescaleTransferFunctionToDataRangeOverTime(vtkSMProxy *proxy, const char *arrayname, int attribute_type)
Safely call RescaleTransferFunctionToDataRangeOverTime() after casting the proxy to appropriate type...
virtual void SetPropertyModifiedFlag(const char *name, int flag)
Note on property modified flags: The modified flag of each property associated with a proxy is stored...
static bool SetScalarBarVisibility(vtkSMProxy *proxy, vtkSMProxy *view, bool visible)
Set the scalar bar visibility.
static int GetEstimatedNumberOfAnnotationsOnScalarBar(vtkSMProxy *proxy, vtkSMProxy *view)
static bool GetUsingScalarColoring(vtkSMProxy *proxy)
Safely call GetUsingScalarColoring() after casting the proxy to appropriate type. ...
static bool RescaleTransferFunctionToDataRange(vtkSMProxy *proxy, bool extend=false, bool force=true)
Safely call RescaleTransferFunctionToDataRange() after casting the proxy to appropriate type...
name
static vtkPVArrayInformation * GetArrayInformationForColorArray(vtkSMProxy *proxy, bool checkRepresentedData=true)
Returns the array information for the data array used for scalar coloring, from input data...
virtual bool SetRepresentationType(const char *type)
Set the representation type.
Prominent values a data array takes on.
void PrintSelf(ostream &os, vtkIndent indent) override
The vtkSMSessionProxyManager is esponsible for creating and managing proxies for a given session...
static bool RescaleTransferFunctionToDataRangeOverTime(vtkSMProxy *proxy)
Safely call RescaleTransferFunctionToDataRangeOverTime() after casting the proxy to appropriate type...
static bool SetScalarColoring(vtkSMProxy *proxy, const char *arrayname, int attribute_type, int component)
Safely call SetScalarColoring() after casting the proxy to the appropriate type, component version...
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:152
provides meta data about arrays.
vtkSmartPointer< vtkSMProxy > LastLUTProxy
Used as a memory of what was the last LUT proxy linked to this representation.
static bool RescaleTransferFunctionToVisibleRange(vtkSMProxy *proxy, vtkSMProxy *view)
Safely call RescaleTransferFunctionToVisibleRange() after casting the proxy to the appropriate type...
int ReadXMLAttributes(vtkSMSessionProxyManager *pm, vtkPVXMLElement *element) override
Read attributes from an XML element.
static bool HideScalarBarIfNotNeeded(vtkSMProxy *repr, vtkSMProxy *view)
While SetScalarBarVisibility can be used to hide a scalar bar, it will always simply hide the scalar ...
This is used by vtkPVXMLParser to represent an XML document starting at the root element.
static bool SetScalarColoring(vtkSMProxy *proxy, const char *arrayname, int attribute_type)
Safely call SetScalarColoring() after casting the proxy to the appropriate type.
static vtkPVProminentValuesInformation * GetProminentValuesInformationForColorArray(vtkSMProxy *proxy, double uncertaintyAllowed=1e-6, double fraction=1e-3, bool force=false)
Call vtkSMRepresentationProxy::GetProminentValuesInformation() for the array used for scalar color...
static vtkSMRepresentationProxy * New()
virtual void ViewUpdated(vtkSMProxy *view)
Called after the view updates.
static vtkSMPVRepresentationProxy * SafeDownCast(vtkObject *o)
static bool IsScalarBarVisible(vtkSMProxy *repr, vtkSMProxy *view)
Check scalar bar visibility.