vtkTilesHelper.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: $RCSfile$
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 =========================================================================*/
24 #ifndef vtkTilesHelper_h
25 #define vtkTilesHelper_h
26 
27 #include "vtkObject.h"
28 #include "vtkRemotingViewsModule.h" // needed for export macro
29 #include "vtkVector.h" // for vtkVector
30 
32 {
33 public:
34  static vtkTilesHelper* New();
35  vtkTypeMacro(vtkTilesHelper, vtkObject);
36  void PrintSelf(ostream& os, vtkIndent indent) override;
37 
39 
42  vtkSetVector2Macro(TileDimensions, int);
43  vtkGetVector2Macro(TileDimensions, int);
45 
47 
51  vtkSetVector2Macro(TileMullions, int);
52  vtkGetVector2Macro(TileMullions, int);
54 
56 
60  vtkSetVector2Macro(TileWindowSize, int);
61  vtkGetVector2Macro(TileWindowSize, int);
63 
71  bool GetTiledSizeAndOrigin(int rank, vtkVector2i& size, vtkVector2i& lowerLeft) const;
72 
79  bool GetTiledSizeAndOrigin(
80  int rank, vtkVector2i& size, vtkVector2i& lowerLeft, vtkVector4d viewport) const;
81 
87  bool GetTileViewport(int rank, vtkVector4d& tile_viewport) const;
88 
93  bool GetTileIndex(int rank, int* tileX, int* tileY) const;
94 
98  bool GetTileEnabled(int rank) const
99  {
100  int x, y;
101  return this->GetTileIndex(rank, &x, &y);
102  }
103 
104 protected:
105  vtkTilesHelper();
106  ~vtkTilesHelper() override;
107 
108  int TileDimensions[2];
109  int TileMullions[2];
110  int TileWindowSize[2];
111 
112 private:
113  vtkTilesHelper(const vtkTilesHelper&) = delete;
114  void operator=(const vtkTilesHelper&) = delete;
115 };
116 
117 #endif
this is a helper class that handles viewport computations when rendering for tile-displays.
bool GetTileEnabled(int rank) const
Returns true if current rank will render a tile.
#define VTKREMOTINGVIEWS_EXPORT
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
static vtkObject * New()
void operator=(const vtkObjectBase &)