api.cpp File Reference

#include "api.h"
#include "paramset.h"
#include "color.h"
#include "scene.h"
#include "film.h"
#include "dynload.h"
#include "volume.h"
#include <map>

Go to the source code of this file.

Classes

struct  RenderOptions
struct  GraphicsState

Defines

#define STATE_UNINITIALIZED   0
#define STATE_OPTIONS_BLOCK   1
#define STATE_WORLD_BLOCK   2
#define VERIFY_INITIALIZED(func)
#define VERIFY_OPTIONS(func)
#define VERIFY_WORLD(func)

Functions

COREDLL void pbrtInit ()
COREDLL void pbrtCleanup ()
COREDLL void pbrtIdentity ()
COREDLL void pbrtTranslate (float dx, float dy, float dz)
COREDLL void pbrtTransform (float tr[16])
COREDLL void pbrtConcatTransform (float tr[16])
COREDLL void pbrtRotate (float angle, float dx, float dy, float dz)
COREDLL void pbrtScale (float sx, float sy, float sz)
COREDLL void pbrtLookAt (float ex, float ey, float ez, float lx, float ly, float lz, float ux, float uy, float uz)
COREDLL void pbrtCoordinateSystem (const string &name)
COREDLL void pbrtCoordSysTransform (const string &name)
COREDLL void pbrtPixelFilter (const string &name, const ParamSet &params)
COREDLL void pbrtFilm (const string &type, const ParamSet &params)
COREDLL void pbrtSampler (const string &name, const ParamSet &params)
COREDLL void pbrtAccelerator (const string &name, const ParamSet &params)
COREDLL void pbrtSurfaceIntegrator (const string &name, const ParamSet &params)
COREDLL void pbrtVolumeIntegrator (const string &name, const ParamSet &params)
COREDLL void pbrtCamera (const string &name, const ParamSet &params)
COREDLL void pbrtSearchPath (const string &path)
COREDLL void pbrtWorldBegin ()
COREDLL void pbrtAttributeBegin ()
COREDLL void pbrtAttributeEnd ()
COREDLL void pbrtTransformBegin ()
COREDLL void pbrtTransformEnd ()
COREDLL void pbrtTexture (const string &name, const string &type, const string &texname, const ParamSet &params)
COREDLL void pbrtMaterial (const string &name, const ParamSet &params)
COREDLL void pbrtLightSource (const string &name, const ParamSet &params)
COREDLL void pbrtAreaLightSource (const string &name, const ParamSet &params)
COREDLL void pbrtShape (const string &name, const ParamSet &params)
COREDLL void pbrtReverseOrientation ()
COREDLL void pbrtVolume (const string &name, const ParamSet &params)
COREDLL void pbrtObjectBegin (const string &name)
COREDLL void pbrtObjectEnd ()
COREDLL void pbrtObjectInstance (const string &name)
COREDLL void pbrtWorldEnd ()

Variables

static int currentApiState = STATE_UNINITIALIZED
static Transform curTransform
static map< string, TransformnamedCoordinateSystems
static RenderOptionsrenderOptions = NULL
static GraphicsState graphicsState
static vector< GraphicsStatepushedGraphicsStates
static vector< TransformpushedTransforms


Define Documentation

#define STATE_OPTIONS_BLOCK   1

Definition at line 110 of file api.cpp.

Referenced by pbrtInit(), and pbrtWorldEnd().

#define STATE_UNINITIALIZED   0

Definition at line 109 of file api.cpp.

Referenced by pbrtCleanup(), and pbrtInit().

#define STATE_WORLD_BLOCK   2

Definition at line 111 of file api.cpp.

Referenced by pbrtCleanup(), and pbrtWorldBegin().

#define VERIFY_INITIALIZED ( func   ) 

Value:

if (currentApiState == STATE_UNINITIALIZED) { \
        Error("pbrtInit() must be before calling \"%s()\". " \
                "Ignoring.", func); \
        return; \
} else

Definition at line 120 of file api.cpp.

Referenced by pbrtConcatTransform(), pbrtCoordinateSystem(), pbrtCoordSysTransform(), pbrtIdentity(), pbrtLookAt(), pbrtRotate(), pbrtScale(), pbrtTransform(), and pbrtTranslate().

