ParaView
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 "vtkPVVTKExtensionsRenderingModule.h" // needed for export macro
29 
30 class VTKPVVTKEXTENSIONSRENDERING_EXPORT vtkTilesHelper : public vtkObject
31 {
32 public:
33  static vtkTilesHelper* New();
34  vtkTypeMacro(vtkTilesHelper, vtkObject);
35  void PrintSelf(ostream& os, vtkIndent indent);
36 
38 
41  vtkSetVector2Macro(TileDimensions, int);
42  vtkGetVector2Macro(TileDimensions, int);
44 
46 
50  vtkSetVector2Macro(TileMullions, int);
51  vtkGetVector2Macro(TileMullions, int);
53 
55 
59  vtkSetVector2Macro(TileWindowSize, int);
60  vtkGetVector2Macro(TileWindowSize, int);
62 
70  bool GetTileViewport(const double* viewport, int rank, int out_tile_viewport[4]);
71 
77  bool GetNormalizedTileViewport(const double* viewport, int rank, double out_tile_viewport[4]);
78 
84  bool GetPhysicalViewport(
85  const double* global_viewport, int rank, double out_phyiscal_viewport[4]);
86 
90  void GetTileIndex(int rank, int* tileX, int* tileY);
91 
92 protected:
94  ~vtkTilesHelper();
95 
96  int TileDimensions[2];
97  int TileMullions[2];
98  int TileWindowSize[2];
99 
100 private:
101  vtkTilesHelper(const vtkTilesHelper&) VTK_DELETE_FUNCTION;
102  void operator=(const vtkTilesHelper&) VTK_DELETE_FUNCTION;
103 };
104 
105 #endif
this is a helper class that handles viewport computations when rendering for tile-displays.