Commit f8b0948f authored by Julien Finet's avatar Julien Finet Committed by Sebastien Jourdain

Fix typos in web protocols

parent c353ed5c
......@@ -178,7 +178,6 @@ vtkUnsignedCharArray* vtkWebApplication::StillRender(vtkRenderWindow* view, int
value.Data != nullptr /* FIXME SEB &&
view->HasDirtyRepresentation() == false */)
{
//cout << "Reusing cache" << endl;
bool latest = this->Internals->Encoder->GetLatestOutput(this->Internals->ObjectIdMap->GetGlobalId(view), value.Data);
value.HasImagesBeingProcessed = !latest;
return value.Data;
......@@ -210,7 +209,9 @@ vtkUnsignedCharArray* vtkWebApplication::StillRender(vtkRenderWindow* view, int
//vtkTimerLog::MarkEndEvent("StillRenderToString");
//vtkTimerLog::DumpLogWithIndents(&cout, 0.0);
this->Internals->Encoder->PushAndTakeReference(this->Internals->ObjectIdMap->GetGlobalId(view), image, quality);
this->Internals->Encoder->PushAndTakeReference(
this->Internals->ObjectIdMap->GetGlobalId(view), image, quality,
this->ImageEncoding);
assert(image == nullptr);
if (value.Data == nullptr)
......
......@@ -143,7 +143,7 @@ class vtkWebViewPort(vtkWebProtocol):
RPC callback to reset camera.
"""
view = self.getView(viewId)
camera = view.GetRenderer().GetActiveCamera()
camera = view.GetRenderers().GetFirstRenderer().GetActiveCamera()
camera.ResetCamera()
try:
# FIXME seb: view.CenterOfRotation = camera.GetFocalPoint()
......@@ -186,10 +186,10 @@ class vtkWebViewPort(vtkWebProtocol):
def updateCamera(self, view_id, focal_point, view_up, position):
view = self.getView(view_id)
camera = view.GetRenderer().GetActiveCamera()
camera = view.GetRenderers().GetFirstRenderer().GetActiveCamera()
camera.SetFocalPoint(focal_point)
camera.SetCameraViewUp(view_up)
camera.SetCameraPosition(position)
camera.SetViewUp(view_up)
camera.SetPosition(position)
self.getApplication().InvalidateCache(view)
self.getApplication().InvokeEvent('UpdateEvent')
......@@ -342,6 +342,8 @@ class vtkWebPublishImageDelivery(vtkWebProtocol):
self.targetFrameRate = self.maxFrameRate
if nextAnimateTime < 0:
if nextAnimateTime < -1.0:
self.targetFrameRate = 1
if self.targetFrameRate > self.minFrameRate:
self.targetFrameRate -= 1.0
reactor.callLater(0.001, lambda: self.animate())
......@@ -366,10 +368,9 @@ class vtkWebPublishImageDelivery(vtkWebProtocol):
sView = self.getView(viewId)
realViewId = str(self.getGlobalId(sView))
if realViewId not in self.viewsInAnimations:
self.viewsInAnimations.append(realViewId)
if len(self.viewsInAnimations) == 1:
self.animate()
self.viewsInAnimations.append(realViewId)
if len(self.viewsInAnimations) == 1:
self.animate()
@exportRpc("viewport.image.animation.stop")
......@@ -475,7 +476,7 @@ class vtkWebPublishImageDelivery(vtkWebProtocol):
# There is an observer on this view already
self.trackingViews[realViewId]['observerCount'] += 1
self.publish('viewport.image.push.subscription', self.pushRender(realViewId))
self.pushRender(realViewId)
return { 'success': True, 'viewId': realViewId }
......@@ -524,7 +525,7 @@ class vtkWebPublishImageDelivery(vtkWebProtocol):
# Update image size right now!
if "originalSize" in self.trackingViews[realViewId]:
size = [int(s * ratio) for s in self.trackingViews[realViewId]["originalSize"]]
if 'SetSize' in sView:
if hasattr(sView, 'SetSize'):
sView.SetSize(size)
else:
sView.ViewSize = size
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment