35 #ifndef __ContourMeshContainer_h
36 #define __ContourMeshContainer_h
45 #include "boost/multi_index_container.hpp"
46 #include "boost/multi_index/member.hpp"
47 #include "boost/multi_index/hashed_index.hpp"
48 #include "boost/multi_index/ordered_index.hpp"
49 #include "boost/numeric/conversion/cast.hpp"
50 #include "boost/lexical_cast.hpp"
52 #include "vtkProperty.h"
53 #include "vtkPolyData.h"
55 #include "vtkMapper.h"
59 #include "QGoGUILibConfigure.h"
83 typedef multi_index::multi_index_container<
85 boost::multi_index::indexed_by<
86 boost::multi_index::ordered_non_unique<
87 boost::multi_index::tag< TCoord >,
90 boost::multi_index::ordered_unique<
91 boost::multi_index::tag< TraceID >,
94 boost::multi_index::ordered_non_unique<
95 boost::multi_index::tag< CollectionID >,
96 BOOST_MULTI_INDEX_MEMBER(
TraceStructure,
unsigned int, CollectionID)
98 boost::multi_index::ordered_non_unique<
99 boost::multi_index::tag< Highlighted >,
102 boost::multi_index::ordered_non_unique<
103 boost::multi_index::tag< Visible >,
126 typedef MultiIndexContainerType::index< TCoord >::type::iterator
139 void SetTimePoint(
const unsigned int & iT);
144 void ShowActorsWithGivenTimePoint(
const unsigned int & iT);
153 ChangeActorsVisibility(
156 const bool & iVisibility);
167 void UpdateCurrentElementFromVisu(std::vector< vtkActor * >& iActors,
169 const unsigned int & iT,
170 const bool & iHighlighted,
171 const bool & iVisible);
177 void RemoveActorsWithGivenTimePoint(
const unsigned int & iT);
182 void AddActorsWithGivenTimePoint(
const unsigned int & iT);
199 iContour->GetBounds(bounds);
201 return ComputeDirectionFromBounds< double >(bounds);
211 template<
typename T >
218 for (
int i = 0; i < 3; i++ )
220 if ( iBounds[2 * i] == iBounds[2 * i + 1] )
229 template<
typename T >
236 if ( iBounds.size() == 6 )
238 for (
int i = 0; i < 3; ++i )
240 if ( iBounds[2 * i] == iBounds[2 * i + 1] )
258 Qt::CheckState state;
259 Superclass::UpdateElementHighlightingWithTraceID(TraceId, state );
260 emit TracePicked(TraceId, state);
272 Superclass::UpdateElementVisibilityWithTraceID(iTraceID, iState);
275 emit TraceVisibilityChanged(iTraceID, Qt::Checked );
278 emit TraceVisibilityChanged(iTraceID, Qt::Unchecked );
298 bool DeleteElement(MultiIndexContainerTraceIDIterator iIter);
313 void Clear(
const std::list<unsigned int>& iTraceIDs);
319 std::list< unsigned int > GetElementsTraceIDForGivenTimePoint(
unsigned int iTimePoint);
327 std::map< unsigned int, double* > GetMeshesPoints( std::list< unsigned int> iMeshID );
336 template<
class TIndex >
338 typename MultiIndexContainerType::template index< TIndex >::type::iterator iBegin,
339 typename MultiIndexContainerType::template index< TIndex >::type::iterator iEnd,
340 const bool & iVisibility)
342 typename MultiIndexContainerType::template index< TIndex >::type::iterator
345 typedef void (
QGoImageView3D::*ImageViewMember )(
const int &, vtkActor *);
359 if ( it->Visible != iVisibility )
361 it->SetActorVisibility( iVisibility );
367 ( m_ImageView->*f )(0, it->ActorXY);
371 ( m_ImageView->*f )(1, it->ActorXZ);
375 ( m_ImageView->*f )(2, it->ActorYZ);
379 ( m_ImageView->*f )(3, it->ActorXYZ);
383 bool visible = iVisibility;
384 m_Container.get< TIndex >().
387 Qt::CheckState State;
395 State = Qt::Unchecked;
398 emit TraceVisibilityChanged( it->TraceID, State );
404 void AssignToGivenCollection(
unsigned int iCollection,
405 std::list< unsigned int > iToBeAssigned);
407 std::list< unsigned int > GetHighlightedElementsTCoord();
416 void UpdateElementHighlightingWithGivenTraceIDs(
const QStringList& iList,
417 const Qt::CheckState& iCheck );
424 void UpdateElementVisibilityWithGivenTraceIDs(
const QStringList& iList,
425 const Qt::CheckState& iCheck );
429 void TracePicked(
unsigned int, Qt::CheckState);
432 void TraceVisibilityChanged(
unsigned int, Qt::CheckState);
441 #endif // CONTOURMESHCONTAINER_H
virtual std::list< unsigned int > DeleteAllHighlightedElements()=0
Delete all highlighted elements.
void UpdateElementVisibility(unsigned int iTraceID, bool iState)
Update highlighting property of one element given one actor.
void ChangeActorsVisibility(typename MultiIndexContainerType::template index< TIndex >::type::iterator iBegin, typename MultiIndexContainerType::template index< TIndex >::type::iterator iEnd, const bool &iVisibility)
Change element visibility in the scene.
unsigned int collectionID
boost::MultiIndexContourMeshContainer MultiIndexContainerType
void ModifyCollectionID(unsigned int iCollectionID)
void UpdateElementHighlighting(unsigned int TraceId)
Update highlighting property of one element given one actor.
class for the visualization of 3D Image represented by one vtkImageData*.
virtual void RemoveActor(const int &iId, vtkActor *iActor)
static int ComputeDirectionFromContour(vtkPolyData *iContour)
Returns the direction of a given contour vtkPolyData. This static method is supposed to be used when ...
change_collectionID(const unsigned int &iCollectionID)
Generic interface for trace container. More specific container should inherit from this class and get...
virtual bool DeleteElement(const unsigned int &iId)=0
Remove the element which TraceId = iId.
Wraps a boost::multi_index_container of ContourMeshStructure. This class intends to synchronize Conto...
Superclass::MultiIndexContainerType MultiIndexContainerType
virtual void AddActor(const int &iId, vtkActor *iActor)
static int ComputeDirectionFromBounds(const std::vector< T > &iBounds)
TraceContainerBase< boost::MultiIndexContourMeshContainer > Superclass
Structure which represent a contour or a mesh, and used for interaction between Visualization and Tab...
multi_index::multi_index_container< ContourMeshStructure, boost::multi_index::indexed_by< boost::multi_index::ordered_non_unique< boost::multi_index::tag< TCoord >, >, boost::multi_index::ordered_unique< boost::multi_index::tag< TraceID >, >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< CollectionID >, >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< Highlighted >, >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< Visible >, > >> MultiIndexContourMeshContainer
void operator()(ContourMeshStructure &iStructure)
MultiIndexContainerType::index< TCoord >::type::iterator MultiIndexContainerTCoordIterator
static int ComputeDirectionFromBounds(T *iBounds)
Returns the direction of a given element given its bounding box. This static method is supposed to be...
Structure which represent a trace (contour, mesh, track, lineage), and used for interaction between V...