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 
28 #include <string>
29 
30 class vtkSMProxy;
31 
33 {
34 public:
35  static vtkSMCoreUtilities* New();
36  vtkTypeMacro(vtkSMCoreUtilities, vtkObject);
37  void PrintSelf(ostream& os, vtkIndent indent) override;
38 
44  static const char* GetFileNameProperty(vtkSMProxy*);
45 
49  static std::string SanitizeName(const char*);
50 
52 
56  static bool AdjustRangeForLog(double range[2]);
57  static bool AdjustRangeForLog(double& rmin, double& rmax)
58  {
59  double range[2] = { rmin, rmax };
60  bool retVal = vtkSMCoreUtilities::AdjustRangeForLog(range);
61  rmin = range[0];
62  rmax = range[1];
63  return retVal;
64  }
66 
68 
82  static bool AdjustRange(double range[2]);
83  static bool AdjustRange(double& rmin, double& rmax)
84  {
85  double range[2] = { rmin, rmax };
86  bool retVal = vtkSMCoreUtilities::AdjustRange(range);
87  rmin = range[0];
88  rmax = range[1];
89  return retVal;
90  }
92 
94 
98  static bool AlmostEqual(const double range[2], int ulpsDiff);
99  static bool AlmostEqual(double rmin, double rmax, int ulpsDiff)
100  {
101  double range[2] = { rmin, rmax };
102  return vtkSMCoreUtilities::AlmostEqual(range, ulpsDiff);
103  }
105 
107 
110  static const char* GetInputPropertyName(vtkSMProxy* proxy, int port = 0);
112 
119  static const char* GetStringForCellType(int cellType);
120 
121 protected:
123  ~vtkSMCoreUtilities() override;
124 
125 private:
126  vtkSMCoreUtilities(const vtkSMCoreUtilities&) = delete;
127  void operator=(const vtkSMCoreUtilities&) = delete;
128 };
129 
130 #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...
#define VTKREMOTINGSERVERMANAGER_EXPORT
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
CellTypeInDataSet cellType(vtkDataSet *input)
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:152
port
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...