#define VERIFY_OPTIONS ( func   ) 

Value:

VERIFY_INITIALIZED(func); \
if (currentApiState == STATE_WORLD_BLOCK) { \
        Error("Options cannot be set inside world block; " \
                "\"%s\" not allowed.  Ignoring.", func); \
        return; \
} else

Definition at line 126 of file api.cpp.

Referenced by pbrtAccelerator(), pbrtCamera(), pbrtFilm(), pbrtPixelFilter(), pbrtSampler(), pbrtSearchPath(), pbrtSurfaceIntegrator(), pbrtVolumeIntegrator(), and pbrtWorldBegin().

#define VERIFY_WORLD ( func   ) 

Value:

VERIFY_INITIALIZED(func); \
if (currentApiState == STATE_OPTIONS_BLOCK) { \
        Error("Scene description must be inside world block; " \
                "\"%s\" not allowed. Ignoring.", func); \
        return; \
} else

Definition at line 133 of file api.cpp.

Referenced by pbrtAreaLightSource(), pbrtAttributeBegin(), pbrtAttributeEnd(), pbrtLightSource(), pbrtMaterial(), pbrtObjectBegin(), pbrtObjectEnd(), pbrtObjectInstance(), pbrtReverseOrientation(), pbrtShape(), pbrtTexture(), pbrtTransformBegin(), pbrtTransformEnd(), pbrtVolume(), and pbrtWorldEnd().


Function Documentation

COREDLL void pbrtAccelerator ( const string &  name,
const ParamSet params 
)

COREDLL void pbrtAreaLightSource ( const string &  name,
const ParamSet params 
)

Definition at line 348 of file api.cpp.

References GraphicsState::areaLight, GraphicsState::areaLightParams, and VERIFY_WORLD.

COREDLL void pbrtAttributeBegin (  ) 

Definition at line 274 of file api.cpp.

References pushedGraphicsStates, pushedTransforms, and VERIFY_WORLD.

Referenced by pbrtObjectBegin().

COREDLL void pbrtAttributeEnd (  ) 

Definition at line 279 of file api.cpp.

References Error(), pushedGraphicsStates, pushedTransforms, and VERIFY_WORLD.

Referenced by pbrtObjectEnd().

COREDLL void pbrtCamera ( const string &  name,
const ParamSet params 
)

COREDLL void pbrtCleanup (  ) 

Definition at line 163 of file api.cpp.

References currentApiState, Error(), STATE_UNINITIALIZED, STATE_WORLD_BLOCK, and StatsCleanup().

Referenced by main().

COREDLL void pbrtConcatTransform ( float  tr[16]  ) 

Definition at line 191 of file api.cpp.

References VERIFY_INITIALIZED.

COREDLL void pbrtCoordinateSystem ( const string &  name  ) 

Definition at line 213 of file api.cpp.

References namedCoordinateSystems, and VERIFY_INITIALIZED.

COREDLL void pbrtCoordSysTransform ( const string &  name  ) 

Definition at line 217 of file api.cpp.

References namedCoordinateSystems, and VERIFY_INITIALIZED.

COREDLL void pbrtFilm ( const string &  type,
const ParamSet params 
)

Definition at line 229 of file api.cpp.

References RenderOptions::FilmName, RenderOptions::FilmParams, and VERIFY_OPTIONS.

COREDLL void pbrtIdentity (  ) 

Definition at line 174 of file api.cpp.

References VERIFY_INITIALIZED.

COREDLL void pbrtInit (  ) 

Definition at line 141 of file api.cpp.

References currentApiState, Error(), GraphicsState::GraphicsState(), STATE_OPTIONS_BLOCK, and STATE_UNINITIALIZED.

Referenced by main().

COREDLL void pbrtLightSource ( const string &  name,
const ParamSet params 
)

Definition at line 338 of file api.cpp.

References Error(), RenderOptions::lights, MakeLight(), and VERIFY_WORLD.

COREDLL void pbrtLookAt ( float  ex,
float  ey,
float  ez,
float  lx,
float  ly,
float  lz,
float  ux,
float  uy,
float  uz 
)

Definition at line 207 of file api.cpp.

