RE: [ROOT] 3D objects.

From: Faine, Valeri (fine@bnl.gov)
Date: Tue May 27 2003 - 21:22:54 MEST


Hello Kevin,

 I think the generic solution is to be provided by the new ROOT class
family
  (see: http://root.cern.ch/root/htmldoc/TGeoShape.html   for example)

TShape classes have no built-in method to address your needs.
On other hand they have the virtual method:

void TShape:: SetPoints(Float_t *buff) 

where the buff is an array of 3D points the concrete shape is built of.

This allows to make a quick (rough though) check
 If your point coordinate are
   buff[3*i]   < x < buff[3*(i+1)]
   buff[3*i+1] < y < buff[3*(i+1)+1]
   buff[3*i+2] < z < buff[3*(i+1)+2]

you are in (approximately :-)

This assumes one has to allocate the buffer first. TShape doesn't
provide the virtual method to answer how large this buffer should be.
One still can get some idea by study TShape::Paint method. 
It is very place the "buff" arrays are allocated.
(see: http://root.cern.ch/root/htmldoc/src/TSPHE.cxx.html#TSPHE:Paint
for example)

 In other words TShape class has to be populated with a bunch of 
new methods.

It seems to me this is what TGeopShape is about.

 Best regards, Valeri


> -----Original Message-----
> From: owner-roottalk@pcroot.cern.ch
[mailto:owner-roottalk@pcroot.cern.ch]
> On Behalf Of Kevin Reil
> Sent: Tuesday, May 27, 2003 2:56 PM
> To: roottalk@pcroot.cern.ch
> Subject: [ROOT] 3D objects.
> 
> Hi rooters,
> 
> I wish to find out of a point is contained within (or on the surface
of)
> a 3D object. (More accurately I wish to know if a line intersects an
> object ie a raytrace).
> 
> Is there such a feedback mechanism in the 3D geometry classes? For a
TBRIK
> its pretty easy, but TTUBE, TCONE etc it becomes much harder.
> 
> Thanks,
> Kevin
> 
>
|------------------------------------|---------------------------------|
> | Kevin Reil                         | 2575 Sand Hill Road, MS 26
|
> | X2447, 103D A&E Bldg. 041          | Menlo Park, CA 94025
|
>
|------------------------------------|---------------------------------|
> | http://www.slac.stanford.edu/~reil | Office (650) 926-2447
|
> | reil@slac.stanford.edu             | Home   (650) 938-1767
|
> | http://reil.no-ip.org              | Fax    (650) 926-5368
|
>
|----------------------------------------------------------------------|
> |                    And my father dwelt in a tent.
|
>
|----------------------------------------------------------------------|
> 
> On Tue, 27 May 2003, cstrato wrote:
> 
> >Dear Fons and Stanislav
> >
> >Thank you for this great solution. It really solves my special case.
> >
> >(In the case of *.txt, the only problem would be that normal users
> >would be confused to see a grep expression instead of what they
> >usually expect. But for the moment it does not matter.)
> >
> >Best regards
> >Christian
> >
> >Fons Rademakers wrote:
> >
> >>Hi Stanislav,
> >>
> >> thanks for these remarks. In the GUI the following works and solves
> >>Christian's problem:
> >>
> >>const char *filetypes[] = { "All files",     "*",
> >>                            "Text files",    "*.[tT][xX][tT]",
> >>                            0,               0 };
> >>
> >>Cheers, Fons.
> >>
> >>
> >>
> >>On Mon, 2003-05-26 at 22:45, Stanislav Nesterov wrote:
> >>
> >>
> >>>   Hi,
> >>>   I just want to clarify one point:
> >>>expression "*.{txt,TXT}" in fact is not regexp at all but shell
> wildcard.
> >>>
> >>>   To be more precise similar condition can be achieved via regex:
> >>>        .*\.(txt|TXT)
> >>> or even
> >>>        .*\.[tT][xX][tT]
> >>>
> >>>                                 Best regards,
> >>>						Stanislav.
> >>>
> >>>On 26 May 2003, Fons Rademakers wrote:
> >>>
> >>>
> >>>
> >>>>Hi Christian,
> >>>>
> >>>> this is currently not supported via our regexp processor. Ideally
> this
> >>>>should work "*.{txt,TXT}" but currently it doesn't.
> >>>>
> >>>>Cheers, Fons.
> >>>>
> >>>>
> >>>>
> >>>>On Sun, 2003-05-25 at 19:13, cstrato wrote:
> >>>>
> >>>>
> >>>>>Dear Rooters
> >>>>>
> >>>>>TGFileDialog offers the possibility to show only files
> >>>>>of selected type TGFileInfo::fFileTypes.
> >>>>>
> >>>>>However, I would like to display e.g. text-files only,
> >>>>>which could have the extension *.txt or *.TXT.
> >>>>>Is this possible, and how can I achieve this?
> >>>>>
> >>>>>Thank you in advance.
> >>>>>Best regards
> >>>>>Christian
> >>>>>_._._._._._._._._._._._._._._._
> >>>>>C.h.i.s.t.i.a.n S.t.r.a.t.o.w.a
> >>>>>V.i.e.n.n.a       A.u.s.t.r.i.a
> >>>>>_._._._._._._._._._._._._._._._
> >>>>>
> >>>>>
> >
> >
> >



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:11 MET