()
| 153 | } |
| 154 | |
| 155 | public synchronized void Render() |
| 156 | { |
| 157 | if (!rendering) |
| 158 | { |
| 159 | rendering = true; |
| 160 | if (ren.VisibleActorCount() == 0) |
| 161 | { |
| 162 | rendering = false; |
| 163 | return; |
| 164 | } |
| 165 | if (rw != null) |
| 166 | { |
| 167 | if (windowset == 0) |
| 168 | { |
| 169 | // set the window id and the active camera |
| 170 | cam = ren.GetActiveCamera(); |
| 171 | if (lightingset == 0) |
| 172 | { |
| 173 | ren.AddLight(lgt); |
| 174 | lgt.SetPosition(cam.GetPosition()); |
| 175 | lgt.SetFocalPoint(cam.GetFocalPoint()); |
| 176 | lightingset = 1; |
| 177 | } |
| 178 | RenderCreate(rw); |
| 179 | Lock(); |
| 180 | rw.SetSize(getWidth(), getHeight()); |
| 181 | UnLock(); |
| 182 | windowset = 1; |
| 183 | this.setSize(getWidth(), getHeight()); |
| 184 | } |
| 185 | Lock(); |
| 186 | rw.Render(); |
| 187 | if (rw instanceof vtkOpenGLRenderWindow) |
| 188 | { |
| 189 | ((vtkOpenGLRenderWindow)rw).BlitDisplayFramebuffer(); |
| 190 | } |
| 191 | UnLock(); |
| 192 | rendering = false; |
| 193 | } |
| 194 | } |
| 195 | } |
| 196 | |
| 197 | public boolean isWindowSet() { return (this.windowset == 1); } |
| 198 |
no test coverage detected