Public Member Functions | Public Attributes | Friends

Carthesian::Segment3D Class Reference

Collaboration diagram for Carthesian::Segment3D:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Segment3D (const Carthesian::Point3D &p1=Carthesian::Point3D(), const Carthesian::Point3D &p2=Carthesian::Point3D())
 default constructor
 Segment3D (const Geodetic::Point3D &p1, const Geodetic::Point3D &p2)
 constructor
 Segment3D (const Segment3D &s)
 copy constructor
Segment3Doperator= (const Segment3D &s)
 affectation constructor
void set (const Carthesian::Point3D &p1, const Carthesian::Point3D &p2)
 geneal setter
Point3D get_p1 () const
 accessor to origin of the segment
Point3D get_p2 () const
 accessor to end of the segment
double length () const
 return the length of the segment
Carthesian::Vector3D to_vector () const
 construct the vector corresponding to the segment
Carthesian::Vector3D to_unit_vector () const
 construct the unit vector corresponding to the segment

Public Attributes

Point3D p1
Point3D p2

Friends

std::ostream & operator<< (std::ostream &os, const Segment3D &p)
 content printer

Detailed Description

3D segment


Constructor & Destructor Documentation

Carthesian::Segment3D::Segment3D ( const Carthesian::Point3D p1 = Carthesian::Point3D(),
const Carthesian::Point3D p2 = Carthesian::Point3D() 
)

default constructor

Parameters:
p1 point of origin
p2 end point constructor
p1 point of origin
p2 end point
Carthesian::Segment3D::Segment3D ( const Geodetic::Point3D p1,
const Geodetic::Point3D p2 
)

constructor

Parameters:
p1 point of origin
p2 end point constructor
p1 point of origin
p2 end point

References Geodetic::Point3D::to_carthesian().

Carthesian::Segment3D::Segment3D ( const Segment3D s  ) 

copy constructor

Parameters:
s object to copy

References p1, and p2.


Member Function Documentation

Point3D Carthesian::Segment3D::get_p1 (  )  const [inline]

accessor to origin of the segment

Returns:
point origin of the segment

References p1.

Point3D Carthesian::Segment3D::get_p2 (  )  const [inline]

accessor to end of the segment

Returns:
point end of the segment

References p2.

double Carthesian::Segment3D::length (  )  const [inline]

return the length of the segment

Returns:
the length of the segment

References p1, and p2.

Carthesian::Segment3D & Carthesian::Segment3D::operator= ( const Segment3D s  ) 

affectation constructor

Parameters:
s object to copy

References p1, and p2.

void Carthesian::Segment3D::set ( const Carthesian::Point3D p1,
const Carthesian::Point3D p2 
)

geneal setter

Parameters:
p1 point of origin
p2 end point
Carthesian::Vector3D Carthesian::Segment3D::to_unit_vector (  )  const

construct the unit vector corresponding to the segment

Returns:
the vector having the same orientation and a length of 1

References Carthesian::Vector3D::norm(), and to_vector().

Carthesian::Vector3D Carthesian::Segment3D::to_vector (  )  const

construct the vector corresponding to the segment

Returns:
the vector having the same orientation and the same length than the segment

References p1, and p2.

Referenced by to_unit_vector().


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const Segment3D p 
) [friend]

content printer

Parameters:
os output flux
pixel current oject alias
Returns:
the content description added to the output flux

Member Data Documentation

origin of the segment

Referenced by get_p1(), Carthesian::intersection(), length(), operator=(), Segment3D(), and to_vector().


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