Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/trisyoungs/aten
Browse files Browse the repository at this point in the history
  • Loading branch information
trisyoungs committed Oct 19, 2018
2 parents 56243b7 + 3c397cf commit 157ae83
Show file tree
Hide file tree
Showing 10 changed files with 434 additions and 37 deletions.
6 changes: 6 additions & 0 deletions src/base/fileparser.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ class FileParser
variable = parser_.line();
return (result == 0);
}
// Read next delimited argument from file
bool readArg(QString& variable)
{
if (!parser_.getNextArg(Parser::Defaults, variable)) return false;
return true;
}
// Read next line from file into the variable supplied, and parse it as well
bool readAndParseLine(QString& variable)
{
Expand Down
2 changes: 2 additions & 0 deletions src/gui/qcustomplot/plotdata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ PlotData& PlotData::operator=(const PlotData& source)
title_ = source.title_;
x_ = source.x_;
y_ = source.y_;

return (*this) ;
}

// Set titles for data and axes
Expand Down
4 changes: 4 additions & 0 deletions src/gui/qcustomplot/tplotwidget_funcs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ QCPGraph* TPlotWidget::addData(PlotData& source, PlotDataStyle::DataStyle style)
graph->setBrush(brush);

plot_->replot();

return graph;
}

// Add the specified data source as a bar chart to the QCustomPlot
Expand All @@ -124,6 +126,8 @@ QCPBars* TPlotWidget::addBarsData(PlotData& source, bool group, PlotDataStyle::D
}

plot_->replot();

return graph;
}

/*
Expand Down
26 changes: 26 additions & 0 deletions src/plugins/io_cube/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
### Cube Model

# Meta-Objects
set(cubemodel_MOC_HDRS
cubemodel.hui
)
QT5_WRAP_CPP(cubemodel_MOC_SRCS ${cubemodel_MOC_HDRS} OPTIONS -I${PROJECT_SOURCE_DIR}/src)

add_library(cubemodel MODULE
cubemodel_funcs.cpp
${cube_MOC_SRCS}
)
target_link_libraries(cubemodel
${PLUGIN_LINK_LIBS}
)
set_target_properties(cubemodel PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${Aten_BINARY_DIR}/data/plugins
COMPILE_DEFINITIONS "QT_PLUGIN"
PREFIX ""
)

#### Cube

# Meta-Objects
set(cube_MOC_HDRS
cube.hui
Expand All @@ -17,6 +40,9 @@ set_target_properties(cube PROPERTIES
PREFIX ""
)

# Install Targets

# Install Targets
if(UNIX AND NOT APPLE)
install(TARGETS cube
RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/aten/plugins COMPONENT RuntimePlugins
Expand Down
8 changes: 6 additions & 2 deletions src/plugins/io_cube/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Set plugin installation dir and define plugin targets
pluginexecdir = @ATEN_PLUGINLIBDIR@
pluginexec_LTLIBRARIES = cube.la
pluginexec_LTLIBRARIES = cube.la cubemodel.la

# Rules
.ui.lo:
Expand All @@ -18,8 +18,12 @@ pluginexec_LTLIBRARIES = cube.la
clean-local:
-rm -f cube.cpp

# AKF Model plugin
# Cube Model plugin
cube_la_SOURCES = cube_funcs.cpp cube.hui
cube_la_LDFLAGS = -module -shared -avoid-version

# Cube Model plugin
cubemodel_la_SOURCES = cubemodel_funcs.cpp cubemodel.hui
cubemodel_la_LDFLAGS = -module -shared -avoid-version

AM_CPPFLAGS = -I${top_srcdir}/src @ATEN_INCLUDES@ @ATEN_CFLAGS@
14 changes: 7 additions & 7 deletions src/plugins/io_cube/cube.hui
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
*** CUBE Model File Plugin
*** Cube Grid File Plugin
*** src/plugins/io_cube/cube.hui
Copyright T. Youngs 2016-2018

Expand All @@ -19,8 +19,8 @@
along with Aten. If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef ATEN_CUBEMODELPLUGIN_H
#define ATEN_CUBEMODELPLUGIN_H
#ifndef ATEN_CUBEGRIDPLUGIN_H
#define ATEN_CUBEGRIDPLUGIN_H

#include "plugins/interfaces/fileplugin.h"

Expand All @@ -29,8 +29,8 @@ ATEN_BEGIN_NAMESPACE
// Forward Declarations
/* none */

// CUBE Model Plugin
class CUBEModelPlugin : public QObject, public FilePluginInterface
// Cube Grid Plugin
class CubeGridPlugin : public QObject, public FilePluginInterface
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "com.projectaten.Aten.FilePluginInterface.v1")
Expand All @@ -39,9 +39,9 @@ class CUBEModelPlugin : public QObject, public FilePluginInterface

public:
// Constructor
CUBEModelPlugin();
CubeGridPlugin();
// Destructor
~CUBEModelPlugin();
~CubeGridPlugin();


