vtkSMMultiSliceViewProxy.h 2.88 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
/*=========================================================================

  Program:   ParaView
  Module:    vtkSMMultiSliceViewProxy.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.

=========================================================================*/
15 16 17 18 19 20
/**
 * @class   vtkSMMultiSliceViewProxy
 *
 * Custom RenderViewProxy to override CreateDefaultRepresentation method
 * so only the Multi-Slice representation will be available to the user
*/
21

22 23
#ifndef vtkSMMultiSliceViewProxy_h
#define vtkSMMultiSliceViewProxy_h
24

25
#include "vtkPVServerManagerRenderingModule.h" //needed for exports
26 27
#include "vtkSMRenderViewProxy.h"

28 29
class vtkSMSourceProxy;

30
class VTKPVSERVERMANAGERRENDERING_EXPORT vtkSMMultiSliceViewProxy : public vtkSMRenderViewProxy
31 32 33 34
{
public:
  static vtkSMMultiSliceViewProxy* New();
  vtkTypeMacro(vtkSMMultiSliceViewProxy, vtkSMRenderViewProxy);
35
  void PrintSelf(ostream& os, vtkIndent indent) override;
36

37 38 39 40
  /**
   * Similar to IsSelectionAvailable(), however, on failure returns the
   * error message otherwise 0.
   */
41
  const char* IsSelectVisiblePointsAvailable() override;
42

43 44 45 46 47
  /**
   * Overridden to set initial default slices when a representation is created.
   * Not sure that's the best way to do this, but leaving the logic unchanged in
   * this pass.
   */
48
  vtkSMRepresentationProxy* CreateDefaultRepresentation(vtkSMProxy* proxy, int outputPort) override;
49

50 51 52
  /**
   * Overridden to forward the call to the internal root view proxy.
   */
53
  const char* GetRepresentationType(vtkSMSourceProxy* producer, int outputPort) override;
54

55 56 57 58 59
  /**
   * Fetchs data bounds from the client-side object. We simply fetch the
   * client-side data bounds since vtkPVMultiSliceView ensures that they are
   * synced among all ranks in Update().
   */
60 61
  void GetDataBounds(double bounds[6]);

62 63 64
  /**
   * HACK: method to force representation type to "Slices".
   */
65 66
  static void ForceRepresentationType(vtkSMProxy* reprProxy, const char* type);

67 68 69 70
  /**
   * HACK: Get source's input data bounds (or BoundingBoxInModelCoordinates if
   * present).
   */
71
  static bool GetDataBounds(vtkSMSourceProxy* source, int opport, double bounds[6]);
72

73 74
protected:
  vtkSMMultiSliceViewProxy();
75
  ~vtkSMMultiSliceViewProxy() override;
76

77 78 79 80
  /**
   * Use the center of the source to initialize the view with three orthogonal
   * slices in x, y, z.
   */
Kitware Robot's avatar
Kitware Robot committed
81
  void InitDefaultSlices(vtkSMSourceProxy* source, int opport, vtkSMRepresentationProxy* repr);
82

83
private:
84 85
  vtkSMMultiSliceViewProxy(const vtkSMMultiSliceViewProxy&) = delete;
  void operator=(const vtkSMMultiSliceViewProxy&) = delete;
86 87 88

  class vtkInternals;
  vtkInternals* Internals;
89 90 91
};

#endif