Cortex  10.0.0-a4
Public Member Functions | List of all members
IECore::WorldBlock Class Reference

A context object intended for use with python's "with" syntax. More...

#include <WorldBlock.h>

Inherits noncopyable.

Public Member Functions

 WorldBlock (RendererPtr renderer, bool active=true)
 
 ~WorldBlock ()
 
def __init__ (self, renderer)
 
def __enter__ (self)
 
def __exit__ (self, type, value, traceBack)
 

Detailed Description

A context object intended for use with python's "with" syntax.

The WorldBlock class provides a simple means of ensuring that renderer->worldBegin() calls are matched by renderer->worldEnd() calls, even in the face of exceptions and multiple return statements from a function.

It calls renderer.worldBegin() in enter and renderer.worldEnd() in exit.

Constructor & Destructor Documentation

IECore::WorldBlock::WorldBlock ( RendererPtr  renderer,
bool  active = true 
)

Starts a new world block, calling renderer->worldBegin(). If active is false then nothing is done.

IECore::WorldBlock::~WorldBlock ( )

Closes the world block by calling renderer->worldEnd(). If active was false in the constructor then nothing is done.


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