29 #include "WMWriteRawData.h"
30 #include "WMWriteRawData.xpm"
31 #include "core/common/WPathHelper.h"
32 #include "core/kernel/WKernel.h"
54 return WMWriteRawData_xpm;
58 return "Write Raw Data";
63 return "Write scalar data defined on uniform lattices"
64 "in raw format, i.e., plain three-dimensional arrays of data. Data format is defined by data type of dataset (float, byte, ...).";
69 m_input = std::shared_ptr< WModuleInputData< WDataSetScalar > >(
102 boost::static_visitor<>(),
113 template <
typename T >
118 std::ofstream file(
m_filename.string().c_str(), std::ios::out | std::ofstream::binary );
119 file.write(
reinterpret_cast<const char *
>( vals->rawData() ) ,
sizeof( T ) * vals->rawSize() );
157 std::shared_ptr< WProgress > progress(
new WProgress(
"Write File", 2 ) );
162 m_dataSet->getValueSet()->applyFunction( visitor );
Visitor for discriminating the type of the first valueset.
boost::filesystem::path m_filename
Where to write.
void operator()(const WValueSet< T > *const &vals) const
Called by boost::varying during static visiting.
VisitorVSet(boost::filesystem::path fn)
Create visitor instance and convert it to the given input type.
virtual void wait() const
Wait for the condition.
virtual void add(std::shared_ptr< WCondition > condition)
Adds another condition to the set of conditions to wait for.
Class to encapsulate boost::condition_variable_any.
A module to read scalar data stored as array of raw data.
std::shared_ptr< WModuleInputData< WDataSetScalar > > m_input
Output connector provided by this module.
virtual void moduleMain()
Entry point after loading the module.
std::shared_ptr< WCondition > m_propCondition
A condition used to notify about changes in several properties.
WMWriteRawData()
Constructor of module.
virtual void connectors()
Initialize the connectors this module is using.
virtual const std::string getDescription() const
Gives back a description of this module.
virtual ~WMWriteRawData()
Destructor of module.
std::shared_ptr< WDataSetScalar > m_dataSet
This data set is provided as output through the connector.
virtual void requirements()
Initialize requirements for this module.
virtual void properties()
Initialize the properties for this module.
virtual std::shared_ptr< WModule > factory() const
Due to the prototype design pattern used to build modules, this method returns a new instance of this...
WPropFilename m_dataFile
The data will be read from this file.
virtual const char ** getXPMIcon() const
Get the icon for this module in XPM format.
virtual const std::string getName() const
Gives back the name of this module.
Class representing a single module of OpenWalnut.
virtual void properties()
Initialize properties in this function.
wlog::WStreamedLogger debugLog() const
Logger instance for comfortable debug logging.
void addConnector(std::shared_ptr< WModuleInputConnector > con)
Adds the specified connector to the list of inputs.
std::shared_ptr< WProperties > m_properties
The property object for the module.
void ready()
Call this whenever your module is ready and can react on property changes.
WConditionSet m_moduleState
The internal state of the module.
std::shared_ptr< WProgressCombiner > m_progress
Progress indicator used as parent for all progress' of this module.
virtual void connectors()
Initialize connectors in this function.
static boost::filesystem::path getAppPath()
The path where the binary file resides in.
Class managing progress inside of modules.
WBoolFlag m_shutdownFlag
Condition getting fired whenever the thread should quit.
Base Class for all value set types.