OpenWalnut  1.5.0dev
Public Types | Public Member Functions | Private Attributes | List of all members
WConnectorData Class Reference

Holds the data of the WMPointConnector. More...

#include <WConnectorData.h>

+ Collaboration diagram for WConnectorData:

Public Types

typedef std::shared_ptr< WConnectorDataSPtr
 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...
 

Detailed Description

Holds the data of the WMPointConnector.

Definition at line 37 of file WConnectorData.h.

Member Typedef Documentation

◆ SPtr

typedef std::shared_ptr< WConnectorData > WConnectorData::SPtr

A shared_ptr to this class.

Definition at line 43 of file WConnectorData.h.

Constructor & Destructor Documentation

◆ WConnectorData()

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.

Member Function Documentation

◆ addVertex()

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.

Parameters
vertexThe vertex to add.
colorThe color of the vertex.
edepThe energy deposition of the vertex.
clusterSizeThe cluster size of the vertex.

Definition at line 69 of file WConnectorData.cpp.

References m_clusterSizes, m_colors, m_edeps, and m_vertices.

◆ clear()

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.

◆ deselectPoint()

void WConnectorData::deselectPoint ( )

Deselects the currently selected point.

Definition at line 77 of file WConnectorData.cpp.

References m_hasSelected.

◆ getClusterSizes()

std::shared_ptr< std::vector< float > > WConnectorData::getClusterSizes ( )
Returns
std::shared_ptr< std::vector< float > > The cluster size in this data.

Definition at line 63 of file WConnectorData.cpp.

References m_clusterSizes.

◆ getColors()

osg::ref_ptr< osg::Vec4Array > WConnectorData::getColors ( )
Returns
osg::ref_ptr< osg::Vec4Array > The colors in this data.

Definition at line 53 of file WConnectorData.cpp.

References m_colors.

◆ getEdeps()

std::shared_ptr< std::vector< float > > WConnectorData::getEdeps ( )
Returns
std::shared_ptr< std::vector< float > > The energy deposition in this data.

Definition at line 58 of file WConnectorData.cpp.

References m_edeps.

◆ getSelectedPoint()

bool WConnectorData::getSelectedPoint ( size_t *  idx)
Parameters
idxWhere to write the index of the selected point
Returns
true A point is selected
false A point is not selected

Definition at line 96 of file WConnectorData.cpp.

References m_hasSelected, and m_selectedIndex.

◆ getVertices()

osg::ref_ptr< osg::Vec3Array > WConnectorData::getVertices ( )
Returns
osg::ref_ptr< osg::Vec3Array > The vertices in this data.

Definition at line 48 of file WConnectorData.cpp.

References m_vertices.

◆ hasClusterSize()

bool WConnectorData::hasClusterSize ( )
Returns
true Cluster size should be used.
false Cluster size should not be used.

Definition at line 103 of file WConnectorData.cpp.

References m_hasClusterSize.

◆ selectPoint() [1/2]

void WConnectorData::selectPoint ( osg::Vec3  vertex)

Selects a poit by its coordinates.

Parameters
vertexThe coordinates of the point.

Definition at line 88 of file WConnectorData.cpp.

References m_vertices, and selectPoint().

+ Here is the call graph for this function:

◆ selectPoint() [2/2]

void WConnectorData::selectPoint ( size_t  idx)

Selects a point by its index in m_vertices.

Parameters
idxThe index of the point.

Definition at line 82 of file WConnectorData.cpp.

References m_hasSelected, and m_selectedIndex.

Referenced by selectPoint().

+ Here is the caller graph for this function:

◆ setHasClusterSize()

void WConnectorData::setHasClusterSize ( bool  clusterSize = true)

Sets whether the cluster size should be used.

Parameters
clusterSize

Definition at line 108 of file WConnectorData.cpp.

References m_hasClusterSize.

Member Data Documentation

◆ m_clusterSizes

std::shared_ptr< std::vector< float > > WConnectorData::m_clusterSizes
private

The cluster size of the vertices.

Definition at line 140 of file WConnectorData.h.

Referenced by addVertex(), clear(), getClusterSizes(), and WConnectorData().

◆ m_colors

osg::ref_ptr< osg::Vec4Array > WConnectorData::m_colors
private

The color of the vertices that are drawn.

Definition at line 130 of file WConnectorData.h.

Referenced by addVertex(), clear(), getColors(), and WConnectorData().

◆ m_edeps

std::shared_ptr< std::vector< float > > WConnectorData::m_edeps
private

The energy deposition of the vertices.

Definition at line 135 of file WConnectorData.h.

Referenced by addVertex(), clear(), getEdeps(), and WConnectorData().

◆ m_hasClusterSize

bool WConnectorData::m_hasClusterSize = false
private

Whether cluster size should be used.

Definition at line 155 of file WConnectorData.h.

Referenced by clear(), hasClusterSize(), and setHasClusterSize().

◆ m_hasSelected

bool WConnectorData::m_hasSelected = false
private

Whether a selection has been done or not.

Definition at line 150 of file WConnectorData.h.

Referenced by deselectPoint(), getSelectedPoint(), and selectPoint().

◆ m_selectedIndex

size_t WConnectorData::m_selectedIndex
private

The index of the selected vertex.

Definition at line 145 of file WConnectorData.h.

Referenced by getSelectedPoint(), and selectPoint().

◆ m_vertices

osg::ref_ptr< osg::Vec3Array > WConnectorData::m_vertices
private

The vertices that are drawn.

Definition at line 125 of file WConnectorData.h.

Referenced by addVertex(), clear(), getVertices(), selectPoint(), and WConnectorData().


The documentation for this class was generated from the following files: