GOFIGURE2  0.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
TraceContainerBase< TContainer > Class Template Referenceabstract

Generic interface for trace container. More specific container should inherit from this class and get specialized depending on the kind of trace it contains. More...

#include <Code/GUI/lib/VisualizationTraceContainers/TraceContainerBase.h>

Inheritance diagram for TraceContainerBase< TContainer >:
Inheritance graph
[legend]
Collaboration diagram for TraceContainerBase< TContainer >:
Collaboration graph
[legend]

Public Types

typedef
MultiIndexContainerType::template
index< CollectionID >
::type::iterator 
MultiIndexContainerCollectionIDIterator
 
typedef
MultiIndexContainerType::value_type 
MultiIndexContainerElementType
 
typedef
MultiIndexContainerType::template
index< Highlighted >
::type::iterator 
MultiIndexContainerHighlightedIterator
 
typedef
MultiIndexContainerType::template
index< TraceID >
::type::iterator 
MultiIndexContainerTraceIDIterator
 
typedef TContainer MultiIndexContainerType
 
typedef
MultiIndexContainerType::template
index< Visible >
::type::iterator 
MultiIndexContainerVisibleIterator
 

Public Member Functions

virtual std::list< unsigned int > DeleteAllHighlightedElements ()=0
 Delete all highlighted elements. More...
 
virtual bool DeleteElement (const unsigned int &iId)=0
 Remove the element which TraceId = iId. More...
 
virtual bool DeleteElement (MultiIndexContainerTraceIDIterator iIter)=0
 
std::vector< vtkActor * > GetActorGivenTraceID (unsigned int iTraceID)
 
unsigned int GetCollectionIDOfGivenTraceID (unsigned int iTraceID)
 Get the CollectionID given a TraceID. More...
 
double * GetCurrentElementColor ()
 Get the color of the current element track. More...
 
vtkPolyData * GetCurrentElementNodes ()
 Get the polydata representing the current element track. More...
 
std::list< vtkPolyData * > GetHighlightedElements ()
 Get all highlighted elements by pair<ID, Polydata>. More...
 
std::list< unsigned int > GetHighlightedElementsCollectionID ()
 
std::list< unsigned int > GetHighlightedElementsTraceID ()
 Get the list of highlighted elements TraceID. More...
 
vtkProperty * GetHighlightedProperty ()
 Get property for highlighted traces. More...
 
void Insert (const MultiIndexContainerElementType &iE)
 Insert one element in the container. More...
 
void InsertCurrentElement ()
 Insert Current Element in the container. More...
 
template<class TIterator >
void Print (TIterator iBegin, TIterator iEnd)
 Print the container content in the application output. More...
 
template<class TIndex >
void Print ()
 Print the container content in the application output according to the template parameter. More...
 
void Print ()
 Print the container content in the application output. More...
 
bool RemoveElementFromVisualizationWithGivenTraceID (const unsigned int &iId)
 Remove element from visualization. More...
 
void ResetCurrentElement ()
 Reset Current Element to a default state. More...
 
void SetColorCode (const std::string &iColumnName, const std::map< unsigned int, std::string > &iValues)
 Color code contour / mesh according to values provided. More...
 
template<typename TValue >
void SetColorCode (const std::string &iColumnName, const std::map< unsigned int, TValue > &iValues)
 Color code contour / mesh according to values provided. More...
 
void SetHighlightedProperty (vtkProperty *iProperty)
 Set property whenever the trace is highlighted. More...
 
void SetIntersectionLineWidth (const float &iWidth)
 
void SetLookupTableForColorCoding (vtkLookupTable *iLut)
 Apply the given lookup table to all traces in the container. More...
 
void SetRandomColor (const std::string &iColumnName, const std::map< unsigned int, unsigned int > &iIds)
 
void SetRandomColor (const std::string &iColumnName, const std::map< unsigned int, std::string > &iValues)
 
 TraceContainerBase (QObject *iParent, QGoImageView3D *iView)
 Constructor. More...
 
std::list< unsigned int > UpdateAllHighlightedElementsWithGivenColor (QColor iColor)
 Update all highlighted elements in the container with a given color. More...
 
void UpdateCurrentElementCollection (unsigned int iCollectionID)
 
void UpdateCurrentElementFromDB (unsigned int iTraceID, double irgba[4], bool IsVisible=false)
 Update Current Element from te database. More...
 
bool UpdateCurrentElementFromExistingOne (unsigned int iTraceID, bool iErase=true)
 put the information of the existing element into m_CurrentElement and remove the existing element from the container,the visu and the memory More...
 
template<class TIndex >
bool UpdateCurrentElementFromExistingOne (typename MultiIndexContainerType::template index< TIndex >::type::iterator iIt)
 
bool UpdateElementHighlightingWithGivenTraceID (const unsigned int &iId)
 Update element highlighting given it TraceId. More...
 
bool UpdateElementVisibilityWithGivenTraceID (const unsigned int &iId)
 Update element visibility given it TraceId. More...
 
template<class TIndex >
void UpdateVisualizationForGivenElement (typename MultiIndexContainerType::template index< TIndex >::type::iterator &iIt, std::vector< vtkActor * > iActors, const bool &iHighlighted, const bool &iVisible)
 Update Actors, Highlighted, Visibility (properties) of given a element. More...
 
template<class TList >
void UpdateVisualizationForGivenIDs (TList iList)
 Update Visualization of the given TraceIDs. More...
 
virtual ~TraceContainerBase ()
 Destructor. More...
 

Public Attributes

MultiIndexContainerType m_Container
 Trace Contaienr. More...
 
MultiIndexContainerElementType m_CurrentElement
 Current Element of the trace type. More...
 
QGoImageView3Dm_ImageView
 Link to the visualization. More...
 

Protected Member Functions

void RenderAllElementsWithOriginalColors ()
 Render with original colors. More...
 
void SetScalarRangeForAllElements (const double &iMin, const double &iMax)
 Set the scalar range. More...
 
void UpdateCurrentElementFromVisuBase (std::vector< vtkActor * > &iActors, vtkPolyData *iNodes, const bool &iHighlighted, const bool &iVisible)
 
virtual void UpdateElementHighlightingWithGivenTraceIDsBase (const QStringList &iList, const Qt::CheckState &iCheck)
 Change elements highlighting property given a list of TraceIDs and the new status. More...
 
void UpdateElementHighlightingWithTraceID (const unsigned int &oTraceId, Qt::CheckState &oState)
 Update highlighting property of one element given one actor. More...
 
virtual void UpdateElementVisibilityWithGivenTraceIDsBase (const QStringList &iList, const Qt::CheckState &iCheck)
 Change elements visibility property given a list of TraceIDs and the new status. More...
 
void UpdateElementVisibilityWithTraceID (const unsigned int &oTraceId, const bool &iState)
 

Protected Attributes

vtkProperty * m_HighlightedProperty
 
float m_IntersectionLineWidth
 

Detailed Description

template<class TContainer>
class TraceContainerBase< TContainer >

Generic interface for trace container. More specific container should inherit from this class and get specialized depending on the kind of trace it contains.

Template Parameters
TContainerboost::multi_index_container of a given TraceStructure

Definition at line 144 of file TraceContainerBase.h.

Member Typedef Documentation

template<class TContainer>
typedef MultiIndexContainerType::template index< CollectionID >::type::iterator TraceContainerBase< TContainer >::MultiIndexContainerCollectionIDIterator

Definition at line 154 of file TraceContainerBase.h.

template<class TContainer>
typedef MultiIndexContainerType::value_type TraceContainerBase< TContainer >::MultiIndexContainerElementType

Definition at line 148 of file TraceContainerBase.h.

template<class TContainer>
typedef MultiIndexContainerType::template index< Highlighted >::type::iterator TraceContainerBase< TContainer >::MultiIndexContainerHighlightedIterator

Definition at line 157 of file TraceContainerBase.h.

template<class TContainer>
typedef MultiIndexContainerType::template index< TraceID >::type::iterator TraceContainerBase< TContainer >::MultiIndexContainerTraceIDIterator

Definition at line 151 of file TraceContainerBase.h.

