Cortex  10.0.0-a4
Renderer.h
1 //
3 // Copyright (c) 2007-2013, Image Engine Design Inc. All rights reserved.
4 // Copyright (c) 2011, John Haddon. All rights reserved.
5 //
6 // Redistribution and use in source and binary forms, with or without
7 // modification, are permitted provided that the following conditions are
8 // met:
9 //
10 // * Redistributions of source code must retain the above copyright
11 // notice, this list of conditions and the following disclaimer.
12 //
13 // * Redistributions in binary form must reproduce the above copyright
14 // notice, this list of conditions and the following disclaimer in the
15 // documentation and/or other materials provided with the distribution.
16 //
17 // * Neither the name of Image Engine Design nor the names of any
18 // other contributors to this software may be used to endorse or
19 // promote products derived from this software without specific prior
20 // written permission.
21 //
22 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
23 // IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
24 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
25 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
26 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
27 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
28 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
29 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
30 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
31 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 //
35 
36 #ifndef IECOREGL_RENDERER_H
37 #define IECOREGL_RENDERER_H
38 
39 #include "IECore/Renderer.h"
40 
41 #include "IECoreGL/Export.h"
42 #include "IECoreGL/TypeIds.h"
43 
44 namespace IECoreGL
45 {
46 
47 IE_CORE_FORWARDDECLARE( Scene );
48 IE_CORE_FORWARDDECLARE( TextureLoader );
49 IE_CORE_FORWARDDECLARE( ShaderLoader );
50 
58 
64 class IECOREGL_API Renderer : public IECore::Renderer
65 {
66  public :
67 
68  Renderer();
69  ~Renderer() override;
70 
71  IE_CORE_DECLARERUNTIMETYPEDEXTENSION( IECoreGL::Renderer, RendererTypeId, IECore::Renderer );
72 
108  void setOption( const std::string &name, IECore::ConstDataPtr value ) override;
109  IECore::ConstDataPtr getOption( const std::string &name ) const override;
118  void camera( const std::string &name, const IECore::CompoundDataMap &parameters ) override;
119  void display( const std::string &name, const std::string &type, const std::string &data, const IECore::CompoundDataMap &parameters ) override;
120 
121  void worldBegin() override;
122  void worldEnd() override;
131  ScenePtr scene();
132 
133  void transformBegin() override;
134  void transformEnd() override;
135  void setTransform( const Imath::M44f &m ) override;
136  void setTransform( const std::string &coordinateSystem ) override;
137  Imath::M44f getTransform() const override;
138  Imath::M44f getTransform( const std::string &coordinateSystem ) const override;
139  void concatTransform( const Imath::M44f &m ) override;
140  void coordinateSystem( const std::string &name ) override;
141 
142  void attributeBegin() override;
143  void attributeEnd() override;
377  void setAttribute( const std::string &name, IECore::ConstDataPtr value ) override;
378  IECore::ConstDataPtr getAttribute( const std::string &name ) const override;
386  void shader( const std::string &type, const std::string &name, const IECore::CompoundDataMap &parameters ) override;
387  void light( const std::string &name, const std::string &handle, const IECore::CompoundDataMap &parameters ) override;
388  void illuminate( const std::string &lightHandle, bool on ) override;
389 
390  void motionBegin( const std::set<float> &times ) override;
391  void motionEnd() override;
392 
425  void points( size_t numPoints, const IECore::PrimitiveVariableMap &primVars ) override;
426  void disk( float radius, float z, float thetaMax, const IECore::PrimitiveVariableMap &primVars ) override;
431  void curves( const IECore::CubicBasisf &basis, bool periodic, IECore::ConstIntVectorDataPtr numVertices, const IECore::PrimitiveVariableMap &primVars ) override;
432  void text( const std::string &font, const std::string &text, float kerning = 1.0f, const IECore::PrimitiveVariableMap &primVars=IECore::PrimitiveVariableMap() ) override;
433  void sphere( float radius, float zMin, float zMax, float thetaMax, const IECore::PrimitiveVariableMap &primVars ) override;
448  void image( const Imath::Box2i &dataWindow, const Imath::Box2i &displayWindow, const IECore::PrimitiveVariableMap &primVars ) override;
451  void mesh( IECore::ConstIntVectorDataPtr vertsPerFace, IECore::ConstIntVectorDataPtr vertIds, const std::string &interpolation, const IECore::PrimitiveVariableMap &primVars ) override;
453  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;
455  void patchMesh( const IECore::CubicBasisf &uBasis, const IECore::CubicBasisf &vBasis, int nu, bool uPeriodic, int nv, bool vPeriodic, const IECore::PrimitiveVariableMap &primVars ) override;
457  void geometry( const std::string &type, const IECore::CompoundDataMap &topology, const IECore::PrimitiveVariableMap &primVars ) override;
458  void procedural( IECore::Renderer::ProceduralPtr proc ) override;
459 
460  void instanceBegin( const std::string &name, const IECore::CompoundDataMap &parameters ) override;
461  void instanceEnd() override;
462  void instance( const std::string &name ) override;
463 
482  IECore::DataPtr command( const std::string &name, const IECore::CompoundDataMap &parameters ) override;
483 
485  void editBegin( const std::string &name, const IECore::CompoundDataMap &parameters ) override;
486  void editEnd() override;
487 
490  ShaderLoader *shaderLoader();
491 
494  TextureLoader *textureLoader();
495 
496  struct MemberData;
497 
498  private :
499 
500  MemberData *m_data;
501 
502 };
503 
504 IE_CORE_DECLAREPTR( Renderer );
505 
506 } // namespace IECoreGL
507 
508 #endif // IECOREGL_RENDERER_H
The namespace within which all CoreGL functionality is defined.
Definition: AlphaTexture.h:41
Definition: TextureLoader.h:56
Definition: Renderer.h:93
Definition: ShaderLoader.h:54
Definition: Renderer.h:64
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