Cortex  10.0.0-a4
Renderer.h
1 //
3 // Copyright (c) 2007-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 IECORERI_RENDERER_H
36 #define IECORERI_RENDERER_H
37 
38 #include "IECoreRI/Export.h"
39 #include "IECoreRI/TypeIds.h"
40 
41 #include "IECore/Renderer.h"
42 
43 namespace IECoreRI
44 {
45 
46 IE_CORE_FORWARDDECLARE( RendererImplementation );
47 
54 class IECORERI_API Renderer : public IECore::Renderer
55 {
56 
57  public :
58 
61  Renderer();
66  Renderer( const std::string &name );
67 
68  ~Renderer() override;
69 
70  IE_CORE_DECLARERUNTIMETYPEDEXTENSION( IECoreRI::Renderer, RendererTypeId, IECore::Renderer );
71 
94  void setOption( const std::string &name, IECore::ConstDataPtr value ) override;
103  IECore::ConstDataPtr getOption( const std::string &name ) const override;
104 
119  void camera( const std::string &name, const IECore::CompoundDataMap &parameters ) override;
120  void display( const std::string &name, const std::string &type, const std::string &data, const IECore::CompoundDataMap &parameters ) override;
121 
122  void worldBegin() override;
123  void worldEnd() override;
124 
125  void transformBegin() override;
126  void transformEnd() override;
127  void setTransform( const Imath::M44f &m ) override;
128  void setTransform( const std::string &coordinateSystem ) override;
129  Imath::M44f getTransform() const override;
130  Imath::M44f getTransform( const std::string &coordinateSystem ) const override;
131  void concatTransform( const Imath::M44f &m ) override;
132  void coordinateSystem( const std::string &name ) override;
133 
134  void attributeBegin() override;
135  void attributeEnd() override;
192  void setAttribute( const std::string &name, IECore::ConstDataPtr value ) override;
204  IECore::ConstDataPtr getAttribute( const std::string &name ) const override;
213  void shader( const std::string &type, const std::string &name, const IECore::CompoundDataMap &parameters ) override;
214 
217  void light( const std::string &name, const std::string &handle, const IECore::CompoundDataMap &parameters ) override;
218  void illuminate( const std::string &lightHandle, bool on ) override;
219 
220  void motionBegin( const std::set<float> &times ) override;
221  void motionEnd() override;
222 
223  void points( size_t numPoints, const IECore::PrimitiveVariableMap &primVars ) override;
224  void disk( float radius, float z, float thetaMax, const IECore::PrimitiveVariableMap &primVars ) override;
225 
226  void curves( const IECore::CubicBasisf &basis, bool periodic, IECore::ConstIntVectorDataPtr numVertices, const IECore::PrimitiveVariableMap &primVars ) override;
227 
228  void text( const std::string &font, const std::string &text, float kerning = 1.0f, const IECore::PrimitiveVariableMap &primVars=IECore::PrimitiveVariableMap() ) override;
229  void sphere( float radius, float zMin, float zMax, float thetaMax, const IECore::PrimitiveVariableMap &primVars ) override;
230 
231  void image( const Imath::Box2i &dataWindow, const Imath::Box2i &displayWindow, const IECore::PrimitiveVariableMap &primVars ) override;
242  void mesh( IECore::ConstIntVectorDataPtr vertsPerFace, IECore::ConstIntVectorDataPtr vertIds, const std::string &interpolation, const IECore::PrimitiveVariableMap &primVars ) override;
243 
244  void nurbs( int uOrder, IECore::ConstFloatVectorDataPtr uKnot, float uMin, float uMax, int vOrder, IECore::ConstFloatVectorDataPtr vKnot, float vMin, float vMax, const IECore::PrimitiveVariableMap &primVars ) override;
245 
246  void patchMesh( const IECore::CubicBasisf &uBasis, const IECore::CubicBasisf &vBasis, int nu, bool uPeriodic, int nv, bool vPeriodic, const IECore::PrimitiveVariableMap &primVars ) override;
247 
248  void geometry( const std::string &type, const IECore::CompoundDataMap &topology, const IECore::PrimitiveVariableMap &primVars ) override;
249 
260  void procedural( IECore::Renderer::ProceduralPtr proc ) override;
261 
262  void instanceBegin( const std::string &name, const IECore::CompoundDataMap &parameters ) override;
263  void instanceEnd() override;
264  void instance( const std::string &name ) override;
265 
281  IECore::DataPtr command( const std::string &name, const IECore::CompoundDataMap &parameters ) override;
282 
283  void editBegin( const std::string &name, const IECore::CompoundDataMap &parameters ) override;
284  void editEnd() override;
285 
286  private :
287 
288  friend class RendererImplementation;
289  // Constructor used by RendererImplementation when rendering procedurals.
290  Renderer( RendererImplementationPtr implementation );
291 
292  RendererImplementationPtr m_implementation;
293 
294 };
295 
296 IE_CORE_DECLAREPTR( Renderer );
297 
298 } // namespace IECoreRI
299 
300 #endif // IECORERI_RENDERER_H
The IECoreRI namespace holds all the functionality implemented in libIECoreRI.
Definition: IECoreRI.h:41
Definition: Renderer.h:93
Definition: Renderer.h:54
std::map< InternedString, DataPtr > CompoundDataMap
The type of Data held by the CompoundData typedef.
Definition: CompoundDataBase.h:46
std::map< std::string, PrimitiveVariable > PrimitiveVariableMap
A simple type to hold named PrimitiveVariables.
Definition: PrimitiveVariable.h:107