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

SpheRep.cxx

Go to the documentation of this file.
00001 // $Header: /nfs/slac/g/glast/ground/cvs/geomrep/src/SpheRep.cxx,v 1.3 2001/01/23 01:40:12 burnett Exp $
00002 //  Author: T. Burnett
00003 //
00004 // Representation of a Sphe with ArveScene
00005 
00006 #include "geomrep/SpheRep.h"
00007 #include "geometry/Sphe.h"
00008 
00009 static void createCircle(gui::DisplayRep& view, const Point& p, double r, const Vector& xhat,
00010 const Vector& yhat)
00011 {
00012     static const int ns=100;
00013     static const double dphi= 2.0*M_PI/(ns-1);
00014     double  phi=0 ;
00015     view.move_to(p+r*xhat);
00016     for(int i=0; i<ns; i++)
00017     {
00018         phi +=  dphi;
00019         view.line_to(p+ r*cos(phi)* xhat + r*sin(phi)*yhat);
00020     }
00021     view.flush();
00022 }
00023 
00024 static const Vector xhat(1,0,0), yhat(0,1,0), zhat(0,0,1);
00025 
00026 void SpheRep::update()
00027 {
00028   double r[]={m_sphe.innerRadius(),m_sphe.outerRadius()};
00029   for( int i=0; i<2; i++)
00030   {
00031     if( r[i]==0 ) continue;
00032     createCircle(*this, m_sphe.center(), r[i], xhat, yhat );
00033     createCircle(*this, m_sphe.center(), r[i], yhat, zhat );
00034     createCircle(*this, m_sphe.center(), r[i], zhat, xhat );
00035   }
00036 }
00037 

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