us.ihmc.robotics.quadTree.Box类的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(8.2k)|赞(0)|评价(0)|浏览(145)

本文整理了Java中us.ihmc.robotics.quadTree.Box类的一些代码示例,展示了Box类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Box类的具体详情如下:
包路径:us.ihmc.robotics.quadTree.Box
类名称:Box

Box介绍

暂无

代码示例

代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit

public QuadTreeForGroundNode(String id, double minX, double minY, double maxX, double maxY, QuadTreeForGroundParameters parameters, QuadTreeForGroundPointLimiter decay, QuadTreeForGroundNode parent, double defaultHeightWhenNoPonts, 
             ArrayList<QuadTreeForGroundListener> listeners)
{
 this(id, new Box(minX, minY, maxX, maxY), parameters, decay, parent, defaultHeightWhenNoPonts, listeners);
}

代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit

public void getAllPointsWithinBounds(Box bounds, ArrayList<Point3D> pointsToPack)
{
 for (Point3D point : points)
 {
   if (bounds.containsOrEquals(point.getX(), point.getY()))
   {
    pointsToPack.add(point);
   }
 }
}

代码示例来源:origin: us.ihmc/IHMCRoboticsToolkit

public void getAllPointsWithinDistance(double x, double y, double maxDistance, ArrayList<Point3d> pointsWithinDistanceToPack)
{
 if (maxDistance < 0.0)
   return;
 if (this.hasChildren)
 {
   if (this.NW.bounds.calcDist(x, y) <= maxDistance)
   {
    this.NW.getAllPointsWithinDistance(x, y, maxDistance, pointsWithinDistanceToPack);
   }
   if (this.NE.bounds.calcDist(x, y) <= maxDistance)
   {
    this.NE.getAllPointsWithinDistance(x, y, maxDistance, pointsWithinDistanceToPack);
   }
   if (this.SE.bounds.calcDist(x, y) <= maxDistance)
   {
    this.SE.getAllPointsWithinDistance(x, y, maxDistance, pointsWithinDistanceToPack);
   }
   if (this.SW.bounds.calcDist(x, y) <= maxDistance)
   {
    this.SW.getAllPointsWithinDistance(x, y, maxDistance, pointsWithinDistanceToPack);
   }
   return;
 }
 if (this.leaf != null)
 {
   leaf.getAllPointsWithinDistance(x, y, maxDistance, pointsWithinDistanceToPack);
 }
}

代码示例来源:origin: us.ihmc/IHMCRoboticsToolkit

if (this.NW.bounds.intersects(bounds))
if (this.NE.bounds.intersects(bounds))
if (this.SE.bounds.intersects(bounds))
if (this.SW.bounds.intersects(bounds))
if (bounds.containsOrEquals(this.bounds))

代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit

if (this.NW.bounds.intersects(bounds))
if (this.NE.bounds.intersects(bounds))
if (this.SE.bounds.intersects(bounds))
if (this.SW.bounds.intersects(bounds))
if (bounds.containsOrEquals(this.bounds))

代码示例来源:origin: us.ihmc/IHMCRoboticsToolkit

public QuadTreeForGroundNode(String id, double minX, double minY, double maxX, double maxY, QuadTreeForGroundParameters parameters, QuadTreeForGroundPointLimiter decay, QuadTreeForGroundNode parent, double defaultHeightWhenNoPonts, 
             ArrayList<QuadTreeForGroundListener> listeners)
{
 this(id, new Box(minX, minY, maxX, maxY), parameters, decay, parent, defaultHeightWhenNoPonts, listeners);
}

代码示例来源:origin: us.ihmc/IHMCRoboticsToolkit

public void getAllPointsWithinBounds(Box bounds, ArrayList<Point3d> pointsToPack)
{
 for (Point3d point : points)
 {
   if (bounds.containsOrEquals(point.getX(), point.getY()))
   {
    pointsToPack.add(point);
   }
 }
}

代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit

