Commit acdee51d authored by David Partyka's avatar David Partyka Committed by Kitware Robot
Browse files

Merge topic 'plot-matrix-resolve'

402a9342 Add private copy operator/constructor for vtkPVPlotMatrixRepresentation
54f51399 Fixed build issues.
3a44b5c6 Fixed HeaderTesting.
b23184b6 Ported collaboration code to new scatter plot branch
7451bc2c Bring in the new VTK with all the pvvtk-master merges.
eb5aa104 Bring in new scatter plot matrix features/fixes
a2ef60c5 ENH: Added selection link between plot-matrix view and other views
e28b9c14 Store plot matrix settings in vtkPVPlotMatrixRepresentation
e3c95262 Change plot matrix color properties to be doubles instead of strings
6609b7f2 Remove vtkSMPlotMatrixRepresentationProxy class
bb8285ea Use pqChartRepresentation for plot matrix
3f9dbee3 Add more settings for plot matrix view
22471389 Set rootIsDecorated to false in pqPlotMatrixDisplayPanel
ed207fc9 Call renderViewEventually() when model changes for plot matrix
4f5cc67d Add scatter plot matrix support
parents 5bc7ae18 402a9342
......@@ -77,6 +77,8 @@ SET (Kit_SRCS
vtkPVOptionsXMLParser.cxx
vtkPVParallelCoordinatesChartView.cxx
vtkPVParallelCoordinatesRepresentation.cxx
vtkPVPlotMatrixView.cxx
vtkPVPlotMatrixRepresentation.cxx
vtkPVPlugin.cxx
vtkPVPluginLoader.cxx
vtkPVPluginTracker.cxx
......
......@@ -101,7 +101,7 @@ bool vtkChartRepresentation::AddToView(vtkView* view)
this->ContextView = chartView;
if (this->Options)
{
this->Options->SetChart(chartView->GetChart());
this->Options->SetChart(vtkChart::SafeDownCast(chartView->GetContextItem()));
this->Options->SetTableVisibility(this->GetVisibility());
}
return true;
......@@ -204,12 +204,15 @@ int vtkChartRepresentation::RequestData(vtkInformation* request,
this->Options->SetTable(this->GetLocalOutput());
}
if (this->ContextView && this->ContextView->GetChart())
if (this->ContextView)
{
vtkSelection* sel = vtkSelection::SafeDownCast(
this->SelectionDeliveryFilter->GetOutputDataObject(0));
this->AnnLink->SetCurrentSelection(sel);
this->ContextView->GetChart()->SetAnnotationLink(this->AnnLink);
if(vtkChart *chart = vtkChart::SafeDownCast(this->ContextView->GetContextItem()))
{
vtkSelection* sel = vtkSelection::SafeDownCast(
this->SelectionDeliveryFilter->GetOutputDataObject(0));
this->AnnLink->SetCurrentSelection(sel);
chart->SetAnnotationLink(this->AnnLink);
}
}
return this->Superclass::RequestData(request, inputVector, outputVector);
......
......@@ -23,6 +23,7 @@
#include "vtkPVView.h"
class vtkContextView;
class vtkAbstractContextItem;
class vtkRenderWindow;
class vtkChart;
......@@ -48,8 +49,8 @@ public:
vtkGetObjectMacro(ContextView, vtkContextView);
// Description:
// Get the chart.
virtual vtkChart* GetChart()=0;
// Get the context item.
virtual vtkAbstractContextItem* GetContextItem() = 0;
// Description:
vtkGetObjectMacro(RenderWindow, vtkRenderWindow);
......
......@@ -47,6 +47,10 @@ bool vtkPVParallelCoordinatesRepresentation::AddToView(vtkView* view)
return false;
}
std::cout << "pc table: ";
this->GetLocalOutput()->Print(std::cout);
std::cout << "num cols: " << this->GetLocalOutput()->GetNumberOfColumns() << std::endl;
if (this->GetChart())
{
// Set the table, in case it has changed.
......@@ -74,7 +78,7 @@ vtkChartParallelCoordinates* vtkPVParallelCoordinatesRepresentation::GetChart()
if (this->ContextView)
{
return vtkChartParallelCoordinates::SafeDownCast(
this->ContextView->GetChart());
this->ContextView->GetContextItem());
}
return 0;
......
/*=========================================================================
Program: ParaView
Module: pqPlotMatrixDisplayPanel.h
Copyright (c) 2005-2008 Sandia Corporation, Kitware Inc.
All rights reserved.
ParaView is a free software; you can redistribute it and/or modify it
under the terms of the ParaView license version 1.2.
See License_v1.2.txt for the full ParaView license.
A copy of this license can be obtained by contacting
Kitware Inc.
28 Corporate Drive
Clifton Park, NY 12065
USA
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
=========================================================================*/
#include "vtkPVPlotMatrixRepresentation.h"
#include "vtkObjectFactory.h"
#include "vtkScatterPlotMatrix.h"
#include "vtkPVContextView.h"
#include "vtkTable.h"
#include "vtkStdString.h"
#include "vtkPlotPoints.h"
#include "vtkAnnotationLink.h"
#include "vtkSelectionDeliveryFilter.h"
vtkStandardNewMacro(vtkPVPlotMatrixRepresentation);
//----------------------------------------------------------------------------
vtkPVPlotMatrixRepresentation::vtkPVPlotMatrixRepresentation()
{
// default colors are black (0, 0, 0)
for(int i = 0; i < 3; i++)
{
this->ScatterPlotColor[i] = 0;
this->ActivePlotColor[i] = 0;
this->HistogramColor[i] = 0;
}
this->ScatterPlotMarkerStyle = vtkPlotPoints::CIRCLE;
this->ActivePlotMarkerStyle = vtkPlotPoints::CIRCLE;
this->ScatterPlotMarkerSize = 5.0;
this->ActivePlotMarkerSize = 8.0;
}
//----------------------------------------------------------------------------
vtkPVPlotMatrixRepresentation::~vtkPVPlotMatrixRepresentation()
{
}
//----------------------------------------------------------------------------
bool vtkPVPlotMatrixRepresentation::AddToView(vtkView *view)
{
if(!this->Superclass::AddToView(view))
{
return false;
}
if(vtkScatterPlotMatrix *plotMatrix = this->GetPlotMatrix())
{
plotMatrix->SetInput(this->GetLocalOutput());
plotMatrix->SetVisible(true);
// set chart properties
plotMatrix->SetColor(this->ScatterPlotColor[0],
this->ScatterPlotColor[1],
this->ScatterPlotColor[2]);
plotMatrix->SetHistogramColor(this->HistogramColor[0],
this->HistogramColor[1],
this->HistogramColor[2]);
plotMatrix->SetActivePlotColor(this->ActivePlotColor[0],
this->ActivePlotColor[1],
this->ActivePlotColor[2]);
plotMatrix->SetMarkerStyle(this->ScatterPlotMarkerStyle);
plotMatrix->SetActivePlotMarkerStyle(this->ActivePlotMarkerStyle);
plotMatrix->SetMarkerSize(this->ScatterPlotMarkerSize);
plotMatrix->SetActivePlotMarkerSize(this->ActivePlotMarkerSize);
}
return true;
}
//----------------------------------------------------------------------------
bool vtkPVPlotMatrixRepresentation::RemoveFromView(vtkView* view)
{
if(vtkScatterPlotMatrix *plotMatrix = this->GetPlotMatrix())
{
plotMatrix->SetInput(0);
plotMatrix->SetVisible(false);
}
return this->Superclass::RemoveFromView(view);
}
//----------------------------------------------------------------------------
int vtkPVPlotMatrixRepresentation::RequestData(vtkInformation *request,
vtkInformationVector **inputVector,
vtkInformationVector *outputVector)
{
if(!this->Superclass::RequestData(request, inputVector, outputVector))
{
return 0;
}
if(vtkScatterPlotMatrix *plotMatrix = this->GetPlotMatrix())
{
plotMatrix->SetInput(this->GetLocalOutput());
if(vtkAnnotationLink* annLink = plotMatrix->GetActiveAnnotationLink())
{
vtkSelection* sel = vtkSelection::SafeDownCast(
this->SelectionDeliveryFilter->GetOutputDataObject(0));
annLink->SetCurrentSelection(sel);
}
}
return 1;
}
//----------------------------------------------------------------------------
void vtkPVPlotMatrixRepresentation::SetVisibility(bool visible)
{
if(vtkScatterPlotMatrix *plotMatrix = this->GetPlotMatrix())
{
plotMatrix->SetVisible(visible);
}
}
//----------------------------------------------------------------------------
void vtkPVPlotMatrixRepresentation::SetSeriesVisibility(const char *name, bool visible)
{
if(vtkScatterPlotMatrix *plotMatrix = this->GetPlotMatrix())
{
plotMatrix->SetColumnVisibility(name, visible);
}
}
//----------------------------------------------------------------------------
void vtkPVPlotMatrixRepresentation::SetSeriesLabel(const char *name, const char *label)
{
if(vtkScatterPlotMatrix *plotMatrix = this->GetPlotMatrix())
{
}
}
//----------------------------------------------------------------------------
void vtkPVPlotMatrixRepresentation::SetColor(double r, double g, double b)
{
if(vtkScatterPlotMatrix *plotMatrix = this->GetPlotMatrix())
{
plotMatrix->SetColor(r, g, b);
}
this->ScatterPlotColor[0] = r;
this->ScatterPlotColor[1] = g;
this->ScatterPlotColor[2] = b;
}
//----------------------------------------------------------------------------
void vtkPVPlotMatrixRepresentation::SetActivePlotColor(double r, double g, double b)
{
if(vtkScatterPlotMatrix *plotMatrix = this->GetPlotMatrix())
{
plotMatrix->SetActivePlotColor(r, g, b);
}
this->ActivePlotColor[0] = r;
this->ActivePlotColor[1] = g;
this->ActivePlotColor[2] = b;
}
//----------------------------------------------------------------------------
void vtkPVPlotMatrixRepresentation::SetHistogramColor(double r, double g, double b)
{
if(vtkScatterPlotMatrix *plotMatrix = this->GetPlotMatrix())
{
plotMatrix->SetHistogramColor(r, g, b);
}
this->HistogramColor[0] = r;
this->HistogramColor[1] = g;
this->HistogramColor[2] = b;
}
//----------------------------------------------------------------------------
void vtkPVPlotMatrixRepresentation::SetMarkerStyle(int style)
{
if(vtkScatterPlotMatrix *plotMatrix = this->GetPlotMatrix())
{
plotMatrix->SetMarkerStyle(style);
}
this->ScatterPlotMarkerStyle = style;
}
//----------------------------------------------------------------------------
void vtkPVPlotMatrixRepresentation::SetActivePlotMarkerStyle(int style)
{
if(vtkScatterPlotMatrix *plotMatrix = this->GetPlotMatrix())
{
plotMatrix->SetActivePlotMarkerStyle(style);
}
this->ActivePlotMarkerStyle = style;
}
//----------------------------------------------------------------------------
void vtkPVPlotMatrixRepresentation::SetMarkerSize(double size)
{
if(vtkScatterPlotMatrix *plotMatrix = this->GetPlotMatrix())
{
plotMatrix->SetMarkerSize(size);
}
this->ScatterPlotMarkerSize = size;
}
//----------------------------------------------------------------------------
void vtkPVPlotMatrixRepresentation::SetActivePlotMarkerSize(double size)
{
if(vtkScatterPlotMatrix *plotMatrix = this->GetPlotMatrix())
{
plotMatrix->SetActivePlotMarkerSize(size);
}
this->ActivePlotMarkerSize = size;
}
//----------------------------------------------------------------------------
void vtkPVPlotMatrixRepresentation::PrintSelf(ostream &os, vtkIndent indent)
{
this->Superclass::PrintSelf(os, indent);
}
//----------------------------------------------------------------------------
vtkScatterPlotMatrix* vtkPVPlotMatrixRepresentation::GetPlotMatrix() const
{
if(this->ContextView)
{
return vtkScatterPlotMatrix::SafeDownCast(this->ContextView->GetContextItem());
}
return 0;
}
/*=========================================================================
Program: ParaView
Module: pqPlotMatrixDisplayPanel.h
Copyright (c) 2005-2008 Sandia Corporation, Kitware Inc.
All rights reserved.
ParaView is a free software; you can redistribute it and/or modify it
under the terms of the ParaView license version 1.2.
See License_v1.2.txt for the full ParaView license.
A copy of this license can be obtained by contacting
Kitware Inc.
28 Corporate Drive
Clifton Park, NY 12065
USA
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
=========================================================================*/
#ifndef _vtkPVPlotMatrixRepresentation_h
#define _vtkPVPlotMatrixRepresentation_h
#include "vtkChartRepresentation.h"
class vtkScatterPlotMatrix;
class VTK_EXPORT vtkPVPlotMatrixRepresentation : public vtkChartRepresentation
{
public:
static vtkPVPlotMatrixRepresentation* New();
vtkTypeMacro(vtkPVPlotMatrixRepresentation, vtkChartRepresentation);
void PrintSelf(ostream &os, vtkIndent indent);
// Description:
// Sets the visibility for the plot matrix representation.
virtual void SetVisibility(bool visible);
// Description:
// Sets the visibility for the series in the plot matrix.
void SetSeriesVisibility(const char *name, bool visible);
// Description:
// Sets the label for the series in the plot matrix.
void SetSeriesLabel(const char *name, const char *label);
// Description:
// Sets the color for the scatter plots in the plot matrix.
void SetColor(double r, double g, double b);
// Description:
// Sets the color for the active plot.
void SetActivePlotColor(double r, double g, double b);
// Description:
// Sets the color for the histograms.
void SetHistogramColor(double r, double g, double b);
// Description:
// Sets the marker style for the scatter plots.
void SetMarkerStyle(int style);
// Description:
// Sets the marker style for the active plot.
void SetActivePlotMarkerStyle(int style);
// Description:
// Sets the marker size for the scatter plots.
void SetMarkerSize(double size);
// Description:
// Sets the marker size for the active plots.
void SetActivePlotMarkerSize(double size);
// Description:
// Returns the scatter plot matrix.
vtkScatterPlotMatrix* GetPlotMatrix() const;
protected:
vtkPVPlotMatrixRepresentation();
~vtkPVPlotMatrixRepresentation();
virtual int RequestData(vtkInformation *,
vtkInformationVector **,
vtkInformationVector *);
// Description:
// Add the plot matrix representation to the view.
virtual bool AddToView(vtkView *view);
// Description:
// Remove the plot matrix representation from the view.
virtual bool RemoveFromView(vtkView *view);
private:
vtkPVPlotMatrixRepresentation(const vtkPVPlotMatrixRepresentation&); // Not implemented
void operator=(const vtkPVPlotMatrixRepresentation&); // Not implemented
private:
double ActivePlotColor[3];
double ScatterPlotColor[3];
double HistogramColor[3];
int ScatterPlotMarkerStyle;
int ActivePlotMarkerStyle;
double ScatterPlotMarkerSize;
double ActivePlotMarkerSize;
};
#endif
/*=========================================================================
Program: ParaView
Module: vtkPVPlotMatrixView.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.
=========================================================================*/
#include "vtkPVPlotMatrixView.h"
#include "vtkObjectFactory.h"
#include "vtkScatterPlotMatrix.h"
#include "vtkContextView.h"
#include "vtkContextScene.h"
#include "vtkCommand.h"
vtkStandardNewMacro(vtkPVPlotMatrixView);
//----------------------------------------------------------------------------
vtkPVPlotMatrixView::vtkPVPlotMatrixView()
{
this->PlotMatrix = vtkScatterPlotMatrix::New();
this->PlotMatrix->AddObserver(
vtkCommand::SelectionChangedEvent, this,
&vtkPVPlotMatrixView::PlotMatrixSelectionCallback);
this->ContextView->GetScene()->AddItem(this->PlotMatrix);
}
//----------------------------------------------------------------------------
vtkPVPlotMatrixView::~vtkPVPlotMatrixView()
{
this->PlotMatrix->Delete();
}
//----------------------------------------------------------------------------
vtkAbstractContextItem* vtkPVPlotMatrixView::GetContextItem()
{
return this->PlotMatrix;
}
//----------------------------------------------------------------------------
void vtkPVPlotMatrixView::PlotMatrixSelectionCallback(vtkObject*,
unsigned long event, void*)
{
// forward the SelectionChangedEvent
this->InvokeEvent(event);
}
//----------------------------------------------------------------------------
void vtkPVPlotMatrixView::PrintSelf(ostream &os, vtkIndent indent)
{
this->Superclass::PrintSelf(os, indent);
}
/*=========================================================================
Program: ParaView
Module: vtkPVPlotMatrixView.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.
=========================================================================*/
#ifndef __vtkPVPlotMatrixView_h
#define __vtkPVPlotMatrixView_h
#include "vtkPVContextView.h"
class vtkScatterPlotMatrix;
class VTK_EXPORT vtkPVPlotMatrixView : public vtkPVContextView
{
public:
static vtkPVPlotMatrixView* New();
vtkTypeMacro(vtkPVPlotMatrixView, vtkPVContextView);
void PrintSelf(ostream &os, vtkIndent indent);
vtkAbstractContextItem* GetContextItem();
protected:
vtkPVPlotMatrixView();
~vtkPVPlotMatrixView();
// Description:
// The callback function when SelectionChangedEvent is invoked from
// the Big chart in vtkScatterPlotMatrix.
void PlotMatrixSelectionCallback(vtkObject*, unsigned long, void*);
private:
vtkPVPlotMatrixView(const vtkPVPlotMatrixView&); // Not implemented.
void operator=(const vtkPVPlotMatrixView&); // Not implemented.
vtkScatterPlotMatrix *PlotMatrix;
};
#endif
......@@ -84,6 +84,12 @@ vtkPVXYChartView::~vtkPVXYChartView()
this->Command->Delete();
}
//----------------------------------------------------------------------------
vtkAbstractContextItem* vtkPVXYChartView::GetContextItem()
{
return this->GetChart();
}
//----------------------------------------------------------------------------
void vtkPVXYChartView::SetChartType(const char *type)
{
......
......@@ -233,6 +233,10 @@ public:
// Provides access to the chart view.
virtual vtkChart* GetChart();
// Description: