% Program listings need to be typeset
\usepackage{color}
\usepackage[final]{listings}

\definecolor{vtkmidentifier}{rgb}{0,0,1}
\definecolor{vtkmnamespace}{rgb}{0.5,0,0}
\definecolor{vtkmmacro}{rgb}{0.5,0,0}
\definecolor{vtkmsignature}{rgb}{0,0.5,0}
\definecolor{codebackground}{rgb}{0.95,0.95,0.95}

\lstloadlanguages{C,C++}
%% \lstset{fontadjust=false,basicstyle=\scriptsize\ttfamily}
\lstset{fontadjust=false,basicstyle=\footnotesize\ttfamily,
        xleftmargin=3em, xrightmargin=3em,
        numbers=left, numberstyle=\footnotesize, numbersep=1em,
        belowcaptionskip=0pt,  %Prevents caption from being on different page.
        frame=l, backgroundcolor=\color{codebackground}}
\lstdefinelanguage{VTKm}{
  morekeywords={struct,class,public,typedef,using,typename,void,template,return,operator,const,for,int,float,double},
  morekeywords={[2]Id,Id2,Id3,IdComponent,Vec,
                   Int8,Int16,Int32,Int64,UInt8,UInt16,UInt32,UInt64,
                   Float32,Float64,FloatDefault,
                   make_Id3,make_Vec,
                   dot,NUM_COMPONENTS,
                   VecC,VecCConst,make_VecC,
                   VecFromPortal,VecFromPortalPermute,
                   VecRectilinearPointCoordinates,
                   VecVariable,
                   Extent,Extent3,Pair,
                   Range,Bounds,
                   ExtentPointDimensions,ExtentCellDimensions,
                   ExtentNumberOfPoints,ExtentNumberOfCells,
                   ExtentPointFlatIndexToTopologyIndex,
                   ExtentCellFlatIndexToTopologyIndex,
                   ExtentPointTopologyIndexToFlatIndex,
                   ExtentCellTopologyIndexToFlatIndex,
                   ExtentFirstPointOnCell,
                   ListTagEmpty,
                   ListTagBase,
                   ListTagJoin,
                   ListForEach,
                   TypeListTagId,TypeListTagId2,TypeListTagId3,
                   TypeListTagIndex,
                   TypeListTagFieldScalar,TypeListTagScalarAll,
                   TypeListTagFieldVec2,
                   TypeListTagFieldVec3,
                   TypeListTagFieldVec4,
                   TypeListTagField,
                   TypeListTagVecCommon,TypeListTagVecAll,
                   TypeListTagAll,TypeListTagCommon,
                   IsZeroInitialized,NotZeroInitialized,LogicalNot,
                   Equal,NotEqual,SortLess,SortGreater,LogicalAnd,LogicalOr,
                   Sum,Product,Maximum,Minimum,MinAndMax,
                   BitwiseAnd,BitwiseOr,BitwiseXor,
                   WorkletBase,
                   WorkletMapField,
                   WorkletMapTopology,
                   WorkletMapPointToCell,
                   WorkletMapCellToPoint,
                   WorkletReduceByKey,
                   DispatcherMapField,
                   DispatcherMapTopology,
                   DispatcherReduceByKey,
                   ScatterIdentity,
                   ScatterUniform,
                   ScatterCounting,
                   Keys,
                   ExecutionObjectBase,
                   AverageByKey,
                   TypeTraits,NumericTag,DimensionalityTag,
                   TypeTraitsRealTag,TypeTraitsIntegerTag,
                   TypeTraitsScalarTag,TypeTraitsVectorTag,
                   VecTraits,ComponentType,HasMultipleComponents,
                   IsSizeStatic,VecTraitsTagSizeStatic,VecTraitsTagSizeVariable,
                   VecTraitsTagMultipleComponents,
                   VecTraitsTagSingleComponent,
                   Error,ErrorExecution,
                   ErrorBadAllocation,
                   ErrorBadType,
                   ErrorBadValue,
                   ErrorInternal,
                   DeviceAdapterTagSerial,
                   DeviceAdapterTagCuda,
                   DeviceAdapterTagOpenMP,
                   DeviceAdapterTagTBB,
                   DeviceAdapterTraits,
                   DeviceAdapterId,
                   DeviceAdapterNameType,
                   RuntimeDeviceTracker,GetGlobalRuntimeDeviceTracker,
                   TryExecute,
                   CellDataToPointDataGenerateKeys,
                   CellDataToPointDataReduceKeys,
                   CellGradient,
                   Cosine,Sine,Magnitude,Square,
                   Elevation,
                   MarchingCubesClassify,MarchingCubesGenerate,
                   PointDataToCellData,
                   SliceClassify,SliceGenerate,
                   Streamline,
                   Tetrahedralize,
                   ThresholdClassify,ThresholdTopology,
                   ArrayHandle,make_ArrayHandle,
                   ArrayHandleCast,make_ArrayHandleCast,
                   ArrayHandleCompositeVector,make_ArrayHandleCompositeVector,
                   ArrayHandleCompositeVectorType,
                   ArrayHandleConstant,make_ArrayHandleConstant,
                   ArrayHandleCounting,make_ArrayHandleCounting,
                   ArrayHandleDiscard,
                   ArrayHandleExtractComponent,make_ArrayHandleExtractComponent,
                   ArrayHandleGroupVec,make_ArrayHandleGroupVec,
                   ArrayHandleGroupVecVariable,make_ArrayHandleGroupVecVariable,
                   ConvertNumComponentsToOffsets,
                   ArrayHandleImplicit,make_ArrayHandleImplicit,
                   ArrayHandleIndex,
                   ArrayHandleTransform,make_ArrayHandleTransform,
                   ArrayHandleSwizzle,make_ArrayHandleSwizzle,
                   ArrayHandlePermutation,make_ArrayHandlePermutation,
                   ArrayHandleZip,make_ArrayHandleZip,
                   ArrayHandleUniformPointCoordinates,
                   ArrayHandleCartesianProduct,make_ArrayHandleCartesianProduct,
                   ArrayPortalToIterators,
                   ArrayPortalToIteratorBegin,ArrayPortalToIteratorEnd,
                   ArrayCopy,
                   ArrayRangeCompute,
                   Storage,
                   StorageTagBasic,
                   StorageTagImplicit,
                   ArrayContainerControl,
                   ArrayContainerControlTagBasic,
                   ArrayContainerControlTagImplicit,
                   ArrayTransfer,
                   ArrayManagerExecution,
                   ArrayManagerExecutionShareWithControl,
                   ExecutionPortalFactoryBasic,
                   ExecutionPortalFactoryBasicShareWithControl,
                   ExecutionArrayInterfaceBasic,
                   ExecutionArrayInterfaceBasicBase,
                   ExecutionArrayInterfaceBasicShareWithControl,
                   StorageBasicBase,
                   TypelessExecutionArray,
                   VirtualObjectTransfer,
                   VirtualObjectTransferShareWithControl,
                   DynamicArrayHandle,DynamicArrayHandleBase,
                   DynamicPointCoordinates,
                   PointCoordinatesArray,PointCoordinatesUniform,
                   PointCoordinatesBase,
                   PointCoordinatesListTagCommon,
                   DataSet,
                   CellSet,
                   CellSetExplicit,
                   CellSetPermutation,
                   CellSetSingleType,
                   CellSetStructured,
                   DynamicCellSet,
                   Field,
                   CoordinateSystem,
                   DataSetBuilderExplicit,DataSetBuilderExplicitIterative,
                   DataSetBuilderRectilinear,
                   DataSetBuilderUniform,
                   DataSetFieldAdd,
                   FilterCell,
                   FilterDataSet,
                   FilterDataSetWithField,
                   FilterField,
                   FieldMetadata,
                   FilterTraits,
                   Result,
                   PolicyBase,
                   PolicyDefault,
                   ApplyPolicy,
                   CellAverage,
                   PointAverage,
                   ExternalFaces,
                   MarchingCubes,
                   PointElevation,
                   CleanGrid,
                   Threshold,
                   VertexClustering,
                   Actor,
                   AxisAnnotation, AxisAnnotation2D, AxisAnnotation3D,
                   BitmapFont, BitmapFontFactory,
                   BoundingBoxAnnotation,
                   Camera,
                   Canvas,
                   CanvasGL,
                   CanvasOSMesa,
                   CanvasRayTracer,
                   Color,
                   ColorBarAnnotation,
                   ColorTable,
                   MatrixHelpers,
                   Scene,
                   Mapper,
                   MapperGL,
                   MapperRayTracer,
                   MapperVolume,
                   TextAnnotation,
                   Triangulator,
                   View,View1D,View2D,View3D,
                   WorldAnnotator, WorldAnnotatorGL,
                   DeviceAdapterAlgorithm, DeviceAdapterAlgorithmGeneral,
                   DeviceAdapterTimerImplementation,
                   IteratorFromArrayPortal,
                   TypeCheck,TypeCheckTagArray,TypeCheckTagExecObject,
                   TypeCheckTagAtomicArray,
                   TypeCheckTagCellSet,TypeCheckTagKeys,
                   Transport,
                   TransportTagArrayIn,TransportTagArrayOut,
                   TransportTagArrayInOut,
                   TransportTagExecObject,
                   TransportTagWholeArrayIn,TransportTagWholeArrayOut,
                   TransportTagWholeArrayInOut,
                   TransportTagAtomicArray,
                   TransportTagCellSetIn,TransportTagTopologyFieldIn,
                   TransportTagKeysIn,
                   TransportTagKeyedValuesIn,TransportTagKeyedValuesOut,
                   TransportTagKeyedValuesInOut,
                   TransportTagReducedValuesIn,
                   Fetch,
                   FetchTagArrayDirectIn,FetchTagArrayDirectOut,
                   FetchTagExecObject,
                   FetchtagCellSetIn,FetchTagArrayTopologyMapIn,
                   AspectTagDefault,
                   AspectTagWorkIndex,AspectTagOutputIndex,
                   AspectTagVisitIndex,
                   AspectTagCellShape,
                   AspectTagFromCount,AspectTagFromIndices,
                   AspectTagValueCount,
                   ControlSignatureTagBase,ExecutionSignatureTagBase,
                   Invocation,
                   FunctionInterface,make_FunctionInterface,
                   FunctionInterfaceReturnContainer,
                   DynamicTransform,
                   CellField, CellVertices,
                   InterpolatedCellPoints,
                   CellTraits,NUM_VERTICES,
                   CellTagHexahedron, CellTagLine, CellTagQuadrilateral,
                   CellTagTetrahedron, CellTagTriangle, CellTagVectex,
                   CellTagVoxel, CellTagWedge,
                   CellTraits,
                   CellTopologicalDimensionsTag,
                   GridTagUniform, GridTagUnstructured,
                   NUM_VERTICES, TOPOLOGICAL_DIMENSIONS,
                   ParametricCoordinates, CellDerivative,
                   SortLess, SortGreater,
                   Max, Min,
                   Cbrt, Exp, Exp10, Exp2, ExpM1, Log, Log10, Log1P, Log2,
                   Pow, RCbrt, RSqrt, Sqrt,
                   Matrix, Matrix2x2, Matrix3x3, Matrix4x4,
                   MatrixColumn, MatrixDeterminant, MatrixIdentity,
                   MatrixInverse, MatrixMultiply, MatrixRow,
                   MatrixSetColumn, MatrixSetRow, MatrixTranspose,
                   SolveLinearSystem,
                   NewtonsMethod,NewtonsMethodResult,
                   Ceil, Epsilon, Floor, FMod, Infinity, IsFinite, IsInf,
                   IsNan, ModF, Nan, NegativeInfinity, Remainder,
                   RemainderQuotient, Round,
                   Abs, CopySign, IsNegative, SignBit,
                   ACos, ACosH, ASin, ASinH, ATan, ATan2, ATanH, Cos, CosH,
                   Pi, Sin, SinH, Tan, TanH,
                   Cross, Magnitude, MagnitudeSquared, Lerp, Normal,
                   Normalize, RMagnitude, TriangleNormal,
                   CellShapeTagEmpty,
                   CellShapeTagVertex,
                   CellShapeTagLine,
                   CellShapeTagTriangle,
                   CellShapeTagPolygon,
                   CellShapeTagQuad,
                   CellShapeTagTetra,
                   CellShapeTagHexahedron,
                   CellShapeTagWedge,
                   CellShapeTagPyramid,
                   CellShapeTagGeneric,
                   CellShapeIdToTag,
                   CELL_SHAPE_EMPTY,
                   CELL_SHAPE_VERTEX,
                   CELL_SHAPE_LINE,
                   CELL_SHAPE_TRIANGLE,
                   CELL_SHAPE_POLYGON,
                   CELL_SHAPE_QUAD,
                   CELL_SHAPE_TETRA,
                   CELL_SHAPE_HEXAHEDRON,
                   CELL_SHAPE_WEDGE,
                   CELL_SHAPE_PYRAMID,
                   CellTraits,
                   CellTopologicalDimensionsTag,
                   CellTraitsTagSizeFixed,
                   CellTraitsTagSizeVariable,
                   ParametricCoordinatesToWorldCoordinates,
                   WorldCoordinatesToParametricCoordinates,
                   ParametricCoordinatesCenter,
                   ParametricCoordinatesPoint,
                   CellInterpolate,
                   CellDerivative,
                   CellEdgeNumberOfEdges,CellEdgeLocalIndices,
                   CellEdgeCanonicalId,
                   CellFaceNumberOfFaces,CellFaceNumberOfPoints,
                   CellFaceLocalIndices,CellFaceCanonicalId,
                   Hash,HashType,
                   TransferToOpenGL,
                   TopologyElementTagCell,
                   TopologyElementTagPoint,
                   TopologyElementTagEdge,
                   TopologyElementTagFace,
                   VTKDataSetReader,VTKDataSetWriter
                   },
  morekeywords={[3]VTKM_CONT,VTKM_EXEC,VTKM_EXEC_CONT,
                   VTKM_EXEC_CONSTANT,
                   VTKM_SUPPRESS_EXEC_WARNINGS,
                   VTKM_DEVICE_ADAPTER,
                   VTKM_DEVICE_ADAPTER_SERIAL,
                   VTKM_DEVICE_ADAPTER_CUDA,
                   VTKM_DEVICE_ADAPTER_OPENMP,
                   VTKM_DEVICE_ADAPTER_TBB,
                   VTKM_DEVICE_ADAPTER_ERROR,
                   VTKM_DEFAULT_DEVICE_ADAPTER_TAG,
                   VTKM_STORAGE,
                   VTKM_STORAGE_BASIC,
                   VTKM_STORAGE_ERROR,
                   VTKM_STORAGE_UNDEFINED,
                   VTKM_DEFAULT_STORAGE_TAG,
                   VTKM_ARRAY_HANDLE_SUBCLASS,VTKM_ARRAY_HANDLE_SUBCLASS_NT,
                   VTKM_ASSERT,VTKM_STATIC_ASSERT,
                   VTKM_DEFAULT_TYPE_LIST_TAG,
                   VTKM_DEFAULT_CONTAINER_LIST_TAG,
                   VTKM_DEFAULT_POINT_COORDINATES_LIST_TAG,
                   VTKM_VALID_DEVICE_ADAPTER,
                   VTKM_INVALID_DEVICE_ADAPTER,
                   VTKM_IS_DEVICE_ADAPTER_TAG,
                   VTKM_IS_ARRAY_HANDLE,
                   vtkmGenericCellShapeMacro
                   },
  morekeywords={[4]vtkm,exec,cont,worklet,math,arg,internal,detail,
                   io,reader,writer,
                   filter,
                   rendering,
                   cuda,openmp,tbb},
  morekeywords={[5]ControlSignature,ExecutionSignature,
                   InputDomain,
                   ScatterType,
                   FieldIn,FieldOut,FieldInOut,
                   FieldInTo,FieldInFrom,
                   FieldInPoint,FieldInCell,FieldOutCell,FieldInOutCell,
                   CellSetIn,
                   KeysIn,
                   ValuesIn,ValuesInOut,ValuesOut,
                   ReducedValuesIn,ReducedValuesInOut,ReducedValuesOut,
                   WholeArrayIn,WholeArrayOut,WholeArrayInOut,
                   AtomicArrayInOut,
                   WholeCellSetIn,
                   ExecObject,
                   WorkIndex,VisitIndex,InputIndex,OutputIndex,ThreadIndices,
                   ThreadIndices,
                   CellShape,
                   FromCount,PointCount,CellCount,
                   FromIndices,PointIndices,CellIndices,
                   IdType,Id2Type,Id3Type,IdComponentType,Index,
                   Scalar,ScalarAll,
                   Vec2,Vec3,Vec4,VecAll,
                   FieldCommon,VecCommon,
                   CommonTypes,AllTypes,
                   _1,_2,_3,_4,_5,_6,_7,_8,_9
                   }
}
\lstset{language=VTKm}
\lstset{
  keywordstyle=\bfseries,
  keywordstyle=[2]\color{vtkmidentifier},
  keywordstyle=[3]\color{vtkmmacro},
  keywordstyle=[4]\color{vtkmnamespace},
  keywordstyle=[5]\color{vtkmsignature}
}

