Skip to content

Commit a735910

Browse files
committed
Remove StateRenderable
Like PreWorldRenderable, this doesn't make a distinction worth having in Gaffer's scene representation. In fact, CoordinateSystems are treated as objects in Gaffer, and only Shaders are treated as attribute state.
1 parent bb4951c commit a735910

13 files changed

+21
-279
lines changed

Changes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Breaking Changes
1717
- Font : Removed `meshGroup()` method.
1818
- Options, Group, Transform, MatrixTransform, MatrixMotionTransform, AttributeState, Light, MotionPrimitive : Removed.
1919
- CurveExtrudeOp, IDXReader : Removed.
20-
- PreWorldRenderable : Removed. All derived classes now derive directly from Renderable.
20+
- PreWorldRenderable, StateRenderable : Removed. All derived classes now derive directly from Renderable.
2121
- Renderer, AttributeBlock, EditBlock, MotionBlock, TransformBlock, WorldBlock : Removed.
2222
- IECoreHoudini : Removed.
2323
- IECoreMaya : Removed.

include/IECoreScene/CoordinateSystem.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,21 @@
3636
#define IECORESCENE_COORDINATESYSTEM_H
3737

3838
#include "IECoreScene/Export.h"
39-
#include "IECoreScene/StateRenderable.h"
39+
#include "IECoreScene/Renderable.h"
4040

