Class PathFinder


  • public class PathFinder
    extends Object
    Author:
    Nicolas Fortin, Pierre Aumond, Sylvain Palominos
    • Field Detail

      • LOGGER

        public static final org.slf4j.Logger LOGGER
      • progressVisitor

        public org.h2gis.api.ProgressVisitor progressVisitor
        Progression information
    • Constructor Detail

      • PathFinder

        public PathFinder​(Scene data,
                          org.h2gis.api.ProgressVisitor progressVisitor)
        Create new instance from the propagation data.
        Parameters:
        data - Propagation data used for ray computation.
      • PathFinder

        public PathFinder​(Scene data)
        Create new instance from the propagation data.
        Parameters:
        data - Propagation data used for ray computation.
    • Method Detail

      • getData

        public Scene getData()
      • getProfilerThread

        public ProfilerThread getProfilerThread()
        Computation stacks and timing are collected by this class in order to profile the execution of the simulation
        Returns:
        Instance of ProfilerThread or null
      • setProfilerThread

        public void setProfilerThread​(ProfilerThread profilerThread)
        Computation stacks and timing are collected by this class in order to profile the execution of the simulation
        Parameters:
        profilerThread - Instance of ProfilerThread
      • setThreadCount

        public void setThreadCount​(int threadCount)
        Sets the number of thread to use.
        Parameters:
        threadCount - Number of thread.
      • run

        public void run​(CutPlaneVisitorFactory computeRaysOut)
        Run computation and store the results in the given output.
        Parameters:
        computeRaysOut - Result output.
      • computeRaysAtPosition

        public void computeRaysAtPosition​(PathFinder.ReceiverPointInfo receiverPointInfo,
                                          CutPlaneVisitor dataOut,
                                          org.h2gis.api.ProgressVisitor visitor)
        Compute the rays to the given receiver.
        Parameters:
        receiverPointInfo - Receiver point.
        dataOut - Computation output.
        visitor - Progress visitor used for cancellation and progression managing.
      • computeSideHull

        public List<org.locationtech.jts.geom.Coordinate> computeSideHull​(boolean left,
                                                                          org.locationtech.jts.geom.Coordinate p1,
                                                                          org.locationtech.jts.geom.Coordinate p2,
                                                                          ProfileBuilder profileBuilder)
        Compute Side Hull Create a line between p1 and p2. Find the first intersection of this line with a building then create a ConvexHull with the points of buildings in intersection. While there is an intersection add more points to the convex hull. The side diffraction path is found when there is no more intersection.
        Parameters:
        left - If true return the path on the left side between p1 and p2; else on the right side
        p1 - First point
        p2 - Second point
        Returns:
      • computeZeroRadPlane

        public static org.apache.commons.math3.geometry.euclidean.threed.Plane computeZeroRadPlane​(org.locationtech.jts.geom.Coordinate p0,
                                                                                                   org.locationtech.jts.geom.Coordinate p1)
        Parameters:
        p0 -
        p1 -
        Returns:
      • filterPointsBySide

        public static List<org.locationtech.jts.geom.Coordinate> filterPointsBySide​(org.locationtech.jts.geom.LineSegment sr,
                                                                                    boolean left,
                                                                                    List<org.locationtech.jts.geom.Coordinate> segmentsCoordinates)
        Remove points that are left or right of the provided segment
        Parameters:
        sr - Source receiver segment
        left - Side to keep
        segmentsCoordinates - Roof points
        Returns:
        Only points of the requested side
      • cutRoofPointsWithPlane

        public static List<org.locationtech.jts.geom.Coordinate> cutRoofPointsWithPlane​(org.apache.commons.math3.geometry.euclidean.threed.Plane plane,
                                                                                        List<org.locationtech.jts.geom.Coordinate> roofPts)
        Parameters:
        plane - 3D plane with position and normal vector
        roofPts - Top altitude coordinates that create segments of verticals walls, these walls will be cut by the plane.
        Returns:
        Remaining segments coordinates after the plane cutting
      • coordinateToVector

        public static org.apache.commons.math3.geometry.euclidean.threed.Vector3D coordinateToVector​(org.locationtech.jts.geom.Coordinate p)
        Parameters:
        p - coordinate
        Returns:
        the three dimensions vector of p
      • splitLineStringIntoPoints

        public static double splitLineStringIntoPoints​(org.locationtech.jts.geom.LineString geom,
                                                       double segmentSizeConstraint,
                                                       List<org.locationtech.jts.geom.Coordinate> pts)
        Parameters:
        geom - Geometry
        segmentSizeConstraint - Maximal distance between points
        pts - computed points
        Returns:
        Fixed distance between points
      • makeSourceRelativeZToAbsolute

        public void makeSourceRelativeZToAbsolute()
        Update ground Z coordinates of sound sources absolute to sea levels
      • makeRelativeZToAbsolute

        public void makeRelativeZToAbsolute()
        Update ground Z coordinates of sound sources and receivers absolute to sea levels
      • makeReceiverRelativeZToAbsolute

        public void makeReceiverRelativeZToAbsolute()
        Update ground Z coordinates of receivers absolute to sea levels