OpenWalnut
1.5.0dev
|
Converts the csv data to points and fibers. More...
#include <WCsvConverter.h>
Public Types | |
typedef std::shared_ptr< std::vector< float > > | SPFloatVector |
represents a std::shared_ptr to a vector containing a vector of floats. More... | |
typedef std::shared_ptr< std::vector< size_t > > | SPSizeVector |
represents a std::shared_ptr to a vector containing a vector of size_t. More... | |
Public Member Functions | |
WCsvConverter (WProtonData::SPtr protonData, std::shared_ptr< WPropertyStatus > propertyStatus, WModule::SPtr colorBar) | |
Initializes the vectors, indices and transfer function color bar Calls setOutputFromCSV. More... | |
std::shared_ptr< WDataSetFibers > | getFibers () |
Getter. More... | |
std::shared_ptr< WDataSetPoints > | getPoints () |
Getter. More... | |
std::shared_ptr< WDataSetSingle > | getTransferFunction () |
Getter. More... | |
std::shared_ptr< WDataSetPoints > | getPointsAndData () |
Getter. More... | |
Private Member Functions | |
std::shared_ptr< std::vector< unsigned char > > | sampleTransferFunction () |
Computes gradient vector from transfer function specified in visualization properties. More... | |
void | normalizeEdeps (SPFloatVector edeps, SPFloatVector colorArray, float maxEdep, float minEdep) |
Normalize energy deposition values to use as RGB values. More... | |
bool | checkConditionToPass (WDataSetCSV::Content::iterator dataRow) |
checks whether the requirements are fulfilled. More... | |
void | addVertex (WDataSetCSV::Content::iterator dataRow) |
Create vertex for point/fiber renderer. More... | |
void | addColor (WColor plainColor) |
Create color for point/Fiber renderer. More... | |
void | addEdepAndSize (WDataSetCSV::Content::iterator dataRow, float *maxEdep, float *minEdep) |
Create edep and sizes for point/fiber renderer. More... | |
void | addEventID (WDataSetCSV::Content::iterator dataRow) |
Create eventID for Fiber renderer. More... | |
void | calculateFibers () |
calculate the property of WDataSetFiber (index, length, verticesReverse) More... | |
void | createOutputFibers () |
Create the fibers for fiber renderer. More... | |
void | createOutputPoints () |
Create the points for points renderer. More... | |
void | createOutputPointsAndData () |
Create the points and selected data for Point Connector. More... | |
void | setOutputFromCSV () |
Create outputs, so it can be displayed by the fiber display and the point renderer. More... | |
void | setTransferFunction (std::shared_ptr< std::vector< unsigned char > > data) |
Creates output for transfer function. More... | |
bool | checkIfOutputIsNull () |
the cast value from string to float More... | |
float | getClusterSize (float edep) |
Computes the cluster size. More... | |
float | stringToDouble (std::string str) |
checks whether the string is a number (double) More... | |
int | stringToInt (std::string str) |
checks whether the string is a number (int) More... | |
Private Attributes | |
WProtonData::SPtr | m_protonData |
Stores information form csv content. More... | |
WModule::SPtr | m_colorBar |
Stores reference to the given transfer function color bar module. More... | |
std::shared_ptr< WDataSetFibers > | m_fibers |
Stores information for the fiber display. More... | |
std::shared_ptr< WDataSetPoints > | m_points |
Stores information for the point renderer. More... | |
std::shared_ptr< WDataSetPoints > | m_pointsAndData |
Stores information for the point Conncetor. More... | |
std::shared_ptr< WDataSetSingle > | m_transferFunction |
Stores the currently mapped transfer function. More... | |
WConverterVectors::SPtr | m_vectors |
Stores points for point and fiber renderer. More... | |
WConverterIndexes::SPtr | m_indexes |
Stores indexes for fiber renderer. More... | |
WPropertyStatus::SPtr | m_propertyStatus |
includes all property groups More... | |
Friends | |
class | WCsvConverterTest |
only test classes may be friend More... | |
Converts the csv data to points and fibers.
Definition at line 53 of file WCsvConverter.h.
typedef std::shared_ptr< std::vector< float > > WCsvConverter::SPFloatVector |
represents a std::shared_ptr to a vector containing a vector of floats.
Definition at line 72 of file WCsvConverter.h.
typedef std::shared_ptr< std::vector< size_t > > WCsvConverter::SPSizeVector |
represents a std::shared_ptr to a vector containing a vector of size_t.
Definition at line 77 of file WCsvConverter.h.
WCsvConverter::WCsvConverter | ( | WProtonData::SPtr | protonData, |
std::shared_ptr< WPropertyStatus > | propertyStatus, | ||
WModule::SPtr | colorBar | ||
) |
Initializes the vectors, indices and transfer function color bar Calls setOutputFromCSV.
protonData | The proton data to use. |
propertyStatus | The status of the properties. |
colorBar | Reference to the transfer function color bar module |
Definition at line 36 of file WCsvConverter.cpp.
References m_colorBar, m_indexes, m_propertyStatus, m_protonData, m_vectors, and setOutputFromCSV().
|
private |
Create color for point/Fiber renderer.
plainColor | The color to create |
Definition at line 250 of file WCsvConverter.cpp.
References WSingleSelectorName::getEdep(), m_propertyStatus, m_protonData, and m_vectors.
Referenced by setOutputFromCSV().
|
private |
Create edep and sizes for point/fiber renderer.
dataRow | each row of the csv file (content of row) |
maxEdep | a pointer to the current maximum of the edep |
minEdep | a pointer to the current minimum of the edep |
Definition at line 262 of file WCsvConverter.cpp.
References WSingleSelectorName::getEdep(), m_indexes, m_protonData, m_vectors, and stringToDouble().
Referenced by setOutputFromCSV().
|
private |
Create eventID for Fiber renderer.
dataRow | each row of the csv file (content of row) |
Definition at line 420 of file WCsvConverter.cpp.
References WSingleSelectorName::getEventId(), m_indexes, m_protonData, m_vectors, and stringToInt().
Referenced by setOutputFromCSV().
|
private |
Create vertex for point/fiber renderer.
dataRow | each row of the csv file (content of row) |
Definition at line 243 of file WCsvConverter.cpp.
References m_indexes, m_vectors, and stringToDouble().
Referenced by setOutputFromCSV().
|
private |
calculate the property of WDataSetFiber (index, length, verticesReverse)
Definition at line 283 of file WCsvConverter.cpp.
References m_fibers, m_vectors, and wlog::warn().
Referenced by createOutputFibers().
|
private |
checks whether the requirements are fulfilled.
dataRow | the row to check. |
Definition at line 194 of file WCsvConverter.cpp.
References WSingleSelectorName::getEventId(), WSingleSelectorName::getParentId(), WSingleSelectorName::getPDG(), m_indexes, m_propertyStatus, m_protonData, stringToDouble(), and stringToInt().
Referenced by setOutputFromCSV().
|
private |
the cast value from string to float
Definition at line 444 of file WCsvConverter.cpp.
References m_fibers, m_points, m_pointsAndData, and m_vectors.
Referenced by setOutputFromCSV().
|
private |
Create the fibers for fiber renderer.
Definition at line 376 of file WCsvConverter.cpp.
References calculateFibers(), WSingleSelectorName::getEventId(), m_fibers, and m_protonData.
Referenced by setOutputFromCSV().
|
private |
Create the points for points renderer.
Definition at line 352 of file WCsvConverter.cpp.
References WSingleSelectorName::getEdep(), m_points, m_propertyStatus, m_protonData, and m_vectors.
Referenced by setOutputFromCSV().
|
private |
Create the points and selected data for Point Connector.
Definition at line 395 of file WCsvConverter.cpp.
References WSingleSelectorName::getEdep(), WSingleSelectorName::getEventId(), m_pointsAndData, m_propertyStatus, m_protonData, and m_vectors.
Referenced by setOutputFromCSV().
|
private |
Computes the cluster size.
edep | energy deposition |
Definition at line 456 of file WCsvConverter.cpp.
Referenced by normalizeEdeps(), setOutputFromCSV(), and WCsvConverterTest::testGetClusterSize().
std::shared_ptr< WDataSetFibers > WCsvConverter::getFibers | ( | ) |
Getter.
Definition at line 53 of file WCsvConverter.cpp.
References m_fibers.
std::shared_ptr< WDataSetPoints > WCsvConverter::getPoints | ( | ) |
Getter.
Definition at line 58 of file WCsvConverter.cpp.
References m_points.
std::shared_ptr< WDataSetPoints > WCsvConverter::getPointsAndData | ( | ) |
Getter.
Definition at line 63 of file WCsvConverter.cpp.
References m_pointsAndData.
std::shared_ptr< WDataSetSingle > WCsvConverter::getTransferFunction | ( | ) |
Getter.
Definition at line 123 of file WCsvConverter.cpp.
References m_transferFunction.
|
private |
Normalize energy deposition values to use as RGB values.
edeps | vector containing energy deposition values |
colorArray | vector containing colors per vertex |
maxEdep | maximum energy deposition |
minEdep | minimum energy deposition |
Definition at line 139 of file WCsvConverter.cpp.
References getClusterSize(), WSingleSelectorName::getEdep(), m_colorBar, m_indexes, m_propertyStatus, m_protonData, m_vectors, sampleTransferFunction(), and setTransferFunction().
Referenced by setOutputFromCSV().
|
private |
Computes gradient vector from transfer function specified in visualization properties.
Definition at line 128 of file WCsvConverter.cpp.
References m_propertyStatus, and WTransferFunction::sample1DTransferFunction().
Referenced by normalizeEdeps().
|
private |
Create outputs, so it can be displayed by the fiber display and the point renderer.
Definition at line 68 of file WCsvConverter.cpp.
References addColor(), addEdepAndSize(), addEventID(), addVertex(), checkConditionToPass(), checkIfOutputIsNull(), createOutputFibers(), createOutputPoints(), createOutputPointsAndData(), getClusterSize(), WSingleSelectorName::getEdep(), WSingleSelectorName::getX(), WSingleSelectorName::getY(), WSingleSelectorName::getZ(), m_indexes, m_propertyStatus, m_protonData, m_vectors, wlimits::MAX_FLOAT, wlimits::MIN_FLOAT, normalizeEdeps(), and stringToDouble().
Referenced by WCsvConverter().
|
private |
Creates output for transfer function.
data | shared_ptr of mapped gradient from transfer function in RGBA format |
Definition at line 433 of file WCsvConverter.cpp.
Referenced by normalizeEdeps().
|
private |
checks whether the string is a number (double)
str | The string to cast |
Definition at line 461 of file WCsvConverter.cpp.
Referenced by addEdepAndSize(), addVertex(), checkConditionToPass(), setOutputFromCSV(), stringToInt(), and WCsvConverterTest::testStringToDouble().
|
private |
checks whether the string is a number (int)
str | The string to cast |
Definition at line 477 of file WCsvConverter.cpp.
References stringToDouble().
Referenced by addEventID(), checkConditionToPass(), and WCsvConverterTest::testStringToInt().
|
friend |
only test classes may be friend
Definition at line 58 of file WCsvConverter.h.
|
private |
Stores reference to the given transfer function color bar module.
Definition at line 114 of file WCsvConverter.h.
Referenced by normalizeEdeps(), and WCsvConverter().
|
private |
Stores information for the fiber display.
Definition at line 119 of file WCsvConverter.h.
Referenced by calculateFibers(), checkIfOutputIsNull(), createOutputFibers(), and getFibers().
|
private |
Stores indexes for fiber renderer.
Definition at line 144 of file WCsvConverter.h.
Referenced by addEdepAndSize(), addEventID(), addVertex(), checkConditionToPass(), normalizeEdeps(), setOutputFromCSV(), and WCsvConverter().
|
private |
Stores information for the point renderer.
Definition at line 124 of file WCsvConverter.h.
Referenced by checkIfOutputIsNull(), createOutputPoints(), and getPoints().
|
private |
Stores information for the point Conncetor.
Definition at line 129 of file WCsvConverter.h.
Referenced by checkIfOutputIsNull(), createOutputPointsAndData(), and getPointsAndData().
|
private |
includes all property groups
Definition at line 149 of file WCsvConverter.h.
Referenced by addColor(), checkConditionToPass(), createOutputPoints(), createOutputPointsAndData(), normalizeEdeps(), sampleTransferFunction(), setOutputFromCSV(), and WCsvConverter().
|
private |
Stores information form csv content.
Content object containing data
Definition at line 109 of file WCsvConverter.h.
Referenced by addColor(), addEdepAndSize(), addEventID(), checkConditionToPass(), createOutputFibers(), createOutputPoints(), createOutputPointsAndData(), normalizeEdeps(), setOutputFromCSV(), and WCsvConverter().
|
private |
Stores the currently mapped transfer function.
Definition at line 134 of file WCsvConverter.h.
Referenced by getTransferFunction().
|
private |
Stores points for point and fiber renderer.
Definition at line 139 of file WCsvConverter.h.
Referenced by addColor(), addEdepAndSize(), addEventID(), addVertex(), calculateFibers(), checkIfOutputIsNull(), createOutputPoints(), createOutputPointsAndData(), normalizeEdeps(), setOutputFromCSV(), and WCsvConverter().