public void getAllPointsWithinDistance(double x, double y, double maxDistance, ArrayList<Point3D> pointsWithinDistanceToPack)
{
 if (maxDistance < 0.0)
   return;
 if (this.hasChildren)
 {
   if (this.NW.bounds.calcDist(x, y) <= maxDistance)
   {
    this.NW.getAllPointsWithinDistance(x, y, maxDistance, pointsWithinDistanceToPack);
   }
   if (this.NE.bounds.calcDist(x, y) <= maxDistance)
   {
    this.NE.getAllPointsWithinDistance(x, y, maxDistance, pointsWithinDistanceToPack);
   }
   if (this.SE.bounds.calcDist(x, y) <= maxDistance)
   {
    this.SE.getAllPointsWithinDistance(x, y, maxDistance, pointsWithinDistanceToPack);
   }
   if (this.SW.bounds.calcDist(x, y) <= maxDistance)
   {
    this.SW.getAllPointsWithinDistance(x, y, maxDistance, pointsWithinDistanceToPack);
   }
   return;
 }
 if (this.leaf != null)
 {
   leaf.getAllPointsWithinDistance(x, y, maxDistance, pointsWithinDistanceToPack);
 }
}

代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit

public Box scale(double scaleX, double scaleY)
{
 scaleY *= this.centreY - this.minY;
 scaleX *= this.centreX - this.minX;
 return new Box(this.minX - scaleX, this.minY - scaleY, this.maxX + scaleX, this.maxY + scaleY);
}

代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit

this.bounds.containsOrEquals(NE.bounds);
this.bounds.containsOrEquals(NW.bounds);
this.bounds.containsOrEquals(SE.bounds);
this.bounds.containsOrEquals(SW.bounds);

代码示例来源:origin: us.ihmc/IHMCRoboticsToolkit

public Box scale(double scaleX, double scaleY)
{
 scaleY *= this.centreY - this.minY;
 scaleX *= this.centreX - this.minX;
 return new Box(this.minX - scaleX, this.minY - scaleY, this.maxX + scaleX, this.maxY + scaleY);
}

代码示例来源:origin: us.ihmc/IHMCRoboticsToolkit

this.bounds.containsOrEquals(NE.bounds);
this.bounds.containsOrEquals(NW.bounds);
this.bounds.containsOrEquals(SE.bounds);
this.bounds.containsOrEquals(SW.bounds);

代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit

public Box intersection(Box r)
{
 double tempX1 = this.minX;
 double tempY1 = this.minY;
 double tempX2 = this.maxX;
 double tempY2 = this.maxY;
 if (this.minX < r.minX)
 {
   tempX1 = r.minX;
 }
 if (this.minY < r.minY)
 {
   tempY1 = r.minY;
 }
 if (tempX2 > r.maxX)
 {
   tempX2 = r.maxX;
 }
 if (tempY2 > r.maxY)
 {
   tempY2 = r.maxY;
 }
 if (tempX2 - tempX1 <= 0.f || tempY2 - tempY1 <= 0.f)
 {
   return null;
 }
 return new Box(tempX1, tempY1, tempX2, tempY2);
}

代码示例来源:origin: us.ihmc/IHMCRoboticsToolkit

public void checkRepInvarients(Box bounds)
{
 if ((points == null) || (points.isEmpty()))
 {
   throw new RuntimeException("All leaves should have at least one point");
 }
 if ((points != null) && (!points.isEmpty()))
 {
   for (Point3d point : points)
   {
    if (!bounds.containsOrEquals(point.getX(), point.getY()))
      throw new RuntimeException();
   }
 }
 if ((averagePoint != null) && (Double.isNaN(averagePoint.getX())))
 {
   Point3d averageCheck = new Point3d(averagePoint);
   averagePoint.set(Double.NaN, Double.NaN, Double.NaN);
   if (averageCheck.distance(this.getAveragePoint()) > 1e-7)
    throw new RuntimeException();
 }
}

代码示例来源:origin: us.ihmc/IHMCRoboticsToolkit

