PlusLib  2.9.0
Software library for tracked ultrasound image acquisition, calibration, and processing.
Planes.cxx
Go to the documentation of this file.
1 /*=Plus=header=begin======================================================
2 Program: Plus
3 Copyright (c) Laboratory for Percutaneous Surgery. All rights reserved.
4 See License.txt for details.
5 =========================================================Plus=header=end*/
6 
7 // Local includes
8 #include "PlusConfigure.h"
9 #include "Planes.h"
10 
11 //-----------------------------------------------------------------------------
13 {
14 }
15 
16 //-----------------------------------------------------------------------------
18 {
19 }
20 
21 //-----------------------------------------------------------------------------
23 {
24  this->m_PlaneList.clear();
25 }
26 
27 //-----------------------------------------------------------------------------
28 void Planes::InsertPlane(const Plane& newPlane)
29 {
30  Plane copy = newPlane;
31  this->m_PlaneList.push_back(copy);
32 }
33 
34 //-----------------------------------------------------------------------------
35 void Planes::RemovePlane(int index)
36 {
37  std::vector<Plane>::iterator it = this->m_PlaneList.begin();
38  it += index;
39  this->m_PlaneList.erase(it);
40 }
41 
42 //-----------------------------------------------------------------------------
43 const Plane& Planes::GetPlane(int index)
44 {
45  return this->m_PlaneList.at(index);
46 }
47 
48 //-----------------------------------------------------------------------------
50 {
51  return this->m_PlaneList.size();
52 }
53 
54 //-----------------------------------------------------------------------------
55 std::vector<Plane>::const_iterator Planes::PlanesBegin() const
56 {
57  return this->m_PlaneList.begin();
58 }
59 
60 //-----------------------------------------------------------------------------
61 std::vector<Plane>::const_iterator Planes::PlanesEnd() const
62 {
63  return this->m_PlaneList.end();
64 }
65 
66 //-----------------------------------------------------------------------------
68 {
69  if (this != &rhs)
70  {
71  this->m_PlaneList.clear();
72  this->m_PlaneList.resize(rhs.m_PlaneList.size());
73  std::copy(rhs.m_PlaneList.begin(), rhs.m_PlaneList.end(), this->m_PlaneList.begin());
74  }
75  return *this;
76 }
std::vector< Plane >::const_iterator PlanesBegin() const
Definition: Planes.cxx:55
const Plane & GetPlane(int index)
Definition: Planes.cxx:43
void RemovePlane(int index)
Definition: Planes.cxx:35
Planes()
Definition: Planes.cxx:12
void Reset()
Definition: Planes.cxx:22
Definition: Plane.h:18
std::vector< Plane > m_PlaneList
Definition: Planes.h:31
~Planes()
Definition: Planes.cxx:17
Definition: Planes.h:13
int GetNumberOfPlanes()
Definition: Planes.cxx:49
void InsertPlane(const Plane &newPlane)
Definition: Planes.cxx:28
std::vector< Plane >::const_iterator PlanesEnd() const
Definition: Planes.cxx:61
Planes & operator=(const Planes &rhs)
Definition: Planes.cxx:67