Re: Geometry classes

From: Valery Fine (fine@bnl.gov)
Date: Sun Jun 21 1998 - 02:24:48 MEST


On 12 Jun 98 at 14:48, Rutger van der Eijk wrote:


> 3) TELTU seems to be implemented as a normal cylinder, not as a
> cylinder with elliptical cross section.


  Just an idea:

  1. Rename the TTUBE class to TELSTU (may be ?)
  2. Change the ctor of class:

     TTUBE::TTUBE(Text_t *name, Text_t *title, Text_t *material, Float_t rmin, Float_t rmax, Float_t dz
                ,Float_t aspect=1)

     adding one extra parameter as above:

  3. Add one extra data member and one method:
     i.e instead of 

      class TTUBE : public TShape {
 
      protected:
           Float_t fRmin;        // inside  radius
           Float_t fRmax;        // outside raduis

             ....
          [snip]
             ....
    }

     class TELTU : public TShape {

      protected:
          Float_t fRmin;        // inside  the  ellipse  semi-axis   in  X
          Float_t fRmax;        // outside the  ellipse  semi-axis   in  X

          Float_t fAspectRatio; // defines  (the ellipse semi-axis in Y)/(the ellipse semi-axis in X)


             ....
          [snip]
             ....
       public:

             ....
          [snip]
             ....

          virtual void    SetAspectRatio(Float_t factor=1)(fAspectRatio = factor;}
          virtual Float_t GetAspectRatio()(return fAspectRatio;}


             ....
          [snip]
             ....
     }

  3. Change two lines of the method void TTUBE::SetPoints(Float_t *buff):
     instead of:

            buff[indx+6*n] = buff[indx] = fRmin * fSiTab[j];

    write:

            buff[indx+6*n] = buff[indx] = fAspectRatio*fRmin * fSiTab[j];



  afterwards this class will be able to draw all kind of elliptic 
  tube (the cylindrical one included too).  

  I've tried and it works very well.

  The corrections sent to ROOT team. In theory the same
  could be done for all "cylindrical" classes ike 

          TPCone TCone, TCons etc and even for TSphe 

 (for TSphe two aspect rations should be introduced to draw ellipsoids).

  Hope this helps,
                       Valery




  
=================================================================
Dr. Valeri Faine (Fine)
    -------------------          Phone: +1 516 344 7806
Brookhaven National Laboratory   FAX  : +1 516 344 4206
Bldg. 510A /STAR                 mailto:fine@bnl.gov
Upton, New York, 11973-5000      http://nicewww.cern.ch/~fine
USA
                                 
Dr. Valery Fine                  Telex : 911621 dubna su
    -----------
LCTA/Joint Inst.for Nuclear Res. Phone : +7 09621 6 40 80
141980 Dubna, Moscow region      Fax   : +7 09621 6 51 45
Russia                           mailto:fine@main1.jinr.dubna.su                              



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:34:34 MET