template<class TContainer>
typedef TContainer TraceContainerBase< TContainer >::MultiIndexContainerType

Definition at line 147 of file TraceContainerBase.h.

template<class TContainer>
typedef MultiIndexContainerType::template index< Visible >::type::iterator TraceContainerBase< TContainer >::MultiIndexContainerVisibleIterator

Definition at line 160 of file TraceContainerBase.h.

Constructor & Destructor Documentation

template<class TContainer>
TraceContainerBase< TContainer >::TraceContainerBase ( QObject *  iParent,
QGoImageView3D iView 
)
explicit

Constructor.

Parameters
[in]iParentParent to provide ownership (Qt style)
[in]iViewVisualization for trace
template<class TContainer>
virtual TraceContainerBase< TContainer >::~TraceContainerBase ( )
virtual

Destructor.

Member Function Documentation

template<class TContainer>
virtual std::list< unsigned int > TraceContainerBase< TContainer >::DeleteAllHighlightedElements ( )
pure virtual

Delete all highlighted elements.

Returns
the list of TraceIDs of such elements

Implemented in ContourMeshContainer, TrackContainer, and LineageContainer.

template<class TContainer>
TraceContainerBase< TContainer >::DeleteElement ( const unsigned int &  iId)
pure virtual

Remove the element which TraceId = iId.

  • from the visualization
  • from the container
  • from memory (release memory)
Parameters
[in]iIdTraceID of the element to be deleted
Returns
true if the element was present in the container.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Implemented in ContourMeshContainer, TrackContainer, and LineageContainer.

template<class TContainer>
virtual bool TraceContainerBase< TContainer >::DeleteElement ( MultiIndexContainerTraceIDIterator  iIter)
pure virtual
template<class TContainer>
std::vector<vtkActor*> TraceContainerBase< TContainer >::GetActorGivenTraceID ( unsigned int  iTraceID)
template<class TContainer>
unsigned int TraceContainerBase< TContainer >::GetCollectionIDOfGivenTraceID ( unsigned int  iTraceID)

Get the CollectionID given a TraceID.

template<class TContainer>
double* TraceContainerBase< TContainer >::GetCurrentElementColor ( )

Get the color of the current element track.

Returns
Pointer to the current element color
template<class TContainer>
vtkPolyData* TraceContainerBase< TContainer >::GetCurrentElementNodes ( )

Get the polydata representing the current element track.

Returns
Pointer to the current element track
template<class TContainer>
std::list< vtkPolyData* > TraceContainerBase< TContainer >::GetHighlightedElements ( )

Get all highlighted elements by pair<ID, Polydata>.

template<class TContainer>
std::list< unsigned int > TraceContainerBase< TContainer >::GetHighlightedElementsCollectionID ( )
template<class TContainer>
std::list< unsigned int > TraceContainerBase< TContainer >::GetHighlightedElementsTraceID ( )

Get the list of highlighted elements TraceID.

template<class TContainer>
vtkProperty* TraceContainerBase< TContainer >::GetHighlightedProperty ( )

Get property for highlighted traces.

template<class TContainer>
void TraceContainerBase< TContainer >::Insert ( const MultiIndexContainerElementType iE)

Insert one element in the container.

Parameters
[in]iEelement to be insert in the container
template<class TContainer>
void TraceContainerBase< TContainer >::InsertCurrentElement ( )

Insert Current Element in the container.

template<class TContainer>
template<class TIterator >
void TraceContainerBase< TContainer >::Print ( TIterator  iBegin,
TIterator  iEnd 
)
inline

Print the container content in the application output.

Template Parameters
TIteratorIterator on one index of boost::multi_index_container or on the container itself.

Definition at line 187 of file TraceContainerBase.h.

template<class TContainer>
template<class TIndex >
void TraceContainerBase< TContainer >::Print ( )
inline

Print the container content in the application output according to the template parameter.

Template Parameters
TIndex

Definition at line 206 of file TraceContainerBase.h.

template<class TContainer>
void TraceContainerBase< TContainer >::Print ( )

Print the container content in the application output.

template<class TContainer>
bool TraceContainerBase< TContainer >::RemoveElementFromVisualizationWithGivenTraceID ( const unsigned int &  iId)

