Commit 944330e9 authored by David E. DeMarle's avatar David E. DeMarle

make material library consistent among processes

No longer using an actual singleton. However we still
effectively have one as we make one instance and assign it
to all views and representations.

We always read the material library on the server and
then serialize the content back to the client so everyone can
agree. The library search path is modelled after plugins.

We update the material domain that objects can
choose to color by via domains that watch the material library.

The UI to load additional materials is now on the menu not the
view.
parent 1a859176
......@@ -120,6 +120,11 @@ if (PARAVIEW_USE_ICE_T)
vtkIceTSynchronizedRenderers.cxx)
endif()
if (PARAVIEW_USE_OSPRAY)
list(APPEND Module_SRCS
vtkPVOSPRayMaterialLibrary.cxx)
endif()
if(NOT VTK_LEGACY_REMOVE)
list(APPEND Module_SRCS
vtkPVDisplayInformation.cxx
......
......@@ -170,11 +170,6 @@ vtkGeometryRepresentation::vtkGeometryRepresentation()
this->Actor = vtkPVLODActor::New();
this->Property = vtkProperty::New();
#ifdef PARAVIEW_USE_OSPRAY
vtkSmartPointer<vtkOSPRayMaterialLibrary> ml = vtkOSPRayMaterialLibrary::GetInstance();
ml->LoadMaterials(this->Property);
#endif
// setup composite display attributes
vtkCompositeDataDisplayAttributes* compositeAttributes = vtkCompositeDataDisplayAttributes::New();
vtkCompositePolyDataMapper2::SafeDownCast(this->Mapper)
......@@ -1063,6 +1058,16 @@ void vtkGeometryRepresentation::SetScalingFunction(vtkPiecewiseFunction* pwf)
(void)pwf;
#endif
}
//----------------------------------------------------------------------------
void vtkGeometryRepresentation::SetMaterialLibrary(vtkOSPRayMaterialLibrary* ml)
{
#ifdef PARAVIEW_USE_OSPRAY
// todo this should probably be on the proxy, we only have the ML we
// can its MLP in a proxy property to use in the domain
#else
(void)ml;
#endif
}
//----------------------------------------------------------------------------
void vtkGeometryRepresentation::SetMaterial(const char* val)
......@@ -1076,7 +1081,6 @@ void vtkGeometryRepresentation::SetMaterial(const char* val)
{
this->Property->SetMaterialName(val);
}
#else
(void)val;
#endif
......
......@@ -36,6 +36,7 @@ class vtkCallbackCommand;
class vtkCompositeDataDisplayAttributes;
class vtkCompositePolyDataMapper2;
class vtkMapper;
class vtkOSPRayMaterialLibrary;
class vtkPiecewiseFunction;
class vtkPVCacheKeeper;
class vtkPVGeometryFilter;
......@@ -258,6 +259,10 @@ public:
virtual void SetScalingFunction(vtkPiecewiseFunction* pwf);
//@}
/**
* For OSPRay, set the library of materials.
*/
virtual void SetMaterialLibrary(vtkOSPRayMaterialLibrary*);
/**
* For OSPRay, choose from among the materials.
*/
......
/*=========================================================================
Program: ParaView
Module: vtkPVOSPRayMaterialLibrary.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 "vtkPVOSPRayMaterialLibrary.h"
#include "vtkObjectFactory.h"
#include "vtkPVConfig.h"
#include "vtkPVOptions.h"
#include "vtkProcessModule.h"
#include <string>
#include <vtksys/SystemTools.hxx>
#if defined(_WIN32) && !defined(__CYGWIN__)
const char ENV_PATH_SEP = ';';
#else
const char ENV_PATH_SEP = ':';
#endif
vtkStandardNewMacro(vtkPVOSPRayMaterialLibrary);
//-----------------------------------------------------------------------------
vtkPVOSPRayMaterialLibrary::vtkPVOSPRayMaterialLibrary()
{
this->SearchPaths = nullptr;
vtksys::String paths;
const char* env = vtksys::SystemTools::GetEnv("PV_MATERIALS_PATH");
if (env)
{
paths += env;
}
/*
//todo: compile time defined paths like so, see vtkPVPluginLoader
#ifdef PARAVIEW_PLUGIN_LOADER_PATHS
if (!paths.empty())
{
paths += ENV_PATH_SEP;
}
paths += PARAVIEW_PLUGIN_LOADER_PATHS;
#endif
*/
vtkProcessModule* pm = vtkProcessModule::GetProcessModule();
vtkPVOptions* opt = pm ? pm->GetOptions() : NULL;
if (opt)
{
std::string appDir = vtkProcessModule::GetProcessModule()->GetSelfDir();
if (appDir.size())
{
appDir += "/materials";
if (paths.size())
{
paths += ENV_PATH_SEP;
}
paths += appDir;
}
}
this->SetSearchPaths(paths.c_str());
}
//-----------------------------------------------------------------------------
vtkPVOSPRayMaterialLibrary::~vtkPVOSPRayMaterialLibrary()
{
this->SetSearchPaths(nullptr);
}
//-----------------------------------------------------------------------------
void vtkPVOSPRayMaterialLibrary::PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os, indent);
os << indent << "SearchPaths: " << (this->SearchPaths ? this->SearchPaths : "(none)") << endl;
}
//-----------------------------------------------------------------------------
void vtkPVOSPRayMaterialLibrary::ReadRelativeFile(const char* FileName)
{
#ifdef PARAVIEW_USE_OSPRAY
std::vector<std::string> paths;
vtksys::SystemTools::Split(this->SearchPaths, paths, ENV_PATH_SEP);
for (size_t cc = 0; cc < paths.size(); cc++)
{
std::vector<std::string> subpaths;
vtksys::SystemTools::Split(paths[cc].c_str(), subpaths, ';');
for (size_t scc = 0; scc < subpaths.size(); scc++)
{
std::string fullpath = subpaths[scc] + "/" + FileName;
if (this->ReadFile(fullpath.c_str()))
{
return;
}
}
}
#else
(void)FileName;
#endif
}
/*=========================================================================
Program: ParaView
Module: vtkPVOSPRayMaterialLibrary.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.
=========================================================================*/
/**
* @class vtkPVOSPRayMaterialLibrary
* @brief Used to load OSPRay Material Library definitions.
*
* vtkPVOSPRayMaterialLibrary helps ParaView to load OSPRay Material files
* from known, generally process relative, locations on the sever.
*/
#ifndef vtkPVOSPRayMaterialLibrary_h
#define vtkPVOSPRayMaterialLibrary_h
#include "vtkOSPRayMaterialLibrary.h"
#include "vtkPVClientServerCoreCoreModule.h" //needed for exports
class VTKPVCLIENTSERVERCORECORE_EXPORT vtkPVOSPRayMaterialLibrary : public vtkOSPRayMaterialLibrary
{
public:
static vtkPVOSPRayMaterialLibrary* New();
vtkTypeMacro(vtkPVOSPRayMaterialLibrary, vtkOSPRayMaterialLibrary);
void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
/**
* Unlike parent classes ReadFile, this searches in a number of
* relative and environmental paths specified by the SearchPaths
* member variable.
*/
void ReadRelativeFile(const char* FileName);
/**
* Get a string of standard search paths (path1;path2;path3)
* search paths are based on PV_PLUGIN_PATH,
* plugin dir relative to executable.
*/
vtkGetStringMacro(SearchPaths);
protected:
vtkPVOSPRayMaterialLibrary();
~vtkPVOSPRayMaterialLibrary() override;
vtkSetStringMacro(SearchPaths);
char* SearchPaths;
private:
vtkPVOSPRayMaterialLibrary(const vtkPVOSPRayMaterialLibrary&) VTK_DELETE_FUNCTION;
void operator=(const vtkPVOSPRayMaterialLibrary&) VTK_DELETE_FUNCTION;
};
#endif
......@@ -3032,22 +3032,13 @@ bool vtkPVRenderView::GetEnableOSPRay()
}
//----------------------------------------------------------------------------
void vtkPVRenderView::SetMaterialLibrary(const char* val)
void vtkPVRenderView::SetMaterialLibrary(vtkOSPRayMaterialLibrary* ml)
{
#ifdef PARAVIEW_USE_OSPRAY
if (!strcmp(val, "None"))
{
;
}
else
{
// TODO: should only do this when val is changed
vtkSmartPointer<vtkOSPRayMaterialLibrary> ml = vtkOSPRayMaterialLibrary::GetInstance();
ml->ReadFile(val, this->GetRenderer());
vtkOSPRayMaterialLibrary::GetInstance()->Fire();
}
vtkRenderer* ren = this->GetRenderer();
vtkOSPRayRendererNode::SetMaterialLibrary(ml, ren);
#else
(void)val;
(void)ml;
#endif
}
......
......@@ -49,6 +49,7 @@ class vtkInteractorStyleRubberBandZoom;
class vtkLight;
class vtkLightKit;
class vtkMatrix4x4;
class vtkOSPRayMaterialLibrary;
class vtkPartitionOrderingInterface;
class vtkProp;
class vtkPVAxesWidget;
......@@ -898,9 +899,9 @@ public:
void SetOSPRayRendererType(std::string);
/**
* For OSPRay, loads a set of materials.
* For OSPRay, set the library of materials.
*/
virtual void SetMaterialLibrary(const char*);
virtual void SetMaterialLibrary(vtkOSPRayMaterialLibrary*);
//@{
/**
......
......@@ -17,6 +17,7 @@
#include "vtkCommand.h"
#include "vtkNew.h"
#include "vtkObjectFactory.h"
#include "vtkPVConfig.h"
#include "vtkPVInstantiator.h"
#include "vtkPVProxyDefinitionIterator.h"
#include "vtkPVXMLElement.h"
......@@ -340,6 +341,12 @@ bool vtkSMParaViewPipelineController::CreateAnimationHelpers(vtkSMProxy* proxy)
return true;
}
//----------------------------------------------------------------------------
void vtkSMParaViewPipelineController::DoMaterialStuff(vtkSMProxy* proxy)
{
// typically overridedn by rendering capable subclass
}
//----------------------------------------------------------------------------
bool vtkSMParaViewPipelineController::InitializeSession(vtkSMSession* session)
{
......@@ -389,6 +396,26 @@ bool vtkSMParaViewPipelineController::InitializeSession(vtkSMSession* session)
pxm->RegisterProxy("timekeeper", timeKeeper);
}
//---------------------------------------------------------------------------
// Create the materiallibrary
vtkSmartPointer<vtkSMProxy> materialLib = this->FindMaterialLibrary(session);
if (!materialLib)
{
#ifdef PARAVIEW_USE_OSPRAY
materialLib.TakeReference(vtkSafeNewProxy(pxm, "materials", "MaterialLibrary"));
if (!materialLib)
{
vtkErrorMacro("Failed to create 'MaterialLibrary' proxy. ");
return false;
}
this->InitializeProxy(materialLib);
materialLib->UpdateVTKObjects();
this->DoMaterialStuff(materialLib.Get());
pxm->RegisterProxy("materiallibrary", materialLib);
#endif
}
//---------------------------------------------------------------------------
// Create the animation-scene (optional)
vtkSMProxy* animationScene = this->GetAnimationScene(session);
......@@ -430,6 +457,17 @@ vtkSMProxy* vtkSMParaViewPipelineController::FindTimeKeeper(vtkSMSession* sessio
return this->FindProxy(pxm, "timekeeper", "misc", "TimeKeeper");
}
//----------------------------------------------------------------------------
vtkSMProxy* vtkSMParaViewPipelineController::FindMaterialLibrary(vtkSMSession* session)
{
assert(session != NULL);
vtkSMSessionProxyManager* pxm = session->GetSessionProxyManager();
assert(pxm);
return this->FindProxy(pxm, "materiallibrary", "materials", "MaterialLibrary");
}
//----------------------------------------------------------------------------
vtkSMProxy* vtkSMParaViewPipelineController::FindAnimationScene(vtkSMSession* session)
{
......@@ -639,6 +677,12 @@ bool vtkSMParaViewPipelineController::RegisterViewProxy(vtkSMProxy* proxy, const
scene->UpdateVTKObjects();
}
vtkSmartPointer<vtkSMProxy> materialLib = this->FindMaterialLibrary(proxy->GetSession());
if (materialLib)
{
vtkSMPropertyHelper(proxy, "OSPRayMaterialLibrary").Add(materialLib);
}
// Make the proxy active.
vtkSMProxySelectionModel* selmodel =
proxy->GetSessionProxyManager()->GetSelectionModel("ActiveView");
......@@ -734,6 +778,7 @@ bool vtkSMParaViewPipelineController::RegisterRepresentationProxy(vtkSMProxy* pr
// Register the proxy itself.
proxy->GetSessionProxyManager()->RegisterProxy("representations", proxy);
return true;
}
......
......@@ -65,6 +65,11 @@ public:
*/
virtual vtkSMProxy* FindTimeKeeper(vtkSMSession* session);
/**
* Returns the MaterialLibrary proxy associated with the session.
*/
virtual vtkSMProxy* FindMaterialLibrary(vtkSMSession* session);
//---------------------------------------------------------------------------
/**
* Pre-initializes a proxy i.e. prepares the proxy for initialization.
......@@ -323,6 +328,8 @@ protected:
*/
void ProcessInitializationHelper(vtkSMProxy*, vtkMTimeType initializationTimeStamp);
virtual void DoMaterialStuff(vtkSMProxy* proxy);
private:
vtkSMParaViewPipelineController(const vtkSMParaViewPipelineController&) VTK_DELETE_FUNCTION;
void operator=(const vtkSMParaViewPipelineController&) VTK_DELETE_FUNCTION;
......
......@@ -48,6 +48,7 @@ set (Module_SRCS
vtkSMFunctionalBagChartSeriesSelectionDomain.cxx
vtkSMImplicitPlaneRepresentationProxy.cxx
vtkSMMaterialDomain.cxx
vtkSMMaterialLibraryProxy.cxx
vtkSMMultiSliceViewProxy.cxx
vtkSMNewWidgetRepresentationProxy.cxx
vtkSMOrthographicSliceViewProxy.cxx
......
......@@ -16,15 +16,26 @@
#include "vtkSMMaterialDomain.h"
#include "vtkCommand.h"
#include "vtkNew.h"
#include "vtkOSPRayMaterialLibrary.h"
#include "vtkObjectFactory.h"
#include "vtkSMMaterialLibraryProxy.h"
#include "vtkSMParaViewPipelineController.h"
#include "vtkSMProperty.h"
#include "vtkStdString.h"
#include "vtkPVConfig.h"
#ifdef PARAVIEW_USE_OSPRAY
#include "vtkOSPRayMaterialLibrary.h"
#endif
class vtkSMMaterialObserver : public vtkCommand
{
public:
static vtkSMMaterialObserver* New() { return new vtkSMMaterialObserver; }
static vtkSMMaterialObserver* New()
{
vtkSMMaterialObserver* ret = new vtkSMMaterialObserver;
return ret;
}
vtkTypeMacro(vtkSMMaterialObserver, vtkCommand);
void Execute(vtkObject* caller, unsigned long eventid, void* calldata) VTK_OVERRIDE
......@@ -40,14 +51,14 @@ vtkStandardNewMacro(vtkSMMaterialDomain);
//---------------------------------------------------------------------------
vtkSMMaterialDomain::vtkSMMaterialDomain()
{
vtkNew<vtkSMMaterialObserver> observer;
observer->Owner = this;
vtkOSPRayMaterialLibrary::GetInstance()->AddObserver(vtkCommand::UpdateDataEvent, observer.Get());
this->Observer = vtkSMMaterialObserver::New();
this->Observer->Owner = this;
}
//---------------------------------------------------------------------------
vtkSMMaterialDomain::~vtkSMMaterialDomain()
{
this->Observer->Delete();
}
//---------------------------------------------------------------------------
......@@ -59,6 +70,7 @@ void vtkSMMaterialDomain::PrintSelf(ostream& os, vtkIndent indent)
//---------------------------------------------------------------------------
int vtkSMMaterialDomain::ReadXMLAttributes(vtkSMProperty* prop, vtkPVXMLElement* element)
{
#ifdef PARAVIEW_USE_OSPRAY
int retVal = this->Superclass::ReadXMLAttributes(prop, element);
if (!retVal)
{
......@@ -66,12 +78,34 @@ int vtkSMMaterialDomain::ReadXMLAttributes(vtkSMProperty* prop, vtkPVXMLElement*
}
// throw away whatever XML said our strings are and call update instead
this->Update(nullptr);
// register updates whenever the materials change
vtkNew<vtkSMParaViewPipelineController> controller;
vtkSMMaterialLibraryProxy* mlp =
vtkSMMaterialLibraryProxy::SafeDownCast(controller->FindMaterialLibrary(this->GetSession()));
if (!mlp)
{
return 1;
}
// todo: is GetClientSideObject guaranteed to succeed?
vtkOSPRayMaterialLibrary* ml = vtkOSPRayMaterialLibrary::SafeDownCast(mlp->GetClientSideObject());
if (!ml)
{
return 1;
}
ml->AddObserver(vtkCommand::UpdateDataEvent, this->Observer);
return 1;
#else
(void)prop;
(void)element;
#endif
}
//---------------------------------------------------------------------------
void vtkSMMaterialDomain::CallMeSometime()
{
// materials changed, update self with new contents
this->Update(nullptr);
this->DomainModified();
}
......@@ -79,19 +113,38 @@ void vtkSMMaterialDomain::CallMeSometime()
//---------------------------------------------------------------------------
void vtkSMMaterialDomain::Update(vtkSMProperty* vtkNotUsed(prop))
{
std::vector<vtkStdString> sa;
sa.push_back(vtkStdString("None"));
#ifdef PARAVIEW_USE_OSPRAY
// find the material library we reflect contents of
vtkNew<vtkSMParaViewPipelineController> controller;
vtkSMMaterialLibraryProxy* mlp =
vtkSMMaterialLibraryProxy::SafeDownCast(controller->FindMaterialLibrary(this->GetSession()));
if (!mlp)
{
return;
}
vtkOSPRayMaterialLibrary* ml = vtkOSPRayMaterialLibrary::SafeDownCast(mlp->GetClientSideObject());
if (!ml)
{
return;
}
std::set<std::string> materialNames = vtkOSPRayMaterialLibrary::GetInstance()->GetMaterialNames();
// populate my list
std::vector<vtkStdString> sa;
sa.push_back(vtkStdString("None")); // 1: standard vtk coloration
// 2: whole actor material choices
std::set<std::string> materialNames = ml->GetMaterialNames();
std::set<std::string>::iterator it = materialNames.begin();
while (it != materialNames.end())
{
sa.push_back(*it);
it++;
}
// 3: cells/blocks can choose for themselves from the above
if (materialNames.size() > 1)
{
sa.push_back(vtkStdString("MasterMaterial"));
}
this->SetStrings(sa);
#endif
}
......@@ -25,6 +25,8 @@
#include "vtkPVServerManagerRenderingModule.h" //needed for exports
#include "vtkSMStringListDomain.h"
class vtkSMMaterialObserver;
class VTKPVSERVERMANAGERRENDERING_EXPORT vtkSMMaterialDomain : public vtkSMStringListDomain
{
public:
......@@ -45,6 +47,7 @@ protected:
void CallMeSometime();
friend class vtkSMMaterialObserver;
vtkSMMaterialObserver* Observer;
private:
vtkSMMaterialDomain(const vtkSMMaterialDomain&) VTK_DELETE_FUNCTION;
......
/*=========================================================================
Program: ParaView
Module: vtkSMMaterialLibraryProxy.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 "vtkSMMaterialLibraryProxy.h"
#include "vtkClientServerStream.h"
#include "vtkObjectFactory.h"
#include "vtkPVConfig.h"
#include "vtkPVSession.h"
#include "vtkProcessModule.h"
#include "vtkSmartPointer.h"
#ifdef PARAVIEW_USE_OSPRAY
#include "vtkOSPRayMaterialLibrary.h"
#endif
vtkStandardNewMacro(vtkSMMaterialLibraryProxy);
//-----------------------------------------------------------------------------
vtkSMMaterialLibraryProxy::vtkSMMaterialLibraryProxy()
{
}
//-----------------------------------------------------------------------------
vtkSMMaterialLibraryProxy::~vtkSMMaterialLibraryProxy()
{
}
//-----------------------------------------------------------------------------
void vtkSMMaterialLibraryProxy::LoadMaterials(const char* filename)
{
#ifdef PARAVIEW_USE_OSPRAY
vtkClientServerStream stream;
stream << vtkClientServerStream::Invoke << VTKOBJECT(this) << "ReadFile" << filename
<< vtkClientServerStream::End;
this->ExecuteStream(stream, false, vtkPVSession::RENDER_SERVER_ROOT);
this->Synchronize();
#else
(void)filename;
return;
#endif
}
//-----------------------------------------------------------------------------
void vtkSMMaterialLibraryProxy::LoadDefaultMaterials()
{
#ifdef PARAVIEW_USE_OSPRAY
// todo: this should be relative to binary or in prefs/settings, see pq
vtkClientServerStream stream;
stream << vtkClientServerStream::Invoke << VTKOBJECT(this) << "ReadRelativeFile"
<< "ospray_mats.json" << vtkClientServerStream::End;
this->ExecuteStream(stream, false, vtkPVSession::RENDER_SERVER_ROOT);
#else
return;
#endif
}
//-----------------------------------------------------------------------------
void vtkSMMaterialLibraryProxy::Synchronize()
{
#ifdef PARAVIEW_USE_OSPRAY
vtkClientServerStream stream;
stream << vtkClientServerStream::Invoke << VTKOBJECT(this) << "WriteBuffer"
<< vtkClientServerStream::End;
this->ExecuteStream(stream, false, vtkPVSession::RENDER_SERVER_ROOT);
vtkClientServerStream res = this->GetLastResult(vtkPVSession::RENDER_SERVER_ROOT);
std::string resbuf = "";
res.GetArgument(0, 0, &resbuf);
vtkClientServerStream stream2;
stream2 << vtkClientServerStream::Invoke << VTKOBJECT(this) << "ReadBuffer" << resbuf
<< vtkClientServerStream::End;
this->ExecuteStream(stream2, false, vtkProcessModule::CLIENT);
vtkOSPRayMaterialLibrary* ml =
vtkOSPRayMaterialLibrary::SafeDownCast(this->GetClientSideObject());
ml->Fire();
#else
return;
#endif
}
//-----------------------------------------------------------------------------
void vtkSMMaterialLibraryProxy::PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os, indent);
}
/*=========================================================================
Program: ParaView
Module: vtkSMMaterialLibraryProxy.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.
=========================================================================*/
/**
* @class vtkSMMaterialLibraryProxy
* @brief proxy for a camera.
*
* This a proxy for controlling vtkOSPRayMaterialLibraries on various nodes.
* In particular we use it to ensure that all rendering processes have
* a consistent set of materials.
*/
#ifndef vtkSMMaterialLibraryProxy_h
#define vtkSMMaterialLibraryProxy_h
#include "vtkPVServerManagerRenderingModule.h" //needed for exports
#include "vtkSMProxy.h"
class VTKPVSERVERMANAGERRENDERING_EXPORT vtkSMMaterialLibraryProxy : public vtkSMProxy
{
public:
static vtkSMMaterialLibraryProxy* New();
vtkTypeMacro(vtkSMMaterialLibraryProxy, vtkSMProxy);
void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;