RixRIBParser Class Reference
#include <RixRIBParser.h>
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:
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:
- Initialize parser with Begin() (once per session), cleanup with End().
- Invoke ParseRIBFile() / ParseRIBBuffer() between Begin() / End().
- Intercept Ri calls using RifFilter handlers.
- Issue more ParseRIBFile() as needed (e.g. to handle ReadArchive).
- Determine the size of parameterlist entries with GetDeclaration() coupled with per-primitive specs.
In procedural primitive and Rif plugins:
- Do not call Begin() / End().
- Trigger parsing via ParseRIBFile() / ParseRIBBuffer().
- If you need parsing callbacks, standard Rif plugins can be employed (but must be installed via standard mechanisms).
The documentation for this class was generated from the following file: