Class ElementExtractor


  • public class ElementExtractor
    extends java.lang.Object
    This extractor extracts elements from J3D_Geometry in an iterative fashion Composite surface is expected to be: < , 1006, N> N tuples of the form <, 1003, x> <, 2003, x>* Composite solid should be of the form: < , 1008, N> N solids each of the form <, 1007, > specified using 1 outer surface and N inner surfaces <, 1006, M> and M tuples of the form <,1003, > m times followed by 0 or more inner solids specified as surfaces as: <, 2006, p> and p tuples of the form <,2003, >

    Multi-x geometry can have multiple of the composite-x and/or simple-x geometry. x is here could be solid, surface, line, point.

    The constructor function's extraction_level parameter can have the following values: LOWER_LEVEL: This returns the elements in the next level of hierarchy (e.g., for a solid, the next Level will be surfaces, for a polygon the next level will be lines etc.); MULTICOMP_TOSIMPLE: This returns the elements of a composite or multi-geometry. For instance, for a composite surface, it returns each surface element as a J3D_GEOMETRY in the "next" call; INNER_OUTER: This returns the inner/outer elements if any. For polygons, it returns the outer first which is followed by inner polygons in subsequent "next" calls. The method ElementExtractor.nextElement() returns J3D_GEOMETRY or null.

    If the 3-D geometry has shortcut (optimized box, rectangle) representation, this extractor expands those geometries to full extent via expandSolid and other routines in this code. Thus, the returned geometries will have explicit coordinates and elemInfo.

    In MULTICOMP_TOSIMPLE extraction level, users can also arrange to extract directly simple geometries from multi or composite geometries by setting the public parameter allow_comp_sub_elements to FALSE. The default value is TRUE, which means users will extract composite geometry first (if exists) from multi geometry.

    Optimized (shortcut) representations are only for axis aligned 3-D geometries.

    Please note that the INNER_OUTER parameter is different than the inner_outer integer array of nextElementmethod.

    • Constructor Detail

      • ElementExtractor

        public ElementExtractor​(J3D_Geometry geom,
                                int elemStart,
                                int type,
                                boolean allow_comp_sub_elements_param)
                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • ElementExtractor

        public ElementExtractor​(J3D_Geometry geom,
                                int elemStart,
                                int type)
                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • ElementExtractor

        public ElementExtractor​(J3D_Geometry geom,
                                int type)
                         throws java.lang.Exception
        Constructs an extractor that extracts elements from J3D_Geometry in an iterative fashion
        Parameters:
        geom - Geometry
        type - MULTICOMP_TOSIMPLE (0), or INNER_OUTER (1) or LOWER_LEVEL (2) This is the constructor function's extraction_level parameter which can have the following values: LOWER_LEVEL (2): This returns the elements in the next level of hierarchy (e.g., for a solid, the next Level will be surfaces, for a polygon the next level will be lines etc.); MULTICOMP_TOSIMPLE (0): This returns the elements of a composite or multi-geometry. For instance, for a composite surface, it returns each surface element as a J3D_GEOMETRY in the "next" call; INNER_OUTER (1): This returns the inner/outer elements if any. For polygons, it returns the outer first which is followed by inner polygons in subsequent "next" calls.
        Throws:
        java.lang.Exception - General exception
      • ElementExtractor

        public ElementExtractor​(J3D_Geometry geom,
                                int elemStart,
                                int type,
                                int mydim,
                                boolean allow_comp_sub_elements_param)
                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • ElementExtractor

        public ElementExtractor​(J3D_Geometry geom,
                                int elemStart,
                                int type,
                                int mydim)
                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • ElementExtractor

        public ElementExtractor​(J3D_Geometry geom)
                         throws java.lang.Exception
        Throws:
        java.lang.Exception
    • Method Detail

      • expandSolid

        protected J3D_Geometry expandSolid​(J3D_Geometry geom)
                                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • nextElement

        public J3D_Geometry nextElement​(int[] inner_outer)
                                 throws java.lang.Exception
        Returns the next element of J3D_Geometry.

        This is the iterator to get next element using the above hierarchy. It takes an input J3D_Geometry and returns the next element in sequence.

        Parameters:
        inner_outer - This is a single element integer array. It tells whether the extracted next element geometry is a hole(2) or outer geometry(1).
        Returns:
        J3D_Geometry geometry which is the next element of input 3-D geometry
        Throws:
        java.lang.Exception - General exception