Remove element from visualization.

Parameters
[in]iIdTraceID of the element to be removed
Returns
true if the element was present in the container.
template<class TContainer>
void TraceContainerBase< TContainer >::RenderAllElementsWithOriginalColors ( )
protected

Render with original colors.

template<class TContainer>
void TraceContainerBase< TContainer >::ResetCurrentElement ( )

Reset Current Element to a default state.

template<class TContainer>
void TraceContainerBase< TContainer >::SetColorCode ( const std::string &  iColumnName,
const std::map< unsigned int, std::string > &  iValues 
)

Color code contour / mesh according to values provided.

Parameters
[in]iColumnNameName of data provided
[in]iValuesis a map where the key is the TraceID and the Value is a string that can be either converted to a double, or not
Note
if iColumnName and/or iValues are empty traces will be then rendered with their original colors.
template<class TContainer>
template<typename TValue >
void TraceContainerBase< TContainer >::SetColorCode ( const std::string &  iColumnName,
const std::map< unsigned int, TValue > &  iValues 
)
inline

Color code contour / mesh according to values provided.

Template Parameters
TValuenumerical type that can be converted into double
Parameters
[in]iColumnNameName of data provided
[in]iValuesis a map where the key is the TraceID and the Value is the actual data used to color.
Note
if iColumnName and/or iValues are empty traces will be then rendered with their original colors.

Definition at line 508 of file TraceContainerBase.h.

template<class TContainer>
void TraceContainerBase< TContainer >::SetHighlightedProperty ( vtkProperty *  iProperty)

Set property whenever the trace is highlighted.

Parameters
[in]iProperty
template<class TContainer>
void TraceContainerBase< TContainer >::SetIntersectionLineWidth ( const float &  iWidth)
template<class TContainer>
void TraceContainerBase< TContainer >::SetLookupTableForColorCoding ( vtkLookupTable *  iLut)

Apply the given lookup table to all traces in the container.

Parameters
[in]iLutlookup table
template<class TContainer>
void TraceContainerBase< TContainer >::SetRandomColor ( const std::string &  iColumnName,
const std::map< unsigned int, unsigned int > &  iIds 
)
template<class TContainer>
void TraceContainerBase< TContainer >::SetRandomColor ( const std::string &  iColumnName,
const std::map< unsigned int, std::string > &  iValues 
)
template<class TContainer>
void TraceContainerBase< TContainer >::SetScalarRangeForAllElements ( const double &  iMin,
const double &  iMax 
)
protected

Set the scalar range.

template<class TContainer>
std::list< unsigned int > TraceContainerBase< TContainer >::UpdateAllHighlightedElementsWithGivenColor ( QColor  iColor)

Update all highlighted elements in the container with a given color.

Note
Elements remain highlighted as long as it is checked in the Table Widget.
Parameters
[in]iColor
Returns
list of highlighted elements
template<class TContainer>
void TraceContainerBase< TContainer >::UpdateCurrentElementCollection ( unsigned int  iCollectionID)
template<class TContainer>
void TraceContainerBase< TContainer >::UpdateCurrentElementFromDB ( unsigned int  iTraceID,
double  irgba[4],
bool  IsVisible = false 
)

Update Current Element from te database.

Parameters
[in]iTraceID
[in]irgba
[in]IsVisible
template<class TContainer>
bool TraceContainerBase< TContainer >::UpdateCurrentElementFromExistingOne ( unsigned int  iTraceID,
bool  iErase = true 
)

put the information of the existing element into m_CurrentElement and remove the existing element from the container,the visu and the memory

Parameters
[in]iTraceIDID of the existing element
Returns
true if the element was found in the container, false if not
template<class TContainer>
template<class TIndex >
bool TraceContainerBase< TContainer >::UpdateCurrentElementFromExistingOne ( typename MultiIndexContainerType::template index< TIndex >::type::iterator  iIt)
inline

Definition at line 400 of file TraceContainerBase.h.