public Box intersection(Box r)
{
 double tempX1 = this.minX;
 double tempY1 = this.minY;
 double tempX2 = this.maxX;
 double tempY2 = this.maxY;
 if (this.minX < r.minX)
 {
   tempX1 = r.minX;
 }
 if (this.minY < r.minY)
 {
   tempY1 = r.minY;
 }
 if (tempX2 > r.maxX)
 {
   tempX2 = r.maxX;
 }
 if (tempY2 > r.maxY)
 {
   tempY2 = r.maxY;
 }
 if (tempX2 - tempX1 <= 0.f || tempY2 - tempY1 <= 0.f)
 {
   return null;
 }
 return new Box(tempX1, tempY1, tempX2, tempY2);
}

代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit

public void checkRepInvarients(Box bounds)
{
 if ((points == null) || (points.isEmpty()))
 {
   throw new RuntimeException("All leaves should have at least one point");
 }
 if ((points != null) && (!points.isEmpty()))
 {
   for (Point3D point : points)
   {
    if (!bounds.containsOrEquals(point.getX(), point.getY()))
      throw new RuntimeException();
   }
 }
 if ((averagePoint != null) && (Double.isNaN(averagePoint.getX())))
 {
   Point3D averageCheck = new Point3D(averagePoint);
   averagePoint.set(Double.NaN, Double.NaN, Double.NaN);
   if (averageCheck.distance(this.getAveragePoint()) > 1e-7)
    throw new RuntimeException();
 }
}

代码示例来源:origin: us.ihmc/IHMCRoboticsToolkit

public Box union(Box b)
{
 return new Box(Math.min(this.minX, b.minX), Math.min(this.minY, b.minY), Math.max(this.maxX, b.maxX), Math.max(this.maxY, b.maxY));
}

代码示例来源:origin: us.ihmc/SensorProcessing

public ArrayList<Point3d> readPointsFromBufferedReader(BufferedReader bufferedReader, int skipPoints, int maxNumberOfPoints, Box bounds, double maxZ) throws IOException
{
 ArrayList<Point3d> points = new ArrayList<Point3d>();
 String inputString;
 int numPoints = 0;
 while (((inputString = bufferedReader.readLine()) != null) && (numPoints < maxNumberOfPoints))
 {
   Point3d point = parsePoint3d(inputString);
   if ((point != null) && (bounds.containsOrEquals(point.getX(), point.getY())) && (point.getZ() < maxZ))
   {
    if (noiseAmplitudeForReading > 0.0)
    {
      point.add(RandomTools.generateRandomPoint(random, noiseAmplitudeForReading, noiseAmplitudeForReading, noiseAmplitudeForReading));
    }
    points.add(point);
    numPoints++;
   }
 }
 bufferedReader.close();
 return points;
}

代码示例来源:origin: us.ihmc/ihmc-robotics-toolkit

public Box union(Box b)
{
 return new Box(Math.min(this.minX, b.minX), Math.min(this.minY, b.minY), Math.max(this.maxX, b.maxX), Math.max(this.maxY, b.maxY));
}

代码示例来源:origin: us.ihmc/IHMCRoboticsToolkit

public synchronized double getHeightAtPoint(double x, double y)
{
 if (!bounds.containsOrEquals(x, y))
   return Double.NaN;
 nearestPointForHeightAt.set(Double.NaN, Double.NaN, Double.NaN);
 PointAndDistance pointAndDistance = new PointAndDistance(nearestPointForHeightAt,
                     quadTreeParameters.getMaxAllowableXYDistanceForAPointToBeConsideredClose());
 root.getClosestPointAndDistance(x, y, pointAndDistance);
 double heightToReturn = nearestPointForHeightAt.getZ();
 
 if (Double.isNaN(heightToReturn))
 {
   heightToReturn = root.getDefaultHeightWhenNoPoints();
 }
 return heightToReturn;
 
}

相关文章

微信公众号

最新文章

更多