OpenWalnut
1.5.0dev
|
Holds the data of the WMPointConnector. More...
#include <WConnectorData.h>
Public Types | |
typedef std::shared_ptr< WConnectorData > | SPtr |
A shared_ptr to this class. More... | |
Public Member Functions | |
WConnectorData () | |
Creates the internal vector arrays. More... | |
void | clear () |
Clears the internal vector arrays. More... | |
osg::ref_ptr< osg::Vec3Array > | getVertices () |
osg::ref_ptr< osg::Vec4Array > | getColors () |
std::shared_ptr< std::vector< float > > | getEdeps () |
std::shared_ptr< std::vector< float > > | getClusterSizes () |
void | addVertex (osg::Vec3 vertex, osg::Vec4 color, float edep=0.0, float clusterSize=0.0) |
Adds a vertex with its color to the currently selected fiber. More... | |
void | selectPoint (size_t idx) |
Selects a point by its index in m_vertices. More... | |
void | selectPoint (osg::Vec3 vertex) |
Selects a poit by its coordinates. More... | |
void | deselectPoint () |
Deselects the currently selected point. More... | |
bool | getSelectedPoint (size_t *idx) |
bool | hasClusterSize () |
void | setHasClusterSize (bool clusterSize=true) |
Sets whether the cluster size should be used. More... | |
Private Attributes | |
osg::ref_ptr< osg::Vec3Array > | m_vertices |
The vertices that are drawn. More... | |
osg::ref_ptr< osg::Vec4Array > | m_colors |
The color of the vertices that are drawn. More... | |
std::shared_ptr< std::vector< float > > | m_edeps |
The energy deposition of the vertices. More... | |
std::shared_ptr< std::vector< float > > | m_clusterSizes |
The cluster size of the vertices. More... | |
size_t | m_selectedIndex |
The index of the selected vertex. More... | |
bool | m_hasSelected = false |
Whether a selection has been done or not. More... | |
bool | m_hasClusterSize = false |
Whether cluster size should be used. More... | |
Holds the data of the WMPointConnector.
Definition at line 37 of file WConnectorData.h.
typedef std::shared_ptr< WConnectorData > WConnectorData::SPtr |
A shared_ptr to this class.
Definition at line 43 of file WConnectorData.h.
WConnectorData::WConnectorData | ( | ) |
Creates the internal vector arrays.
Definition at line 31 of file WConnectorData.cpp.
References m_clusterSizes, m_colors, m_edeps, and m_vertices.
void WConnectorData::addVertex | ( | osg::Vec3 | vertex, |
osg::Vec4 | color, | ||
float | edep = 0.0 , |
||
float | clusterSize = 0.0 |
||
) |
Adds a vertex with its color to the currently selected fiber.
vertex | The vertex to add. |
color | The color of the vertex. |
edep | The energy deposition of the vertex. |
clusterSize | The cluster size of the vertex. |
Definition at line 69 of file WConnectorData.cpp.
References m_clusterSizes, m_colors, m_edeps, and m_vertices.
void WConnectorData::clear | ( | ) |
Clears the internal vector arrays.
Definition at line 39 of file WConnectorData.cpp.
References m_clusterSizes, m_colors, m_edeps, m_hasClusterSize, and m_vertices.
void WConnectorData::deselectPoint | ( | ) |
Deselects the currently selected point.
Definition at line 77 of file WConnectorData.cpp.
References m_hasSelected.
std::shared_ptr< std::vector< float > > WConnectorData::getClusterSizes | ( | ) |
Definition at line 63 of file WConnectorData.cpp.
References m_clusterSizes.
osg::ref_ptr< osg::Vec4Array > WConnectorData::getColors | ( | ) |
Definition at line 53 of file WConnectorData.cpp.
References m_colors.
std::shared_ptr< std::vector< float > > WConnectorData::getEdeps | ( | ) |
Definition at line 58 of file WConnectorData.cpp.
References m_edeps.
bool WConnectorData::getSelectedPoint | ( | size_t * | idx | ) |
idx | Where to write the index of the selected point |
Definition at line 96 of file WConnectorData.cpp.
References m_hasSelected, and m_selectedIndex.
osg::ref_ptr< osg::Vec3Array > WConnectorData::getVertices | ( | ) |
Definition at line 48 of file WConnectorData.cpp.
References m_vertices.
bool WConnectorData::hasClusterSize | ( | ) |
Definition at line 103 of file WConnectorData.cpp.
References m_hasClusterSize.
void WConnectorData::selectPoint | ( | osg::Vec3 | vertex | ) |
Selects a poit by its coordinates.
vertex | The coordinates of the point. |
Definition at line 88 of file WConnectorData.cpp.
References m_vertices, and selectPoint().
void WConnectorData::selectPoint | ( | size_t | idx | ) |
Selects a point by its index in m_vertices.
idx | The index of the point. |
Definition at line 82 of file WConnectorData.cpp.
References m_hasSelected, and m_selectedIndex.
Referenced by selectPoint().
void WConnectorData::setHasClusterSize | ( | bool | clusterSize = true | ) |
Sets whether the cluster size should be used.
clusterSize |
Definition at line 108 of file WConnectorData.cpp.
References m_hasClusterSize.
|
private |
The cluster size of the vertices.
Definition at line 140 of file WConnectorData.h.
Referenced by addVertex(), clear(), getClusterSizes(), and WConnectorData().
|
private |
The color of the vertices that are drawn.
Definition at line 130 of file WConnectorData.h.
Referenced by addVertex(), clear(), getColors(), and WConnectorData().
|
private |
The energy deposition of the vertices.
Definition at line 135 of file WConnectorData.h.
Referenced by addVertex(), clear(), getEdeps(), and WConnectorData().
|
private |
Whether cluster size should be used.
Definition at line 155 of file WConnectorData.h.
Referenced by clear(), hasClusterSize(), and setHasClusterSize().
|
private |
Whether a selection has been done or not.
Definition at line 150 of file WConnectorData.h.
Referenced by deselectPoint(), getSelectedPoint(), and selectPoint().
|
private |
The index of the selected vertex.
Definition at line 145 of file WConnectorData.h.
Referenced by getSelectedPoint(), and selectPoint().
|
private |
The vertices that are drawn.
Definition at line 125 of file WConnectorData.h.
Referenced by addVertex(), clear(), getVertices(), selectPoint(), and WConnectorData().