Commit 809f12c9 authored by Utkarsh Ayachit's avatar Utkarsh Ayachit Committed by Kitware Robot
Browse files

Merge topic '0013486-export_gl2ps_charts'

86f50f81 Add missing object factory include.
b72c1cb8 Enable GL2PS export for charts.
parents ef48d7cd 86f50f81
......@@ -43,6 +43,7 @@ set (Module_SRCS
vtkSMCSVExporterProxy.cxx
vtkSMDirectoryProxy.cxx
vtkSMExporterProxy.cxx
vtkSMGL2PSExporterProxy.cxx
vtkSMInteractionUndoStackBuilder.cxx
vtkSMMultiServerSourceProxy.cxx
vtkSMNullProxy.cxx
......
/*=========================================================================
Program: ParaView
Module: vtkSMGL2PSExporterProxy.cxx
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.
=========================================================================*/
#include "vtkSMGL2PSExporterProxy.h"
#include "vtkObjectFactory.h"
#include "vtkPVGL2PSExporter.h"
#include "vtkSMProxy.h"
#include "vtkSMRenderViewProxy.h"
#include "vtkSMContextViewProxy.h"
vtkStandardNewMacro(vtkSMGL2PSExporterProxy)
//----------------------------------------------------------------------------
vtkSMGL2PSExporterProxy::vtkSMGL2PSExporterProxy()
{
}
//----------------------------------------------------------------------------
vtkSMGL2PSExporterProxy::~vtkSMGL2PSExporterProxy()
{
}
//----------------------------------------------------------------------------
bool vtkSMGL2PSExporterProxy::CanExport(vtkSMProxy* proxy)
{
return proxy && ( proxy->IsA("vtkSMRenderViewProxy") ||
proxy->IsA("vtkSMContextViewProxy") );
}
//----------------------------------------------------------------------------
void vtkSMGL2PSExporterProxy::Write()
{
this->CreateVTKObjects();
vtkPVGL2PSExporter* exporter = vtkPVGL2PSExporter::SafeDownCast(
this->GetClientSideObject());
vtkRenderWindow *renWin = NULL;
// Forces vtkGL2PSExporter::NO_SORT for charts, as they use a painter.
bool forceNoSort = false;
if (vtkSMRenderViewProxy* rv = vtkSMRenderViewProxy::SafeDownCast(this->View))
{
renWin = rv->GetRenderWindow();
}
else if (vtkSMContextViewProxy *cv =
vtkSMContextViewProxy::SafeDownCast(this->View))
{
renWin = cv->GetRenderWindow();
forceNoSort = true;
}
if (exporter && renWin)
{
int oldSort = -1;
if (forceNoSort)
{
oldSort = exporter->GetSort();
exporter->SetSortToOff();
}
exporter->SetRenderWindow(renWin);
exporter->Write();
exporter->SetRenderWindow(0);
if (forceNoSort)
{
exporter->SetSort(oldSort);
}
}
}
//----------------------------------------------------------------------------
void vtkSMGL2PSExporterProxy::PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os, indent);
}
/*=========================================================================
Program: ParaView
Module: vtkSMGL2PSExporterProxy.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 vtkSMGL2PSExporterProxy - Proxy for vtkPVGL2PSExporter
// .SECTION Description
// Proxy for vtkPVGL2PSExporter
#ifndef __vtkSMGL2PSExporterProxy_h
#define __vtkSMGL2PSExporterProxy_h
#include "vtkSMRenderViewExporterProxy.h"
#include "vtkPVServerManagerDefaultModule.h" //needed for exports
class VTKPVSERVERMANAGERDEFAULT_EXPORT vtkSMGL2PSExporterProxy :
public vtkSMRenderViewExporterProxy
{
public:
static vtkSMGL2PSExporterProxy* New();
vtkTypeMacro(vtkSMGL2PSExporterProxy, vtkSMRenderViewExporterProxy);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Returns if the view can be exported.
// Default implementation return true if the view is a render view or a
// context view.
bool CanExport(vtkSMProxy*);
// Description:
// Export the current view.
void Write();
//BTX
protected:
vtkSMGL2PSExporterProxy();
~vtkSMGL2PSExporterProxy();
private:
vtkSMGL2PSExporterProxy(const vtkSMGL2PSExporterProxy&); // Not implemented
void operator=(const vtkSMGL2PSExporterProxy&); // Not implemented
//ETX
};
#endif
......@@ -2278,7 +2278,7 @@
</StringVectorProperty>
<!-- End of POVExporter -->
</RenderViewExporterProxy>
<RenderViewExporterProxy class="not-used"
<GL2PSExporterProxy class="not-used"
name="GL2PSExporterBase">
<Documentation>Base API definition for all GL2PS vector graphic exporters.
</Documentation>
......@@ -2349,8 +2349,8 @@
<BooleanDomain name="bool" />
</IntVectorProperty>
<!-- End of "GL2PSExporterBase" -->
</RenderViewExporterProxy>
<RenderViewExporterProxy base_proxygroup="exporters"
</GL2PSExporterProxy>
<GL2PSExporterProxy base_proxygroup="exporters"
base_proxyname="GL2PSExporterBase"
class="vtkPVGL2PSExporter"
file_extension="ps"
......@@ -2375,8 +2375,8 @@
Encapsulated PostScript, 2: PDF, 3: TeX, 4: SVG</Documentation>
</IntVectorProperty>
<!-- End of GL2PSExporterPS -->
</RenderViewExporterProxy>
<RenderViewExporterProxy base_proxygroup="exporters"
</GL2PSExporterProxy>
<GL2PSExporterProxy base_proxygroup="exporters"
base_proxyname="GL2PSExporterBase"
class="vtkPVGL2PSExporter"
file_extension="eps"
......@@ -2394,8 +2394,8 @@
Encapsulated PostScript, 2: PDF, 3: TeX, 4: SVG</Documentation>
</IntVectorProperty>
<!-- End of GL2PSExporterEPS -->
</RenderViewExporterProxy>
<RenderViewExporterProxy base_proxygroup="exporters"
</GL2PSExporterProxy>
<GL2PSExporterProxy base_proxygroup="exporters"
base_proxyname="GL2PSExporterBase"
class="vtkPVGL2PSExporter"
file_extension="pdf"
......@@ -2413,8 +2413,8 @@
Encapsulated PostScript, 2: PDF, 3: TeX, 4: SVG</Documentation>
</IntVectorProperty>
<!-- End of GL2PSExporterPDF -->
</RenderViewExporterProxy>
<RenderViewExporterProxy base_proxygroup="exporters"
</GL2PSExporterProxy>
<GL2PSExporterProxy base_proxygroup="exporters"
base_proxyname="GL2PSExporterBase"
class="vtkPVGL2PSExporter"
file_extension="svg"
......@@ -2432,7 +2432,7 @@
Encapsulated PostScript, 2: PDF, 3: TeX, 4: SVG</Documentation>
</IntVectorProperty>
<!-- End of GL2PSExporterSVG -->
</RenderViewExporterProxy>
</GL2PSExporterProxy>
<!-- End of "exporters" -->
</ProxyGroup>
<ProxyGroup name="point_placers">
......
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