diff --git a/include/IECoreScene/MeshPrimitive.h b/include/IECoreScene/MeshPrimitive.h index b6c3f50aab..649b724e91 100644 --- a/include/IECoreScene/MeshPrimitive.h +++ b/include/IECoreScene/MeshPrimitive.h @@ -126,14 +126,14 @@ class IECORESCENE_API MeshPrimitive : public Primitive ///////////////////////////////////////////////////////////////////////////// //@{ - const IECore::InternedString &interpolateBoundary() const; + const IECore::InternedString &getInterpolateBoundary() const; void setInterpolateBoundary( const IECore::InternedString &interpolateBoundary ); static const IECore::InternedString interpolateBoundaryNone; static const IECore::InternedString interpolateBoundaryEdgeOnly; static const IECore::InternedString interpolateBoundaryEdgeAndCorner; - const IECore::InternedString &faceVaryingLinearInterpolation() const; + const IECore::InternedString &getFaceVaryingLinearInterpolation() const; void setFaceVaryingLinearInterpolation( const IECore::InternedString &faceVaryingLinearInterpolation ); static const IECore::InternedString faceVaryingLinearInterpolationNone; @@ -143,7 +143,7 @@ class IECORESCENE_API MeshPrimitive : public Primitive static const IECore::InternedString faceVaryingLinearInterpolationBoundaries; static const IECore::InternedString faceVaryingLinearInterpolationAll; - const IECore::InternedString &triangleSubdivisionRule() const; + const IECore::InternedString &getTriangleSubdivisionRule() const; void setTriangleSubdivisionRule( const IECore::InternedString &triangleSubdivisionRule ); static const IECore::InternedString triangleSubdivisionRuleCatmullClark; diff --git a/src/IECoreScene/MeshPrimitive.cpp b/src/IECoreScene/MeshPrimitive.cpp index 122abeaf4b..7543b664fd 100644 --- a/src/IECoreScene/MeshPrimitive.cpp +++ b/src/IECoreScene/MeshPrimitive.cpp @@ -382,7 +382,7 @@ void MeshPrimitive::removeCreases() m_creaseSharpnesses = emptyFloatVectorData(); } -const IECore::InternedString &MeshPrimitive::interpolateBoundary() const +const IECore::InternedString &MeshPrimitive::getInterpolateBoundary() const { return (*g_classData)[ this ].interpolateBoundary; } @@ -392,7 +392,7 @@ void MeshPrimitive::setInterpolateBoundary( const IECore::InternedString &interp (*g_classData)[ this ].interpolateBoundary = interpolateBoundary; } -const IECore::InternedString &MeshPrimitive::faceVaryingLinearInterpolation() const +const IECore::InternedString &MeshPrimitive::getFaceVaryingLinearInterpolation() const { return (*g_classData)[ this ].faceVaryingLinearInterpolation; } @@ -402,7 +402,7 @@ void MeshPrimitive::setFaceVaryingLinearInterpolation( const IECore::InternedStr (*g_classData)[ this ].faceVaryingLinearInterpolation = faceVaryingLinearInterpolation; } -const IECore::InternedString &MeshPrimitive::triangleSubdivisionRule() const +const IECore::InternedString &MeshPrimitive::getTriangleSubdivisionRule() const { return (*g_classData)[ this ].triangleSubdivisionRule; } @@ -457,9 +457,9 @@ void MeshPrimitive::copyFrom( const Object *other, IECore::Object::CopyContext * m_creaseLengths = tOther->m_creaseLengths; m_creaseIds = tOther->m_creaseIds; m_creaseSharpnesses = tOther->m_creaseSharpnesses; - setInterpolateBoundary( tOther->interpolateBoundary() ); - setFaceVaryingLinearInterpolation( tOther->faceVaryingLinearInterpolation() ); - setTriangleSubdivisionRule( tOther->triangleSubdivisionRule() ); + setInterpolateBoundary( tOther->getInterpolateBoundary() ); + setFaceVaryingLinearInterpolation( tOther->getFaceVaryingLinearInterpolation() ); + setTriangleSubdivisionRule( tOther->getTriangleSubdivisionRule() ); } void MeshPrimitive::save( IECore::Object::SaveContext *context ) const @@ -489,9 +489,9 @@ void MeshPrimitive::save( IECore::Object::SaveContext *context ) const context->save( m_creaseSharpnesses.get(), container.get(), g_creaseSharpnessesEntry ); } - container->write( g_interpolateBoundaryEntry, interpolateBoundary().string() ); - container->write( g_faceVaryingLinearInterpolationEntry, faceVaryingLinearInterpolation().string() ); - container->write( g_triangleSubdivisionRuleEntry, triangleSubdivisionRule().string() ); + container->write( g_interpolateBoundaryEntry, getInterpolateBoundary().string() ); + container->write( g_faceVaryingLinearInterpolationEntry, getFaceVaryingLinearInterpolation().string() ); + container->write( g_triangleSubdivisionRuleEntry, getTriangleSubdivisionRule().string() ); } void MeshPrimitive::load( IECore::Object::LoadContextPtr context ) @@ -594,15 +594,15 @@ bool MeshPrimitive::isEqualTo( const Object *other ) const { return false; } - if( interpolateBoundary() != tOther->interpolateBoundary() ) + if( getInterpolateBoundary() != tOther->getInterpolateBoundary() ) { return false; } - if( faceVaryingLinearInterpolation() != tOther->faceVaryingLinearInterpolation() ) + if( getFaceVaryingLinearInterpolation() != tOther->getFaceVaryingLinearInterpolation() ) { return false; } - if( triangleSubdivisionRule() != tOther->triangleSubdivisionRule() ) + if( getTriangleSubdivisionRule() != tOther->getTriangleSubdivisionRule() ) { return false; } @@ -637,9 +637,9 @@ void MeshPrimitive::topologyHash( MurmurHash &h ) const m_verticesPerFace->hash( h ); m_vertexIds->hash( h ); h.append( m_interpolation ); - h.append( interpolateBoundary() ); - h.append( faceVaryingLinearInterpolation() ); - h.append( triangleSubdivisionRule() ); + h.append( getInterpolateBoundary() ); + h.append( getFaceVaryingLinearInterpolation() ); + h.append( getTriangleSubdivisionRule() ); } MeshPrimitivePtr MeshPrimitive::createBox( const Box3f &b ) diff --git a/src/IECoreScene/bindings/MeshPrimitiveBinding.cpp b/src/IECoreScene/bindings/MeshPrimitiveBinding.cpp index 168adfa02f..0903dccae2 100644 --- a/src/IECoreScene/bindings/MeshPrimitiveBinding.cpp +++ b/src/IECoreScene/bindings/MeshPrimitiveBinding.cpp @@ -95,19 +95,19 @@ MeshPrimitivePtr createSphereWrapper( float radius, float zMin, float zMax, floa return MeshPrimitive::createSphere( radius, zMin, zMax, thetaMax, divisions, canceller ); } -InternedString interpolateBoundaryWrapper( const MeshPrimitive &p ) +InternedString getInterpolateBoundaryWrapper( const MeshPrimitive &p ) { - return p.interpolateBoundary(); + return p.getInterpolateBoundary(); } -InternedString faceVaryingLinearInterpolationWrapper( const MeshPrimitive &p ) +InternedString getFaceVaryingLinearInterpolationWrapper( const MeshPrimitive &p ) { - return p.faceVaryingLinearInterpolation(); + return p.getFaceVaryingLinearInterpolation(); } -InternedString triangleSubdivisionRuleWrapper( const MeshPrimitive &p ) +InternedString getTriangleSubdivisionRuleWrapper( const MeshPrimitive &p ) { - return p.triangleSubdivisionRule(); + return p.getTriangleSubdivisionRule(); } } // namespace @@ -140,11 +140,11 @@ void IECoreSceneModule::bindMeshPrimitive() // Note these are bound as functions, not properties - this is inconsistent with how interpolation is // bound, but we hope to switch interpolation at some point, see todo above. - .def( "interpolateBoundary", &interpolateBoundaryWrapper ) + .def( "getInterpolateBoundary", &getInterpolateBoundaryWrapper ) .def( "setInterpolateBoundary", &MeshPrimitive::setInterpolateBoundary ) - .def( "faceVaryingLinearInterpolation", &faceVaryingLinearInterpolationWrapper ) + .def( "getFaceVaryingLinearInterpolation", &getFaceVaryingLinearInterpolationWrapper ) .def( "setFaceVaryingLinearInterpolation", &MeshPrimitive::setFaceVaryingLinearInterpolation ) - .def( "triangleSubdivisionRule", &triangleSubdivisionRuleWrapper ) + .def( "getTriangleSubdivisionRule", &getTriangleSubdivisionRuleWrapper ) .def( "setTriangleSubdivisionRule", &MeshPrimitive::setTriangleSubdivisionRule ) .def_readonly( "interpolationLinear", MeshPrimitive::interpolationLinear ) .def_readonly( "interpolationCatmullClark", MeshPrimitive::interpolationCatmullClark ) diff --git a/test/IECoreScene/MeshPrimitive.py b/test/IECoreScene/MeshPrimitive.py index ac16a99165..d02035d4a6 100644 --- a/test/IECoreScene/MeshPrimitive.py +++ b/test/IECoreScene/MeshPrimitive.py @@ -53,9 +53,9 @@ def test( self ) : self.assertEqual( m.verticesPerFace, IECore.IntVectorData() ) self.assertEqual( m.vertexIds, IECore.IntVectorData() ) self.assertEqual( m.interpolation, "linear" ) - self.assertEqual( m.interpolateBoundary(), IECoreScene.MeshPrimitive.interpolateBoundaryEdgeAndCorner ) - self.assertEqual( m.faceVaryingLinearInterpolation(), IECoreScene.MeshPrimitive.faceVaryingLinearInterpolationCornersPlus1 ) - self.assertEqual( m.triangleSubdivisionRule(), IECoreScene.MeshPrimitive.triangleSubdivisionRuleCatmullClark ) + self.assertEqual( m.getInterpolateBoundary(), IECoreScene.MeshPrimitive.interpolateBoundaryEdgeAndCorner ) + self.assertEqual( m.getFaceVaryingLinearInterpolation(), IECoreScene.MeshPrimitive.faceVaryingLinearInterpolationCornersPlus1 ) + self.assertEqual( m.getTriangleSubdivisionRule(), IECoreScene.MeshPrimitive.triangleSubdivisionRuleCatmullClark ) self.assertEqual( m, m.copy() ) self.assertEqual( m.maxVerticesPerFace(), 0 ) @@ -553,28 +553,28 @@ def testSubdivOptions( self ) : default = IECoreScene.MeshPrimitive.createPlane( imath.Box2f( imath.V2f( 0 ), imath.V2f( 1 ) ) ) m = IECoreScene.MeshPrimitive.createPlane( imath.Box2f( imath.V2f( 0 ), imath.V2f( 1 ) ) ) - self.assertEqual( m.interpolateBoundary(), IECoreScene.MeshPrimitive.interpolateBoundaryEdgeAndCorner ) - self.assertEqual( m.faceVaryingLinearInterpolation(), IECoreScene.MeshPrimitive.faceVaryingLinearInterpolationCornersPlus1 ) - self.assertEqual( m.triangleSubdivisionRule(), IECoreScene.MeshPrimitive.triangleSubdivisionRuleCatmullClark ) + self.assertEqual( m.getInterpolateBoundary(), IECoreScene.MeshPrimitive.interpolateBoundaryEdgeAndCorner ) + self.assertEqual( m.getFaceVaryingLinearInterpolation(), IECoreScene.MeshPrimitive.faceVaryingLinearInterpolationCornersPlus1 ) + self.assertEqual( m.getTriangleSubdivisionRule(), IECoreScene.MeshPrimitive.triangleSubdivisionRuleCatmullClark ) self.assertEqual( m, default ) self.assertEqual( m.hash(), default.hash() ) m.setInterpolateBoundary( IECoreScene.MeshPrimitive.interpolateBoundaryEdgeOnly ) self.assertNotEqual( m, default ) self.assertNotEqual( m.hash(), default.hash() ) - self.assertEqual( m.interpolateBoundary(), IECoreScene.MeshPrimitive.interpolateBoundaryEdgeOnly ) + self.assertEqual( m.getInterpolateBoundary(), IECoreScene.MeshPrimitive.interpolateBoundaryEdgeOnly ) m.setInterpolateBoundary( IECoreScene.MeshPrimitive.interpolateBoundaryEdgeAndCorner ) self.assertEqual( m, default ) self.assertEqual( m.hash(), default.hash() ) m.setFaceVaryingLinearInterpolation( IECoreScene.MeshPrimitive.faceVaryingLinearInterpolationCornersPlus2 ) - self.assertEqual( m.faceVaryingLinearInterpolation(), IECoreScene.MeshPrimitive.faceVaryingLinearInterpolationCornersPlus2 ) + self.assertEqual( m.getFaceVaryingLinearInterpolation(), IECoreScene.MeshPrimitive.faceVaryingLinearInterpolationCornersPlus2 ) self.assertNotEqual( m, default ) self.assertNotEqual( m.hash(), default.hash() ) m.setFaceVaryingLinearInterpolation( IECoreScene.MeshPrimitive.faceVaryingLinearInterpolationCornersPlus1 ) self.assertEqual( m, default ) self.assertEqual( m.hash(), default.hash() ) m.setTriangleSubdivisionRule( IECoreScene.MeshPrimitive.triangleSubdivisionRuleSmooth ) - self.assertEqual( m.triangleSubdivisionRule(), IECoreScene.MeshPrimitive.triangleSubdivisionRuleSmooth ) + self.assertEqual( m.getTriangleSubdivisionRule(), IECoreScene.MeshPrimitive.triangleSubdivisionRuleSmooth ) self.assertNotEqual( m, default ) self.assertNotEqual( m.hash(), default.hash() ) @@ -582,17 +582,17 @@ def testSubdivOptions( self ) : m.setFaceVaryingLinearInterpolation( IECoreScene.MeshPrimitive.faceVaryingLinearInterpolationCornersPlus2 ) mCopy = m.copy() - self.assertEqual( mCopy.interpolateBoundary(), IECoreScene.MeshPrimitive.interpolateBoundaryEdgeOnly ) - self.assertEqual( mCopy.faceVaryingLinearInterpolation(), IECoreScene.MeshPrimitive.faceVaryingLinearInterpolationCornersPlus2 ) + self.assertEqual( mCopy.getInterpolateBoundary(), IECoreScene.MeshPrimitive.interpolateBoundaryEdgeOnly ) + self.assertEqual( mCopy.getFaceVaryingLinearInterpolation(), IECoreScene.MeshPrimitive.faceVaryingLinearInterpolationCornersPlus2 ) self.assertEqual( m, mCopy ) io = IECore.MemoryIndexedIO( IECore.CharVectorData(), [], IECore.IndexedIO.OpenMode.Append ) m.save( io, "test" ) m2 = IECore.Object.load( io, "test" ) - self.assertEqual( m2.interpolateBoundary(), IECoreScene.MeshPrimitive.interpolateBoundaryEdgeOnly ) - self.assertEqual( m2.faceVaryingLinearInterpolation(), IECoreScene.MeshPrimitive.faceVaryingLinearInterpolationCornersPlus2 ) - self.assertEqual( m.triangleSubdivisionRule(), IECoreScene.MeshPrimitive.triangleSubdivisionRuleSmooth ) + self.assertEqual( m2.getInterpolateBoundary(), IECoreScene.MeshPrimitive.interpolateBoundaryEdgeOnly ) + self.assertEqual( m2.getFaceVaryingLinearInterpolation(), IECoreScene.MeshPrimitive.faceVaryingLinearInterpolationCornersPlus2 ) + self.assertEqual( m.getTriangleSubdivisionRule(), IECoreScene.MeshPrimitive.triangleSubdivisionRuleSmooth ) self.assertEqual( m, m2 ) def tearDown( self ) :