4141
namespace IECoreScene
4242
{
4343

4444
/// Allows the specification of coordinate systems to Renderers.
4545
/// \ingroup renderingGroup
46-
class IECORESCENE_API CoordinateSystem : public StateRenderable
46+
class IECORESCENE_API CoordinateSystem : public Renderable
4747
{
4848
public:
4949

5050
CoordinateSystem( const std::string &name = "unspecified" );
5151
~CoordinateSystem() override;
5252

53-
IE_CORE_DECLAREEXTENSIONOBJECT( CoordinateSystem, CoordinateSystemTypeId, StateRenderable );
53+
IE_CORE_DECLAREEXTENSIONOBJECT( CoordinateSystem, CoordinateSystemTypeId, Renderable );
5454

5555
const std::string &getName() const;
5656
void setName( const std::string &name );

include/IECoreScene/Shader.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@
3636
#define IECORESCENE_SHADER_H
3737

3838
#include "IECoreScene/Export.h"
39-
#include "IECoreScene/StateRenderable.h"
39+
#include "IECoreScene/Renderable.h"
4040

4141
namespace IECoreScene
4242
{
4343

4444
/// A class to represent shaders.
4545
/// \ingroup renderingGroup
46-
class IECORESCENE_API Shader : public StateRenderable
46+
class IECORESCENE_API Shader : public Renderable
4747
{
4848
public:
4949

@@ -56,7 +56,7 @@ class IECORESCENE_API Shader : public StateRenderable
5656

5757
~Shader() override;
5858

59-
IE_CORE_DECLAREEXTENSIONOBJECT( Shader, ShaderTypeId, StateRenderable );
59+
IE_CORE_DECLAREEXTENSIONOBJECT( Shader, ShaderTypeId, Renderable );
6060

6161
const std::string &getName() const;
6262
void setName( const std::string &name );

include/IECoreScene/StateRenderable.h

Lines changed: 0 additions & 66 deletions
This file was deleted.

include/IECoreScene/TypeIds.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ enum TypeId
5959
GroupTypeId = 108016, // Obsolete, available for reuse
6060
AttributeStateTypeId = 108017, // Obsolete, available for reuse
6161
VisibleRenderableTypeId = 108018,
62-
StateRenderableTypeId = 108019,
62+
StateRenderableTypeId = 108019, // Obsolete, available for reuse
6363
OBJReaderTypeId = 108020,
6464
PointNormalsOpTypeId = 108021, // Obsolete, available for reuse
6565
PointDensitiesOpTypeId = 108022, // Obsolete, available for reuse
66-
StateRenderableParameterTypeId = 108023,
66+
StateRenderableParameterTypeId = 108023, // Obsolete, available for reuse
6767
AttributeStateParameterTypeId = 108024, // Obsolete, available for reuse
6868
ShaderParameterTypeId = 108025,
6969
TransformParameterTypeId = 108026, // Obsolete, available for reuse

src/IECoreScene/CoordinateSystem.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ void CoordinateSystem::setName( const std::string &name )
6666

6767
bool CoordinateSystem::isEqualTo( const Object *other ) const
6868
{
69-
if( !StateRenderable::isEqualTo( other ) )
69+
if( !Renderable::isEqualTo( other ) )
7070
{
7171
return false;
7272
}
@@ -80,34 +80,34 @@ bool CoordinateSystem::isEqualTo( const Object *other ) const
8080

8181
void CoordinateSystem::memoryUsage( Object::MemoryAccumulator &a ) const
8282
{
83-
StateRenderable::memoryUsage( a );
83+
Renderable::memoryUsage( a );
8484
a.accumulate( m_name.capacity() + sizeof( m_name ) );
8585
}
8686

8787
void CoordinateSystem::copyFrom( const Object *other, CopyContext *context )
8888
{
89-
StateRenderable::copyFrom( other, context );
89+
Renderable::copyFrom( other, context );
9090
const CoordinateSystem *c = static_cast<const CoordinateSystem *>( other );
9191
m_name = c->m_name;
9292
}
9393

9494
void CoordinateSystem::save( SaveContext *context ) const
9595
{
96-
StateRenderable::save( context );
96+
Renderable::save( context );
9797
IndexedIOPtr container = context->container( staticTypeName(), m_ioVersion );
9898
container->write( g_nameEntry, m_name );
9999
}
100100

101101
void CoordinateSystem::load( LoadContextPtr context )
102102
{
103-
StateRenderable::load( context );
103+
Renderable::load( context );
104104
unsigned int v = m_ioVersion;
105105
ConstIndexedIOPtr container = context->container( staticTypeName(), v );
106106
container->read( g_nameEntry, m_name );
107107
}
108108

109109
void CoordinateSystem::hash( MurmurHash &h ) const
110110
{
111-
StateRenderable::hash( h );
111+
Renderable::hash( h );
112112
h.append( m_name );
113113
}

src/IECoreScene/Shader.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ const CompoundData *Shader::parametersData() const
103103

104104
bool Shader::isEqualTo( const Object *other ) const
105105
{
106-
if( !StateRenderable::isEqualTo( other ) )
106+
if( !Renderable::isEqualTo( other ) )
107107
{
108108
return false;
109109
}
@@ -121,15 +121,15 @@ bool Shader::isEqualTo( const Object *other ) const
121121

122122
void Shader::memoryUsage( Object::MemoryAccumulator &a ) const
123123
{
124-
StateRenderable::memoryUsage( a );
124+
Renderable::memoryUsage( a );
125125
a.accumulate( m_name.capacity() );
126126
a.accumulate( m_type.capacity() );
127127
a.accumulate( m_parameters.get() );
128128
}
129129

130130
void Shader::copyFrom( const Object *other, CopyContext *context )
131131
{
132-
StateRenderable::copyFrom( other, context );
132+
Renderable::copyFrom( other, context );
133133
const Shader *s = static_cast<const Shader *>( other );
134134
m_name = s->m_name;
135135
m_type = s->m_type;
@@ -138,7 +138,7 @@ void Shader::copyFrom( const Object *other, CopyContext *context )
138138

139139
void Shader::save( SaveContext *context ) const
140140
{
141-
StateRenderable::save( context );
141+
Renderable::save( context );
142142
IndexedIOPtr container = context->container( staticTypeName(), m_ioVersion );
143143
container->write( g_nameEntry, m_name );
144144
container->write( g_typeEntry, m_type );
@@ -147,7 +147,7 @@ void Shader::save( SaveContext *context ) const
147147

148148
void Shader::load( LoadContextPtr context )
149149
{
150-
StateRenderable::load( context );
150+
Renderable::load( context );
151151
unsigned int v = m_ioVersion;
152152
ConstIndexedIOPtr container = context->container( staticTypeName(), v );
153153
container->read( g_nameEntry, m_name );
@@ -157,7 +157,7 @@ void Shader::load( LoadContextPtr context )
157157

158158
void Shader::hash( MurmurHash &h ) const
159159
{
160-
StateRenderable::hash( h );
160+
Renderable::hash( h );
161161
h.append( m_name );
162162
h.append( m_type );
163163
m_parameters->hash( h );

src/IECoreScene/StateRenderable.cpp

Lines changed: 0 additions & 84 deletions
This file was deleted.

src/IECoreScene/TypedObjectParameter.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
#include "IECoreScene/Renderable.h"
3838
#include "IECoreScene/Shader.h"
3939
#include "IECoreScene/SmoothSkinningData.h"
40-
#include "IECoreScene/StateRenderable.h"
4140
#include "IECoreScene/VisibleRenderable.h"
4241

4342
#include "IECore/TypedObjectParameter.inl"
@@ -46,13 +45,11 @@ namespace IECore
4645
{
4746

4847
IECORE_RUNTIMETYPED_DEFINETEMPLATESPECIALISATION( IECoreScene::RenderableParameter, IECoreScene::RenderableParameterTypeId );
49-
IECORE_RUNTIMETYPED_DEFINETEMPLATESPECIALISATION( IECoreScene::StateRenderableParameter, IECoreScene::StateRenderableParameterTypeId );
5048
IECORE_RUNTIMETYPED_DEFINETEMPLATESPECIALISATION( IECoreScene::ShaderParameter, IECoreScene::ShaderParameterTypeId );
5149
IECORE_RUNTIMETYPED_DEFINETEMPLATESPECIALISATION( IECoreScene::VisibleRenderableParameter, IECoreScene::VisibleRenderableParameterTypeId );
5250
IECORE_RUNTIMETYPED_DEFINETEMPLATESPECIALISATION( IECoreScene::SmoothSkinningDataParameter, IECoreScene::SmoothSkinningDataParameterTypeId );
5351

5452
template class TypedObjectParameter<IECoreScene::Renderable>;
55-
template class TypedObjectParameter<IECoreScene::StateRenderable>;
5653
template class TypedObjectParameter<IECoreScene::Shader>;
5754
template class TypedObjectParameter<IECoreScene::VisibleRenderable>;
5855
template class TypedObjectParameter<IECoreScene::SmoothSkinningData>;

src/IECoreScene/bindings/IECoreScene.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@
9494
#include "SmoothSmoothSkinningWeightsOpBinding.h"
9595
#include "SpherePrimitiveBinding.h"
9696
#include "SpherePrimitiveEvaluatorBinding.h"
97-
#include "StateRenderableBinding.h"
9897
#include "TransferSmoothSkinningWeightsOpBinding.h"
9998
#include "TransformOpBinding.h"
10099
#include "TriangulateOpBinding.h"
@@ -115,7 +114,6 @@ BOOST_PYTHON_MODULE(_IECoreScene)
115114
bindParticleReader();
116115
bindPDCParticleReader();
117116
bindRenderable();
118-
bindStateRenderable();
119117
bindVisibleRenderable();
120118
bindParticleWriter();
121119
bindPDCParticleWriter();

0 commit comments

Comments
 (0)