Commit 0f482b46 authored by schurade's avatar schurade
Browse files

[DOC]

parent 6b63a8cf
......@@ -44,7 +44,6 @@ public:
/**
* Constructs a new set of fibers, usage of WFiber here is for backward compatibility and should be removed
*
* \param fibs Fiber vector to store in this data set
* \param vertices
* \param lineStartIndexes
* \param lineLengths
......@@ -65,12 +64,6 @@ public:
*/
size_t size() const;
/**
* \param index The index number of the fiber which should be returned
* \return The i'th fiber.
*/
//const wmath::WFiber& operator[]( const size_t index ) const;
/**
* Sort fibers descending on their length.
*/
......@@ -125,7 +118,10 @@ public:
boost::shared_ptr< std::vector< unsigned int > > getVerticesReverse() const;
/**
* returns the position in space for a vertex of a given fiber
*
* \param fiber
* \param vertex
*/
wmath::WPosition getPosition( unsigned int fiber, unsigned int vertex ) const;
......
......@@ -54,8 +54,18 @@ public:
*/
boost::signals2::signal0< void >* getSignalIsModified();
/**
* sets the NOT flag
*
* \param isNot
*/
void setNot( bool isNot = true );
/**
* getter for NOT flag
*
* \return the flag
*/
bool isNot();
protected:
......
......@@ -103,9 +103,19 @@ public:
*/
WQtModuleTreeItem* addModule( boost::shared_ptr< WModule > module );
/**
* Adds a roi entry to the dataset browser
*
* \param roi pointer to the roi representation object
*/
void addRoi( boost::shared_ptr< WRMROIRepresentation > roi );
/**
* Adds a module to the dataset browser. This function will combine addDataset and addModule
*
* \param module the module to add.
* \param subjectId the subject under which the entry is added
*/
void addModule2( boost::shared_ptr< WModule > module, int subjectId = 0 );
/**
......@@ -131,7 +141,9 @@ public:
boost::shared_ptr< WModule > getSelectedModule();
/**
* Returns the currently selected roi.
*
* \return pointer to roi representation
*/
boost::shared_ptr< WRMROIRepresentation > getSelectedRoi();
......@@ -186,12 +198,17 @@ protected:
int getFirstSubject();
/**
* fills the modul toolbar with buttons for modules that are compatible with the currently
* selected dataset
*
* \param module pointer to the currently selected module
*/
void createCompatibleButtons( boost::shared_ptr< WModule >module );
/**
* returns a pointer to the properties object of the currently selected tree item
*
* \return the properties
*/
boost::shared_ptr< WProperties > getPropOfSelected();
......@@ -201,54 +218,27 @@ protected:
WMainWindow* m_mainWindow;
private:
/**
* point to the tree widget
*/
WQtTreeWidget* m_treeWidget;
WQtTreeWidget* m_treeWidget; //!< pointer to the tree widget
/**
* pointer to the tab widget
*/
QTabWidget* m_tabWidget;
QTabWidget* m_tabWidget; //!< pointer to the tab widget
/**
* button down
*/
QPushButton* m_downButton;
QPushButton* m_downButton; //!< button down
/**
* button up
*/
QPushButton* m_upButton;
QPushButton* m_upButton; //!< button up
/**
* tab 1
*/
QWidget* m_tab1;
QWidget* m_tab1; //!< tab 1
/**
* tab 2
*/
QWidget* m_tab2;
QWidget* m_tab2; //!< tab 2
/**
* tab 3
*/
QWidget* m_tab3;
QWidget* m_tab3; //!< tab 3
/**
* panel
*/
QWidget* m_panel;
QWidget* m_panel; //!< panel
/**
* layout
*/
QVBoxLayout* m_layout;
QVBoxLayout* m_layout; //!< layout
WQtModuleHeaderTreeItem* m_tiModules;
WQtModuleHeaderTreeItem* m_tiModules; //!< header for modules
WQtRoiHeaderTreeItem* m_tiRois;
WQtRoiHeaderTreeItem* m_tiRois; //!< header for rois
private slots:
/**
......
......@@ -32,18 +32,20 @@
#include "WQtRoiTreeItem.h"
/**
* TODO(schurade): Document this!
* header item for rois
*/
class WQtRoiHeaderTreeItem : public QTreeWidgetItem
{
public:
/**
* TODO(schurade): Document this!
* constructor
*
* \param parent
*/
explicit WQtRoiHeaderTreeItem( QTreeWidget * parent );
/**
* TODO(schurade): Document this!
* destructor
*/
virtual ~WQtRoiHeaderTreeItem();
......
......@@ -34,21 +34,29 @@
#include "../../../modules/fiberDisplay2/WRMROIRepresentation.h"
/**
* TODO(schurade): Document this!
* a tree widget item to represent a roi in the dataset browser
*/
class WQtRoiTreeItem : public QTreeWidgetItem
{
public:
/**
* TODO(schurade): Document this!
* constructor
*
* \param parent
* \param roi
* \param type
*/
WQtRoiTreeItem( QTreeWidgetItem * parent, boost::shared_ptr< WRMROIRepresentation > roi, int type = 5 );
/**
* TODO(schurade): Document this!
* destructor
*/
~WQtRoiTreeItem();
/**
* getter
* \return the roi representation object
*/
boost::shared_ptr< WRMROIRepresentation > getRoi();
/**
......@@ -60,7 +68,7 @@ public:
protected:
private:
boost::shared_ptr< WRMROIRepresentation > m_roi;
boost::shared_ptr< WRMROIRepresentation > m_roi; //!< roi
};
#endif // WQTROITREEITEM_H
......@@ -33,18 +33,19 @@
#include "../../../modules/fiberDisplay2/WRMROIRepresentation.h"
/**
* TODO(schurade): Document this!
* Event signalling a new roi has been associated with the roi manager in the kernel.
*/
class WRoiAssocEvent: public QEvent
{
public:
/**
* TODO(schurade): Document this!
* constructor
* \param roi
*/
explicit WRoiAssocEvent( boost::shared_ptr< WRMROIRepresentation > roi );
/**
* TODO(schurade): Document this!
* destructor
*/
~WRoiAssocEvent();
......
......@@ -29,7 +29,7 @@
#include "WKdTree.h"
WKdTree::WKdTree( int size, float *pointArray, bool ) :
WKdTree::WKdTree( int size, float *pointArray ) :
m_size( size ), m_pointArray( pointArray )
{
m_tree.clear();
......@@ -71,18 +71,6 @@ WKdTree::WKdTree( int size, float *pointArray, bool ) :
wlog::debug( "KdTree" ) << "All threads finished";
}
WKdTree::WKdTree( int size, float *pointArray ) :
m_size( size ), m_pointArray( pointArray )
{
wlog::debug( "KdTree" ) << " Start building KdTree";
m_tree.clear();
m_tree.resize( size );
for ( int i = 0; i < size; ++i )
m_tree[i] = i;
buildTree( 0, size - 1, 0 );
wlog::debug( "KdTree" ) << " Finished building KdTree";
}
WKdTree::~WKdTree()
{
}
......@@ -99,7 +87,7 @@ void WKdTree::buildTree( int left, int right, int axis )
buildTree( div + 1, right, ( axis + 1 ) % 3 );
}
WKdTreeThread::WKdTreeThread( float *pointArray, std::vector< unsigned int >* tree, int left, int right, int axis ) :
WKdTreeThread::WKdTreeThread( float* pointArray, std::vector< unsigned int >* tree, int left, int right, int axis ) :
WThreadedRunner(), m_tree( tree ), m_pointArray( pointArray ), m_left( left ), m_right( right ), m_axis( axis )
{
}
......
......@@ -30,54 +30,107 @@
#include "../../common/WThreadedRunner.h"
/**
* implements the compare function for std::nth_element on a point array
*/
struct lessy
{
float const * const data;
const int pos;
float const * const data; //!< stores the pointer to the data array
const int pos; //!< stores the axis at which the array is sorted
/**
* constructor
* \param data pointer to the array
* \param pos x,y or z axis
*/
lessy( float const * const data, const int pos ) :
data( data ), pos( pos )
{
}
bool operator()( const unsigned int& a, const unsigned int& b ) const //NOLINT
/**
* compare operator
* \param lhs
* \param rhs
*/
bool operator()( const unsigned int& lhs, const unsigned int& rhs ) const //NOLINT
{
return data[3* a + pos] < data[3* b + pos];
return data[3 * lhs + pos] < data[3 * rhs + pos];
}
};
/**
* class to provide threaded computation of parts of the kd tree
*/
class WKdTreeThread: public WThreadedRunner
{
public:
WKdTreeThread( float*, std::vector< unsigned int >*, int, int, int );
/**
* constructor
*
* \param pointArray
* \param tree pointer to the tree
* \param left boundary of the part to compute
* \param right boundary of the part to compute
* \param axis starting axis
*/
WKdTreeThread( float* pointArray, std::vector< unsigned int >* tree, int left, int right, int axis );
/**
* recursive function to compute a part of the kd tree
*
* \param left
* \param right
* \param axis
*/
void buildTree( int left, int right, int axis );
void buildTree( int, int, int );
/**
* entry for the run command
*/
virtual void threadMain();
std::vector< unsigned int >* m_tree;
float *m_pointArray;
std::vector< unsigned int >* m_tree; //!< stores a pointer to the tree
float *m_pointArray; //!< stores a pointer to the vertex array
int m_left;
int m_right;
int m_axis;
int m_left; //!< stores left boundary, since the threadMain method has no arguments
int m_right; //!< stores left boundary, since the threadMain method has no arguments
int m_axis; //!< stores axis, since the threadMain method has no arguments
};
/**
* TODO(schurade): Document this!
* implements the computation of a kd tree on a point array
*/
class WKdTree
{
public:
WKdTree( int size, float* pointArray, bool );
/**
* constructor
*
* \param size
* \param pointArray
*/
WKdTree( int size, float* pointArray );
/**
* destructor
*/
~WKdTree();
std::vector< unsigned int > m_tree;
std::vector< unsigned int > m_tree; //!< stores the tree
private:
void buildTree( int, int, int );
int m_size;
unsigned int m_root;
float *m_pointArray;
/**
* recursive function to compute a part of the kd tree
*
* \param left
* \param right
* \param axis
*/
void buildTree( int left, int right, int axis );
int m_size; //!< size of the tree
unsigned int m_root; //!< index of the root point
float *m_pointArray; //!< stores a pointer to the vertex array
};
#endif // WKDTREE_H
......@@ -147,6 +147,7 @@ void WMFiberDisplay2::updateLinesShown()
void WMFiberDisplay2::moduleMain()
{
// additional fire-condition: "data changed" flag
m_moduleState.setResetable( true, true );
m_moduleState.add( m_fiberInput->getDataChangedCondition() );
ready();
......@@ -195,7 +196,7 @@ void WMFiberDisplay2::create()
WKernel::getRunningKernel()->getGraphicsEngine()->getScene()->addChild( m_osgNode.get() );
m_osgNode->setUserData( this );
m_osgNode->setUpdateCallback( new fdNodeCallback );
m_osgNode->addUpdateCallback( new fdNodeCallback );
}
void WMFiberDisplay2::connectors()
......
......@@ -88,9 +88,6 @@ protected:
/**
* Generates an OSG geometry for the given fiber dataset.
*
* \param fibers pointer to fiber data set.
* \param globalColoring determines whether the whole fiber has
* the same color (true) or separate segements can have different colors.
* \return OSG geometry representing the fiber.
*/
osg::ref_ptr< osg::Geode > genFiberGeode();
......@@ -108,12 +105,14 @@ protected:
/**
* Redraws the scene.
*
* \problem This might take a while with e.g. 70,000 fibers approx 4 sec
*/
void update();
/**
* initial creation of the osg geometry
*/
void create();
/**
* Deletes the primitive list and adds only the avtivated
*/
......@@ -162,6 +161,12 @@ private:
*/
boost::shared_mutex m_updateLock;
/**
* calculates a color from the vector between two points in space
*
* \param pos1
* \param pos2
*/
WColor getRGBAColorFromDirection( const wmath::WPosition &pos1, const wmath::WPosition &pos2 );
......
......@@ -36,43 +36,53 @@
class WROIManagerFibers;
/**
* TODO(schurade): Document this!
* implements a branch in the tree like structure for rois
*/
class WRMBranch : public boost::enable_shared_from_this< WRMBranch >
{
public:
/**
* TODO(schurade): Document this!
* construtor
* \param roiManager
*/
explicit WRMBranch( boost::shared_ptr< WROIManagerFibers > roiManager );
/**
* TODO(schurade): Document this!
* destructor
*/
~WRMBranch();
/**
* adds a roi to the branch
*
* \param roi
*/
void addRoi( boost::shared_ptr< WRMROIRepresentation > roi );
/**
* getter for the bitfield
*
* \param index of the associated fiber dataset
* \return the bitfield
*/
boost::shared_ptr< std::vector< bool > > getBitField( unsigned int index );
/**
* creates and adds a bitfield to the list
*
* \param size of the bitfield
*/
void addBitField( size_t size );
/**
*
* updates the branch bitfield for this branch
*/
void recalculate();
/**
* getter for dirty flag
*
* \return the dirty flag
*/
bool isDirty();
......@@ -83,23 +93,28 @@ public:
/**
* returns a pointer to the first roi in the branch
*
* \return the roi
*/
boost::shared_ptr< WRMROIRepresentation >getFirstRoi();
/**
* getter for roi manager pointer
*
* \return the roi manager
*/
boost::shared_ptr< WROIManagerFibers > getRoiManager();
protected:
private:
bool m_dirty;
bool m_dirty; //!< dirty flag to indicate the bit field must be recalculated
boost::shared_ptr< WROIManagerFibers > m_roiManager;
boost::shared_ptr< WROIManagerFibers > m_roiManager; //!< stores a pointer to the roi manager
std::list< boost::shared_ptr< std::vector<bool> > >m_bitFields;
std::list< boost::shared_ptr< std::vector<bool> > >m_bitFields; //!< list of bit fields for each fiber dataset
std::list< boost::shared_ptr< WRMROIRepresentation> > m_rois;
std::list< boost::shared_ptr< WRMROIRepresentation> > m_rois; //!< list of rois in this this branch,
// first in the list is the master roi
};
#endif // WRMBRANCH_H
......@@ -38,53 +38,55 @@
#include "../../graphicsEngine/WROI.h"
class WRMBranch;
/**
* TODO(schurade): Document this!
* class encapsulates rois for the roi manager class
*/
class WRMROIRepresentation
{
public:
/**
* TODO(schurade): Document this!
* constructor
*
* \param roi
* \param branch
*/
WRMROIRepresentation( boost::shared_ptr< WROI > roi, boost::shared_ptr< WRMBranch > branch );
/**
* TODO(schurade): Document this!
* destructor
*/
~WRMROIRepresentation();
/**
* getter
*
* \return the roi
*/
boost::shared_ptr< WROI > getROI();
/**
* getter for bit field for a selected fiber dataset
*
*\param index
* \return the bit field
*/
boost::shared_ptr< std::vector< bool > > getBitField( unsigned int index );
/**
* adds a bit field of a given size to the list of bit fields
*
* \param size
*/
void addBitField( size_t size );
/**
*
* updates the bit fields with the fibers selected by the associated roi
*/
void recalculate();
/**
*
*/
void