Man Page for vtkSource
Table of Contents

NAME

vtkSource - abstract class specifies interface for visualization network source (or objects that generate output data)

SYNOPSIS


#include "/opt/vtk-c++/common/vtkSource.h"

class VTK_EXPORT vtkSource : public vtkObject

vtkSource();
virtual ~vtkSource() { if (this->Output) this->Output->Delete();};
static vtkSource *New() {return new vtkSource;};
const char *GetClassName() {return "vtkSource";};
void PrintSelf(ostream& os, vtkIndent indent);
virtual void Update();
void SetStartMethod(void (*f)(void *), void *arg);
void SetEndMethod(void (*f)(void *), void *arg);
void SetStartMethodArgDelete(void (*f)(void *));
void SetEndMethodArgDelete(void (*f)(void *));
virtual void SetReleaseDataFlag(int);
virtual int GetReleaseDataFlag();
void ReleaseDataFlagOn();
void ReleaseDataFlagOff();
virtual int GetDataReleased();
virtual void SetDataReleased(int flag);

DESCRIPTION

vtkSource is an abstract object that specifies behavior and interface of source objects. Source objects are objects that begin visualization pipeline. Sources include readers (read data from file or communications port) and procedural sources (generate data programmatically). vtkSource objects are also objects that generate output data. In this sense vtkSource is used as a superclass to vtkFilter.

Concrete subclasses of vtkSource must define Update() and Execute() methods. The public method Update() invokes network execution and will bring the network up-to-date. The protected Execute() method actually does the work of data creation/generation. The difference between the two methods is that Update() implements input consistency checks and modified time comparisons and then invokes the Execute() which is an implementation of a particular algorithm.

vtkSource provides a mechanism for invoking the methods StartMethod() and EndMethod() before and after object execution (via Execute()). These are convenience methods you can use for any purpose (e.g., debugging info, highlighting/notifying user interface, etc.) These methods accept a single void* pointer that can be used to send data to the methods. It is also possible to specify a function to delete the argument via StartMethodArgDelete and

EndMethodArgDelete.

An important feature of subclasses of vtkSource is that it is possible to control the memory-management model (i.e., retain output versus delete output data). If enabled the ReleaseDataFlag enables the deletion of the output data once the downstream process object finishes processing the data (please see text).

SEE ALSO

vtkDataSetReader vtkFilter vtkPolyDataSource vtkStructuredGridSource
vtkStructuredPointsSource
vtkUnstructuredGridSource

SUMMARY

virtual void Update();
Bring object up-to-date before execution. Update() checks modified time against last execution time, and re-executes object if necessary.

virtual void SetReleaseDataFlag(int);
Turn on/off flag to control whether this object's data is released after being used by a source.

virtual int GetDataReleased();
Set/Get flag indicating whether data has been released since last execution. Used during update method to determine whether to execute or not.

void SetStartMethod(void (*f)(void *), void *arg)
Specify function to be called before object executes.

void SetEndMethod(void (*f)(void *), void *arg)
Specify function to be called after object executes.

void SetStartMethodArgDelete(void (*f)(void *))
Set the arg delete method. This is used to free user memory.

void SetEndMethodArgDelete(void (*f)(void *))
Set the arg delete method. This is used to free user memory.


Table of Contents