Back to index

See source file

PHCylinder.h

 
#ifndef PHCYLINDER_H 
#define PHCYLINDER_H 
 
//--------------------------------------------------------------------------------------- 
// Class:  PHCylinder header 
// 
// Written by:  Jane M. Burward-Hoy and Federica Messer 
// 
// Purpose:  A Cylinder  
//  
// Last update:  10/28/99 
// 
// Pioneered by  J. Mitchell 
// 
// Details: the cylinder is defined by its center, its radius and a  not 
//           normalized direction vector, the length of which is the cylinder half-length 
//---------------------------------------------------------------------------- 
 
#include <iostream.h> 
#include "PHPoint.h" 
#include "PHVector.h" 
 
class PHCylinder 
{ 
public: 
  
  PHCylinder(); 
  PHCylinder(double radius,const PHPoint, const PHVector);   
  PHCylinder(const PHCylinder &);  
  ~PHCylinder(); 
   
  PHCylinder& operator= (const PHCylinder &); 
   
  void setCenter(PHPoint& val) { center = val;} 
  void setAxis(PHVector& val)  { axis   = val;} 
  void setRadius(double val)   { radius = val;} 
   
  double getRadius()  const { return radius;} 
  PHPoint getCenter()const { return center;} 
  PHVector getAxis() const { return axis;} 
 
  void print() const;  
  friend ostream& operator<<(ostream& ,const PHCylinder&); 
 
  double length() const { return 2*axis.length(); } 
 
private: 
  double radius; 
  PHVector axis; 
  PHPoint center; 
   
}; 
 
#endif /* PHCYLINDER_H */ 
 
 

Back to index

See source file