Class Shell3D

java.lang.Object
edu.cnu.mdi.view.demo.geoslice.Shell3D

public final class Shell3D extends Object
Synthetic three-dimensional shell surrounding one detector-like region.

A Shell3D is a simple sector-like envelope around one group of synthetic wires. It is not a general solid modeling class. Its purpose is to provide a shared model object for two demos:

  • the 2D MDI slice view, where the shell produces a 2D polygon by intersecting a constant-phi plane, and
  • the companion MDI-3D view, where the shell is drawn directly as a wireframe so readers can see the object that the 2D slice cuts through.
  • Method Details

    • forChamber

      public static Shell3D forChamber(int chamber, double chamberR0, double chamberZ0)
      Create a shell for the given chamber-like region.
      Parameters:
      chamber - zero-based chamber index
      chamberR0 - base radial coordinate
      chamberZ0 - base z coordinate
      Returns:
      shell for the given chamber
    • getPhiMinDeg

      public static double getPhiMinDeg()
      Return the minimum shell azimuth.
      Returns:
      minimum shell phi in degrees
    • getPhiMaxDeg

      public static double getPhiMaxDeg()
      Return the maximum shell azimuth.
      Returns:
      maximum shell phi in degrees
    • getRegionIndex

      public int getRegionIndex()
      Return the zero-based region index.
      Returns:
      zero-based region index
    • getZMin

      public double getZMin()
      Return the minimum z coordinate of the shell envelope.
      Returns:
      minimum shell z
    • getZMax

      public double getZMax()
      Return the maximum z coordinate of the shell envelope.
      Returns:
      maximum shell z
    • label

      public String label()
      Return the human-readable shell label.
      Returns:
      label such as "region 2"
    • slicePolygon

      public Point2D.Double[] slicePolygon(double phiDeg)
      Create the shell intersection polygon for a constant-phi slice.

      This method creates four 3D shell-corner lines spanning the sector in azimuth and intersects those lines with the current constant-phi plane. Thus the shell moves with the slider by the same mechanism as the wires: both are generated by real intersections with the current slice plane.

      Parameters:
      phiDeg - current slice azimuth, in degrees
      Returns:
      four slice-coordinate points, or null if out of range
    • createWireframeEdges

      public Line[] createWireframeEdges()
      Create a 3D wireframe representation of this shell.

      The returned lines trace the four boundaries at the minimum-phi side, the four boundaries at the maximum-phi side, and the four azimuth-spanning connector edges. This is meant for explanatory rendering in the companion 3D view. The 2D slice view does not need these edges; it uses slicePolygon(double) instead.

      Returns:
      twelve finite 3D line segments forming the shell wireframe