Segment

This class represents a 3D line segment by two 3D points.

[ GAMB | Source | Keywords | Summary | Ancestors | All Members | Descendants ]

Quick Index

AUTHORS
CHANGES LOG

Class Summary

class Segment

{
public:
// Constructors.
Segment() ;
Segment(const Vector3& p1, const Vector3& p2) ;
// Inspection.
bool empty() const ;
const Vector3& getFirstPoint() const ;
const Vector3& getSecondPoint() const ;
const float length() const ;
Vector3 midPoint() const;
float midPointDistance(const Segment* segment) const ;
Line getLine() const;
Vector3 getDirection() const ;
void transform(const RigidTrans3& transformation) ;
bool isParallel(const Segment& segment) const;
bool areCollinear(const Segment& segment) const;
friend ostream& operator<<(ostream& s, const Segment& segment);
void outputPDB(ostream& output, unsigned int firstIndex, unsigned int secondIndex) const;
protected:
}; // Segment

Back to the top of Segment


AUTHORS

Oranit Dror (oranit@tau.ac.il)

Copyright: SAMBA group, Tel-Aviv Univ. Israel, 2002.

Back to the top of Segment


CHANGES LOG

Back to the top of Segment


Segment() ;

Constructs an empty segment

  Segment()   
;

Function is currently defined inline.


Back to the top of Segment


Segment(const Vector3& p1, const Vector3& p2) ;

Constructs the 3D line segment between the two given 3D points

  Segment(const Vector3& p1, const Vector3& p2) ;

Function is currently defined inline.


Back to the top of Segment


bool empty() const ;

  bool empty() const                                                                
;

Function is currently defined inline.


Back to the top of Segment


const Vector3& getFirstPoint() const ;

Returns the first endpoint of the segment

  inline const Vector3& getFirstPoint() const                             
;

Function is currently defined inline.


Back to the top of Segment


const Vector3& getSecondPoint() const ;

Returns the second endpoint of the segment

  inline const Vector3& getSecondPoint() const                              
;

Function is currently defined inline.


Back to the top of Segment


const float length() const ;

Returns the length of the segment

  inline const float length() const                                                    
;

Function is currently defined inline.


Back to the top of Segment


Vector3 midPoint() const;

Returns the 3D midpoint of the segment

  Vector3 midPoint() const;

Back to the top of Segment


float midPointDistance(const Segment* segment) const ;

Returns the distance between the midpoints of the two segments

  float midPointDistance(const Segment* segment) const                                                       
;

Function is currently defined inline.


Back to the top of Segment


Line getLine() const;

Returns the line on which the segment is located. The direction of the line is from the first point of the segment to the second one.

  Line getLine() const;

Back to the top of Segment


Vector3 getDirection() const ;

Returns the direction of the segment (normilized).
The segment's direction is defined from the first point of the segment to the second one.

  Vector3 getDirection() const                                                                                                 
;

Function is currently defined inline.


Back to the top of Segment


void transform(const RigidTrans3& transformation) ;

Apply the given transformation to the two points of the segment

  void transform(const RigidTrans3& transformation)                                                                                                    
;

Function is currently defined inline.


Back to the top of Segment


bool isParallel(const Segment& segment) const;

Returns true if the two segments are parallel

  inline bool isParallel(const  Segment& segment) const; 

Function is currently defined inline.


Back to the top of Segment


bool areCollinear(const Segment& segment) const;

Returns true if the two segments are located on the same line

  bool areCollinear(const  Segment& segment) const;

Back to the top of Segment


friend ostream& operator<<(ostream& s, const Segment& segment);

Outputs the coordinates of the two segment's endpoints

  friend ostream& operator<<(ostream& s, const Segment& segment); 

Back to the top of Segment


void outputPDB(ostream& output, unsigned int firstIndex, unsigned int secondIndex) const;

Adds to the given output stream three PDB records that specify the segment. Specifically, the two segment's points are described in ATOM records and the connectivity between them is specified in a CONECT record.

  void outputPDB(ostream& output, unsigned int firstIndex, unsigned int secondIndex) const;

Back to the top of Segment


All Members

public:
// Inspection.
bool empty() const ;
const Vector3& getFirstPoint() const ;
const Vector3& getSecondPoint() const ;
const float length() const ;
Vector3 midPoint() const;
float midPointDistance(const Segment* segment) const ;
Line getLine() const;
Vector3 getDirection() const ;
void transform(const RigidTrans3& transformation) ;
bool isParallel(const Segment& segment) const;
bool areCollinear(const Segment& segment) const;
friend ostream& operator<<(ostream& s, const Segment& segment);
void outputPDB(ostream& output, unsigned int firstIndex, unsigned int secondIndex) const;
protected:

Back to the top of Segment


Ancestors

Class does not inherit from any other class.

Back to the top of Segment


Descendants

Class is not inherited by any others.

Back to the top of Segment


Generated from source by the Cocoon utilities on Sun Nov 15 13:35:26 2009 .

Report problems to jkotula@unimax.com