File: vtkSMTransferFunctionManager.h

package info (click to toggle)
paraview 5.1.2%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 221,108 kB
  • ctags: 236,092
  • sloc: cpp: 2,416,026; ansic: 190,891; python: 99,856; xml: 81,001; tcl: 46,915; yacc: 5,039; java: 4,413; perl: 3,108; sh: 1,974; lex: 1,926; f90: 748; asm: 471; pascal: 228; makefile: 198; objc: 83; fortran: 31
file content (103 lines) | stat: -rw-r--r-- 4,326 bytes parent folder | download
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
/*=========================================================================

  Program:   ParaView
  Module:    vtkSMTransferFunctionManager.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 vtkSMTransferFunctionManager - manages transfer functions i.e. color
// lookuptables and opacity piecewise functions for ParaView applications.
// .SECTION Description
// vtkSMTransferFunctionManager manages transfer functions i.e. color
// lookuptables and opacity piecewise functions for ParaView applications.
// vtkSMTransferFunctionManager implements the ParaView specific mechanism for
// managing such transfer function proxies where there's one transfer function
// created and maintained per data array name.
//
// vtkSMTransferFunctionManager has no state. You can create as many instances as
// per your choosing to call the methods. It uses the session proxy manager to
// locate proxies registered using specific names under specific groups. Thus,
// the state is maintained by the proxy manager itself.

#ifndef vtkSMTransferFunctionManager_h
#define vtkSMTransferFunctionManager_h

#include "vtkSMObject.h"
#include "vtkPVServerManagerRenderingModule.h" // needed for export macro

class vtkSMProxy;
class vtkSMSessionProxyManager;

class VTKPVSERVERMANAGERRENDERING_EXPORT vtkSMTransferFunctionManager : public vtkSMObject
{
public:
  static vtkSMTransferFunctionManager* New();
  vtkTypeMacro(vtkSMTransferFunctionManager, vtkSMObject);
  void PrintSelf(ostream& os, vtkIndent indent);

  // Description:
  // Returns a color transfer function proxy instance for mapping a data array
  // with the given name. If none exists in the given
  // session, a new instance will be created and returned.
  virtual vtkSMProxy* GetColorTransferFunction(const char* arrayName,
    vtkSMSessionProxyManager* pxm);

  // Description:
  // Returns a opacity transfer function proxy (aka Piecewise Function) instance
  // for mapping a data array with the given name. If
  // none exists in the given session, a new instance will be created and
  // returned.
  virtual vtkSMProxy* GetOpacityTransferFunction(const char* arrayName,
    vtkSMSessionProxyManager* pxm);

  // Description:
  // Returns the scalar-bar (color-legend) representation corresponding to the
  // transfer function for the view (currently only render-views are supported).
  // Thus returns an existing proxy, if present, otherwise a new one is created,
  // if possible.
  virtual vtkSMProxy* GetScalarBarRepresentation(
    vtkSMProxy* colorTransferFunctionProxy, vtkSMProxy* view);

  // Description:
  // Iterates over all "known" transfer function proxies and request each one of
  // them to update its range using data information currently available.
  // If \c extend is true, the transfer function is expanded to accommodate
  // current data range rather then resetting it to the range.
  void ResetAllTransferFunctionRangesUsingCurrentData(
    vtkSMSessionProxyManager* pxm, bool extend=false);

  enum UpdateScalarBarsMode
    {
    HIDE_UNUSED_SCALAR_BARS = 0x01,
    SHOW_USED_SCALAR_BARS = 0x02
    };

  // Description:
  // Updates the scalar bar visibility in the view. Based on the specified mode,
  // scalars bars representing non-represented arrays can be automatically hidden;
  // and those corresponding to arrays used for coloring can be automatically shown.
  virtual bool UpdateScalarBars(vtkSMProxy* viewProxy, unsigned int mode);

  // Description:
  // Hides the scalar bar, if any, for the lutProxy in the view if it's not
  // being used. Returns true if the scalar bar visibility was changed.
  virtual bool HideScalarBarIfNotNeeded(vtkSMProxy* lutProxy, vtkSMProxy* view);

protected:
  vtkSMTransferFunctionManager();
  ~vtkSMTransferFunctionManager();

private:
  vtkSMTransferFunctionManager(const vtkSMTransferFunctionManager&); // Not implemented
  void operator=(const vtkSMTransferFunctionManager&); // Not implemented

};

#endif