Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
Signed-off-by: Geoff Hutchison <geoff.hutchison@gmail.com>
  • Loading branch information
ghutchis committed Jul 25, 2023
1 parent a9c62d4 commit a0211c2
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 55 deletions.
29 changes: 9 additions & 20 deletions avogadro/qtgui/extensionplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,45 +7,34 @@

namespace Avogadro::QtGui {

ExtensionPlugin::ExtensionPlugin(QObject* parent_) : QObject(parent_)
{
}
ExtensionPlugin::ExtensionPlugin(QObject* parent_) : QObject(parent_) {}

ExtensionPlugin::~ExtensionPlugin()
{
}
ExtensionPlugin::~ExtensionPlugin() {}

QList<Io::FileFormat*> ExtensionPlugin::fileFormats() const
{
return QList<Io::FileFormat*>();
}

ExtensionPluginFactory::~ExtensionPluginFactory()
{
}
ExtensionPluginFactory::~ExtensionPluginFactory() {}

bool ExtensionPlugin::readMolecule(Molecule&)
{
return false;
}

void ExtensionPlugin::setScene(Rendering::Scene*)
{
}
void ExtensionPlugin::setScene(Rendering::Scene*) {}

void ExtensionPlugin::setCamera(Rendering::Camera* camera)
{
}
void ExtensionPlugin::setCamera(Rendering::Camera* camera) {}

void ExtensionPlugin::setActiveWidget(QWidget* widget)
{
}
void ExtensionPlugin::setActiveWidget(QWidget* widget) {}

bool ExtensionPlugin::handleCommand(const QString& command, const QVariantMap& options)
bool ExtensionPlugin::handleCommand(const QString& command,
const QVariantMap& options)
{
Q_UNUSED(command);
Q_UNUSED(options);
return false;
}

} // End Avogadro namespace
} // namespace Avogadro::QtGui
17 changes: 9 additions & 8 deletions avogadro/qtgui/extensionplugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Molecule;
namespace Rendering {
class Camera;
class Scene;
}
} // namespace Rendering

namespace Io {
class FileFormat;
Expand Down Expand Up @@ -106,13 +106,14 @@ public slots:
/**
* Called by the app to handle a command registered by the extension.
* (e.g., "renderMovie" or "generateSurface", etc.)
*
*
* The app will turn the command into a string and pass it to the extension.
* and any options will go from a JSON dictionary to a QVariantMap.
*
*
* @return true if the command was handled, false otherwise.
*/
virtual bool handleCommand(const QString& command, const QVariantMap& options);
virtual bool handleCommand(const QString& command,
const QVariantMap& options);

signals:
/**
Expand Down Expand Up @@ -146,10 +147,10 @@ public slots:
/**
* Register a new command with the application. The command will be available
* through scripting (e.g., "renderMovie" or "generateSurface", etc.)
*
*
* @param command The name of the command to register.
* @param description A description of the command.
*
*
* @sa handleCommand
*/
void registerCommand(QString command, QString description);
Expand All @@ -168,8 +169,8 @@ class AVOGADROQTGUI_EXPORT ExtensionPluginFactory
~ExtensionPluginFactory() override;
};

} // End QtGui namespace
} // End Avogadro namespace
} // namespace QtGui
} // namespace Avogadro

Q_DECLARE_INTERFACE(Avogadro::QtGui::ExtensionPluginFactory,
"org.openchemistry.avogadro.ExtensionPluginFactory")
Expand Down
21 changes: 7 additions & 14 deletions avogadro/qtgui/toolplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,9 @@

