replaced some tabs, added copyable spaces to lstlistings

metadata
Wenzel Jakob 2014-02-06 15:11:30 +01:00
parent ba2a6dcaf7
commit 093050f755
17 changed files with 591 additions and 555 deletions

View File

@ -85,6 +85,10 @@
\definecolor{remark}{rgb}{1.0, 0.9, 0.9} \definecolor{remark}{rgb}{1.0, 0.9, 0.9}
\definecolor{remarkframe}{rgb}{1.0, 0.7, 0.7} \definecolor{remarkframe}{rgb}{1.0, 0.7, 0.7}
% requires the latest version of package accsupp
\usepackage[space=true]{accsupp}
\newcommand{\copyablespace}{\BeginAccSupp{method=hex,unicode,ActualText=00A0}\ \EndAccSupp{}}
% Listings settings % Listings settings
\lstset{ \lstset{
basicstyle = \small\ttfamily\raggedright, basicstyle = \small\ttfamily\raggedright,
@ -95,7 +99,7 @@
backgroundcolor = \color{lstshade}, backgroundcolor = \color{lstshade},
rulecolor = \color{lstframe}, rulecolor = \color{lstframe},
tabsize = 4, tabsize = 4,
columns = flexible, columns = fullflexible,
keepspaces, keepspaces,
belowskip = \smallskipamount, belowskip = \smallskipamount,
framerule = .7pt, framerule = .7pt,
@ -103,7 +107,10 @@
showstringspaces = false, showstringspaces = false,
keywordstyle = \bfseries, keywordstyle = \bfseries,
captionpos = b, captionpos = b,
upquote = true upquote = true,
literate={*}{{\char42}}1
{-}{{\char45}}1
{\ }{{\copyablespace}}1
} }
\lstdefinelanguage{xml} { \lstdefinelanguage{xml} {

View File

@ -810,3 +810,32 @@ Suppose that \code{bitmap} contains a \code{mitsuba.core.Bitmap} instance (e.g.
import numpy as np import numpy as np
array = np.array(bitmap.getNativeBuffer()) array = np.array(bitmap.getNativeBuffer())
\end{python} \end{python}
\subsubsection{Simultaneously rendering multiple versions of a scene}
\begin{python}
for i in range(2):
destination = 'renderedResult' + str(i)
# Create a shallow copy of the scene so that the queue can tell apart the two
# rendering processes. This takes almost no extra memory
newScene = Scene(scene)
newSensor = PluginManager.getInstance().createObject(scene.getSensor().getProperties())
newFilm = PluginManager.getInstance().createObject(scene.getFilm().getProperties())
newFilm.configure()
newSensor.addChild(newFilm)
newSensor.configure()
newScene.addSensor(newSensor)
newScene.setSensor(newSensor)
newScene.setSampler(scene.getSampler())
newScene.setDestinationFile(destination)
# Create a render job and insert it into the queue
job = RenderJob('myRenderJob' + str(i), newScene, queue, sceneResID)
job.start()
# Wait for all jobs to finish and release resources
# It works when this is moved in the loop when only one job at a time is started
queue.waitLeft(0)
queue.join()
\end{python}