\renewcommand{\lstlistlistingname}{List of Examples}
\renewcommand{\lstlistingname}{Example}

\newcommand*{\textcode}[1]{\textnormal{\texttt{#1}}}
\newcommand*{\textnamespace}[1]{\textcode{\color{vtkmnamespace}{#1}}}
\newcommand*{\textmacro}[1]{\textcode{\color{vtkmmacro}{#1}}}
\newcommand*{\textidentifier}[1]{\textcode{\color{vtkmidentifier}{#1}}}
\newcommand*{\textsignature}[1]{\textcode{\color{vtkmsignature}{#1}}}

\newcommand*{\vtkmmacro}[1]{\textmacro{#1}\index{#1}}

\newcommand{\vtkmcontmodifier}{\vtkmmacro{VTKM\_CONT}\index{modifier!control}\index{function modifier}\index{method modifier}\xspace}
\newcommand{\vtkmexecmodifier}{\vtkmmacro{VTKM\_EXEC}\index{modifier!execution}\index{function modifier}\index{method modifier}\xspace}
\newcommand{\vtkmexeccontmodifier}{\vtkmmacro{VTKM\_EXEC\_CONT}\index{modifier!control}\index{modifier!execution}\index{function modifier}\index{method modifier}\xspace}

\newcommand{\controlsignature}{\textsignature{ControlSignature}\index{control signature}\index{signature!control}\xspace}
\newcommand{\executionsignature}{\textsignature{ExecutionSignature}\index{execution signature}\index{signature!execution}\xspace}
\newcommand{\inputdomain}{\textsignature{InputDomain}\index{input domain}\xspace}
\newcommand{\scattertype}{\textsignature{ScatterType}\index{scatter type}\xspace}

\newcommand*{\sigtag}[1]{\textsignature{#1}\index{#1}\index{signature tags!#1}}
\newcommand*{\sigtagnum}[1]{\sigtag{\_#1}}
\newcommand*{\sigtagmod}[2]{\sigtag{#1}\textcode{<}\sigtag{#2}\textcode{>}}
\newcommand*{\sigtagmodnum}[2]{\sigtag{#1}\textcode{<}\sigtagnum{#2}\textcode{>}}

\newcommand*{\writenamespaceone}[1]{%
  \textnamespace{#1}}
\newcommand*{\writenamespacetwo}[2]{%
  \writenamespaceone{#1}\textcode{:\colonhyp}\textnamespace{#2}}
\newcommand*{\writenamespacethree}[3]{%
  \writenamespacetwo{#1}{#2}\textcode{:\colonhyp}\textnamespace{#3}}
\newcommand*{\writenamespacefour}[4]{%
  \writenamespacethree{#1}{#2}{#3}\textcode{:\colonhyp}\textnamespace{#4}}

\newcommand*{\indexnamespaceone}[1]{%
  \index{#1 namespace}\index{namespace!#1}}
\newcommand*{\indexnamespacetwo}[2]{%
  \index{#2 namespace}\index{#1::#2}\index{namespace!#1::#2}}
\newcommand*{\indexnamespacethree}[3]{%
  \index{#3 namespace}\index{#1::#2::#3}\index{namespace!#1::#2::#3}}
\newcommand*{\indexnamespacefour}[4]{%
  \index{#4 namespace}\index{#1::#2::#3::#4}\index{namespace!#1::#2::#3::#4}}

\newcommand*{\writeindexidentifierone}[2]{%
  \writenamespaceone{#1}\textcode{:\colonhyp}\textidentifier{#2}%
  \index{#2}}
\newcommand*{\writeindexidentifiertwo}[3]{%
  \writenamespacetwo{#1}{#2}\textcode{:\colonhyp}\textidentifier{#3}%
  \index{#3}}
\newcommand*{\writeindexidentifierthree}[4]{%
  \writenamespacethree{#1}{#2}{#3}\textcode{:\colonhyp}\textidentifier{#4}%
  \index{#4}}
\newcommand*{\writeindexidentifierfour}[5]{%
  \writenamespacefour{#1}{#2}{#3}{#4}\textcode{:\colonhyp}\textidentifier{#5}%
  \index{#5}}

\newcommand*{\vtkm}[1]{%
  \ifthenelse{\equal{#1}{}}%
             {\writenamespaceone{vtkm}\indexnamespaceone{vtkm}}%
             {\writeindexidentifierone{vtkm}{#1}}}
\newcommand*{\vtkminternal}[1]{%
  \ifthenelse{\equal{#1}{}}%
             {\writenamespacetwo{vtkm}{internal}\indexnamespacetwo{vtkm}{internal}}%
             {\writeindexidentifiertwo{vtkm}{internal}{#1}}}
\newcommand*{\vtkmcont}[1]{%
  \ifthenelse{\equal{#1}{}}%
             {\writenamespacetwo{vtkm}{cont}\indexnamespacetwo{vtkm}{cont}}%
             {\writeindexidentifiertwo{vtkm}{cont}{#1}}}
\newcommand*{\vtkmcontinternal}[1]{%
  \ifthenelse{\equal{#1}{}}%
             {\writenamespacethree{vtkm}{cont}{internal}\indexnamespacethree{vtkm}{cont}{internal}}%
             {\writeindexidentifierthree{vtkm}{cont}{internal}{#1}}}
\newcommand*{\vtkmcontarg}[1]{%
  \ifthenelse{\equal{#1}{}}%
             {\writenamespacethree{vtkm}{cont}{arg}\indexnamespacethree{vtkm}{cont}{arg}}%
             {\writeindexidentifierthree{vtkm}{cont}{arg}{#1}}}
\newcommand*{\vtkmexec}[1]{%
  \ifthenelse{\equal{#1}{}}%
             {\writenamespacetwo{vtkm}{exec}\indexnamespacetwo{vtkm}{exec}}%
             {\writeindexidentifiertwo{vtkm}{exec}{#1}}}
\newcommand*{\vtkmexecarg}[1]{%
  \ifthenelse{\equal{#1}{}}%
             {\writenamespacethree{vtkm}{exec}{arg}\indexnamespacethree{vtkm}{exec}{arg}}%
             {\writeindexidentifierthree{vtkm}{exec}{arg}{#1}}}
\newcommand*{\vtkmexecinternal}[1]{%
  \ifthenelse{\equal{#1}{}}%
             {\writenamespacethree{vtkm}{exec}{internal}\indexnamespacethree{vtkm}{exec}{internal}}%
             {\writeindexidentifierthree{vtkm}{exec}{internal}{#1}}}
\newcommand*{\vtkmworklet}[1]{%
  \ifthenelse{\equal{#1}{}}%
             {\writenamespacetwo{vtkm}{worklet}\indexnamespacetwo{vtkm}{worklet}}%
             {\writeindexidentifiertwo{vtkm}{worklet}{#1}}}
\newcommand*{\vtkmworkletinternal}[1]{%
  \ifthenelse{\equal{#1}{}}%
             {\writenamespacethree{vtkm}{worklet}{internal}\indexnamespacetwo{vtkm}{worklet}{internal}}%
             {\writeindexidentifierthree{vtkm}{worklet}{internal}{#1}}}
\newcommand*{\vtkmio}[1]{%
  \ifthenelse{\equal{#1}{}}%
             {\writenamespacetwo{vtkm}{io}\indexnamespacetwo{vtkm}{io}}%
             {\writeindexidentifiertwo{vtkm}{io}{#1}}}
\newcommand*{\vtkmioreader}[1]{%
  \ifthenelse{\equal{#1}{}}%
             {\writenamespacethree{vtkm}{io}{reader}\indexnamespacethree{vtkm}{io}{reader}}%
             {\writeindexidentifierthree{vtkm}{io}{reader}{#1}}}
\newcommand*{\vtkmiowriter}[1]{%
  \ifthenelse{\equal{#1}{}}%
             {\writenamespacethree{vtkm}{io}{writer}\indexnamespacethree{vtkm}{io}{writer}}%
             {\writeindexidentifierthree{vtkm}{io}{writer}{#1}}}

\newcommand*{\vtkmfilter}[1]{%
  \ifthenelse{\equal{#1}{}}%
             {\writenamespacetwo{vtkm}{filter}\indexnamespacetwo{vtkm}{filter}}%
             {\writeindexidentifiertwo{vtkm}{filter}{#1}}}

\newcommand*{\vtkmrendering}[1]{%
  \ifthenelse{\equal{#1}{}}%
             {\writenamespacetwo{vtkm}{rendering}\indexnamespacetwo{vtkm}{rendering}}%
             {\writeindexidentifiertwo{vtkm}{rendering}{#1}}}

\newcommand*{\vtkmopengl}[1]{%
  \ifthenelse{\equal{#1}{}}%
             {\writenamespacetwo{vtkm}{opengl}\indexnamespacetwo{vtkm}{opengl}}%
             {\writeindexidentifiertwo{vtkm}{opengl}{#1}}}


\newcommand*{\vtkmcontcuda}[1]{%
  \ifthenelse{\equal{#1}{}}%
             {\writenamespacethree{vtkm}{cont}{cuda}\indexnamespacethree{vtkm}{cont}{cuda}}%
             {\writeindexidentifierthree{vtkm}{cont}{cuda}{#1}}}
\newcommand*{\vtkmcontopenmp}[1]{%
  \ifthenelse{\equal{#1}{}}%
             {\writenamespacethree{vtkm}{cont}{openmp}\indexnamespacethree{vtkm}{cont}{openmp}}%
             {\writeindexidentifierthree{vtkm}{cont}{openmp}{#1}}}
\newcommand*{\vtkmcontserial}[1]{%
  \ifthenelse{\equal{#1}{}}%
             {\writenamespacethree{vtkm}{cont}{serial}\indexnamespacethree{vtkm}{cont}{serial}}%
             {\writeindexidentifierthree{vtkm}{cont}{serial}{#1}}}
\newcommand*{\vtkmconttbb}[1]{%
  \ifthenelse{\equal{#1}{}}%
             {\writenamespacethree{vtkm}{cont}{tbb}\indexnamespacethree{vtkm}{cont}{tbb}}%
             {\writeindexidentifierthree{vtkm}{cont}{tbb}{#1}}}
\newcommand*{\tparams}[1]{\textcode{<#1>}}

\newcommand*{\textfilename}[1]{\textsf{#1}}
\newcommand*{\vtkmheader}[2]{%
  \textfilename{#1\fshyp{}#2}\index{#1\fshyp#2}\index{#2}}

\newcommand*{\cmakevar}[1]{%
  \textsf{#1}%
  \index{#1}%
  \index{CMake!configuration!#1}}

\lstnewenvironment{vtkmexample}[2][-*-]{
  \lstset{caption={#2}}
  \ifthenelse{\equal{#1}{-*-}}{}{\lstset{label=#1}}
}{
}

\newcommand*{\vtkmlisting}[3][]{
  \lstinputlisting[language=VTKm, label=#1, caption={#2}]{examples/listing_#3}
}

% This is an ``odd'' identifier that comes up a lot.
\newcommand*{\Veclike}{\textidentifier{Vec}-like\xspace}

% Used for source code, shell, CMake, or other examples that are not worth
% creating a ``language'' for.
\lstnewenvironment{blankexample}[2][-*-]{
  \lstset{language={}}
  \lstset{caption={#2}}
  \ifthenelse{\equal{#1}{-*-}}{}{\lstset{label=#1}}
}{
}
