Skip to content

Commit

Permalink
Adding vtkIdTypeSize in about dialog
Browse files Browse the repository at this point in the history
This commit adds IdTypeSize in Server Info on server, and displays it
IdTypeSize from client and server in the about dialog.
  • Loading branch information
mwestphal committed Mar 10, 2017
1 parent 82b8e48 commit a9a6df9
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ParaViewCore/ClientServerCore/Core/vtkPVServerInformation.cxx
Expand Up @@ -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;
Expand Down Expand Up @@ -98,13 +99,15 @@ 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;
}

//----------------------------------------------------------------------------
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);
Expand Down Expand Up @@ -182,6 +185,8 @@ void vtkPVServerInformation::CopyFromObject(vtkObject* vtkNotUsed(obj))
{
this->ClientId = 0;
}

this->IdTypeSize = static_cast<int>(8 * sizeof(vtkIdType));
}

//----------------------------------------------------------------------------
Expand Down Expand Up @@ -256,6 +261,7 @@ void vtkPVServerInformation::AddInformation(vtkPVInformation* info)
{
this->ClientId = serverInfo->ClientId;
}
this->SetIdTypeSize(serverInfo->GetIdTypeSize());
}
}

Expand Down Expand Up @@ -294,6 +300,7 @@ void vtkPVServerInformation::CopyToStream(vtkClientServerStream* css)
*css << this->GetEyeSeparation();
*css << this->MultiClientsEnable;
*css << this->ClientId;
*css << this->IdTypeSize;
*css << vtkClientServerStream::End;
}

Expand Down Expand Up @@ -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;
}
}

//----------------------------------------------------------------------------
Expand Down
9 changes: 9 additions & 0 deletions ParaViewCore/ClientServerCore/Core/vtkPVServerInformation.h
Expand Up @@ -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();
Expand All @@ -243,6 +251,7 @@ class VTKPVCLIENTSERVERCORECORE_EXPORT vtkPVServerInformation : public vtkPVInfo
int UseOffscreenRendering;
int MultiClientsEnable;
int ClientId;
int IdTypeSize;

vtkPVServerOptionsInternals* MachinesInternals;

Expand Down
3 changes: 3 additions & 0 deletions Qt/Components/pqAboutDialog.cxx
Expand Up @@ -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<vtkPVPythonInformation> pythonInfo;
pythonInfo->CopyFromObject(NULL);

Expand Down Expand Up @@ -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<vtkPVPythonInformation> pythonInfo;
Expand Down

0 comments on commit a9a6df9

Please sign in to comment.