From a9a6df90902abf7f74b459e180015a35f67c37d0 Mon Sep 17 00:00:00 2001 From: Mathieu Westphal Date: Thu, 9 Mar 2017 15:32:14 +0100 Subject: [PATCH] Adding vtkIdTypeSize in about dialog This commit adds IdTypeSize in Server Info on server, and displays it IdTypeSize from client and server in the about dialog. --- .../ClientServerCore/Core/vtkPVServerInformation.cxx | 12 ++++++++++++ .../ClientServerCore/Core/vtkPVServerInformation.h | 9 +++++++++ Qt/Components/pqAboutDialog.cxx | 3 +++ 3 files changed, 24 insertions(+) diff --git a/ParaViewCore/ClientServerCore/Core/vtkPVServerInformation.cxx b/ParaViewCore/ClientServerCore/Core/vtkPVServerInformation.cxx index 57f104bf795..33d68ae1295 100644 --- a/ParaViewCore/ClientServerCore/Core/vtkPVServerInformation.cxx +++ b/ParaViewCore/ClientServerCore/Core/vtkPVServerInformation.cxx @@ -44,6 +44,7 @@ vtkPVServerInformation::vtkPVServerInformation() { this->MultiClientsEnable = 0; this->ClientId = 0; + this->IdTypeSize = 0; vtkMultiProcessController* controller = vtkMultiProcessController::GetGlobalController(); this->NumberOfProcesses = controller ? controller->GetNumberOfProcesses() : 1; this->MPIInitialized = controller ? controller->IsA("vtkMPIController") != 0 : false; @@ -98,6 +99,7 @@ void vtkPVServerInformation::PrintSelf(ostream& os, vtkIndent indent) os << indent << "MPIInitialized: " << this->MPIInitialized << endl; os << indent << "MultiClientsEnable: " << this->MultiClientsEnable << endl; os << indent << "ClientId: " << this->ClientId << endl; + os << indent << "IdTypeSize: " << this->IdTypeSize << endl; } //---------------------------------------------------------------------------- @@ -105,6 +107,7 @@ void vtkPVServerInformation::DeepCopy(vtkPVServerInformation* info) { this->MultiClientsEnable = info->GetMultiClientsEnable(); this->ClientId = info->GetClientId(); + this->IdTypeSize = info->GetIdTypeSize(); this->RemoteRendering = info->GetRemoteRendering(); info->GetTileDimensions(this->TileDimensions); info->GetTileMullions(this->TileMullions); @@ -182,6 +185,8 @@ void vtkPVServerInformation::CopyFromObject(vtkObject* vtkNotUsed(obj)) { this->ClientId = 0; } + + this->IdTypeSize = static_cast(8 * sizeof(vtkIdType)); } //---------------------------------------------------------------------------- @@ -256,6 +261,7 @@ void vtkPVServerInformation::AddInformation(vtkPVInformation* info) { this->ClientId = serverInfo->ClientId; } + this->SetIdTypeSize(serverInfo->GetIdTypeSize()); } } @@ -294,6 +300,7 @@ void vtkPVServerInformation::CopyToStream(vtkClientServerStream* css) *css << this->GetEyeSeparation(); *css << this->MultiClientsEnable; *css << this->ClientId; + *css << this->IdTypeSize; *css << vtkClientServerStream::End; } @@ -468,6 +475,11 @@ void vtkPVServerInformation::CopyFromStream(const vtkClientServerStream* css) vtkErrorMacro("Error parsing ClientId from message."); return; } + if (!css->GetArgument(0, epilogueOffset + 3, &this->IdTypeSize)) + { + vtkErrorMacro("Error parsing IdTypeSize from message."); + return; + } } //---------------------------------------------------------------------------- diff --git a/ParaViewCore/ClientServerCore/Core/vtkPVServerInformation.h b/ParaViewCore/ClientServerCore/Core/vtkPVServerInformation.h index c2eefd1a403..398bc9401c0 100644 --- a/ParaViewCore/ClientServerCore/Core/vtkPVServerInformation.h +++ b/ParaViewCore/ClientServerCore/Core/vtkPVServerInformation.h @@ -227,6 +227,14 @@ class VTKPVCLIENTSERVERCORECORE_EXPORT vtkPVServerInformation : public vtkPVInfo vtkGetMacro(ClientId, int); //@} + //@{ + /** + * Set/Get vtkIdType size, which can be 32 or 64 + */ + vtkSetMacro(IdTypeSize, int); + vtkGetMacro(IdTypeSize, int); + //@} + protected: vtkPVServerInformation(); ~vtkPVServerInformation(); @@ -243,6 +251,7 @@ class VTKPVCLIENTSERVERCORECORE_EXPORT vtkPVServerInformation : public vtkPVInfo int UseOffscreenRendering; int MultiClientsEnable; int ClientId; + int IdTypeSize; vtkPVServerOptionsInternals* MachinesInternals; diff --git a/Qt/Components/pqAboutDialog.cxx b/Qt/Components/pqAboutDialog.cxx index 145138547e5..e5834fe48df 100644 --- a/Qt/Components/pqAboutDialog.cxx +++ b/Qt/Components/pqAboutDialog.cxx @@ -136,6 +136,8 @@ void pqAboutDialog::AddClientInformation() ::addItem(tree, "Architecture", PARAVIEW_BUILD_ARCHITECTURE); #endif + ::addItem(tree, "vtkIdType size", QString("%1bits").arg(8 * sizeof(vtkIdType))); + vtkNew pythonInfo; pythonInfo->CopyFromObject(NULL); @@ -251,6 +253,7 @@ void pqAboutDialog::AddServerInformation(pqServer* server, QTreeWidget* tree) ::addItem(tree, "Write Ogg/Theora Animations", serverInfo->GetOGVSupport() ? "On" : "Off"); ::addItem(tree, "Write AVI Animations", serverInfo->GetAVISupport() ? "On" : "Off"); + ::addItem(tree, "vtkIdType size", QString("%1bits").arg(serverInfo->GetIdTypeSize())); vtkSMSession* session = server->session(); vtkNew pythonInfo;