@@ -43,17 +43,27 @@ test.onlyIfWebGL('Test Actor2D', (t) => {
43
43
actor2D . getProperty ( ) . setOpacity ( 0.3 ) ;
44
44
actor2D . getProperty ( ) . setDisplayLocation ( DisplayLocation . FOREGROUND ) ;
45
45
actor2D . getProperty ( ) . setRepresentation ( Representation . SURFACE ) ;
46
+ actor2D . setLayerNumber ( 2 ) ;
46
47
renderer . addActor2D ( actor2D ) ;
47
48
const actor2D1 = gc . registerResource ( vtkActor2D . newInstance ( ) ) ;
48
49
actor2D1 . getProperty ( ) . setColor ( [ 0.1 , 0.8 , 0.5 ] ) ;
49
50
actor2D1 . getProperty ( ) . setDisplayLocation ( DisplayLocation . BACKGROUND ) ;
50
51
actor2D1 . getProperty ( ) . setRepresentation ( Representation . SURFACE ) ;
51
52
renderer . addActor2D ( actor2D1 ) ;
53
+ actor2D1 . setLayerNumber ( 1 ) ;
54
+ const actor2D2 = gc . registerResource ( vtkActor2D . newInstance ( ) ) ;
55
+ actor2D2 . getProperty ( ) . setColor ( [ 0.8 , 0.4 , 0.4 ] ) ;
56
+ actor2D2 . getProperty ( ) . setOpacity ( 1.0 ) ;
57
+ actor2D2 . getProperty ( ) . setDisplayLocation ( DisplayLocation . FOREGROUND ) ;
58
+ actor2D2 . getProperty ( ) . setRepresentation ( Representation . SURFACE ) ;
59
+ actor2D2 . setLayerNumber ( 1 ) ;
60
+ renderer . addActor2D ( actor2D2 ) ;
52
61
53
62
const mapper = gc . registerResource ( vtkMapper . newInstance ( ) ) ;
54
63
actor . setMapper ( mapper ) ;
55
64
const mapper2D = gc . registerResource ( vtkMapper2D . newInstance ( ) ) ;
56
65
const mapper2D1 = gc . registerResource ( vtkMapper2D . newInstance ( ) ) ;
66
+ const mapper2D2 = gc . registerResource ( vtkMapper2D . newInstance ( ) ) ;
57
67
const c = vtkCoordinate . newInstance ( ) ;
58
68
c . setCoordinateSystemToWorld ( ) ;
59
69
mapper2D . setTransformCoordinate ( c ) ;
@@ -62,21 +72,30 @@ test.onlyIfWebGL('Test Actor2D', (t) => {
62
72
mapper2D1 . setTransformCoordinate ( c ) ;
63
73
mapper2D1 . setScalarVisibility ( false ) ;
64
74
actor2D1 . setMapper ( mapper2D1 ) ;
75
+ mapper2D2 . setTransformCoordinate ( c ) ;
76
+ mapper2D2 . setScalarVisibility ( false ) ;
77
+ actor2D2 . setMapper ( mapper2D2 ) ;
65
78
66
79
const cubeSource = gc . registerResource ( vtkCubeSource . newInstance ( ) ) ;
67
80
mapper . setInputConnection ( cubeSource . getOutputPort ( ) ) ;
68
81
const sphereSource = gc . registerResource ( vtkSphereSource . newInstance ( ) ) ;
69
82
sphereSource . setCenter ( - 0.5 , 0.0 , 0.0 ) ;
70
- sphereSource . setRadius ( 0.3 ) ;
83
+ sphereSource . setRadius ( 0.35 ) ;
71
84
sphereSource . setThetaResolution ( 25 ) ;
72
85
sphereSource . setPhiResolution ( 25 ) ;
73
86
mapper2D . setInputConnection ( sphereSource . getOutputPort ( ) ) ;
74
87
const sphereSource1 = gc . registerResource ( vtkSphereSource . newInstance ( ) ) ;
75
- sphereSource1 . setCenter ( 0.5 , - 0.3 , 0.0 ) ;
76
- sphereSource1 . setRadius ( 0.3 ) ;
88
+ sphereSource1 . setCenter ( 0 , - 0.5 , 0.0 ) ;
89
+ sphereSource1 . setRadius ( 0.45 ) ;
77
90
sphereSource1 . setThetaResolution ( 30 ) ;
78
91
sphereSource1 . setPhiResolution ( 30 ) ;
79
92
mapper2D1 . setInputConnection ( sphereSource1 . getOutputPort ( ) ) ;
93
+ const sphereSource2 = gc . registerResource ( vtkSphereSource . newInstance ( ) ) ;
94
+ sphereSource2 . setCenter ( - 0.2 , - 0.3 , 0.0 ) ;
95
+ sphereSource2 . setRadius ( 0.35 ) ;
96
+ sphereSource2 . setThetaResolution ( 30 ) ;
97
+ sphereSource2 . setPhiResolution ( 30 ) ;
98
+ mapper2D2 . setInputConnection ( sphereSource2 . getOutputPort ( ) ) ;
80
99
81
100
renderer . getActiveCamera ( ) . azimuth ( 25 ) ;
82
101
renderer . getActiveCamera ( ) . roll ( 25 ) ;
0 commit comments