( self )
| 43 | class PointsAlgoTest( unittest.TestCase ) : |
| 44 | |
| 45 | def points( self ) : |
| 46 | |
| 47 | testObject = IECoreScene.PointsPrimitive( IECore.V3fVectorData( [ imath.V3f( x ) for x in range( 0, 10 ) ] ) ) |
| 48 | |
| 49 | testObject["a"] = IECoreScene.PrimitiveVariable( IECoreScene.PrimitiveVariable.Interpolation.Constant, IECore.FloatData( 0.5 ) ) |
| 50 | testObject["b"] = IECoreScene.PrimitiveVariable( IECoreScene.PrimitiveVariable.Interpolation.Vertex, IECore.FloatVectorData( range( 0, 10 ) ) ) |
| 51 | testObject["c"] = IECoreScene.PrimitiveVariable( IECoreScene.PrimitiveVariable.Interpolation.Uniform, IECore.FloatVectorData( [ 0 ] ) ) |
| 52 | testObject["d"] = IECoreScene.PrimitiveVariable( IECoreScene.PrimitiveVariable.Interpolation.Varying, IECore.FloatVectorData( range( 0, 10 ) ) ) |
| 53 | testObject["e"] = IECoreScene.PrimitiveVariable( IECoreScene.PrimitiveVariable.Interpolation.FaceVarying, IECore.FloatVectorData( range( 0, 10 ) ) ) |
| 54 | |
| 55 | # indexed |
| 56 | testObject["f"] = IECoreScene.PrimitiveVariable( IECoreScene.PrimitiveVariable.Interpolation.Vertex, IECore.FloatVectorData( range( 0, 3 ) ), IECore.IntVectorData( [ 0, 1, 2, 0, 1, 2, 0, 1, 2, 0 ] ) ) |
| 57 | testObject["g"] = IECoreScene.PrimitiveVariable( IECoreScene.PrimitiveVariable.Interpolation.Uniform, IECore.FloatVectorData( [ 0.5 ] ), IECore.IntVectorData( [ 0 ] ) ) |
| 58 | testObject["h"] = IECoreScene.PrimitiveVariable( IECoreScene.PrimitiveVariable.Interpolation.Varying, IECore.FloatVectorData( range( 0, 3 ) ), IECore.IntVectorData( [ 0, 1, 2, 0, 1, 2, 0, 1, 2, 0 ] ) ) |
| 59 | testObject["i"] = IECoreScene.PrimitiveVariable( IECoreScene.PrimitiveVariable.Interpolation.FaceVarying, IECore.FloatVectorData( range( 0, 3 ) ), IECore.IntVectorData( [ 0, 1, 2, 0, 1, 2, 0, 1, 2, 0 ] ) ) |
| 60 | |
| 61 | testObject["uniform_V3f_Point"] = IECoreScene.PrimitiveVariable( IECoreScene.PrimitiveVariable.Interpolation.Uniform, IECore.V3fVectorData( [ imath.V3f() ], IECore.GeometricData.Interpretation.Point ) ) |
| 62 | testObject["vertex_V3f_Normal"] = IECoreScene.PrimitiveVariable( IECoreScene.PrimitiveVariable.Interpolation.Vertex, |
| 63 | IECore.V3fVectorData( [imath.V3f( i, i, i ) for i in range( 0, 10 )], IECore.GeometricData.Interpretation.Normal ) ) |
| 64 | |
| 65 | testObject["j"] = IECoreScene.PrimitiveVariable( IECoreScene.PrimitiveVariable.Interpolation.Constant, IECore.StringData( "test" ) ) |
| 66 | testObject["k"] = IECoreScene.PrimitiveVariable( IECoreScene.PrimitiveVariable.Interpolation.Constant, IECore.BoolData( True ) ) |
| 67 | |
| 68 | self.assertTrue( testObject.arePrimitiveVariablesValid() ) |
| 69 | |
| 70 | return testObject |
| 71 | |
| 72 | def testPointsConstantToVertex( self ) : |
| 73 | points = self.points() |
no test coverage detected