[Paraview] Object Factory help!!!

RAVINDRANATH LANKA rlanka at hotmail.com
Mon Nov 29 17:26:32 EST 2004


Hi all,

I am trying to build a shared library containing a reader that uses 
proprietary code.  I would like to have the basic interface to the reader in 
the paraview*/VTK/IO directory and then put my shared library in 
VTK_AUTOLOAD_PATH.
Let us say my reader is divided into two files/classes.
i. vtkPVMyReaderModule.cxx
ii. vtkMyReader.cxx

The first class has the basic interface of a reader like, 
ExecuteInformation, ExecuteData etc.  The second class has the interface to 
get the data from a database, like getNodalData, getNumberOfPoints, 
getNumberOfCells etc.  I will have some dummy functions in the 
paraview*/VTK/IO area and the one that uses the proprietary code in the 
shared library.
My understanding of how vtk Object Factories work is that in the dummy 
implementation I should have a New() function that would be something like,

vtkMyReader::New() {
  vtkObject* retObject =  vtkObjectFactory::CreateInstance("vtkMyReader");

  if (retObject) { return (vtkMyReader* (retObject)) }
  return new vtkMyReader;
}
Then, the users who have access to the library with the proprietary code 
will be able to use the reader functionality.

I need some basic direction on writing/installing the factory itself.

Ravi

_________________________________________________________________
The happening world of BPO! Know all that you need to know! 
http://www.bpowatchindia.com/msn/ Keep in step with what’s hot!



More information about the ParaView mailing list