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

collection of utility methods. More...

#include <vtkSMUtilities.h>

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

Public Types

typedef vtkSMObject Superclass
 
- Public Types inherited from vtkSMObject
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 vtkSMUtilitiesNew ()
 
static int IsTypeOf (const char *type)
 
static vtkSMUtilitiesSafeDownCast (vtkObject *o)
 
static int SaveImage (vtkImageData *image, const char *filename, int quality)
 Save the image to a file. More...
 
static int SaveImage (vtkImageData *image, const char *filename)
 
static int SaveImage (vtkImageData *image, const char *filename, const char *writerName)
 Save the image to a file using a vtkImageWriter subclass given by writerName. More...
 
static int SaveImageOnProcessZero (vtkImageData *image, const char *filename, const char *writerName)
 Calls SaveImage(image, filename, writerName) only on process 0. More...
 
static vtkPointsCreateOrbit (const double center[3], const double normal[3], int resolution, const double startPoint[3])
 Returns the points an orbit to revolve around the center at a distance of radius in the plane defined by the center and the normal. More...
 
static vtkPointsCreateOrbit (const double center[3], const double normal[3], double radius, int resolution)
 
static void Merge (vtkImageData *dest, vtkImageData *src, int borderWidth=0, const unsigned char *borderColorRGB=nullptr)
 Convenience method used to merge a smaller image (src) into a larger one (dest). More...
 
static vtkSmartPointer< vtkImageDataMergeImages (const std::vector< vtkSmartPointer< vtkImageData >> &images, int borderWidth=0, const unsigned char *borderColorRGB=nullptr)
 Merges multiple images into a single one and returns that. More...
 
static void FillImage (vtkImageData *image, const int extent[6], const unsigned char rgb[3])
 Fill the specified extents in the image with the given color. More...
 
- Static Public Member Functions inherited from vtkSMObject
static vtkSMObjectNew ()
 
static int IsTypeOf (const char *type)
 
static vtkSMObjectSafeDownCast (vtkObject *o)
 
static std::string CreatePrettyLabel (const std::string &name)
 Return a well-formated label using provided name by adding spaces between lower cases and upper cases: 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

 vtkSMUtilities ()=default
 
 ~vtkSMUtilities () override=default
 
- Protected Member Functions inherited from vtkSMObject
 vtkSMObject ()
 
 ~vtkSMObject () 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 utility methods.

vtkSMUtilities defines a collection of useful static methods.

Definition at line 20 of file vtkSMUtilities.h.

Member Typedef Documentation

◆ Superclass

Definition at line 24 of file vtkSMUtilities.h.

Constructor & Destructor Documentation

◆ vtkSMUtilities()

vtkSMUtilities::vtkSMUtilities ( )
protecteddefault

◆ ~vtkSMUtilities()

vtkSMUtilities::~vtkSMUtilities ( )
overrideprotecteddefault

Member Function Documentation

◆ New()

static vtkSMUtilities* vtkSMUtilities::New ( )
static

◆ GetClassName()

virtual const char* vtkSMUtilities::GetClassName ( )
virtual

Reimplemented from vtkSMObject.

◆ IsTypeOf()

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

◆ IsA()

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

Reimplemented from vtkSMObject.

◆ SafeDownCast()

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

◆ PrintSelf()

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

Reimplemented from vtkSMObject.

◆ SaveImage() [1/3]

static int vtkSMUtilities::SaveImage ( vtkImageData image,
const char *  filename,
int  quality 
)
static

Save the image to a file.

The file is created on the process on which this method is called. Return vtkErrorCode::NoError (0) on success, otherwise returns the error code. / quality [0,100] – 0 = low, 100=high, -1=default

◆ SaveImage() [2/3]

static int vtkSMUtilities::SaveImage ( vtkImageData image,
const char *  filename 
)
inlinestatic

Definition at line 35 of file vtkSMUtilities.h.

◆ SaveImage() [3/3]

static int vtkSMUtilities::SaveImage ( vtkImageData image,
const char *  filename,
const char *  writerName 
)
static

Save the image to a file using a vtkImageWriter subclass given by writerName.

The file is created on the process on which this method is called.

◆ SaveImageOnProcessZero()

static int vtkSMUtilities::SaveImageOnProcessZero ( vtkImageData image,
const char *  filename,
const char *  writerName 
)
static

Calls SaveImage(image, filename, writerName) only on process 0.

Other processes will receive the return code through a broadcast.

◆ CreateOrbit() [1/2]

static vtkPoints* vtkSMUtilities::CreateOrbit ( const double  center[3],
const double  normal[3],
int  resolution,
const double  startPoint[3] 
)
static

Returns the points an orbit to revolve around the center at a distance of radius in the plane defined by the center and the normal.

The number of points returned is equal to resolution. Returns a new instance of vtkPoints. The caller is responsible for freeing the allocated memory.

◆ CreateOrbit() [2/2]

static vtkPoints* vtkSMUtilities::CreateOrbit ( const double  center[3],
const double  normal[3],
double  radius,
int  resolution 
)
static

◆ Merge()

static void vtkSMUtilities::Merge ( vtkImageData dest,
vtkImageData src,
int  borderWidth = 0,
const unsigned char *  borderColorRGB = nullptr 
)
static

Convenience method used to merge a smaller image (src) into a larger one (dest).

The location of the smaller image in the larger image are determined by their extents.

◆ MergeImages()

static vtkSmartPointer<vtkImageData> vtkSMUtilities::MergeImages ( const std::vector< vtkSmartPointer< vtkImageData >> &  images,
int  borderWidth = 0,
const unsigned char *  borderColorRGB = nullptr 
)
static

Merges multiple images into a single one and returns that.

◆ FillImage()

static void vtkSMUtilities::FillImage ( vtkImageData image,
const int  extent[6],
const unsigned char  rgb[3] 
)
static

Fill the specified extents in the image with the given color.

If the image is a 4 component image, then this method fills the 4th component with 0xff.


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