Commit b800f02a authored by Kitware Robot's avatar Kitware Robot Committed by Ben Boeckel

clang-format: apply to the entire tree

parent dd11d70d

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.
......@@ -32,7 +32,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "vtkPVConfig.h"
#ifdef PARAVIEW_ENABLE_PYTHON
extern "C" {
void vtkPVInitializePythonModules();
void vtkPVInitializePythonModules();
}
#endif
......@@ -50,38 +50,38 @@ extern "C" {
#include "pqSettings.h"
#include "pqTimer.h"
#include "pqWelcomeDialog.h"
#include "vtkProcessModule.h"
#include "vtkPVGeneralSettings.h"
#include "vtkPVPlugin.h"
#include "vtkProcessModule.h"
#include "vtkSMSettings.h"
#ifndef BUILD_SHARED_LIBS
# include "pvStaticPluginsInit.h"
#include "pvStaticPluginsInit.h"
#endif
#include <QDragEnterEvent>
#include <QDropEvent>
#include <QUrl>
#include <QMimeData>
#include <QUrl>
#ifdef PARAVIEW_ENABLE_EMBEDDED_DOCUMENTATION
#include "ParaViewDocumentationInitializer.h"
#endif
#ifdef PARAVIEW_ENABLE_PYTHON
# include "pqPythonDebugLeaksView.h"
typedef pqPythonDebugLeaksView DebugLeaksViewType;
#include "pqPythonDebugLeaksView.h"
typedef pqPythonDebugLeaksView DebugLeaksViewType;
#else
# include "vtkQtDebugLeaksView.h"
typedef vtkQtDebugLeaksView DebugLeaksViewType;
#include "vtkQtDebugLeaksView.h"
typedef vtkQtDebugLeaksView DebugLeaksViewType;
#endif
class ParaViewMainWindow::pqInternals : public Ui::pqClientMainWindow
{
public:
bool FirstShow;
pqInternals() : FirstShow(true)
pqInternals()
: FirstShow(true)
{
}
};
......@@ -92,11 +92,11 @@ ParaViewMainWindow::ParaViewMainWindow()
// the debug leaks view should be constructed as early as possible
// so that it can monitor vtk objects created at application startup.
if (getenv("PV_DEBUG_LEAKS_VIEW"))
{
{
vtkQtDebugLeaksView* leaksView = new DebugLeaksViewType(this);
leaksView->setWindowFlags(Qt::Window);
leaksView->show();
}
}
#ifdef PARAVIEW_ENABLE_PYTHON
vtkPVInitializePythonModules();
......@@ -117,19 +117,14 @@ ParaViewMainWindow::ParaViewMainWindow()
this->setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea);
this->setCorner(Qt::BottomRightCorner, Qt::RightDockWidgetArea);
this->tabifyDockWidget(
this->Internals->colorMapEditorDock,
this->Internals->memoryInspectorDock);
this->tabifyDockWidget(
this->Internals->colorMapEditorDock,
this->Internals->timeInspectorDock);
this->tabifyDockWidget(
this->Internals->colorMapEditorDock,
this->Internals->comparativePanelDock);
this->tabifyDockWidget(
this->Internals->colorMapEditorDock,
this->Internals->collaborationPanelDock);
this->tabifyDockWidget(this->Internals->colorMapEditorDock,
this->Internals->memoryInspectorDock);
this->tabifyDockWidget(this->Internals->colorMapEditorDock,
this->Internals->timeInspectorDock);
this->tabifyDockWidget(this->Internals->colorMapEditorDock,
this->Internals->comparativePanelDock);
this->tabifyDockWidget(this->Internals->colorMapEditorDock,
this->Internals->collaborationPanelDock);
this->Internals->selectionDisplayDock->hide();
this->Internals->animationViewDock->hide();
......@@ -142,77 +137,78 @@ ParaViewMainWindow::ParaViewMainWindow()
this->Internals->timeInspectorDock->hide();
this->tabifyDockWidget(this->Internals->animationViewDock,
this->Internals->statisticsDock);
this->Internals->statisticsDock);
// setup properties dock
this->tabifyDockWidget(
this->Internals->propertiesDock,
this->Internals->viewPropertiesDock);
this->tabifyDockWidget(
this->Internals->propertiesDock,
this->Internals->displayPropertiesDock);
this->tabifyDockWidget(this->Internals->propertiesDock,
this->Internals->informationDock);
this->Internals->viewPropertiesDock);
this->tabifyDockWidget(this->Internals->propertiesDock,
this->Internals->displayPropertiesDock);
this->tabifyDockWidget(this->Internals->propertiesDock,
this->Internals->informationDock);
vtkSMSettings* settings = vtkSMSettings::GetInstance();
int propertiesPanelMode = settings->GetSettingAsInt(
".settings.GeneralSettings.PropertiesPanelMode", vtkPVGeneralSettings::ALL_IN_ONE);
int propertiesPanelMode =
settings->GetSettingAsInt(".settings.GeneralSettings.PropertiesPanelMode",
vtkPVGeneralSettings::ALL_IN_ONE);
switch (propertiesPanelMode)
{
case vtkPVGeneralSettings::SEPARATE_DISPLAY_PROPERTIES:
delete this->Internals->viewPropertiesPanel;
delete this->Internals->viewPropertiesDock;
this->Internals->viewPropertiesPanel = NULL;
this->Internals->viewPropertiesDock = NULL;
this->Internals->propertiesPanel->setPanelMode(
pqPropertiesPanel::SOURCE_PROPERTIES|pqPropertiesPanel::VIEW_PROPERTIES);
break;
case vtkPVGeneralSettings::SEPARATE_VIEW_PROPERTIES:
delete this->Internals->displayPropertiesPanel;
delete this->Internals->displayPropertiesDock;
this->Internals->displayPropertiesPanel = NULL;
this->Internals->displayPropertiesDock = NULL;
this->Internals->propertiesPanel->setPanelMode(
pqPropertiesPanel::SOURCE_PROPERTIES|pqPropertiesPanel::DISPLAY_PROPERTIES);
break;
case vtkPVGeneralSettings::ALL_SEPARATE:
this->Internals->propertiesPanel->setPanelMode(
pqPropertiesPanel::SOURCE_PROPERTIES);
break;
case vtkPVGeneralSettings::ALL_IN_ONE:
default:
delete this->Internals->viewPropertiesPanel;
delete this->Internals->viewPropertiesDock;
this->Internals->viewPropertiesPanel = NULL;
this->Internals->viewPropertiesDock = NULL;
delete this->Internals->displayPropertiesPanel;
delete this->Internals->displayPropertiesDock;
this->Internals->displayPropertiesPanel = NULL;
this->Internals->displayPropertiesDock = NULL;
break;
}
{
case vtkPVGeneralSettings::SEPARATE_DISPLAY_PROPERTIES:
delete this->Internals->viewPropertiesPanel;
delete this->Internals->viewPropertiesDock;
this->Internals->viewPropertiesPanel = NULL;
this->Internals->viewPropertiesDock = NULL;
this->Internals->propertiesPanel->setPanelMode(
pqPropertiesPanel::SOURCE_PROPERTIES |
pqPropertiesPanel::VIEW_PROPERTIES);
break;
case vtkPVGeneralSettings::SEPARATE_VIEW_PROPERTIES:
delete this->Internals->displayPropertiesPanel;
delete this->Internals->displayPropertiesDock;
this->Internals->displayPropertiesPanel = NULL;
this->Internals->displayPropertiesDock = NULL;
this->Internals->propertiesPanel->setPanelMode(
pqPropertiesPanel::SOURCE_PROPERTIES |
pqPropertiesPanel::DISPLAY_PROPERTIES);
break;
case vtkPVGeneralSettings::ALL_SEPARATE:
this->Internals->propertiesPanel->setPanelMode(
pqPropertiesPanel::SOURCE_PROPERTIES);
break;
case vtkPVGeneralSettings::ALL_IN_ONE:
default:
delete this->Internals->viewPropertiesPanel;
delete this->Internals->viewPropertiesDock;
this->Internals->viewPropertiesPanel = NULL;
this->Internals->viewPropertiesDock = NULL;
delete this->Internals->displayPropertiesPanel;
delete this->Internals->displayPropertiesDock;
this->Internals->displayPropertiesPanel = NULL;
this->Internals->displayPropertiesDock = NULL;
break;
}
this->Internals->propertiesDock->show();
this->Internals->propertiesDock->raise();
// Enable help from the properties panel.
QObject::connect(this->Internals->propertiesPanel,
SIGNAL(helpRequested(const QString&, const QString&)),
this, SLOT(showHelpForProxy(const QString&, const QString&)));
SIGNAL(helpRequested(const QString&, const QString&)), this,
SLOT(showHelpForProxy(const QString&, const QString&)));
/// hook delete to pqDeleteReaction.
QAction* tempDeleteAction = new QAction(this);
pqDeleteReaction* handler = new pqDeleteReaction(tempDeleteAction);
handler->connect(this->Internals->propertiesPanel,
SIGNAL(deleteRequested(pqPipelineSource*)),
SLOT(deleteSource(pqPipelineSource*)));
SIGNAL(deleteRequested(pqPipelineSource*)),
SLOT(deleteSource(pqPipelineSource*)));
// setup color editor
/// Provide access to the color-editor panel for the application.
......@@ -263,61 +259,63 @@ ParaViewMainWindow::~ParaViewMainWindow()
}
//-----------------------------------------------------------------------------
void ParaViewMainWindow::showHelpForProxy(const QString& groupname, const
QString& proxyname)
void ParaViewMainWindow::showHelpForProxy(const QString& groupname,
const QString& proxyname)
{
pqHelpReaction::showProxyHelp(groupname, proxyname);
}
//-----------------------------------------------------------------------------
void ParaViewMainWindow::dragEnterEvent(QDragEnterEvent *evt)
void ParaViewMainWindow::dragEnterEvent(QDragEnterEvent* evt)
{
evt->acceptProposedAction();
}
//-----------------------------------------------------------------------------
void ParaViewMainWindow::dropEvent(QDropEvent *evt)
void ParaViewMainWindow::dropEvent(QDropEvent* evt)
{
QList<QUrl> urls = evt->mimeData()->urls();
if (urls.isEmpty())
{
{
return;
}
}
QList<QString> files;
foreach(QUrl url,urls)
foreach (QUrl url, urls)
{
if (!url.toLocalFile().isEmpty())
{
if(!url.toLocalFile().isEmpty())
{
files.append(url.toLocalFile());
}
}
}
// If we have no file we return
if(files.empty() || files.first().isEmpty())
{
if (files.empty() || files.first().isEmpty())
{
return;
}
}
pqLoadDataReaction::loadData(files);
}
//-----------------------------------------------------------------------------
void ParaViewMainWindow::showEvent(QShowEvent * evt)
void ParaViewMainWindow::showEvent(QShowEvent* evt)
{
this->Superclass::showEvent(evt);
if (this->Internals->FirstShow)
{
{
this->Internals->FirstShow = false;
pqApplicationCore* core = pqApplicationCore::instance();
if (!core->getOptions()->GetDisableRegistry())
{
if (core->settings()
->value("GeneralSettings.ShowWelcomeDialog", true)
.toBool())
{
if (core->settings()->value("GeneralSettings.ShowWelcomeDialog", true).toBool())
{
pqTimer::singleShot(1000, this, SLOT(showWelcomeDialog()));
}
}
}
}
}
//-----------------------------------------------------------------------------
......
......@@ -39,14 +39,15 @@ class ParaViewMainWindow : public QMainWindow
{
Q_OBJECT
typedef QMainWindow Superclass;
public:
ParaViewMainWindow();
~ParaViewMainWindow();
protected:
void dragEnterEvent(QDragEnterEvent *evt);
void dropEvent(QDropEvent *evt);
void showEvent(QShowEvent * evt);
void dragEnterEvent(QDragEnterEvent* evt);
void dropEvent(QDropEvent* evt);
void showEvent(QShowEvent* evt);
protected slots:
void showHelpForProxy(const QString& proxyname, const QString& groupname);
......@@ -60,5 +61,3 @@ private:
};
#endif
......@@ -31,59 +31,58 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
========================================================================*/
#include "ParaViewVRUI.h"
#include "pqActiveObjects.h"
#include "pqView.h"
#include "vruiPipe.h"
#include "vruiServerState.h"
#include "vruiThread.h"
#include <vector>
#include <iostream>
#include <QTcpSocket>
#include <QWaitCondition>
#include <QMutex>
#include "vtkMath.h"
#include "vtkSMCaveRenderViewProxy.h"
#include "pqActiveObjects.h"
#include "pqView.h"
#include <QMutex>
#include <QTcpSocket>
#include <QWaitCondition>
#include <iostream>
#include <vector>
class ParaViewVRUI::pqInternals
{
public:
pqInternals()
{
this->Pipe = 0;
this->State = 0;
this->Active = false;
this->Streaming = false;
this->Thread = 0;
this->StateMutex = 0;
this->PacketSignalCond = 0;
this->PacketSignalCondMutex = 0;
}
~pqInternals()
{
if (this->Pipe != 0)
{
this->Pipe=0;
this->State=0;
this->Active=false;
this->Streaming=false;
this->Thread=0;
this->StateMutex=0;
this->PacketSignalCond=0;
this->PacketSignalCondMutex=0;
delete this->Pipe;
}
~pqInternals()
if (this->State != 0)
{
if(this->Pipe!=0)
{
delete this->Pipe;
}
if(this->State!=0)
{
delete this->State;
}
if(this->Thread!=0)
{
delete this->Thread;
}
delete this->State;
}
if (this->Thread != 0)
{
delete this->Thread;
}
vruiPipe *Pipe;
vruiServerState *State;
}
vruiPipe* Pipe;
vruiServerState* State;
bool Active;
bool Streaming;
vruiThread *Thread;
vruiThread* Thread;
QMutex *StateMutex;
QMutex* StateMutex;
QWaitCondition *PacketSignalCond;
QMutex *PacketSignalCondMutex;
QWaitCondition* PacketSignalCond;
QMutex* PacketSignalCondMutex;
};
#if 0
......@@ -117,32 +116,32 @@ void VRUI_CALLBACK handleTrackerPosQuat(void *userdata,
// ----------------------------------------------------------------------------
ParaViewVRUI::ParaViewVRUI()
{
this->Internals=new pqInternals();
this->Name=0;
this->Port=8555;
this->Initialized=false;
this->Internals = new pqInternals();
this->Name = 0;
this->Port = 8555;
this->Initialized = false;
}
// ----------------------------------------------------------------------------
void ParaViewVRUI::SetName(const char *name)
void ParaViewVRUI::SetName(const char* name)
{
if(this->Name!=name)
if (this->Name != name)
{
int size = strlen(name) + 1;
if (name && size > 1)
{
int size=strlen(name)+1;
if(name && size > 1)
if (this->Name != 0)
{
if(this->Name!=0)
{
delete[] this->Name;
}
this->Name=new char[size];
}
strncpy(this->Name,name,size);
this->Name = new char[size];
}
strncpy(this->Name, name, size);
}
}
// ----------------------------------------------------------------------------
const char *ParaViewVRUI::GetName() const
const char* ParaViewVRUI::GetName() const
{
return this->Name;
}
......@@ -156,10 +155,9 @@ int ParaViewVRUI::GetPort() const
// ----------------------------------------------------------------------------
void ParaViewVRUI::SetPort(int port)
{
this->Port=port;
this->Port = port;
}
// ----------------------------------------------------------------------------
bool ParaViewVRUI::GetInitialized() const
{
......@@ -169,70 +167,70 @@ bool ParaViewVRUI::GetInitialized() const
// ----------------------------------------------------------------------------
void ParaViewVRUI::Init()
{
QTcpSocket *socket=new QTcpSocket;
socket->connectToHost(QString(this->Name),this->Port); // ReadWrite?
this->Internals->Pipe=new vruiPipe(socket);
QTcpSocket* socket = new QTcpSocket;
socket->connectToHost(QString(this->Name), this->Port); // ReadWrite?
this->Internals->Pipe = new vruiPipe(socket);
this->Internals->Pipe->Send(vruiPipe::CONNECT_REQUEST);
if(!this->Internals->Pipe->WaitForServerReply(30000)) // 30s
{
if (!this->Internals->Pipe->WaitForServerReply(30000)) // 30s
{
cerr << "Timeout while waiting for CONNECT_REPLY" << endl;
delete this->Internals->Pipe;
this->Internals->Pipe=0;
this->Internals->Pipe = 0;
return;
}
if(this->Internals->Pipe->Receive()!=vruiPipe::CONNECT_REPLY)
{
}
if (this->Internals->Pipe->Receive() != vruiPipe::CONNECT_REPLY)
{
cerr << "Mismatching message while waiting for CONNECT_REPLY" << endl;
delete this->Internals->Pipe;
this->Internals->Pipe=0;
this->Internals->Pipe = 0;
return;
}
}
this->Internals->State=new vruiServerState;
this->Internals->StateMutex=new QMutex;
this->Internals->State = new vruiServerState;
this->Internals->StateMutex = new QMutex;
this->Internals->Pipe->ReadLayout(this->Internals->State);
this->Activate();
// this->StartStream();
// this->StartStream();
this->Initialized=true;
this->Initialized = true;
}
// ----------------------------------------------------------------------------
void ParaViewVRUI::Activate()
{
if(!this->Internals->Active)
{
if (!this->Internals->Active)
{
this->Internals->Pipe->Send(vruiPipe::ACTIVATE_REQUEST);
this->Internals->Active=true;
}
this->Internals->Active = true;
}
}
// ----------------------------------------------------------------------------
void ParaViewVRUI::Deactivate()
{
if(this->Internals->Active)
{
this->Internals->Active=false;
if (this->Internals->Active)
{
this->Internals->Active = false;
this->Internals->Pipe->Send(vruiPipe::DEACTIVATE_REQUEST);
}
}
}
// ----------------------------------------------------------------------------
void ParaViewVRUI::StartStream()
{
if(this->Internals->Active)
{
this->Internals->Thread=new vruiThread;
this->Internals->Streaming=true;
if (this->Internals->Active)
{
this->Internals->Thread = new vruiThread;
this->Internals->Streaming