30 #include "WMFilterProtonData.h"
46 return "Filter Proton Data";
79 if(
m_input->getData() == NULL )
84 std::shared_ptr< WProgress > progressBar(
new WProgress(
"Preparing..." ) );
120 m_propertyStatus->getEventIDLimitationPropertyHandler()->createProperties();
131 progressBar->finish();
135 if(
m_input->getData() == NULL )
140 std::shared_ptr< WProgress > progressBar(
new WProgress(
"Updating output..." ) );
145 progressBar->finish();
158 "output transferfunction",
"Output transfer function" );
160 "output points and data",
"Output CSV data as points and additional data for PointConnector" );
183 WPropertyGroup::SPtr groupRename = groupFilter->addPropertyGroup(
"Rename Particle Types",
"Filtering/Rename Particle Types",
false );
187 this, groupColumn, boost::placeholders::_1 );
189 this, groupFilter, boost::placeholders::_1 );
191 this, groupVisual, boost::placeholders::_1 );
193 this, groupEventID, boost::placeholders::_1 );
195 this, groupRename, boost::placeholders::_1 );
197 this, groupOutput, boost::placeholders::_1 );
199 groupColumn->addProperty(
"X",
"Choose the column which should be used to determine the x coordinate.",
200 std::string(
"" ), columnNotifier,
false );
201 groupColumn->addProperty(
"Y",
"Choose the column which should be used to determine the y coordinate.",
202 std::string(
"" ), columnNotifier,
false );
203 groupColumn->addProperty(
"Z",
"Choose the column which should be used to determine the z coordinate.",
204 std::string(
"" ), columnNotifier,
false );
205 groupColumn->addProperty(
"Particle Data Group",
"Choose the column which should be used to determine the particle data group.",
206 std::string(
"" ), columnNotifier,
false );
207 groupColumn->addProperty(
"Energy deposition",
"Choose the column which should be used to determine the energy deposition.",
208 std::string(
"" ), columnNotifier,
false );
209 groupColumn->addProperty(
"Event id",
210 "Choose the column which should be used to determine the event id. Tracks will be drawn based on the the event id, all "
211 "particles with the same event id will be connected.", std::string(
"" ), columnNotifier,
false );
212 groupColumn->addProperty(
"Parent id",
"Choose the column which should be used to determine the parent id."
213 "Primaries and secondaries filtering is based on that id,"
214 " if a particle has the parent id 0 it is a primary otherwise it is a secondary.",
215 std::string(
"" ), columnNotifier,
false );
216 groupFilter->addProperty(
"Show primaries",
"Show or hide primaries. One can either hide primaries or secondaries,"
217 "but not both at the same time.", std::string(
"" ), filterNotifier,
false );
218 groupFilter->addProperty(
"Show secondaries",
"Show or hide secondaries. One can either hide primaries or secondaries,"
219 "but not both at the same time.", std::string(
"" ), filterNotifier,
false );
220 groupFilter->addProperty(
"Show particles",
"Choose particle type(s) to be shown.", std::string(
"" ), filterNotifier,
false );
222 groupRename->addProperty(
"New name (press enter)",
"Type in a new name for the selected particle type."
223 "To submit your entry press enter while you are in the textbox.", std::string(
"" ), renameNotifier,
false );
224 groupRename->addProperty(
"Select particle",
"Select the particle type to be renamed.", std::string(
"" ), renameNotifier,
false );
225 groupRename->addProperty(
"Apply Changes",
"Save", std::string(
"" ), renameNotifier,
false );
227 groupVisual->addProperty(
"Enable cluster size",
"Enables the edep to clustersize conversion", std::string(
"" ), visualNotifier,
false );
228 groupVisual->addProperty(
"Size by energy deposition",
"Scale track and point sizes based on energy deposition.", std::string(
"" ),
229 visualNotifier,
false );
230 groupVisual->addProperty(
"Color by energy deposition",
"Colorize tracks and points based on energy deposition.", std::string(
"" ),
231 visualNotifier,
false );
232 groupVisual->addProperty(
"Point color",
"Points colorized in the chosen color when \"Color by energy deposition\" is disabled.",
233 std::string(
"" ), visualNotifier,
false );
234 groupVisual->addProperty(
"Gradient color",
"Colorize tracks and points based on energy deposition with the configured gradient.",
235 std::string(
"" ), visualNotifier,
false );
236 groupVisual->addProperty(
"Set gradient",
"Apply", std::string(
"" ), visualNotifier,
false );
238 groupEventID->addProperty(
"Minimum event id",
"Filters out every event id which is lower than the set value.", std::string(
"" ),
239 eventIDNotifier,
false );
240 groupEventID->addProperty(
"Maximum event id",
"Filters out every event id which is higher than the set value.", std::string(
"" ),
241 eventIDNotifier,
false );
242 groupEventID->addProperty(
"Set selection",
"Apply", std::string(
"" ), eventIDNotifier,
false );
244 groupOutput->addProperty(
"Energy deposition",
"Enables the energy deposition output", std::string(
"" ), outputNotifier,
false );
245 groupOutput->addProperty(
"Event id",
"Enables the event id output", std::string(
"" ), outputNotifier,
false );
252 std::string name = group->getDescription() +
"/" +
property->getName();
253 std::string value =
property->getAsString();
264 prop->setAsString( ( *iter ).second );
296 m_colorBar->getProperties()->getProperty(
"active" )->toPropBool()->set(
m_active->get() );
Creates, updates and handles the column properties.
std::shared_ptr< WColumnPropertyHandler > SPtr
shared_ptr that points to itself
virtual void wait() const
Wait for the condition.
void setResetable(bool resetable=true, bool autoReset=true)
Sets the resetable flag.
virtual void add(std::shared_ptr< WCondition > condition)
Adds another condition to the set of conditions to wait for.
virtual void notify()
Notifies all waiting threads.
Converts the csv data to points and fibers.
Creates, updates and handles the EventID properties.
std::shared_ptr< WEventIDLimitationPropertyHandler > SPtr
shared_ptr that points to itself
Creates, updates and handles the filter properties.
std::shared_ptr< WFilterPropertyHandler > SPtr
Function variables for updating the data.
This module simply registers a given csv dataset to the csv handling mechanism.
void setToLoadedProperties()
Sets the current properties to the state of the loaded properties.
std::shared_ptr< WModuleOutputData< WDataSetSingle > > m_output_transferFunction
WDataSetSingle output connector to output current transfer function.
virtual ~WMFilterProtonData()
Standard destructor.
virtual const char ** getXPMIcon() const
Get the icon for this module in XPM format.
std::shared_ptr< WCsvConverter > m_converter
Contains the algorithm that converts the raw CSV file into compatible WDataSets (Points,...
std::shared_ptr< WModuleOutputData< WDataSetFibers > > m_output_fibers
WDataSetFibers output connector (required for this module).
virtual const std::string getName() const
Returns the name of this module.
void createColorBar()
Creates the transfer function color bar module within this module container.
WModule::SPtr m_colorBar
Reference to the transfer function color bar module within this module container.
WProtonData::SPtr m_protonData
Pointer that points to the Proton data from the CSV file
std::shared_ptr< WPropertyStatus > m_propertyStatus
Contains all property-groups and the subproperties.
virtual void activate()
Toggles activation for inner module based on activation of this module.
virtual const std::string getDescription() const
Retruns the description of this module.
std::shared_ptr< WModuleOutputData< WDataSetPoints > > m_output_points_eventIds
WDataSetPointsAndEventIDs output connector to output points and eventIDs for PointConn.
virtual void connectors()
Initialize the connectors this module is using.
void clearProperties()
Removes the property groups.
void loadNotifier(WPropertyGroup::SPtr group, WPropertyBase::SPtr property)
Notifier for the dummy properties.
virtual void properties()
Initialize the properties for this module.
std::vector< std::pair< std::string, std::string > > m_loadedProperties
Contains the loaded properties.
WMFilterProtonData()
Standard constructor.
void updateProperty()
update added group property and subproperty
virtual void moduleMain()
Entry point after loading the 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...
std::shared_ptr< WModuleInputData< WDataSetCSV > > m_input
Input connector (required for this module).
std::shared_ptr< WModuleOutputData< WDataSetPoints > > m_output_points
WDataSetPoints output connector (required for this module).
void setOutputFromCSV()
Create outputs, so it can be displayed by the fiber display and the point renderer.
Class able to contain other modules.
virtual WModule::SPtr createAndAdd(std::string name)
Convenience method to create a module instance with a given name and automatically add it to the cont...
virtual void stop()
Stops all modules inside this container.
static PtrType createAndAdd(std::shared_ptr< WModule > module, std::string name="", std::string description="")
Convenience method to create a new instance of this out data connector with proper type and add it to...
static PtrType create(std::shared_ptr< WModule > module, std::string name="", std::string description="")
Convenience method to create a new instance of this out data connector with proper type.
boost::filesystem::path m_localPath
The path where the module binary resides in.
virtual void properties()
Initialize properties in this function.
virtual WModuleMetaInformation::ConstSPtr getMetaInformation() const
The meta information of this module.
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.
WPropBool m_active
True whenever the module should be active.
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.
Creates, updates and handles the output properties.
std::shared_ptr< WOutputPropertyHandler > SPtr
shared_ptr that points to itself.
Class managing progress inside of modules.
boost::function< void(std::shared_ptr< WPropertyBase >)> PropertyChangeNotifierType
Signal signature emitted during set operations.
std::shared_ptr< WPropertyBase > SPtr
Convenience typedef for a std::shared_ptr< WPropertyBase >
std::shared_ptr< WPropertyGroup > SPtr
shared pointer to object of this type
Holds references to all the property handlers.
std::shared_ptr< WProtonData > SPtr
shared_ptr that points to itself
WBoolFlag m_shutdownFlag
Condition getting fired whenever the thread should quit.
Creates, updates and handles the visualization properties.
std::shared_ptr< WVisualizationPropertyHandler > SPtr
shared_ptr that points to itself