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

CalDetGeo.cpp

Go to the documentation of this file.
00001 #include "CalRecon/CalDetGeo.h"
00002 
00003 //#########################################################
00004 void CalGeo::setGeo(Point p, Point s) 
00005 //#########################################################
00006 {
00007         setPosition(p);
00008         setSize(s);
00009 }
00010 //#########################################################
00011 void CalMatGeo::setMaterial(std::string name, double d) 
00012 //#########################################################
00013 {
00014         m_material = name;
00015         m_X0 = d;
00016 }
00017 //#########################################################
00018 double CalMatGeo::radLen() 
00019 //#########################################################
00020 {
00021         return 2.*size().z()/X0();
00022 }
00023 /*
00024 //##########################################
00025 void detGeo::writeOut() const
00026 //##########################################
00027 {
00028         if (messageManager::instance()->acceptLevel("DEBUG_MEDIUM")) return;
00029         std::ostream& out = messageManager::instance()->out();
00030         out << name() <<" " << material() <<" "<<  m_layer << " " << m_axis << " " << m_id << " " ;
00031         out << position().x() << " " << position().y() <<" "<< position().z() << " ";
00032         out << 2.*size().x() << " " << 2.*size().y() <<" "<< 2.*size().z();
00033         out << "\n";
00034 
00035 }
00036 */
00037 //##########################################
00038 void CalDetGeo::draw(gui::DisplayRep& v) const
00039 //##########################################
00040 {
00041         v.setColor("red");
00042 
00043         double sx = size().x();
00044         double sy = size().y();
00045         double sz = size().z();
00046         double x0 = position().x();
00047         double y0 = position().y();
00048         double z0 = position().z();
00049         int i =0;
00050         for (i = 0; i<2; i++) {
00051                 double fz = ((i==0)?-1:1);
00052                 v.moveTo(Point(x0-sx,y0-sy,z0+fz*sz));
00053                 v.lineTo(Point(x0+sx,y0-sy,z0+fz*sz));
00054                 v.lineTo(Point(x0+sx,y0+sy,z0+fz*sz));
00055                 v.lineTo(Point(x0-sx,y0+sy,z0+fz*sz));
00056                 v.lineTo(Point(x0-sx,y0-sy,z0+fz*sz));
00057         }
00058         for (i = 0; i<4; i++) {
00059                 double fx = ( i < 2?-1:1);
00060                 double fy = ( (i == 0 || i == 2)?-1:1);
00061                 v.moveTo(Point(x0+fx*sx,y0+fy*sy,z0-sz));
00062                 v.lineTo(Point(x0+fx*sx,y0+fy*sy,z0+sz));
00063         }
00064 }

Generated on Thu Nov 29 16:38:48 2001 by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001