TridSketchList Class Reference

#include <TridSketchList.h>

Inheritance diagram for TridSketchList:

TridGLFrame TridAnaglyphGLFrame TridFlatGLFrame TridStereoGLFrame TridHistoGLFrame List of all members.

Public Member Functions

 TridSketchList (bool delete_on_destruct=false)
virtual ~TridSketchList (void)
void AddSketch (TridSketch *)
void AddSketchList (TridSketchList &otherlist)
void DeleteSketches (void)
void ClearSketches (void)
TridSketchFindSketch (unsigned int id)
void DeleteSketch (unsigned int id)
void ClearSketch (unsigned int id)
void SetDeleteOnDestruct (bool delete_on_destruct=true)
bool GetDeleteOnDestruct (void) const
int Count (void)
int GetNumSketches (void)
TridSketchListItr GetIterator ()

Private Attributes

bool fDeleteOnDestruct
std::map< unsigned int, TridSketch * > fMap

Friends

class TridSketchListItr

Detailed Description

Definition at line 27 of file TridSketchList.h.


Constructor & Destructor Documentation

TridSketchList::TridSketchList ( bool  delete_on_destruct = false  ) 

Definition at line 7 of file TridSketchList.cxx.

00008 {
00009   fDeleteOnDestruct = delete_on_destruct;
00010 }

TridSketchList::~TridSketchList ( void   )  [virtual]

Definition at line 12 of file TridSketchList.cxx.

References ClearSketches(), DeleteSketches(), and fDeleteOnDestruct.

00013 {
00014   if(fDeleteOnDestruct) DeleteSketches();
00015   ClearSketches();
00016 }


Member Function Documentation

void TridSketchList::AddSketch ( TridSketch  ) 

Definition at line 19 of file TridSketchList.cxx.

References fMap, and TridSketch::GetId().

Referenced by AddSketchList().

00020 {
00021   fMap[sketch->GetId()] = sketch;
00022 }

void TridSketchList::AddSketchList ( TridSketchList otherlist  ) 

Definition at line 24 of file TridSketchList.cxx.

References AddSketch(), and fMap.

Referenced by TridPage::SetupFrame().

00025 {
00026   map<unsigned int,TridSketch*>::iterator it;
00027   for(it = otherlist.fMap.begin(); it!= otherlist.fMap.end(); it++)  {
00028     AddSketch(it->second);
00029   }  
00030 }

void TridSketchList::ClearSketch ( unsigned int  id  ) 

Definition at line 66 of file TridSketchList.cxx.

References fMap.

00067 {
00068   // Removes a single sketch.
00069   map<unsigned int,TridSketch*>::iterator p = fMap.find(id);
00070   if(p!=fMap.end()) {
00071     fMap.erase(p); 
00072   }
00073 }

void TridSketchList::ClearSketches ( void   ) 

Definition at line 41 of file TridSketchList.cxx.

References fMap.

Referenced by ~TridSketchList().

00042 {
00043   fMap.clear();
00044 }

int TridSketchList::Count ( void   )  [inline]

Definition at line 46 of file TridSketchList.h.

References fMap.

00046 { return fMap.size(); };

void TridSketchList::DeleteSketch ( unsigned int  id  ) 

Definition at line 55 of file TridSketchList.cxx.

References fMap.

00056 { 
00057   // Deletes a single sketch.
00058   map<unsigned int,TridSketch*>::iterator p = fMap.find(id);
00059   if(p!=fMap.end()) {
00060     if(p->second) delete p->second;
00061     fMap.erase(p); 
00062   }
00063 }

void TridSketchList::DeleteSketches ( void   ) 

Definition at line 32 of file TridSketchList.cxx.

References fMap.

Referenced by TridGLFrame::TridGLFrame(), and ~TridSketchList().

00033 {
00034   map<unsigned int,TridSketch*>::iterator it;
00035   for(it = fMap.begin(); it!= fMap.end(); it++)  {
00036     if(it->second) delete it->second;
00037     fMap.erase(it);
00038   }   
00039 }

TridSketch * TridSketchList::FindSketch ( unsigned int  id  ) 

Definition at line 47 of file TridSketchList.cxx.

References fMap.

00048 {
00049   map<unsigned int,TridSketch*>::iterator p = fMap.find(id);
00050   if( p == fMap.end()) return NULL; 
00051   return p->second;
00052 }

bool TridSketchList::GetDeleteOnDestruct ( void   )  const [inline]

Definition at line 44 of file TridSketchList.h.

References fDeleteOnDestruct.

00044 { return fDeleteOnDestruct; };

TridSketchListItr TridSketchList::GetIterator (  ) 

Definition at line 76 of file TridSketchList.cxx.

References TridSketchListItr.

Referenced by TridGLFrame::DrawObjects(), TridFlatGLFrame::DrawObjects(), and TridPage::SetupFrame().

00077 {
00078   return TridSketchListItr(*this);
00079 }

int TridSketchList::GetNumSketches ( void   )  [inline]

Definition at line 47 of file TridSketchList.h.

References fMap.

00047 { return fMap.size(); };

void TridSketchList::SetDeleteOnDestruct ( bool  delete_on_destruct = true  )  [inline]

Definition at line 43 of file TridSketchList.h.

References fDeleteOnDestruct.

00043 { fDeleteOnDestruct = delete_on_destruct; };


Friends And Related Function Documentation

friend class TridSketchListItr [friend]

Definition at line 55 of file TridSketchList.h.

Referenced by GetIterator().


Member Data Documentation

bool TridSketchList::fDeleteOnDestruct [private]

Definition at line 52 of file TridSketchList.h.

Referenced by GetDeleteOnDestruct(), SetDeleteOnDestruct(), and ~TridSketchList().

std::map<unsigned int,TridSketch*> TridSketchList::fMap [private]

Definition at line 53 of file TridSketchList.h.

Referenced by AddSketch(), AddSketchList(), ClearSketch(), ClearSketches(), Count(), DeleteSketch(), DeleteSketches(), FindSketch(), GetNumSketches(), and TridSketchListItr::TridSketchListItr().


The documentation for this class was generated from the following files:
Generated on Wed Dec 10 22:50:39 2014 for loon by  doxygen 1.4.7