References LookAt(), and VERIFY_INITIALIZED.

COREDLL void pbrtMaterial ( const string &  name,
const ParamSet params 
)

Definition at line 333 of file api.cpp.

References GraphicsState::material, GraphicsState::materialParams, and VERIFY_WORLD.

COREDLL void pbrtObjectBegin ( const string &  name  ) 

COREDLL void pbrtObjectEnd (  ) 

Definition at line 420 of file api.cpp.

References RenderOptions::currentInstance, Error(), pbrtAttributeEnd(), and VERIFY_WORLD.

COREDLL void pbrtObjectInstance ( const string &  name  ) 

COREDLL void pbrtPixelFilter ( const string &  name,
const ParamSet params 
)

Definition at line 223 of file api.cpp.

References RenderOptions::FilterName, RenderOptions::FilterParams, and VERIFY_OPTIONS.

COREDLL void pbrtReverseOrientation (  ) 

Definition at line 397 of file api.cpp.

References GraphicsState::reverseOrientation, and VERIFY_WORLD.

COREDLL void pbrtRotate ( float  angle,
float  dx,
float  dy,
float  dz 
)

Definition at line 199 of file api.cpp.

References Rotate(), and VERIFY_INITIALIZED.

COREDLL void pbrtSampler ( const string &  name,
const ParamSet params 
)

Definition at line 234 of file api.cpp.

References RenderOptions::SamplerName, RenderOptions::SamplerParams, and VERIFY_OPTIONS.

COREDLL void pbrtScale ( float  sx,
float  sy,
float  sz 
)

Definition at line 203 of file api.cpp.

References Scale(), and VERIFY_INITIALIZED.

COREDLL void pbrtSearchPath ( const string &  path  ) 

Definition at line 263 of file api.cpp.

References RenderOptions::gotSearchPath, UpdatePluginPath(), and VERIFY_OPTIONS.

COREDLL void pbrtShape ( const string &  name,
const ParamSet params 
)

COREDLL void pbrtSurfaceIntegrator ( const string &  name,
const ParamSet params 
)

COREDLL void pbrtTexture ( const string &  name,
const string &  type,
const string &  texname,
const ParamSet params 
)

COREDLL void pbrtTransform ( float  tr[16]  ) 

Definition at line 183 of file api.cpp.

References VERIFY_INITIALIZED.

COREDLL void pbrtTransformBegin (  ) 

Definition at line 291 of file api.cpp.

References pushedTransforms, and VERIFY_WORLD.

COREDLL void pbrtTransformEnd (  ) 

Definition at line 295 of file api.cpp.

References Error(), pushedTransforms, and VERIFY_WORLD.

COREDLL void pbrtTranslate ( float  dx,
float  dy,
float  dz 
)

Definition at line 178 of file api.cpp.

References Translate(), and VERIFY_INITIALIZED.

COREDLL void pbrtVolume ( const string &  name,
const ParamSet params 
)

Definition at line 402 of file api.cpp.

References MakeVolumeRegion(), VERIFY_WORLD, and RenderOptions::volumeRegions.

COREDLL void pbrtVolumeIntegrator ( const string &  name,
const ParamSet params 
)

COREDLL void pbrtWorldBegin (  ) 

Definition at line 268 of file api.cpp.

References currentApiState, namedCoordinateSystems, STATE_WORLD_BLOCK, and VERIFY_OPTIONS.

COREDLL void pbrtWorldEnd (  ) 


Variable Documentation

int currentApiState = STATE_UNINITIALIZED [static]

Definition at line 112 of file api.cpp.

Referenced by pbrtCleanup(), pbrtInit(), pbrtWorldBegin(), and pbrtWorldEnd().

Definition at line 113 of file api.cpp.

Definition at line 116 of file api.cpp.

map<string, Transform> namedCoordinateSystems [static]

Definition at line 117 of file api.cpp.

Referenced by pbrtAttributeBegin(), pbrtAttributeEnd(), and pbrtWorldEnd().

vector<Transform> pushedTransforms [static]

RenderOptions* renderOptions = NULL [static]

Definition at line 115 of file api.cpp.


Generated on Mon Jul 20 17:31:53 2009 for pbrt by  doxygen 1.5.6