namespace Avogadro::QtGui {

ToolPlugin::ToolPlugin(QObject* parent_) : QObject(parent_)
{
}
ToolPlugin::ToolPlugin(QObject* parent_) : QObject(parent_) {}

ToolPlugin::~ToolPlugin()
{
}
ToolPlugin::~ToolPlugin() {}

QUndoCommand* ToolPlugin::mousePressEvent(QMouseEvent*)
{
Expand Down Expand Up @@ -50,19 +46,16 @@ QUndoCommand* ToolPlugin::keyReleaseEvent(QKeyEvent*)
return nullptr;
}

void ToolPlugin::draw(Rendering::GroupNode&)
{
}
void ToolPlugin::draw(Rendering::GroupNode&) {}

bool ToolPlugin::handleCommand(const QString& command, const QVariantMap& options)
bool ToolPlugin::handleCommand(const QString& command,
const QVariantMap& options)
{
Q_UNUSED(command);
Q_UNUSED(options);
return false;
}

ToolPluginFactory::~ToolPluginFactory()
{
}
ToolPluginFactory::~ToolPluginFactory() {}

} // End Avogadro namespace
} // namespace Avogadro::QtGui
19 changes: 10 additions & 9 deletions avogadro/qtgui/toolplugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace Avogadro {
namespace Rendering {
class GroupNode;
class GLRenderer;
}
} // namespace Rendering

namespace QtOpenGL {
class GLWidget;
Expand Down Expand Up @@ -94,13 +94,14 @@ class AVOGADROQTGUI_EXPORT ToolPlugin : public QObject
/**
* Called by the app to handle a command registered by the plugin.
* (e.g., "renderMovie" or "drawAtom", etc.)
*
*
* The app will turn the command into a string and pass it to the tool.
* and any options will go from a JSON dictionary to a QVariantMap.
*
*
* @return true if the command was handled, false otherwise.
*/
virtual bool handleCommand(const QString& command, const QVariantMap& options);
virtual bool handleCommand(const QString& command,
const QVariantMap& options);

signals:
/**
Expand All @@ -117,10 +118,10 @@ class AVOGADROQTGUI_EXPORT ToolPlugin : public QObject
/**
* Register a new command with the application. The command will be available
* through scripting (e.g., "renderMovie" or "generateSurface", etc.)
*
*
* @param command The name of the command to register.
* @param description A description of the command.
*
*
* @sa handleCommand
*/
void registerCommand(QString command, QString description);
Expand Down Expand Up @@ -159,12 +160,12 @@ class AVOGADROQTGUI_EXPORT ToolPluginFactory
public:
virtual ~ToolPluginFactory();

virtual ToolPlugin* createInstance(QObject *parent = nullptr) = 0;
virtual ToolPlugin* createInstance(QObject* parent = nullptr) = 0;
virtual QString identifier() const = 0;
};

} // End QtGui namespace
} // End Avogadro namespace
} // namespace QtGui
} // namespace Avogadro

Q_DECLARE_INTERFACE(Avogadro::QtGui::ToolPluginFactory,
"org.openchemistry.avogadro.ToolPluginFactory")
Expand Down
2 changes: 1 addition & 1 deletion avogadro/qtplugins/spectra/spectra.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ void Spectra::setMode(int mode)
double factor = 0.01 * m_amplitude;
Index atom = 0;
for (Vector3& v : atomDisplacements) {
v *= 10.0*factor;
v *= 10.0 * factor;
m_molecule->setForceVector(atom, v);
++atom;
}
Expand Down
7 changes: 4 additions & 3 deletions avogadro/qtplugins/spectra/spectra.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ class Spectra : public QtGui::ExtensionPlugin

void setMolecule(QtGui::Molecule* mol) override;

bool handleCommand(const QString& command, const QVariantMap& options) override;
bool handleCommand(const QString& command,
const QVariantMap& options) override;

public slots:
void setMode(int mode);
Expand All @@ -68,7 +69,7 @@ private slots:
int m_mode;
int m_amplitude;
};
}
}
} // namespace QtPlugins
} // namespace Avogadro

#endif // AVOGADRO_QTPLUGINS_Spectra_H

0 comments on commit a0211c2

Please sign in to comment.