RixRIBParser Class Reference

#include <RixRIBParser.h>

Inheritance diagram for RixRIBParser:
RixInterface

Public Member Functions

virtual int Begin (const RifFilter *)=0
 Used to initialize the parser when in librix mode (standalone)
 
virtual int ParseRIBFile (const char *filename)=0
 Parse the RIB within a file given by filename.
 
virtual int ParseRIBBuffer (const char *buffer)=0
 Parse the RIB in memory pointed to by buffer.
 
virtual int End ()=0
 Used to destruct the parser state in librix mode.
 
virtual int GetDeclaration (RtToken t, RifTokenType *, RifTokenDetail *, int *alen)=0
 A helper method to determine the size of parameter list entries.
 
- Public Member Functions inherited from RixInterface
virtual int GetVersion () const
 

Protected Member Functions

 RixRIBParser ()
 Constructor,Destuctor are for internal use only.
 
- Protected Member Functions inherited from RixInterface
 RixInterface (int version)
 Interfaces should not be constructed by users.
 
virtual ~RixInterface ()
 Interfaces should not be deleted by users.
 

Additional Inherited Members

- Protected Attributes inherited from RixInterface
int m_version
 Version number of this interface.
 

Detailed Description

The RixRIBParser interface is used to parse a RIB file. RIB files can be either binary or ascii, and, optionally, can be located within a .zip file. Caller provides callbacks in the form of a RifFilter and should include the appropriate RifFilter headers as well. Calls to ParseRIBFile can be nested. A code snippet illustrating this class is below:

RixInterface *xif = RixGetContext()->GetRixInterface(k_RixRIBParser);
RixRIBParser *ribif = static_cast<RixRIBParser *>(xif);
RifFilter myfilter;
myfilter.SphereV = mySphereV;
myfilter.ConeV = myConeV;
myfilter.ReadArchiveV = myReadArchiveV;
ribParseIF->Begin(&myfilter);
ribParseIF->ParseRIBFile("hello.rib");
ribParseIF->End();

This example would parse the RIB in the file "hello.rib" and call user-defined filter functions for Sphere, Cone, and ReadArchive.

Brief: This interface can be used in both standalone (librix) mode and from within procedural and Rif plugins. It cannot be used in other render-time contexts, including RslPlugins, subdiv evaluation, and implicit fields. In the standalone mode caller must invoke the Begin() and End() method. In rendertime mode, the caller should not use Begin() / End() because the renderer has already setup the parsing state, thus can only initiate the parsing in the context of the active Rif chain.

In librix mode:

In procedural primitive and Rif plugins:


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