RenderMan API  23.0
RixRIBParser Class Referenceabstract

#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) More...
 
virtual int ParseRIBFile (const char *filename)=0
 Parse the RIB within a file given by filename. More...
 
virtual int ParseRIBBuffer (const char *buffer)=0
 Parse the RIB in memory pointed to by buffer. More...
 
virtual int End ()=0
 Used to destruct the parser state in librix mode. More...
 
virtual int GetDeclaration (RtUString const t, RifTokenType *, RifTokenDetail *, int *alen)=0
 A helper method to determine the size of parameter list entries. More...
 
- Public Member Functions inherited from RixInterface
virtual int GetVersion () const
 

Protected Member Functions

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

Additional Inherited Members

- Public Types inherited from RixInterface
enum  Type {
  k_Float, k_Integer, k_StringV, k_Color,
  k_Normal, k_Vector, k_Point, k_HPoint,
  k_MPoint, k_Matrix
}
 
- Protected Attributes inherited from RixInterface
int m_version
 Version number of this interface. More...
 

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:

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 RixShadingPlugins, 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:

Definition at line 94 of file RixRIBParser.h.

Constructor & Destructor Documentation

◆ RixRIBParser()

RixRIBParser::RixRIBParser ( )
inlineprotected

Constructor,Destuctor are for internal use only.

Definition at line 118 of file RixRIBParser.h.

◆ ~RixRIBParser()

virtual RixRIBParser::~RixRIBParser ( )
inlineprotectedvirtual

Definition at line 119 of file RixRIBParser.h.

Member Function Documentation

◆ Begin()

virtual int RixRIBParser::Begin ( const RifFilter )
pure virtual

Used to initialize the parser when in librix mode (standalone)

◆ End()

virtual int RixRIBParser::End ( )
pure virtual

Used to destruct the parser state in librix mode.

◆ GetDeclaration()

virtual int RixRIBParser::GetDeclaration ( RtUString const  t,
RifTokenType ,
RifTokenDetail ,
int *  alen 
)
pure virtual

A helper method to determine the size of parameter list entries.

◆ ParseRIBBuffer()

virtual int RixRIBParser::ParseRIBBuffer ( const char *  buffer)
pure virtual

Parse the RIB in memory pointed to by buffer.

◆ ParseRIBFile()

virtual int RixRIBParser::ParseRIBFile ( const char *  filename)
pure virtual

Parse the RIB within a file given by filename.


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