Commit d177dc90 authored by Utkarsh Ayachit's avatar Utkarsh Ayachit

Fixed proxies needed for chart representations.

parent f3a3afc4
......@@ -23,6 +23,7 @@ SET (Kit_SRCS
# --- PM Objects ---
vtkPMArraySelectionProperty.cxx
vtkPMCompoundSourceProxy.cxx
vtkPMContextArraysProperty.cxx
vtkPMDataArrayProperty.cxx
vtkPMDoubleVectorProperty.cxx
vtkPMFileSeriesReaderProxy.cxx
......@@ -35,9 +36,9 @@ SET (Kit_SRCS
vtkPMProxy.cxx
vtkPMProxyProperty.cxx
vtkPMPVRepresentationProxy.cxx
vtkPMScalarBarActorProxy.cxx
vtkPMSelectionRepresentationProxy.cxx
vtkPMSILProperty.cxx
vtkPMScalarBarActorProxy.cxx
vtkPMSourceProxy.cxx
vtkPMStringVectorProperty.cxx
vtkPMTextSourceRepresentationProxy.cxx
......@@ -46,9 +47,9 @@ SET (Kit_SRCS
vtkPMUniformGridVolumeRepresentationProxy.cxx
vtkPMVectorProperty.cxx
vtkPMWriterProxy.cxx
vtkPVKeyFrameAnimationCueForProxies.cxx
vtkPVComparativeView.cxx
vtkPVComparativeAnimationCue.cxx
vtkPVComparativeView.cxx
vtkPVKeyFrameAnimationCueForProxies.cxx
# --- SM Objects ---
vtkSMAnimationScene.cxx
vtkSMAnimationSceneImageWriter.cxx
......@@ -64,6 +65,7 @@ SET (Kit_SRCS
vtkSMCompoundProxyDefinitionLoader.cxx
vtkSMCompoundSourceProxy.cxx
vtkSMCompoundSourceProxyDefinitionBuilder.cxx
vtkSMContextNamedOptionsProxy.cxx
vtkSMContextViewProxy.cxx
vtkSMCSVExporterProxy.cxx
vtkSMDeserializer.cxx
......@@ -199,8 +201,6 @@ SET(Kit_SRCS
## Comparative view +++++++++
## Charts stuff +++++++++++++
vtkSMContextArraysInformationHelper.cxx #---- SM Side only, not managed yet...
vtkSMContextNamedOptionsProxy.cxx #----------- Get stuff on local VTK object
## Reader/Writer factory +++++++++++
vtkSMWriterProxy.cxx
......
......@@ -3491,11 +3491,11 @@
<StringVectorProperty name="SeriesNamesInfo"
number_of_elements_per_command="1"
element_types="2"
information_only="1">
information_only="1"
kernel_class="vtkPMContextArraysProperty" >
<Documentation>
Property providing list of available series that can be plotted.
</Documentation>
<ContextArraysInformationHelper />
</StringVectorProperty>
<StringVectorProperty name="XArrayName"
......
/*=========================================================================
Program: ParaView
Module: vtkSMContextArraysInformationHelper.cxx
Module: $RCSfile$
Copyright (c) Kitware, Inc.
All rights reserved.
......@@ -12,62 +12,54 @@
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "vtkSMContextArraysInformationHelper.h"
#include "vtkPMContextArraysProperty.h"
#include "vtkObjectFactory.h"
#include "vtkSMChartRepresentationProxy.h"
#include "vtkSMStringVectorProperty.h"
#include "vtkChartRepresentation.h"
#include "vtkObjectFactory.h"
#include "vtkSMMessage.h"
vtkStandardNewMacro(vtkSMContextArraysInformationHelper);
vtkStandardNewMacro(vtkPMContextArraysProperty);
//----------------------------------------------------------------------------
vtkSMContextArraysInformationHelper::vtkSMContextArraysInformationHelper()
vtkPMContextArraysProperty::vtkPMContextArraysProperty()
{
}
//----------------------------------------------------------------------------
vtkSMContextArraysInformationHelper::~vtkSMContextArraysInformationHelper()
vtkPMContextArraysProperty::~vtkPMContextArraysProperty()
{
}
//----------------------------------------------------------------------------
void vtkSMContextArraysInformationHelper::UpdateProperty(
vtkIdType vtkNotUsed(connectionId),
int vtkNotUsed(serverIds), vtkClientServerID vtkNotUsed(objectId),
vtkSMProperty* prop)
bool vtkPMContextArraysProperty::Pull(vtkSMMessage* msgToFill)
{
vtkSMChartRepresentationProxy* rep =
vtkSMChartRepresentationProxy::SafeDownCast(prop->GetParent());
if (!rep)
if (!this->InformationOnly)
{
vtkWarningMacro("vtkSMContextArraysInformationHelper can only be used on"
" XY Chart representation proxies.");
return;
return false;
}
vtkSMStringVectorProperty* svp =
vtkSMStringVectorProperty::SafeDownCast(prop);
if (!svp)
vtkChartRepresentation* vtk_rep = vtkChartRepresentation::SafeDownCast(
this->GetVTKObject());
if (!vtk_rep)
{
vtkWarningMacro("vtkSMContextArraysInformationHelper can only update "
"vtkSMStringVectorProperty.");
return;
vtkErrorMacro(
"This helper can only be used for proxies with vtkChartRepresentation");
return false;
}
vtkChartRepresentation* vtk_rep = rep->GetRepresentation();
// Create property and add it to the message
ProxyState_Property *prop = msgToFill->AddExtension(ProxyState::property);
prop->set_name(this->GetXMLName());
Variant *variant = prop->mutable_value();
variant->set_type(Variant::STRING);
int num_series = vtk_rep->GetNumberOfSeries();
svp->SetNumberOfElements(num_series);
for (int i = 0; i < num_series; ++i)
{
svp->SetElement(i, vtk_rep->GetSeriesName(i));
variant->add_txt(vtk_rep->GetSeriesName(i));
}
return true;
}
//----------------------------------------------------------------------------
void vtkSMContextArraysInformationHelper::PrintSelf(ostream& os, vtkIndent indent)
void vtkPMContextArraysProperty::PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os, indent);
}
/*=========================================================================
Program: ParaView
Module: vtkSMContextArraysInformationHelper.h
Module: $RCSfile$
Copyright (c) Kitware, Inc.
All rights reserved.
......@@ -12,47 +12,37 @@
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME vtkSMContextArraysInformationHelper - gather array names for a table
// .NAME vtkPMContextArraysProperty - provides information about array for a
// chart.
// .SECTION Description
//
// This class iterates through a vtkTable and fills the supplied property with
// column names matching their current column index.
#ifndef __vtkSMContextArraysInformationHelper_h
#define __vtkSMContextArraysInformationHelper_h
#ifndef __vtkPMContextArraysProperty_h
#define __vtkPMContextArraysProperty_h
#include "vtkSMInformationHelper.h"
#include "vtkPMProperty.h"
class VTK_EXPORT vtkSMContextArraysInformationHelper : public vtkSMInformationHelper
class VTK_EXPORT vtkPMContextArraysProperty : public vtkPMProperty
{
public:
static vtkSMContextArraysInformationHelper* New();
vtkTypeMacro(vtkSMContextArraysInformationHelper, vtkSMInformationHelper);
static vtkPMContextArraysProperty* New();
vtkTypeMacro(vtkPMContextArraysProperty, vtkPMProperty);
void PrintSelf(ostream& os, vtkIndent indent);
//BTX
// Description:
// Updates the property using value obtained for server. It creates
// an instance of the server helper class vtkPVServerArraySelection
// and passes the objectId (which the helper class gets as a pointer)
// and populates the property using the values returned.
// Each array is represented by two components:
// name, state (on/off)
virtual void UpdateProperty(
vtkIdType connectionId,
int serverIds, vtkClientServerID objectId, vtkSMProperty* prop);
//ETX
//BTX
protected:
vtkSMContextArraysInformationHelper();
~vtkSMContextArraysInformationHelper();
vtkPMContextArraysProperty();
~vtkPMContextArraysProperty();
// Description:
// Pull the current state of the underneath implementation
virtual bool Pull(vtkSMMessage*);
private:
vtkSMContextArraysInformationHelper(const vtkSMContextArraysInformationHelper&); // Not implemented
void operator=(const vtkSMContextArraysInformationHelper&); // Not implemented
vtkPMContextArraysProperty(const vtkPMContextArraysProperty&); // Not implemented
void operator=(const vtkPMContextArraysProperty&); // Not implemented
//ETX
};
#endif
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