template<class TContainer>
void TraceContainerBase< TContainer >::UpdateCurrentElementFromVisuBase ( std::vector< vtkActor * > &  iActors,
vtkPolyData *  iNodes,
const bool &  iHighlighted,
const bool &  iVisible 
)
protected
template<class TContainer>
bool TraceContainerBase< TContainer >::UpdateElementHighlightingWithGivenTraceID ( const unsigned int &  iId)

Update element highlighting given it TraceId.

Parameters
[in]iIdTraceID of the element to be modified
Returns
true if the element was present in the container.
template<class TContainer>
virtual void TraceContainerBase< TContainer >::UpdateElementHighlightingWithGivenTraceIDsBase ( const QStringList &  iList,
const Qt::CheckState &  iCheck 
)
protectedvirtual

Change elements highlighting property given a list of TraceIDs and the new status.

Parameters
[in]iListlist of TraceIDs
[in]iCheck
template<class TContainer>
void TraceContainerBase< TContainer >::UpdateElementHighlightingWithTraceID ( const unsigned int &  oTraceId,
Qt::CheckState &  oState 
)
inlineprotected

Update highlighting property of one element given one actor.

Parameters
[in]iActorActor of the element to be modified
[out]oTraceIdTraceId of the element
[out]oStateQt::Checked if the element is not highlighted else Qt::UnChecked
Returns
true if the element exists
false else

Definition at line 633 of file TraceContainerBase.h.

template<class TContainer>
bool TraceContainerBase< TContainer >::UpdateElementVisibilityWithGivenTraceID ( const unsigned int &  iId)

Update element visibility given it TraceId.

Parameters
[in]iIdTraceID of the element to be modified
Returns
true if the element was present in the container.
Todo:
Nicolas-should return visibility instead??
template<class TContainer>
virtual void TraceContainerBase< TContainer >::UpdateElementVisibilityWithGivenTraceIDsBase ( const QStringList &  iList,
const Qt::CheckState &  iCheck 
)
protectedvirtual

Change elements visibility property given a list of TraceIDs and the new status.

Parameters
[in]iListlist of TraceIDs
[in]iCheck
template<class TContainer>
void TraceContainerBase< TContainer >::UpdateElementVisibilityWithTraceID ( const unsigned int &  oTraceId,
const bool &  iState 
)
inlineprotected

Definition at line 684 of file TraceContainerBase.h.

template<class TContainer>
template<class TIndex >
void TraceContainerBase< TContainer >::UpdateVisualizationForGivenElement ( typename MultiIndexContainerType::template index< TIndex >::type::iterator &  iIt,
std::vector< vtkActor * >  iActors,
const bool &  iHighlighted,
const bool &  iVisible 
)
inline

Update Actors, Highlighted, Visibility (properties) of given a element.

Template Parameters
TIndexIndex Type (referring to multi index container's indices)
Parameters
[in]iItelement to update
[in]iActorsits actors
[in]iHighlighted
[in]iVisibleif false remove the element from the scene, else add it

Definition at line 313 of file TraceContainerBase.h.

template<class TContainer>
template<class TList >
void TraceContainerBase< TContainer >::UpdateVisualizationForGivenIDs ( TList  iList)
inline

Update Visualization of the given TraceIDs.

Template Parameters
TContainerContainer of TraceIDs
Parameters
[in]iListinput container of TraceIDs

Definition at line 239 of file TraceContainerBase.h.

Member Data Documentation

template<class TContainer>
MultiIndexContainerType TraceContainerBase< TContainer >::m_Container

Trace Contaienr.

Definition at line 172 of file TraceContainerBase.h.

template<class TContainer>
MultiIndexContainerElementType TraceContainerBase< TContainer >::m_CurrentElement

Current Element of the trace type.

Definition at line 178 of file TraceContainerBase.h.

template<class TContainer>
vtkProperty* TraceContainerBase< TContainer >::m_HighlightedProperty
protected

Definition at line 596 of file TraceContainerBase.h.

template<class TContainer>
QGoImageView3D* TraceContainerBase< TContainer >::m_ImageView

Link to the visualization.

Definition at line 175 of file TraceContainerBase.h.

template<class TContainer>
float TraceContainerBase< TContainer >::m_IntersectionLineWidth
protected

Definition at line 597 of file TraceContainerBase.h.


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