#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 ¶ms) |
COREDLL void | pbrtFilm (const string &type, const ParamSet ¶ms) |
COREDLL void | pbrtSampler (const string &name, const ParamSet ¶ms) |
COREDLL void | pbrtAccelerator (const string &name, const ParamSet ¶ms) |
COREDLL void | pbrtSurfaceIntegrator (const string &name, const ParamSet ¶ms) |
COREDLL void | pbrtVolumeIntegrator (const string &name, const ParamSet ¶ms) |
COREDLL void | pbrtCamera (const string &name, const ParamSet ¶ms) |
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 ¶ms) |
COREDLL void | pbrtMaterial (const string &name, const ParamSet ¶ms) |
COREDLL void | pbrtLightSource (const string &name, const ParamSet ¶ms) |
COREDLL void | pbrtAreaLightSource (const string &name, const ParamSet ¶ms) |
COREDLL void | pbrtShape (const string &name, const ParamSet ¶ms) |
COREDLL void | pbrtReverseOrientation () |
COREDLL void | pbrtVolume (const string &name, const ParamSet ¶ms) |
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, Transform > | namedCoordinateSystems |
static RenderOptions * | renderOptions = NULL |
static GraphicsState | graphicsState |
static vector< GraphicsState > | pushedGraphicsStates |
static vector< Transform > | pushedTransforms |
#define STATE_OPTIONS_BLOCK 1 |
#define STATE_UNINITIALIZED 0 |
#define STATE_WORLD_BLOCK 2 |
#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().
COREDLL void pbrtAccelerator | ( | const string & | name, | |
const ParamSet & | params | |||
) |
Definition at line 239 of file api.cpp.
References RenderOptions::AcceleratorName, RenderOptions::AcceleratorParams, and VERIFY_OPTIONS.
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 | |||
) |
Definition at line 254 of file api.cpp.
References RenderOptions::CameraName, RenderOptions::CameraParams, Transform::GetInverse(), namedCoordinateSystems, VERIFY_OPTIONS, and RenderOptions::WorldToCamera.
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] | ) |
COREDLL void pbrtCoordinateSystem | ( | const string & | name | ) |
COREDLL void pbrtCoordSysTransform | ( | const string & | name | ) |
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 | ( | ) |
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 | |||
) |
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 | ) |
Definition at line 409 of file api.cpp.
References RenderOptions::currentInstance, Error(), RenderOptions::instances, pbrtAttributeBegin(), and VERIFY_WORLD.
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 | ) |
Definition at line 428 of file api.cpp.
References RenderOptions::AcceleratorName, RenderOptions::AcceleratorParams, RenderOptions::currentInstance, Error(), RenderOptions::instances, MakeAccelerator(), RenderOptions::primitives, Severe(), and VERIFY_WORLD.
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 | |||
) |
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 | |||
) |
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 | |||
) |
Definition at line 354 of file api.cpp.
References GraphicsState::areaLight, GraphicsState::areaLightParams, RenderOptions::currentInstance, GraphicsState::floatTextures, RenderOptions::lights, MakeAreaLight(), MakeMaterial(), MakeShape(), GraphicsState::material, GraphicsState::materialParams, RenderOptions::primitives, ParamSet::ReportUnused(), GraphicsState::reverseOrientation, Severe(), GraphicsState::spectrumTextures, VERIFY_WORLD, and Warning().
COREDLL void pbrtSurfaceIntegrator | ( | const string & | name, | |
const ParamSet & | params | |||
) |
Definition at line 244 of file api.cpp.
References RenderOptions::SurfIntegratorName, RenderOptions::SurfIntegratorParams, and VERIFY_OPTIONS.
COREDLL void pbrtTexture | ( | const string & | name, | |
const string & | type, | |||
const string & | texname, | |||
const ParamSet & | params | |||
) |
Definition at line 305 of file api.cpp.
References Error(), GraphicsState::floatTextures, MakeFloatTexture(), MakeSpectrumTexture(), GraphicsState::spectrumTextures, VERIFY_WORLD, and Warning().
COREDLL void pbrtTransform | ( | float | tr[16] | ) |
COREDLL void pbrtTransformBegin | ( | ) |
COREDLL void pbrtTransformEnd | ( | ) |
COREDLL void pbrtTranslate | ( | float | dx, | |
float | dy, | |||
float | dz | |||
) |
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 | |||
) |
Definition at line 249 of file api.cpp.
References VERIFY_OPTIONS, RenderOptions::VolIntegratorName, and RenderOptions::VolIntegratorParams.
COREDLL void pbrtWorldBegin | ( | ) |
Definition at line 268 of file api.cpp.
References currentApiState, namedCoordinateSystems, STATE_WORLD_BLOCK, and VERIFY_OPTIONS.
COREDLL void pbrtWorldEnd | ( | ) |
Definition at line 458 of file api.cpp.
References currentApiState, RenderOptions::gotSearchPath, RenderOptions::MakeScene(), namedCoordinateSystems, pushedGraphicsStates, pushedTransforms, Scene::Render(), Severe(), STATE_OPTIONS_BLOCK, StatsPrint(), VERIFY_WORLD, and Warning().
int currentApiState = STATE_UNINITIALIZED [static] |
Definition at line 112 of file api.cpp.
Referenced by pbrtCleanup(), pbrtInit(), pbrtWorldBegin(), and pbrtWorldEnd().
Transform curTransform [static] |
GraphicsState graphicsState [static] |
map<string, Transform> namedCoordinateSystems [static] |
Definition at line 114 of file api.cpp.
Referenced by pbrtCamera(), pbrtCoordinateSystem(), pbrtCoordSysTransform(), pbrtWorldBegin(), and pbrtWorldEnd().
vector<GraphicsState> pushedGraphicsStates [static] |
Definition at line 117 of file api.cpp.
Referenced by pbrtAttributeBegin(), pbrtAttributeEnd(), and pbrtWorldEnd().
vector<Transform> pushedTransforms [static] |
Definition at line 118 of file api.cpp.
Referenced by pbrtAttributeBegin(), pbrtAttributeEnd(), pbrtTransformBegin(), pbrtTransformEnd(), and pbrtWorldEnd().
RenderOptions* renderOptions = NULL [static] |