Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

ArcRep.cxx

Go to the documentation of this file.
00001 //     $Id: ArcRep.cxx,v 1.2 2000/05/05 04:38:16 burnett Exp $
00002 //  Author: T. Burnett
00003 // Project: Arve graphics
00004 
00005 
00006 #include "geomrep/ArcRep.h"
00007 #include <algorithm>
00008 
00009 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00010 ArcRep::ArcRep( const Point& center, double radius,
00011                const Vector& xhat, const Vector& yhat, double phi0)
00012 //-------------------------------------------------------------------
00013         :m_center(center), m_radius(radius),
00014         m_xhat(xhat), m_yhat(yhat), m_phi0(phi0)
00015 {}
00016 
00017 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00018 void ArcRep::update()
00019 //-------------------
00020 {
00021     static const int ns=48;
00022     static const double dphi= 2.0*M_PI/(ns-1);
00023     double  phi=-m_phi0;
00024     move_to(m_center+m_radius*cos(phi)*m_xhat + m_radius*sin(phi)*m_yhat);
00025     for(int i=0; i<ns; i++)   {
00026         phi = std::min(m_phi0, phi+dphi) ;
00027         line_to( m_center + m_radius*cos(phi)*m_xhat + m_radius*sin(phi)*m_yhat );
00028         if( phi>=m_phi0 ) break;
00029     }
00030     flush();
00031 }

Generated at Mon Nov 26 18:18:44 2001 by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000