vtkTilesHelper.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
12 #ifndef vtkTilesHelper_h
13 #define vtkTilesHelper_h
14 
15 #include "vtkObject.h"
16 #include "vtkRemotingViewsModule.h" // needed for export macro
17 #include "vtkVector.h" // for vtkVector
18 
20 {
21 public:
22  static vtkTilesHelper* New();
23  vtkTypeMacro(vtkTilesHelper, vtkObject);
24  void PrintSelf(ostream& os, vtkIndent indent) override;
25 
27 
30  vtkSetVector2Macro(TileDimensions, int);
31  vtkGetVector2Macro(TileDimensions, int);
33 
35 
39  vtkSetVector2Macro(TileMullions, int);
40  vtkGetVector2Macro(TileMullions, int);
42 
44 
48  vtkSetVector2Macro(TileWindowSize, int);
49  vtkGetVector2Macro(TileWindowSize, int);
51 
59  bool GetTiledSizeAndOrigin(int rank, vtkVector2i& size, vtkVector2i& lowerLeft) const;
60 
67  bool GetTiledSizeAndOrigin(
68  int rank, vtkVector2i& size, vtkVector2i& lowerLeft, vtkVector4d viewport) const;
69 
75  bool GetTileViewport(int rank, vtkVector4d& tile_viewport) const;
76 
81  bool GetTileIndex(int rank, int* tileX, int* tileY) const;
82 
86  bool GetTileEnabled(int rank) const
87  {
88  int x, y;
89  return this->GetTileIndex(rank, &x, &y);
90  }
91 
92 protected:
94  ~vtkTilesHelper() override;
95 
96  int TileDimensions[2];
97  int TileMullions[2];
98  int TileWindowSize[2];
99 
100 private:
101  vtkTilesHelper(const vtkTilesHelper&) = delete;
102  void operator=(const vtkTilesHelper&) = delete;
103 };
104 
105 #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 &)