vtkSMReaderFactory::TestFileReadability
bool vtkSMReaderFactory::TestFileReadability(const char* filename, vtkSMSession* session)
{
assert("Session should be valid" && session);
vtkSMSessionProxyManager* pxm =
vtkSMProxyManager::GetProxyManager()->GetSessionProxyManager(session);
vtkSmartPointer<vtkSMProxy> proxy;
proxy.TakeReference(pxm->NewProxy("file_listing", "ServerFileListing"));
if (!proxy)
{
vtkGenericWarningMacro("Failed to create ServerFileListing proxy.");
return false;
}
proxy->SetLocation(vtkProcessModule::DATA_SERVER_ROOT);
vtkSMPropertyHelper(proxy, "ActiveFileName").Set(filename);
proxy->UpdateVTKObjects();
proxy->UpdatePropertyInformation();
if (vtkSMPropertyHelper(proxy, "ActiveFileIsReadable").GetAsInt() != 0)
{
return true;
}
return false;
}
proxy->SetLocation(vtkProcessModule::DATA_SERVER_ROOT);
DATA_SERVER_ROOT定义如下:
/**
* These flags are used to specify destination servers for the
* SendStream function.
* FIXME: These flags should simply move to PVSession. They don't make sense
* in non-PVSessions since the processes may have different roles in that
* case.
*/
enum ServerFlags
{
DATA_SERVER = 0x01,
DATA_SERVER_ROOT = 0x02,
RENDER_SERVER = 0x04,
RENDER_SERVER_ROOT = 0x08,
SERVERS = DATA_SERVER | RENDER_SERVER,
CLIENT = 0x10,
CLIENT_AND_SERVERS = DATA_SERVER | CLIENT | RENDER_SERVER
};
ServerFlags这些标志用于指定SendStream函数的目标服务器。
vtkProcessModule:
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
暂无评论内容