vtkSMCoreUtilities.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkSMCoreUtilities.h
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 =========================================================================*/
22 #ifndef vtkSMCoreUtilities_h
23 #define vtkSMCoreUtilities_h
24 
25 #include "vtkObject.h"
26 #include "vtkRemotingServerManagerModule.h" //needed for exports
27 #include "vtkStdString.h" // needed for vtkStdString.
28 
29 class vtkSMProxy;
30 
31 class VTKREMOTINGSERVERMANAGER_EXPORT vtkSMCoreUtilities : public vtkObject
32 {
33 public:
34  static vtkSMCoreUtilities* New();
35  vtkTypeMacro(vtkSMCoreUtilities, vtkObject);
36  void PrintSelf(ostream& os, vtkIndent indent) override;
37 
43  static const char* GetFileNameProperty(vtkSMProxy*);
44 
48  static vtkStdString SanitizeName(const char*);
49 
51 
55  static bool AdjustRangeForLog(double range[2]);
56  static bool AdjustRangeForLog(double& rmin, double& rmax)
57  {
58  double range[2] = { rmin, rmax };
60  rmin = range[0];
61  rmax = range[1];
62  return retVal;
63  }
65 
67 
81  static bool AdjustRange(double range[2]);
82  static bool AdjustRange(double& rmin, double& rmax)
83  {
84  double range[2] = { rmin, rmax };
86  rmin = range[0];
87  rmax = range[1];
88  return retVal;
89  }
91 
93 
97  static bool AlmostEqual(const double range[2], int ulpsDiff);
98  static bool AlmostEqual(double rmin, double rmax, int ulpsDiff)
99  {
100  double range[2] = { rmin, rmax };
101  return vtkSMCoreUtilities::AlmostEqual(range, ulpsDiff);
102  }
104 
106 
109  static const char* GetInputPropertyName(vtkSMProxy* proxy, int port = 0);
111 
118  static const char* GetStringForCellType(int cellType);
119 
120 protected:
122  ~vtkSMCoreUtilities() override;
123 
124 private:
125  vtkSMCoreUtilities(const vtkSMCoreUtilities&) = delete;
126  void operator=(const vtkSMCoreUtilities&) = delete;
127 };
128 
129 #endif
static bool AdjustRange(double range[2])
Adjust the given range to make it suitable for use with color maps.
static bool AlmostEqual(const double range[2], int ulpsDiff)
Compares val1 and val2 and returns true is the two numbers are within ulpsDiff ULPs (units in last pl...
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
collection of utilities.
static bool AdjustRangeForLog(double range[2])
Given a range, converts it to be a valid range to switch to log space.
static bool AdjustRangeForLog(double &rmin, double &rmax)
Given a range, converts it to be a valid range to switch to log space.
static bool AdjustRange(double &rmin, double &rmax)
Adjust the given range to make it suitable for use with color maps.
range
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:152
static vtkObject * New()
void operator=(const vtkObjectBase &)
static bool AlmostEqual(double rmin, double rmax, int ulpsDiff)
Compares val1 and val2 and returns true is the two numbers are within ulpsDiff ULPs (units in last pl...