SYNOPSIS

#include <ForeignFiles/SoForeignFileKit.h>

Inherits SoBaseKit.

Inherited by SoSTLFileKit.

Public Member Functions

virtual SoType getTypeId (void) const

Returns the type identification of an object derived from a class inheriting SoBase. This is used for run-time type checking and 'downward' casting. virtual const SoNodekitCatalog * getNodekitCatalog (void) const

virtual SbBool canReadFile (const char *filename=NULL) const

virtual SbBool readFile (const char *filename)

virtual SbBool canWriteFile (const char *filename=NULL) const

virtual SbBool writeFile (const char *filename)

virtual class SoSeparator * convert ()=0

Static Public Member Functions

static SoType getClassTypeId (void)

static const SoNodekitCatalog * getClassNodekitCatalog (void)

static void initClass (void)

static SbBool isFileSupported (SoInput *in, SbBool exhaust=FALSE)

static SbBool isFileSupported (const char *filename, SbBool exhaust=FALSE)

static SoForeignFileKit * createForeignFileKit (SoInput *in, SbBool exhaust=FALSE)

static SoForeignFileKit * createForeignFileKit (const char *filename, SbBool exhaust=FALSE)

Protected Member Functions

virtual const SoFieldData * getFieldData (void) const

Static Protected Member Functions

static const SoFieldData ** getFieldDataPtr (void)

static const SoNodekitCatalog ** getClassNodekitCatalogPtr (void)

static void initClasses (void)

static SbBool registerFileExtension (SoType handler, SbName extension, SoForeignFileIdentifyFunc *identify)

Protected Attributes

SoSFNode topSeparator

Additional Inherited Members

Detailed Description

Abstract base class for foreign file format support in Coin.

Abstract base class for foreign file format support in Coin.

Be aware that this class is an extension for Coin, and it is not available in the original SGI Open Inventor v2.1 API.

Since:

Coin 3.0

Member Function Documentation

\fBSoType\fP SoForeignFileKit::getTypeId (void) const\fC [virtual]\fP

Returns the type identification of an object derived from a class inheriting SoBase. This is used for run-time type checking and 'downward' casting. Usage example:

void foo(SoNode * node)
{
  if (node->getTypeId() == SoFile::getClassTypeId()) {
    SoFile * filenode = (SoFile *)node;  // safe downward cast, knows the type
  }
}

For application programmers wanting to extend the library with new nodes, engines, nodekits, draggers or others: this method needs to be overridden in all subclasses. This is typically done as part of setting up the full type system for extension classes, which is usually accomplished by using the pre-defined macros available through for instance Inventor/nodes/SoSubNode.h (SO_NODE_INIT_CLASS and SO_NODE_CONSTRUCTOR for node classes), Inventor/engines/SoSubEngine.h (for engine classes) and so on.

For more information on writing Coin extensions, see the class documentation of the toplevel superclasses for the various class groups.

Reimplemented from SoBaseKit.

Reimplemented in SoSTLFileKit.

const \fBSoFieldData\fP * SoForeignFileKit::getFieldData (void) const\fC [protected]\fP, \fC [virtual]\fP

Returns a pointer to the class-wide field data storage object for this instance. If no fields are present, returns NULL.

Reimplemented from SoBaseKit.

Reimplemented in SoSTLFileKit.

const \fBSoNodekitCatalog\fP * SoForeignFileKit::getNodekitCatalog (void) const\fC [virtual]\fP

Returns the nodekit catalog which defines the layout of this class' kit.

Reimplemented from SoBaseKit.

Reimplemented in SoSTLFileKit.

SbBool SoForeignFileKit::isFileSupported (\fBSoInput\fP *in, SbBoolexhaust = \fCFALSE\fP)\fC [static]\fP

Convenience method. Will extract the filename from in and call the other ieFileSupported() method.

Will return false if file is not supported or /e in is not representing a normal file.

SbBool SoForeignFileKit::isFileSupported (const char *filename, SbBoolexhaust = \fCFALSE\fP)\fC [static]\fP

Checks if the filename can be read by a registered SoForeignFileKit handler.

FIXME: exhaust is not implemented.

\fBSoForeignFileKit\fP * SoForeignFileKit::createForeignFileKit (\fBSoInput\fP *in, SbBoolexhaust = \fCFALSE\fP)\fC [static]\fP

Convenience method. Will extract the filename from in and call the other ieFileSupported() method.

\fBSoForeignFileKit\fP * SoForeignFileKit::createForeignFileKit (const char *filename, SbBoolexhaust = \fCFALSE\fP)\fC [static]\fP

Creates an instance of a suitable SoForeignFileKit subtype from the given file and reads its content. Returns NULL on failure or a kit with refcount of 0 on success.

FIXME: exhaust is not implemented.

SbBool SoForeignFileKit::canReadFile (const char *filename = \fCNULL\fP) const\fC [virtual]\fP

Checks if this concrete class can read the given file.

Reimplemented in SoSTLFileKit.

SbBool SoForeignFileKit::readFile (const char *filename)\fC [virtual]\fP

Reads the given file into the internal representation. If successful, Coin should now be able to render the scene. If you need a pure Coin scenegraph, call convert().

Reimplemented in SoSTLFileKit.

SbBool SoForeignFileKit::canWriteFile (const char *filename = \fCNULL\fP) const\fC [virtual]\fP

Checks if this concrete class can write to the given file.

Reimplemented in SoSTLFileKit.

SbBool SoForeignFileKit::writeFile (const char *filename)\fC [virtual]\fP

Writes the current contents to the given file.

See also:

canWriteFile

Reimplemented in SoSTLFileKit.

virtual class \fBSoSeparator\fP* SoForeignFileKit::convert ()\fC [pure virtual]\fP

Converts (if necessary) the internal representation of the foreign file to a pure Coin scenegraph. Returns the root node with a refcount of 0.

Implemented in SoSTLFileKit.

SbBool SoForeignFileKit::registerFileExtension (\fBSoType\fPhandler, \fBSbName\fPextension, SoForeignFileIdentifyFunc *identify)\fC [static]\fP, \fC [protected]\fP

Registers a concrete SoForeignFileKit subtype to be a handler for files with the given extension. One class can be a handler for multiple filename extensions.

FIXME: identify is not implemented

Author

Generated automatically by Doxygen for Coin from the source code.