Re: [ROOT] TGeoShape GetShapeBit policy?

From: Andrei Gheata (Andrei.Gheata@cern.ch)
Date: Thu Feb 12 2004 - 08:58:40 MET


Hi Valeri,

Shape bits should provide the following information:
1. shape type - one might want to cast a shape pointer at run time
2. validity of the shape
3. if shape represent a parametrized object
4. if the shape is closed - e.g. its bounding box is computed

The first category is not used by the modeller. The shape type 
identifiers are set in the constructor. The problem with the TGeoTrap is 
that it inherits from TGeoArb8 but not setting its own bit. So this is a 
bug. In fact, it is more an inconsistent feature, since you will find 
for instance that a TGeoTubeSeg have both kGeoTube and kGeoTubeSeg bits set.

The fix to this is to define an abstract method at TGeoShape level, that 
any specific shape has to implement, e.g.

EShapeType TGeoShape::GetShapeType() const
This will eliminate any ambiguity.

Soon in CVS.

Regards,
Andrei

Valeri Fine wrote:
> Hello team,
> 
> What is the TGeoShape::Set(Get)ShapeBit property really mean?
> 
> For example the list 
> http://root.cern.ch/root/htmldoc/TGeoShape.html#TGeoShape:kGeoArb8 
>       static const TGeoShape::EShapeType kGeoNoShape       
>       static const TGeoShape::EShapeType kGeoBad           
>       static const TGeoShape::EShapeType kGeoRSeg          
>       static const TGeoShape::EShapeType kGeoPhiSeg        
>       static const TGeoShape::EShapeType kGeoThetaSeg      
>       static const TGeoShape::EShapeType kGeoVisX          
>       static const TGeoShape::EShapeType kGeoVisY          
>       static const TGeoShape::EShapeType kGeoVisZ          
>       static const TGeoShape::EShapeType kGeoRunTimeShape  
>       static const TGeoShape::EShapeType kGeoInvalidShape  
>       static const TGeoShape::EShapeType kGeoTorus         
>       static const TGeoShape::EShapeType kGeoBox           
>       static const TGeoShape::EShapeType kGeoPara          
>       static const TGeoShape::EShapeType kGeoSph           
>       static const TGeoShape::EShapeType kGeoTube          
>       static const TGeoShape::EShapeType kGeoTubeSeg       
>       static const TGeoShape::EShapeType kGeoCone          
>       static const TGeoShape::EShapeType kGeoConeSeg       
>       static const TGeoShape::EShapeType kGeoPcon          
>       static const TGeoShape::EShapeType kGeoPgon          
>       static const TGeoShape::EShapeType kGeoArb8          
>       static const TGeoShape::EShapeType kGeoEltu          
>       static const TGeoShape::EShapeType kGeoTrap          
>       static const TGeoShape::EShapeType kGeoCtub          
>       static const TGeoShape::EShapeType kGeoTrd1          
>       static const TGeoShape::EShapeType kGeoTrd2          
>       static const TGeoShape::EShapeType kGeoComb          
>       static const TGeoShape::EShapeType kGeoClosedShape   
>  
> 
> suggests the TGeoTrap::GetShapeBit would contains kGeoTrap bit.
> However TGeoTrap:GetShapeBits returns "kGeoArb8" 
> 
> Is it a bug or undocumented feature? What the shape property stands for?
> Can some one elaborate a little bit to clarify when the shape type
> matches the shape bit?
> 
> Thank you
> 
> Valeri Fine                          
> Brookaven National Laboratiory
> P.O.Box 5000
> Upton, NY 11973-5000
> -----
> Phone: +1 631 344 7806
> Fax:   +1 631 344 4206
> E-mail: fine@bnl.gov 
> 
> 
> 
> 



This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:05 MET