Cortex  10.0.0-a4
CapturingRenderer.h
1 //
3 // Copyright (c) 2010-2013, Image Engine Design Inc. All rights reserved.
4 //
5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are
7 // met:
8 //
9 // * Redistributions of source code must retain the above copyright
10 // notice, this list of conditions and the following disclaimer.
11 //
12 // * Redistributions in binary form must reproduce the above copyright
13 // notice, this list of conditions and the following disclaimer in the
14 // documentation and/or other materials provided with the distribution.
15 //
16 // * Neither the name of Image Engine Design nor the names of any
17 // other contributors to this software may be used to endorse or
18 // promote products derived from this software without specific prior
19 // written permission.
20 //
21 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
22 // IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
23 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
25 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
26 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
27 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
28 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
31 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 //
34 
35 #ifndef IECORE_CAPTURINGRENDERER_H
36 #define IECORE_CAPTURINGRENDERER_H
37 
38 #include "IECore/Export.h"
39 #include "IECore/Renderer.h"
40 
41 namespace IECore
42 {
43 
44 IE_CORE_FORWARDDECLARE( Primitive )
45 IE_CORE_FORWARDDECLARE( Group )
46 
53 class IECORE_API CapturingRenderer : public Renderer
54 {
55 
56  public :
57 
58  IE_CORE_DECLARERUNTIMETYPED( CapturingRenderer, Renderer );
59 
61  ~CapturingRenderer() override;
62 
76  void setOption( const std::string &name, ConstDataPtr value ) override;
77 
78  ConstDataPtr getOption( const std::string &name ) const override;
79 
80  void camera( const std::string &name, const CompoundDataMap &parameters ) override;
81  void display( const std::string &name, const std::string &type, const std::string &data, const CompoundDataMap &parameters ) override;
82 
83  void worldBegin() override;
84  void worldEnd() override;
85 
86  void transformBegin() override;
87  void transformEnd() override;
88  void setTransform( const Imath::M44f &m ) override;
89  void setTransform( const std::string &coordinateSystem ) override;
90  Imath::M44f getTransform() const override;
91  Imath::M44f getTransform( const std::string &coordinateSystem ) const override;
92  void concatTransform( const Imath::M44f &m ) override;
93  void coordinateSystem( const std::string &name ) override;
94 
95  void attributeBegin() override;
96  void attributeEnd() override;
103 
104  void setAttribute( const std::string &name, ConstDataPtr value ) override;
105  ConstDataPtr getAttribute( const std::string &name ) const override;
106  void shader( const std::string &type, const std::string &name, const CompoundDataMap &parameters ) override;
107  void light( const std::string &name, const std::string &handle, const CompoundDataMap &parameters ) override;
108  void illuminate( const std::string &lightHandle, bool on ) override;
109 
110  void motionBegin( const std::set<float> &times ) override;
111  void motionEnd() override;
112 
113  void points( size_t numPoints, const PrimitiveVariableMap &primVars ) override;
114  void disk( float radius, float z, float thetaMax, const PrimitiveVariableMap &primVars ) override;
115  void curves( const CubicBasisf &basis, bool periodic, ConstIntVectorDataPtr numVertices, const IECore::PrimitiveVariableMap &primVars ) override;
116  void text( const std::string &font, const std::string &text, float kerning = 1.0f, const PrimitiveVariableMap &primVars=PrimitiveVariableMap() ) override;
117  void sphere( float radius, float zMin, float zMax, float thetaMax, const PrimitiveVariableMap &primVars ) override;
118  void image( const Imath::Box2i &dataWindow, const Imath::Box2i &displayWindow, const PrimitiveVariableMap &primVars ) override;
119  void mesh( ConstIntVectorDataPtr vertsPerFace, ConstIntVectorDataPtr vertIds, const std::string &interpolation, const PrimitiveVariableMap &primVars ) override;
120  void nurbs( int uOrder, ConstFloatVectorDataPtr uKnot, float uMin, float uMax, int vOrder, ConstFloatVectorDataPtr vKnot, float vMin, float vMax, const PrimitiveVariableMap &primVars ) override;
121  void patchMesh( const CubicBasisf &uBasis, const CubicBasisf &vBasis, int nu, bool uPeriodic, int nv, bool vPeriodic, const PrimitiveVariableMap &primVars ) override;
122  void geometry( const std::string &type, const CompoundDataMap &topology, const PrimitiveVariableMap &primVars ) override;
123 
124  void procedural( ProceduralPtr proc ) override;
125 
126  void instanceBegin( const std::string &name, const CompoundDataMap &parameters ) override;
127  void instanceEnd() override;
128  void instance( const std::string &name ) override;
129 
130  DataPtr command( const std::string &name, const CompoundDataMap &parameters ) override;
131 
132  void editBegin( const std::string &editType, const CompoundDataMap &parameters ) override;
133  void editEnd() override;
134 
138  ConstGroupPtr world();
139 
140  private :
141 
142  class Implementation;
143 
144  boost::shared_ptr<Implementation> m_implementation;
145 
146 };
147 
148 IE_CORE_DECLAREPTR( CapturingRenderer )
149 
150 } // namespace IECore
151 
152 #endif // IECORE_CAPTURINGRENDERER_H
Definition: CapturingRenderer.h:53
Definition: Renderer.h:93
std::map< InternedString, DataPtr > CompoundDataMap
The type of Data held by the CompoundData typedef.
Definition: CompoundDataBase.h:46
This namespace contains all components of the core library.
Definition: AddSmoothSkinningInfluencesOp.h:43
std::map< std::string, PrimitiveVariable > PrimitiveVariableMap
A simple type to hold named PrimitiveVariables.
Definition: PrimitiveVariable.h:107