Open Inventor Release 2024.1.0
 
Loading...
Searching...
No Matches
SoInputReader Class Referenceabstract

Base class for custom readers that create an Open Inventor scene graph. More...

#include <Inventor/SoInputReader.h>

+ Inheritance diagram for SoInputReader:

Public Member Functions

virtual bool canConvert (SoInput *in)=0
 Returns true if the specified input source can be converted by this plugin.
 
virtual SoSeparatorconvert (SoInput *)=0
 Returns the specified input source in the form of an Open Inventor scene graph.
 
- Public Member Functions inherited from SoRefCounter
void ref () const
 Adds a reference to an instance.
 
void unref () const
 Removes a reference from an instance.
 
void unrefNoDelete () const
 unrefNoDelete() should be called when it is desired to decrement the reference count, but not delete the instance if this brings the reference count to zero.
 
int getRefCount () const
 Returns current reference count.
 
void lock () const
 lock this instance.
 
void unlock () const
 unlock this instance.
 
- Public Member Functions inherited from SoTypedObject
virtual SoType getTypeId () const =0
 Returns the type identifier for a specific instance.
 
SbBool isOfType (const SoType &type) const
 Returns TRUE if this object is of the type specified in type or is derived from that type.
 
template<typename TypedObjectClass >
SbBool isOfType () const
 Returns TRUE if this object is of the type of class TypedObjectClass or is derived from that class.
 

Additional Inherited Members

- Static Public Member Functions inherited from SoTypedObject
static SoType getClassTypeId ()
 Returns the type identifier for this class.
 

Detailed Description

Base class for custom readers that create an Open Inventor scene graph.

This class defines the base interface for loading a scene graph from an data format that is not directly supported by Open Inventor.

Input readers should be loaded and managed as plugins. Open Inventor automtically attempts to load all files that may be plugin libraries (files with the extension .dll or .so depending on the platform). Plugin libraries may also be explicitly loaded using SoDB::addPlugin(). See more details on that page. The file name convention (not required) for readers is "Iv*Reader.dll (or .so)".

A plugin library must implement the initPlugin() and exitPlugin() C-formatted entry-points. The initPlugin() function is responsible for registering the new class (or classes) in the Open Inventor database through the standard SoType type creation mechanism. The exitPlugin() function is used to disable the use of the custom class(s) by removing the corresponding type(s) from the Open Inventor database.

When SoDB::readAll() (for example) is called to create a scene graph from a file or buffer, Open Inventor first attempts to handle the data as .iv format. If that fails, Open Inventor will call the canConvert() method for each loaded plugin class, that is derived from SoInputReader, in the order they were loaded. The first reader plugin that returns true from this method will be used to handle the data.

SEE ALSO

SoInput, SoDB::addPlugin() SoDB::removePlugin() SoDB::getPlugins() SoDB::addPluginsDirectory() SoDB::removePluginsDirectory() SoDB::getPluginsDirectories()

Definition at line 74 of file SoInputReader.h.

Member Function Documentation

◆ canConvert()

virtual bool SoInputReader::canConvert ( SoInput in)
pure virtual

Returns true if the specified input source can be converted by this plugin.

Note that the input source (SoInput object) may be a file or a buffer (memory). This method should return false if the input source is a buffer and the reader does not support reading from a buffer. SoInput::getCurFile() returns NULL if the input source is a buffer.

Implemented in SoCADInputReader, and SoSTLInputReader.

◆ convert()

virtual SoSeparator * SoInputReader::convert ( SoInput )
pure virtual

Returns the specified input source in the form of an Open Inventor scene graph.

Note that the input source (SoInput object) may be a file or a buffer (memory). This method should return NULL if the input source is a buffer and the reader does not support reading from a buffer. SoInput::getCurFile() returns NULL if the input source is a buffer.

Implemented in SoCADInputReader, and SoSTLInputReader.


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