Re: Building complex geometries using simple 3d primatives

From: Rene Brun (Rene.Brun@cern.ch)
Date: Wed Nov 19 1997 - 15:52:16 MET


William J. Deninger wrote:

>   Hello, I have a peculiar question concerning implementing 3d
> graphics primitives inside one another.  Suppose I have a detector
> composed of a simple block of aluminum with a hole drilled in the
> middle.  I would suspect we would use TBRIK of material Al and TTUBE
> of material VACUUM.  How does root know which material takes
> precedence in a volume shared by two materials such as the TTUBE
> inside the TBRIK?
>
> You define a  top TNode object (say TOPNODE) made of a TBRIK shape.
> TOPNODE.cd();
> Create another TNode made with a TTUBE shape. This node is
> automatically added
> to the list of nodes in thecurrent node (TOPNODE).
> And so on, you can build a complex hierarchical tree.
> The drawing routines (pad, X3D and OPENGL) will automatically use the
> TNode
> hierarchy .
>
>   Also, suppose those two primitives shared a common origin. Is it
> possible to have both primitives referenced by the same TNode, or is
> it necessary to have a TNode duplicated?  I'm guessing that in such an
> instance, one would want to combine all objects "attached" sharing a
> node to be represented by a class of type TShape.  But then the
> question becomes, which virtual functions of TShape are necessary to
> overload in order to get a correct TShape behavior?
>
> No, each object must be a separate TNode. But a TNode may contain one
> or more TNode
> son objects. In general you build a complex setup with teh set of
> basic shapes provided
> in the library. You can make a new shape (derived from TShape, like
> TBRIK,etc), but this is
> more work. And finally, as the geometry becomes complicated I need to
> highlight certain primitives preferably without redrawing the entire
> detector geometry.  Specifically, I need to mark straws in a drift
> chamber in order to aid debugging my tracking code.
>
>
> This is easy. Interactively, you simply point to the node with the
> right mouse button,
> select SetLineAttributes and change the color,line width of the object
> you want to highlight.

Rene Brun



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