|
49 | 49 |
|
50 | 50 | class CurvesPrimitiveEvaluatorTest( unittest.TestCase ) : |
51 | 51 |
|
52 | | - def runPointAtVTest( self, curvesPrimitive, expectedPositions=None, expectedLengths=None, visualTest=False, printPoints=False ) : |
| 52 | + def runPointAtVTest( self, curvesPrimitive, expectedPositions=None, expectedLengths=None, printPoints=False ) : |
53 | 53 |
|
54 | 54 | e = IECoreScene.CurvesPrimitiveEvaluator( curvesPrimitive ) |
55 | 55 | r = e.createResult() |
@@ -84,34 +84,6 @@ def runPointAtVTest( self, curvesPrimitive, expectedPositions=None, expectedLeng |
84 | 84 |
|
85 | 85 | print( repr( p ).replace( "),", "),\n" ) ) |
86 | 86 |
|
87 | | - if visualTest : |
88 | | - |
89 | | - import IECoreGL |
90 | | - IECoreGL.init( False ) |
91 | | - |
92 | | - r = IECoreGL.Renderer() |
93 | | - r.setOption( "gl:mode", IECore.StringData( "deferred" ) ) |
94 | | - |
95 | | - pointsPrimitive = IECoreScene.PointsPrimitive( p ) |
96 | | - pointsPrimitive["constantwidth"] = IECoreScene.PrimitiveVariable( IECoreScene.PrimitiveVariable.Interpolation.Constant, IECore.FloatData( 0.1 ) ) |
97 | | - |
98 | | - with IECoreScene.WorldBlock( r ) : |
99 | | - |
100 | | - w = IECoreGL.SceneViewer( "scene", r.scene() ) |
101 | | - |
102 | | - with IECoreScene.AttributeBlock( r ) : |
103 | | - |
104 | | - r.shader( "surface", "red", { "gl:fragmentSource" : IECore.StringData( "void main() { gl_FragColor = vec4( 1, 0, 0, 1 ); }" ) } ) |
105 | | - r.setAttribute( "gl:curvesPrimitive:useGLLines", IECore.BoolData( True ) ) |
106 | | - curvesPrimitive.render( r ) |
107 | | - |
108 | | - with IECoreScene.AttributeBlock( r ) : |
109 | | - |
110 | | - r.shader( "surface", "blue", { "gl:fragmentSource" : IECore.StringData( "void main() { gl_FragColor = vec4( 0, 0, 1, 1 ); }" ) } ) |
111 | | - pointsPrimitive.render( r ) |
112 | | - |
113 | | - w.start() |
114 | | - |
115 | 87 | def testLinearSubsetLength( self ) : |
116 | 88 |
|
117 | 89 | pts = IECore.V3fVectorData() |
@@ -267,7 +239,7 @@ def test3SegmentBSpline( self ) : |
267 | 239 |
|
268 | 240 | lengths = IECore.FloatVectorData( [ 2.2106194496154785 ] ) |
269 | 241 |
|
270 | | - self.runPointAtVTest( c, expectedPositions=expected, expectedLengths=lengths, visualTest=False, printPoints=False ) |
| 242 | + self.runPointAtVTest( c, expectedPositions=expected, expectedLengths=lengths, printPoints=False ) |
271 | 243 |
|
272 | 244 | def test3SegmentBSplineDoubledEndpoints( self ) : |
273 | 245 |
|
@@ -345,7 +317,7 @@ def test3SegmentBSplineDoubledEndpoints( self ) : |
345 | 317 |
|
346 | 318 | lengths = IECore.FloatVectorData( [ 3.61808 ] ) |
347 | 319 |
|
348 | | - self.runPointAtVTest( c, expectedPositions=expected, expectedLengths=lengths, visualTest=False, printPoints=False ) |
| 320 | + self.runPointAtVTest( c, expectedPositions=expected, expectedLengths=lengths, printPoints=False ) |
349 | 321 |
|
350 | 322 | def test2Curve3SegmentBSpline( self ) : |
351 | 323 |
|
@@ -478,7 +450,7 @@ def test2Curve3SegmentBSpline( self ) : |
478 | 450 |
|
479 | 451 | lengths = IECore.FloatVectorData( [ 2.2106194496154785, 2.2106194496154785 ] ) |
480 | 452 |
|
481 | | - self.runPointAtVTest( c, expectedPositions=expected, expectedLengths=lengths, visualTest=False, printPoints=False ) |
| 453 | + self.runPointAtVTest( c, expectedPositions=expected, expectedLengths=lengths, printPoints=False ) |
482 | 454 |
|
483 | 455 | def testPeriodicBSpline( self ) : |
484 | 456 |
|
@@ -553,7 +525,7 @@ def testPeriodicBSpline( self ) : |
553 | 525 |
|
554 | 526 | lengths = IECore.FloatVectorData( [ 2.917539119 ] ) |
555 | 527 |
|
556 | | - self.runPointAtVTest( c, expectedPositions=expected, expectedLengths=lengths, visualTest=False, printPoints=False ) |
| 528 | + self.runPointAtVTest( c, expectedPositions=expected, expectedLengths=lengths, printPoints=False ) |
557 | 529 |
|
558 | 530 | def test2CurvePeriodicBSpline( self ) : |
559 | 531 |
|
@@ -682,7 +654,7 @@ def test2CurvePeriodicBSpline( self ) : |
682 | 654 |
|
683 | 655 | lengths = IECore.FloatVectorData( [ 2.917539119, 2.917539119 ] ) |
684 | 656 |
|
685 | | - self.runPointAtVTest( c, expectedPositions=expected, expectedLengths=lengths, visualTest=False, printPoints=False ) |
| 657 | + self.runPointAtVTest( c, expectedPositions=expected, expectedLengths=lengths, printPoints=False ) |
686 | 658 |
|
687 | 659 | def test3SegmentLinear( self ) : |
688 | 660 |
|
@@ -757,7 +729,7 @@ def test3SegmentLinear( self ) : |
757 | 729 |
|
758 | 730 | lengths = IECore.FloatVectorData( [ 5.0 ] ) |
759 | 731 |
|
760 | | - self.runPointAtVTest( c, expectedPositions=expected, expectedLengths=lengths, visualTest=False, printPoints=False ) |
| 732 | + self.runPointAtVTest( c, expectedPositions=expected, expectedLengths=lengths, printPoints=False ) |
761 | 733 |
|
762 | 734 | def test3SegmentLinearDoubledEndpoints( self ) : |
763 | 735 |
|
@@ -835,7 +807,7 @@ def test3SegmentLinearDoubledEndpoints( self ) : |
835 | 807 |
|
836 | 808 | lengths = IECore.FloatVectorData( [ 5.0 ] ) |
837 | 809 |
|
838 | | - self.runPointAtVTest( c, expectedPositions=expected, expectedLengths=lengths, visualTest=False, printPoints=False ) |
| 810 | + self.runPointAtVTest( c, expectedPositions=expected, expectedLengths=lengths, printPoints=False ) |
839 | 811 |
|
840 | 812 | def test2Curve3SegmentLinear( self ) : |
841 | 813 |
|
@@ -967,7 +939,7 @@ def test2Curve3SegmentLinear( self ) : |
967 | 939 |
|
968 | 940 | lengths = IECore.FloatVectorData( [ 5.0, 5.0 ] ) |
969 | 941 |
|
970 | | - self.runPointAtVTest( c, expectedPositions=expected, expectedLengths=lengths, visualTest=False, printPoints=False ) |
| 942 | + self.runPointAtVTest( c, expectedPositions=expected, expectedLengths=lengths, printPoints=False ) |
971 | 943 |
|
972 | 944 | def test3SegmentPeriodicLinear( self ) : |
973 | 945 |
|
@@ -1042,7 +1014,7 @@ def test3SegmentPeriodicLinear( self ) : |
1042 | 1014 |
|
1043 | 1015 | lengths = IECore.FloatVectorData( [ 7.23606777 ] ) |
1044 | 1016 |
|
1045 | | - self.runPointAtVTest( c, expectedPositions=expected, expectedLengths=lengths, visualTest=False, printPoints=False ) |
| 1017 | + self.runPointAtVTest( c, expectedPositions=expected, expectedLengths=lengths, printPoints=False ) |
1046 | 1018 |
|
1047 | 1019 | def test2Curve3SegmentPeriodicLinear( self ) : |
1048 | 1020 |
|
@@ -1173,7 +1145,7 @@ def test2Curve3SegmentPeriodicLinear( self ) : |
1173 | 1145 |
|
1174 | 1146 | lengths = IECore.FloatVectorData( [ 7.23606777, 7.23606777 ] ) |
1175 | 1147 |
|
1176 | | - self.runPointAtVTest( c, expectedPositions=expected, expectedLengths=lengths, visualTest=False, printPoints=False ) |
| 1148 | + self.runPointAtVTest( c, expectedPositions=expected, expectedLengths=lengths, printPoints=False ) |
1177 | 1149 |
|
1178 | 1150 | def testClosestPoint( self ) : |
1179 | 1151 |
|
|
0 commit comments