Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
vtkSMCoreUtilities Class Reference

collection of utilities. More...

#include <vtkSMCoreUtilities.h>

Inheritance diagram for vtkSMCoreUtilities:
Inheritance graph
[legend]
Collaboration diagram for vtkSMCoreUtilities:
Collaboration graph
[legend]

Public Types

typedef vtkObject Superclass
 

Public Member Functions

virtual const char * GetClassName ()
 
virtual int IsA (const char *type)
 
void PrintSelf (ostream &os, vtkIndent indent) override
 
- Public Member Functions inherited from vtkObject
 vtkBaseTypeMacro (vtkObject, vtkObjectBase)
 
virtual void DebugOn ()
 
virtual void DebugOff ()
 
bool GetDebug ()
 
void SetDebug (bool debugFlag)
 
virtual void Modified ()
 
virtual vtkMTimeType GetMTime ()
 
void RemoveObserver (unsigned long tag)
 
void RemoveObservers (unsigned long event)
 
void RemoveObservers (const char *event)
 
void RemoveAllObservers ()
 
int HasObserver (unsigned long event)
 
int HasObserver (const char *event)
 
int InvokeEvent (unsigned long event)
 
int InvokeEvent (const char *event)
 
unsigned long AddObserver (unsigned long event, vtkCommand *, float priority=0.0f)
 
unsigned long AddObserver (const char *event, vtkCommand *, float priority=0.0f)
 
vtkCommandGetCommand (unsigned long tag)
 
void RemoveObserver (vtkCommand *)
 
void RemoveObservers (unsigned long event, vtkCommand *)
 
void RemoveObservers (const char *event, vtkCommand *)
 
int HasObserver (unsigned long event, vtkCommand *)
 
int HasObserver (const char *event, vtkCommand *)
 
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f)
 
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
unsigned long AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
int InvokeEvent (unsigned long event, void *callData)
 
int InvokeEvent (const char *event, void *callData)
 
unsigned long AddObserver (unsigned long event, vtkCommand *, float priority=0.0f)
 
unsigned long AddObserver (const char *event, vtkCommand *, float priority=0.0f)
 
vtkCommandGetCommand (unsigned long tag)
 
void RemoveObserver (vtkCommand *)
 
void RemoveObservers (unsigned long event, vtkCommand *)
 
void RemoveObservers (const char *event, vtkCommand *)
 
int HasObserver (unsigned long event, vtkCommand *)
 
int HasObserver (const char *event, vtkCommand *)
 
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f)
 
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
unsigned long AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 
int InvokeEvent (unsigned long event, void *callData)
 
int InvokeEvent (const char *event, void *callData)
 
- Public Member Functions inherited from vtkObjectBase
const char * GetClassName () const
 
virtual void Delete ()
 
virtual void FastDelete ()
 
void Print (ostream &os)
 
virtual void Register (vtkObjectBase *o)
 
virtual void UnRegister (vtkObjectBase *o)
 
void SetReferenceCount (int)
 
virtual void PrintHeader (ostream &os, vtkIndent indent)
 
virtual void PrintTrailer (ostream &os, vtkIndent indent)
 
int GetReferenceCount ()
 
void PrintRevisions (ostream &)
 
virtual void PrintHeader (ostream &os, vtkIndent indent)
 
virtual void PrintTrailer (ostream &os, vtkIndent indent)
 
int GetReferenceCount ()
 
void PrintRevisions (ostream &)
 

Static Public Member Functions

static vtkSMCoreUtilitiesNew ()
 
static int IsTypeOf (const char *type)
 
static vtkSMCoreUtilitiesSafeDownCast (vtkObject *o)
 
static const char * GetFileNameProperty (vtkSMProxy *)
 Given a proxy (or proxy prototype), returns the name of the property that ParaView application will be use as the default FileName property. More...
 
static std::vector< std::stringGetFileNameProperties (vtkSMProxy *proxy)
 Returns list of all properties that accept filenames in order that they are defined. More...
 
static std::string SanitizeName (const char *)
 Sanitize a label/name to be remove spaces, delimiters etc. More...
 
static std::string SanitizeName (const std::string &name)
 
static const char * GetStringForCellType (int cellType)
 Given a VTK cell type value from the enum in vtkCellTypes.h, returns a string describing that cell type for use if ParaView's GUI. More...
 
static void ReplaceReaderFileName (vtkSMProxy *proxy, const std::vector< std::string > &files, const char *propName)
 Replaces input proxy, which should be a reader proxy, by a new proxy in the pipeline. More...
 
