RenderManAPI  24.0
RixRIBParser Class Referenceabstract

The RixRIBParser interface is used to parse a RIB file. More...

#include <RixRIBParser.h>

Inherits RixInterface.

Public Types

enum  Type {
  k_Float, k_Integer, k_StringV, k_Color,
  k_Normal, k_Vector, k_Point, k_HPoint,
  k_MPoint, k_Matrix
}
 

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...
 
virtual int GetVersion () const
 Get the version number of this interface. More...
 

Protected Member Functions

 RixRIBParser ()
 Constructor,Destuctor are for internal use only. More...
 
virtual ~RixRIBParser ()
 

Protected Attributes

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:

Member Enumeration Documentation

◆ Type

enum RixInterface::Type
inherited
Enumerator
k_Float 
k_Integer 
k_StringV 
k_Color 
k_Normal 
k_Vector 
k_Point 
k_HPoint 
k_MPoint 
k_Matrix 

Constructor & Destructor Documentation

◆ RixRIBParser()

RixRIBParser::RixRIBParser ( )
inlineprotected

Constructor,Destuctor are for internal use only.

◆ ~RixRIBParser()

virtual RixRIBParser::~RixRIBParser ( )
inlineprotectedvirtual

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.

◆ GetVersion()

virtual int RixInterface::GetVersion ( ) const
inlinevirtualinherited

Get the version number of this interface.

Different interfaces might have different version numbers in a given release.

References RixInterface::m_version.

◆ 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.

Member Data Documentation

◆ m_version

int RixInterface::m_version
protectedinherited

Version number of this interface.

Referenced by RixInterface::GetVersion().


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