Commit 7ce00a39 authored by Charles Law's avatar Charles Law
Browse files

Working toward making desktop the default rendering module.

parent 97c1376c
......@@ -27,7 +27,7 @@
//----------------------------------------------------------------------------
vtkStandardNewMacro(vtkPVDeskTopRenderModule);
vtkCxxRevisionMacro(vtkPVDeskTopRenderModule, "1.10");
vtkCxxRevisionMacro(vtkPVDeskTopRenderModule, "1.11");
......@@ -159,7 +159,7 @@ void vtkPVDeskTopRenderModule::SetPVApplication(vtkPVApplication *pvApp)
// **********************************************************
// create a vtkDesktopDeliveryClient on the client
this->CompositeID = pm->NewStreamObject("vtkDesktopDeliveryClient");
this->CompositeID = pm->NewStreamObject("vtkDesktopDeliveryClient2");
pm->SendStream(vtkProcessModule::CLIENT);
// create a vtkDesktopDeliveryServer on the server, but use
// the same id
......@@ -193,13 +193,16 @@ void vtkPVDeskTopRenderModule::SetPVApplication(vtkPVApplication *pvApp)
pm->GetStream() << vtkClientServerStream::Invoke << this->CompositeID
<< "InitializeRMIs"
<< vtkClientServerStream::End;
// Default to off so that the render window does not show up until necessary.
pm->GetStream() << vtkClientServerStream::Invoke << this->CompositeID
<< "UseCompositingOn"
<< "UseCompositingOff"
<< vtkClientServerStream::End;
tmp = pm->GetStream();
pm->SendStream(vtkProcessModule::CLIENT);
pm->GetStream() = tmp;
pm->SendStream(vtkProcessModule::RENDER_SERVER_ROOT);
this->InitializeObservers();
}
//----------------------------------------------------------------------------
......
......@@ -25,7 +25,7 @@
//----------------------------------------------------------------------------
vtkStandardNewMacro(vtkPVDeskTopRenderModuleUI);
vtkCxxRevisionMacro(vtkPVDeskTopRenderModuleUI, "1.5");
vtkCxxRevisionMacro(vtkPVDeskTopRenderModuleUI, "1.6");
int vtkPVDeskTopRenderModuleUICommand(ClientData cd, Tcl_Interp *interp,
int argc, char *argv[]);
......@@ -66,10 +66,9 @@ void vtkPVDeskTopRenderModuleUI::Create(vtkKWApplication *app, const char *)
//this->SquirtLevelScale->EnabledOff();
//this->SquirtLevelLabel->EnabledOff();
this->SetReductionFactor(1);
this->ReductionCheck->EnabledOff();
this->ReductionLabel->EnabledOff();
//this->SetReductionFactor(1);
//this->ReductionCheck->EnabledOff();
//this->ReductionLabel->EnabledOff();
}
//----------------------------------------------------------------------------
......@@ -78,13 +77,10 @@ void vtkPVDeskTopRenderModuleUI::EnableRenductionFactor()
this->SetReductionFactor(2);
this->ReductionCheck->EnabledOn();
this->ReductionLabel->EnabledOn();
}
//----------------------------------------------------------------------------
void vtkPVDeskTopRenderModuleUI::PrintSelf(ostream& os, vtkIndent indent)
{
......
......@@ -43,7 +43,7 @@
//----------------------------------------------------------------------------
vtkStandardNewMacro(vtkPVRenderModule);
vtkCxxRevisionMacro(vtkPVRenderModule, "1.34");
vtkCxxRevisionMacro(vtkPVRenderModule, "1.35");
//===========================================================================
//***************************************************************************
......@@ -302,7 +302,13 @@ void vtkPVRenderModule::SetPVApplication(vtkPVApplication *pvApp)
<< this->RenderWindowID << "AddRenderer" << this->Renderer2DID
<< vtkClientServerStream::End;
pm->SendStream(vtkProcessModule::CLIENT|vtkProcessModule::RENDER_SERVER);
this->InitializeObservers();
}
//----------------------------------------------------------------------------
void vtkPVRenderModule::InitializeObservers()
{
// the 2d renderer must be kept in sync with the main renderer
this->Renderer->AddObserver(
vtkCommand::StartEvent, this->Observer);
......
......@@ -185,6 +185,9 @@ protected:
int DisableRenderingFlag;
int RenderInterruptsEnabled;
// Handle reset observers because we can do them more efficiently than
// the render manager can.
void InitializeObservers();
unsigned long ResetCameraClippingRangeTag;
vtkPVRenderModuleObserver* Observer;
......
......@@ -103,6 +103,7 @@ IF (PARAVIEW_USE_ICE_T)
vtkIceTFactory.cxx
vtkDesktopDeliveryServer.cxx
vtkDesktopDeliveryClient.cxx
vtkDesktopDeliveryClient2.cxx
)
IF(VTK_USE_MPI)
SET(Filters_SRCS
......
This diff is collapsed.
/*=========================================================================
Program: ParaView
Module: vtkDesktopDeliveryClient2.h
Copyright (c) Kitware, Inc.
All rights reserved.
See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME vtkDesktopDeliveryClient2 - An object for remote rendering.
// .SECTION Caveate
// This class uses image actor to display the final image. The original
// vtkDesktopDelivery used SetPixelData which was slower. This class could be
// cleaned up to remove duplicate code from the superclass, but I might just
// modify vtkClientCompositeManager instead.
// .SECTION Description
// The two vtkDesktopDelivery objects (vtkDesktopDeliveryClient2 and
// vtkDesktopDeliveryServer) work together to enable interactive viewing of
// remotely rendered data. The client attaches itself to a vtkRenderWindow
// and, optionally, a vtkRenderWindowInteractor. Whenever a new rendering
// is requested, the client alerts the server, the server renders a new
// frame, and ships the image back to the client, which will display the
// image in the vtkRenderWindow.
// .SECTION note
// You should set up the renderers and render window interactor before setting
// the render window. We set up observers on the renderer, and we have no
// easy way of knowing when the renderers change.
// .SECTION see also
// vtkDesktopDeliveryServer vtkMultiProcessController vtkRenderWindow
// vtkRenderWindowInteractor
#ifndef __vtkDesktopDeliveryClient2_h
#define __vtkDesktopDeliveryClient2_h
#include "vtkParallelRenderManager.h"
class vtkImageData;
class vtkCamera;
class vtkImageActor;
class VTK_EXPORT vtkDesktopDeliveryClient2 : public vtkParallelRenderManager
{
public:
vtkTypeRevisionMacro(vtkDesktopDeliveryClient2, vtkParallelRenderManager);
virtual void PrintSelf(ostream &os, vtkIndent indent);
static vtkDesktopDeliveryClient2 *New();
// For ParaView
void SetUseCompositing(int v) {this->UseCompositing = v; this->SetParallelRendering(v);}
void SetRenderManager(vtkParallelRenderManager*) {};
// Description:
// Set/Get the controller that is attached to a vtkDesktopDeliveryServer.
// This object will assume that the controller has two processors, and
// that the controller on the opposite side of the controller has been
// given to the server object.
virtual void SetController(vtkMultiProcessController *controller);
virtual void SetRenderWindow(vtkRenderWindow *renWin);
// Description:
// If ReplaceActors is set to on (the default), then all the actors of
// each Renderer attached to the RenderWindow are replaced with a single
// bounding box. The replacement occurs whenever a camera is reset or
// the visible prop bounds are calculated. If set to off, the actors are
// never modified.
vtkSetMacro(ReplaceActors, int);
vtkGetMacro(ReplaceActors, int);
vtkBooleanMacro(ReplaceActors, int);
virtual void ComputeVisiblePropBounds(vtkRenderer *ren, double bounds[6]);
// Description:
// Returns true if remote display is on. If remote display is on, then
// the RenderWindow will be updated with an image rendered on the client.
// If not, the RenderWindow keeps the image its Renderers draw. The
// RemoteDisplay flag is determined by the server. The remote display
// is specified by the server, so the value may be out of date if an
// image has not been rendered since the last time the value changed on
// the server.
vtkGetMacro(RemoteDisplay, int);
vtkGetMacro(RemoteImageProcessingTime, double);
vtkGetMacro(TransferTime, double);
virtual double GetRenderTime() {
return (this->RenderTime - this->RemoteImageProcessingTime);
}
virtual double GetImageProcessingTime() {
return ( this->RemoteImageProcessingTime
+ this->TransferTime + this->ImageProcessingTime);
}
// For ParaView
void SetSquirtLevel (int l)
{ if (l == 0) {this->SquirtOff();} else {
this->SquirtOn(); this->SetSquirtCompressionLevel(l-1);}}
// Description:
// Enables or disables SQUIRT compression for image delivery. By
// default, compression is off. Note that this function may be replaced
// with a more universal image compression at a later date.
vtkGetMacro(Squirt, int);
vtkSetMacro(Squirt, int);
vtkBooleanMacro(Squirt, int);
// Description:
// Sets the compression level used by SQUIRT. Higher values result in
// better compression but lower resolution in the color space (the size
// of the image is unaffected by this option).
vtkGetMacro(SquirtCompressionLevel, int);
vtkSetClampMacro(SquirtCompressionLevel, int, 0, 5);
virtual void SetImageReductionFactorForUpdateRate(double DesiredUpdateRate);
// Description:
// Call back to reset the camera. I hope we can get rid of this method
// when we can place image actor in screen coordinates.
virtual void StartRender();
virtual void EndRender();
protected:
vtkDesktopDeliveryClient2();
virtual ~vtkDesktopDeliveryClient2();
virtual void PreRenderProcessing();
virtual void PostRenderProcessing();
int ServerProcessId;
int ReplaceActors;
// Updated by UpdateServerInfo.
int RemoteDisplay;
double RemoteImageProcessingTime;
double TransferTime;
virtual void SendWindowInformation();
// Squirt options (probably to be replaced later).
int Squirt;
int SquirtCompressionLevel;
vtkUnsignedCharArray *SquirtBuffer;
void SquirtDecompress(vtkUnsignedCharArray *in, vtkUnsignedCharArray *out);
int UseCompositing;
// Stuff used for texture map display of final image.
vtkImageData *CompositeData;
vtkImageActor *ImageActor;
// This is used to restore the camera.
// We have to change it to display the image actor.
vtkCamera* SavedCamera;
// Description:
// Write the full image back to the RenderWindow (using texture map).
virtual void WriteFullImage();
private:
vtkDesktopDeliveryClient2(const vtkDesktopDeliveryClient2 &); //Not implemented
void operator=(const vtkDesktopDeliveryClient2 &); //Not implemented
};
#endif //__vtkDesktopDeliveryClient2_h
......@@ -43,7 +43,7 @@ static void SatelliteEndParallelRender(vtkObject *caller,
unsigned long vtkNotUsed(event),
void *clientData, void *);
vtkCxxRevisionMacro(vtkDesktopDeliveryServer, "1.7");
vtkCxxRevisionMacro(vtkDesktopDeliveryServer, "1.8");
vtkStandardNewMacro(vtkDesktopDeliveryServer);
vtkDesktopDeliveryServer::vtkDesktopDeliveryServer()
......@@ -104,6 +104,9 @@ void vtkDesktopDeliveryServer
// Create a reference.
this->ParallelRenderManager->Register(this);
// No need to write the image back on the render server.
this->ParallelRenderManager->WriteBackImagesOff();
// Attach observers.
vtkCallbackCommand *cbc;
......
Supports Markdown
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