static std::string FindLargestPrefix (const std::vector< std::string > &files)
 Find the largest prefix that matches all file names in files, and then append a '*' to signify that it is a collection of files. More...
 
static bool AdjustRangeForLog (double range[2])
 Given a range, converts it to be a valid range to switch to log space. More...
 
static bool AdjustRangeForLog (double &rmin, double &rmax)
 Given a range, converts it to be a valid range to switch to log space. More...
 
static bool AdjustRange (double range[2])
 Adjust the given range to make it suitable for use with color maps. More...
 
static bool AdjustRange (double &rmin, double &rmax)
 Adjust the given range to make it suitable for use with color maps. More...
 
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 place) from each other. More...
 
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 place) from each other. More...
 
static const char * GetInputPropertyName (vtkSMProxy *proxy, int port=0)
 Given a proxy and a port number get the name of the input. More...
 
- Static Public Member Functions inherited from vtkObject
static vtkObjectNew ()
 
static void BreakOnError ()
 
static void SetGlobalWarningDisplay (int val)
 
static void GlobalWarningDisplayOn ()
 
static void GlobalWarningDisplayOff ()
 
static int GetGlobalWarningDisplay ()
 
static void SetGlobalWarningDisplay (int val)
 
static void GlobalWarningDisplayOn ()
 
static void GlobalWarningDisplayOff ()
 
static int GetGlobalWarningDisplay ()
 
- Static Public Member Functions inherited from vtkObjectBase
static vtkTypeBool IsTypeOf (const char *name)
 
static vtkObjectBaseNew ()
 
static vtkObjectBaseNew ()
 

Protected Member Functions

 vtkSMCoreUtilities ()
 
 ~vtkSMCoreUtilities () override
 
- Protected Member Functions inherited from vtkObject
 vtkObject ()
 
virtual ~vtkObject ()
 
void RegisterInternal (vtkObjectBase *, vtkTypeBool check) VTK_OVERRIDE
 
void UnRegisterInternal (vtkObjectBase *, vtkTypeBool check) VTK_OVERRIDE
 
void InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL)
 
void InternalReleaseFocus ()
 
void InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL)
 
void InternalReleaseFocus ()
 
- Protected Member Functions inherited from vtkObjectBase
 vtkObjectBase ()
 
virtual ~vtkObjectBase ()
 
virtual void CollectRevisions (ostream &)
 
virtual void ReportReferences (vtkGarbageCollector *)
 
 vtkObjectBase (const vtkObjectBase &)
 
void operator= (const vtkObjectBase &)
 

Additional Inherited Members

- Protected Attributes inherited from vtkObject
bool Debug
 
vtkTimeStamp MTime
 
vtkSubjectHelper * SubjectHelper
 
- Protected Attributes inherited from vtkObjectBase
vtkAtomicInt32 ReferenceCount
 
vtkWeakPointerBase ** WeakPointers
 

Detailed Description

collection of utilities.

vtkSMCoreUtilities provides miscellaneous utility functions.

Definition at line 21 of file vtkSMCoreUtilities.h.

Member Typedef Documentation

◆ Superclass

Definition at line 25 of file vtkSMCoreUtilities.h.

Constructor & Destructor Documentation

◆ vtkSMCoreUtilities()

vtkSMCoreUtilities::vtkSMCoreUtilities ( )
protected

◆ ~vtkSMCoreUtilities()

vtkSMCoreUtilities::~vtkSMCoreUtilities ( )
overrideprotected

Member Function Documentation

◆ New()

static vtkSMCoreUtilities* vtkSMCoreUtilities::New ( )
static

◆ GetClassName()

virtual const char* vtkSMCoreUtilities::GetClassName ( )
virtual

◆ IsTypeOf()

static int vtkSMCoreUtilities::IsTypeOf ( const char *  type)
static

◆ IsA()

virtual int vtkSMCoreUtilities::IsA ( const char *  type)
virtual

Reimplemented from vtkObjectBase.

◆ SafeDownCast()

static vtkSMCoreUtilities* vtkSMCoreUtilities::SafeDownCast ( vtkObject o)
static

◆ PrintSelf()

void vtkSMCoreUtilities::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
overridevirtual

Reimplemented from vtkObject.

◆ GetFileNameProperty()

static const char* vtkSMCoreUtilities::GetFileNameProperty ( vtkSMProxy )
static

Given a proxy (or proxy prototype), returns the name of the property that ParaView application will be use as the default FileName property.

Returns the name of the property or nullptr when no such property is found.