/*
Expand Down
54 changes: 27 additions & 27 deletions src/plugins/io_cube/cube_funcs.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
*** CUBE Model Plugin Functions
*** Cube Plugin Functions
*** src/plugins/io_cube/cube_funcs.cpp
Copyright T. Youngs 2016-2018
Expand All @@ -23,12 +23,12 @@
#include "model/model.h"

// Constructor
CUBEModelPlugin::CUBEModelPlugin()
CubeGridPlugin::CubeGridPlugin()
{
}

// Destructor
CUBEModelPlugin::~CUBEModelPlugin()
CubeGridPlugin::~CubeGridPlugin()
{
}

Expand All @@ -37,59 +37,59 @@ CUBEModelPlugin::~CUBEModelPlugin()
*/

// Return a copy of the plugin object
BasePluginInterface* CUBEModelPlugin::makeCopy() const
BasePluginInterface* CubeGridPlugin::makeCopy() const
{
return new CUBEModelPlugin;
return new CubeGridPlugin;
}

/*
* Definition
*/

// Return type of plugin
PluginTypes::PluginType CUBEModelPlugin::type() const
PluginTypes::PluginType CubeGridPlugin::type() const
{
return PluginTypes::FilePlugin;
}

// Return category of plugin
int CUBEModelPlugin::category() const
int CubeGridPlugin::category() const
{
return PluginTypes::ModelFilePlugin;
}

// Name of plugin
QString CUBEModelPlugin::name() const
QString CubeGridPlugin::name() const
{
return QString("CUBE (dlputils) 3D probability density");
return QString("Cube (dlputils) 3D probability density");
}

// Nickname of plugin
QString CUBEModelPlugin::nickname() const
QString CubeGridPlugin::nickname() const
{
return QString("cube");
}

// Return whether the plugin is enabled
bool CUBEModelPlugin::enabled() const
bool CubeGridPlugin::enabled() const
{
return true;
}

// Description (long name) of plugin
QString CUBEModelPlugin::description() const
QString CubeGridPlugin::description() const
{
return QString("Import/export for dlputils CUBE files");
return QString("Import/export for cube files");
}

// Related file extensions
QStringList CUBEModelPlugin::extensions() const
QStringList CubeGridPlugin::extensions() const
{
return QStringList() << "cube";
}

// Exact names
QStringList CUBEModelPlugin::exactNames() const
QStringList CubeGridPlugin::exactNames() const
{
return QStringList();
}
Expand All @@ -99,15 +99,15 @@ QStringList CUBEModelPlugin::exactNames() const
*/

// Return whether this plugin can import data
bool CUBEModelPlugin::canImport() const
bool CubeGridPlugin::canImport() const
{
return true;
}

// Import data from the specified file
bool CUBEModelPlugin::importData()
bool CubeGridPlugin::importData()
{
//filter(type="importmodel", name="Gaussian CUBE", nickname="cube", extension="cube", glob="*.cube", zmap="numeric")
//filter(type="importmodel", name="Gaussian Cube", nickname="cube", extension="cube", glob="*.cube", zmap="numeric")
//{
// # Variable declaration
// string e,title;
Expand Down Expand Up @@ -163,7 +163,7 @@ bool CUBEModelPlugin::importData()
// finaliseGrid();
//}
//
//filter(type="importgrid", name="Gaussian CUBE", nickname="cube", extension="cube", glob="*.cube", zmap="numeric", id=1)
//filter(type="importgrid", name="Gaussian Cube", nickname="cube", extension="cube", glob="*.cube", zmap="numeric", id=1)
//{
// # Variable declaration
// string e,title;
Expand Down Expand Up @@ -213,25 +213,25 @@ bool CUBEModelPlugin::importData()
}

// Return whether this plugin can export data
bool CUBEModelPlugin::canExport() const
bool CubeGridPlugin::canExport() const
{
return false;
}

// Export data to the specified file
bool CUBEModelPlugin::exportData()
bool CubeGridPlugin::exportData()
{
return false;
}

// Import next partial data chunk
bool CUBEModelPlugin::importNextPart()
bool CubeGridPlugin::importNextPart()
{
return false;
}

// Skip next partial data chunk
bool CUBEModelPlugin::skipNextPart()
bool CubeGridPlugin::skipNextPart()
{
return false;
}
Expand All @@ -241,25 +241,25 @@ bool CUBEModelPlugin::skipNextPart()
*/

// Return whether the plugin has import options
bool CUBEModelPlugin::hasImportOptions() const
bool CubeGridPlugin::hasImportOptions() const
{
return false;
}

// Show import options dialog
bool CUBEModelPlugin::showImportOptionsDialog(KVMap& targetOptions) const
bool CubeGridPlugin::showImportOptionsDialog(KVMap& targetOptions) const
{
return false;
}

// Return whether the plugin has export options
bool CUBEModelPlugin::hasExportOptions() const
bool CubeGridPlugin::hasExportOptions() const
{
return false;
}

// Show export options dialog
bool CUBEModelPlugin::showExportOptionsDialog(KVMap& targetOptions) const
bool CubeGridPlugin::showExportOptionsDialog(KVMap& targetOptions) const
{
return false;
}
Expand Down
Loading

0 comments on commit 157ae83

Please sign in to comment.