MCPcopy Create free account
hub / github.com/Kitware/ParaView / ExportTransferFunction

Method ExportTransferFunction

Remoting/Views/vtkSMTransferFunctionProxy.cxx:250–273  ·  view source on GitHub ↗

----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

248
249//----------------------------------------------------------------------------
250bool vtkSMTransferFunctionProxy::ExportTransferFunction(
251 vtkSMTransferFunctionProxy* colorTransferFunction,
252 vtkSMTransferFunctionProxy* opacityTransferFunction, const char* tfname, const char* filename,
253 vtkTypeUInt32 location)
254{
255 Json::Value exportCollection(Json::arrayValue);
256 Json::Value transferFunction =
257 vtkSMTransferFunctionProxy::GetStateAsPreset(colorTransferFunction);
258 transferFunction["Name"] = tfname;
259
260 if (opacityTransferFunction)
261 {
262 Json::Value opacities = vtkSMTransferFunctionProxy::GetStateAsPreset(opacityTransferFunction);
263 if (opacities.isMember("Points"))
264 {
265 transferFunction["Points"] = opacities["Points"];
266 }
267 }
268
269 exportCollection.append(transferFunction);
270
271 auto pxm = vtkSMProxyManager::GetProxyManager()->GetActiveSessionProxyManager();
272 return pxm->SaveString(exportCollection.toStyledString().c_str(), filename, location);
273}
274
275//----------------------------------------------------------------------------
276bool vtkSMTransferFunctionProxy::RescaleTransferFunction(

Callers 1

ExportTransferFunctionFunction · 0.80

Calls 3

SaveStringMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected