Berkeley SfM
Public Types | Public Member Functions | Private Attributes | List of all members
bsfm::Point3D Class Reference

#include <point_3d.h>

Public Types

typedef std::shared_ptr< Point3DPtr
 
typedef std::shared_ptr< const Point3DConstPtr
 

Public Member Functions

 Point3D ()
 
 Point3D (double x, double y, double z)
 
 Point3D (const Point3D &in)
 
 Point3D (const Vector3d &in)
 
 ~Point3D ()
 
void SetX (double x)
 
void SetY (double x)
 
void SetZ (double x)
 
void Set (double x, double y, double z)
 
void Set (const Point3D &in)
 
void Set (const Vector3d &in)
 
double & operator() (int index)
 
const double & operator() (int index) const
 
double X () const
 
double Y () const
 
double Z () const
 
Vector3d & Get ()
 
const Vector3d & Get () const
 
void Print (const std::string &prefix=std::string()) const
 
void Normalize ()
 
Point3D Normalized () const
 
double Dot (const Point3D &other) const
 

Private Attributes

Vector3d data_
 

Detailed Description

Definition at line 56 of file point_3d.h.

Member Typedef Documentation

typedef std::shared_ptr<const Point3D> bsfm::Point3D::ConstPtr

Definition at line 59 of file point_3d.h.

typedef std::shared_ptr<Point3D> bsfm::Point3D::Ptr

Definition at line 58 of file point_3d.h.

Constructor & Destructor Documentation

bsfm::Point3D::Point3D ( )

Definition at line 45 of file point_3d.cpp.

45 : data_(Vector3d::Zero()) {}
Vector3d data_
Definition: point_3d.h:96
bsfm::Point3D::Point3D ( double  x,
double  y,
double  z 
)

Definition at line 48 of file point_3d.cpp.

49  : data_(Vector3d(x, y, z)) {}
Vector3d data_
Definition: point_3d.h:96
bsfm::Point3D::Point3D ( const Point3D in)

Definition at line 52 of file point_3d.cpp.

52 : data_(in.Get()) {}
Vector3d data_
Definition: point_3d.h:96
bsfm::Point3D::Point3D ( const Vector3d &  in)

Definition at line 55 of file point_3d.cpp.

55 : data_(in) {}
Vector3d data_
Definition: point_3d.h:96
bsfm::Point3D::~Point3D ( )

Definition at line 58 of file point_3d.cpp.

58 {}

Member Function Documentation

double bsfm::Point3D::Dot ( const Point3D other) const

Definition at line 126 of file point_3d.cpp.

126  {
127  return data_.dot(other.Get());
128 }
Vector3d data_
Definition: point_3d.h:96
Vector3d & bsfm::Point3D::Get ( )

Definition at line 98 of file point_3d.cpp.

98  {
99  return data_;
100 }
Vector3d data_
Definition: point_3d.h:96
const Vector3d & bsfm::Point3D::Get ( ) const

Definition at line 102 of file point_3d.cpp.

102  {
103  return data_;
104 }
Vector3d data_
Definition: point_3d.h:96
void bsfm::Point3D::Normalize ( )

Definition at line 116 of file point_3d.cpp.

116  {
117  data_.normalize();
118 }
Vector3d data_
Definition: point_3d.h:96
Point3D bsfm::Point3D::Normalized ( ) const

Definition at line 120 of file point_3d.cpp.

120  {
121  Point3D out(data_);
122  out.Normalize();
123  return out;
124 }
Vector3d data_
Definition: point_3d.h:96
double & bsfm::Point3D::operator() ( int  index)

Definition at line 82 of file point_3d.cpp.

82  {
83  // No bound-checking. Be careful!
84  return data_(index);
85 }
Vector3d data_
Definition: point_3d.h:96
const double & bsfm::Point3D::operator() ( int  index) const

Definition at line 87 of file point_3d.cpp.

87  {
88  // No bound-checking. Be careful!
89  return data_(index);
90 }
Vector3d data_
Definition: point_3d.h:96
void bsfm::Point3D::Print ( const std::string &  prefix = std::string()) const

Definition at line 107 of file point_3d.cpp.

107  {
108  if (!prefix.empty()) {
109  std::cout << prefix << std::endl;
110  }
111 
112  std::cout << data_ << std::endl;
113 }
Vector3d data_
Definition: point_3d.h:96
void bsfm::Point3D::Set ( double  x,
double  y,
double  z 
)

Definition at line 67 of file point_3d.cpp.

67  {
68  data_(0) = x;
69  data_(1) = y;
70  data_(2) = z;
71 }
Vector3d data_
Definition: point_3d.h:96
void bsfm::Point3D::Set ( const Point3D in)

Definition at line 73 of file point_3d.cpp.

73  {
74  data_ = in.Get();
75 }
Vector3d data_
Definition: point_3d.h:96
void bsfm::Point3D::Set ( const Vector3d &  in)

Definition at line 77 of file point_3d.cpp.

77  {
78  data_ = in;
79 }
Vector3d data_
Definition: point_3d.h:96
void bsfm::Point3D::SetX ( double  x)

Definition at line 61 of file point_3d.cpp.

61 { data_(0) = x; }
Vector3d data_
Definition: point_3d.h:96
void bsfm::Point3D::SetY ( double  x)

Definition at line 63 of file point_3d.cpp.

63 { data_(1) = y; }
Vector3d data_
Definition: point_3d.h:96
void bsfm::Point3D::SetZ ( double  x)

Definition at line 65 of file point_3d.cpp.

65 { data_(2) = z; }
Vector3d data_
Definition: point_3d.h:96
double bsfm::Point3D::X ( ) const

Definition at line 92 of file point_3d.cpp.

92 { return data_(0); }
Vector3d data_
Definition: point_3d.h:96
double bsfm::Point3D::Y ( ) const

Definition at line 94 of file point_3d.cpp.

94 { return data_(1); }
Vector3d data_
Definition: point_3d.h:96
double bsfm::Point3D::Z ( ) const

Definition at line 96 of file point_3d.cpp.

96 { return data_(2); }
Vector3d data_
Definition: point_3d.h:96

Member Data Documentation

Vector3d bsfm::Point3D::data_
private

Definition at line 96 of file point_3d.h.


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