◆ GetFileNameProperties()

static std::vector<std::string> vtkSMCoreUtilities::GetFileNameProperties ( vtkSMProxy proxy)
static

Returns list of all properties that accept filenames in order that they are defined.

◆ SanitizeName() [1/2]

static std::string vtkSMCoreUtilities::SanitizeName ( const char *  )
static

Sanitize a label/name to be remove spaces, delimiters etc.

◆ SanitizeName() [2/2]

static std::string vtkSMCoreUtilities::SanitizeName ( const std::string name)
inlinestatic

Definition at line 45 of file vtkSMCoreUtilities.h.

◆ AdjustRangeForLog() [1/2]

static bool vtkSMCoreUtilities::AdjustRangeForLog ( double  range[2])
static

Given a range, converts it to be a valid range to switch to log space.

If the range is changed, returns true, otherwise returns false.

◆ AdjustRangeForLog() [2/2]

static bool vtkSMCoreUtilities::AdjustRangeForLog ( double rmin,
double rmax 
)
inlinestatic

Given a range, converts it to be a valid range to switch to log space.

If the range is changed, returns true, otherwise returns false.

Definition at line 56 of file vtkSMCoreUtilities.h.

◆ AdjustRange() [1/2]

static bool vtkSMCoreUtilities::AdjustRange ( double  range[2])
static

Adjust the given range to make it suitable for use with color maps.

The current logic (which may change in future) does the following:

  1. If the range is invalid i.e range[1] < range[0], simply returns false and keeps the range unchanged.
  2. If the range[0] == range[1] (using logic to handle nearly similar floating points numbers), then the range[1] is adjusted to be such that range[1] > range[0p].
  3. If range[0] < range[1] (beyond the margin of error checked for in (2), then range is left unchanged.
Returns
true if the range was changed, false is the range was left unchanged.

◆ AdjustRange() [2/2]

static bool vtkSMCoreUtilities::AdjustRange ( double rmin,
double rmax 
)
inlinestatic

Adjust the given range to make it suitable for use with color maps.

The current logic (which may change in future) does the following:

  1. If the range is invalid i.e range[1] < range[0], simply returns false and keeps the range unchanged.
  2. If the range[0] == range[1] (using logic to handle nearly similar floating points numbers), then the range[1] is adjusted to be such that range[1] > range[0p].
  3. If range[0] < range[1] (beyond the margin of error checked for in (2), then range is left unchanged.
Returns
true if the range was changed, false is the range was left unchanged.

Definition at line 82 of file vtkSMCoreUtilities.h.

◆ AlmostEqual() [1/2]

static bool vtkSMCoreUtilities::AlmostEqual ( const double  range[2],
int  ulpsDiff 
)
static

Compares val1 and val2 and returns true is the two numbers are within ulpsDiff ULPs (units in last place) from each other.

◆ AlmostEqual() [2/2]

static bool vtkSMCoreUtilities::AlmostEqual ( double  rmin,
double  rmax,
int  ulpsDiff 
)
inlinestatic

Compares val1 and val2 and returns true is the two numbers are within ulpsDiff ULPs (units in last place) from each other.

Definition at line 98 of file vtkSMCoreUtilities.h.

◆ GetInputPropertyName()

static const char* vtkSMCoreUtilities::GetInputPropertyName ( vtkSMProxy proxy,
int  port = 0 
)
static

Given a proxy and a port number get the name of the input.

◆ GetStringForCellType()

static const char* vtkSMCoreUtilities::GetStringForCellType ( int  cellType)
static

Given a VTK cell type value from the enum in vtkCellTypes.h, returns a string describing that cell type for use if ParaView's GUI.

For example it pasesd VTK_TRIANGLE it will return "Triangle". If an unknown cell type is passed to this it returns the string "Unknown".

◆ ReplaceReaderFileName()

static void vtkSMCoreUtilities::ReplaceReaderFileName ( vtkSMProxy proxy,
const std::vector< std::string > &  files,
const char *  propName 
)
static

Replaces input proxy, which should be a reader proxy, by a new proxy in the pipeline.

The new input files are stored in files, and propName should be the file name property in the reader (usually "FileName" or "FileNames").

◆ FindLargestPrefix()

static std::string vtkSMCoreUtilities::FindLargestPrefix ( const std::vector< std::string > &  files)
static

Find the largest prefix that matches all file names in files, and then append a '*' to signify that it is a collection of files.

If they all start with something different, this returns '*'.


The documentation for this class was generated from the following file: