Tabnine Logo
FrameConvexPolygon2d.clear
Code IndexAdd Tabnine to your IDE (free)

How to use
clear
method
in
us.ihmc.robotics.geometry.FrameConvexPolygon2d

Best Java code snippets using us.ihmc.robotics.geometry.FrameConvexPolygon2d.clear (Showing top 20 results out of 315)

origin: us.ihmc/IHMCRoboticsToolkit

/**
* This method does:
* 1- {@code clear()};
* 2- {@code addVertexByProjectionOntoXYPlane(vertices.get(i)};
* 3- {@code update()}.
* @param vertices {@code List<FramePoint>} the list of points that is used to creates the vertices.
*/
public void setAndUpdate(List<FramePoint> vertices)
{
 clear();
 for (int i = 0; i < vertices.size(); i++)
 {
   addVertexByProjectionOntoXYPlane(vertices.get(i));
 }
 update();
}
origin: us.ihmc/IHMCRoboticsToolkit

/**
* This method does:
* 1- {@code clear(referenceFrame)};
* 2- {@code addVertices(vertices)};
* 3- {@code update()}.
* @param referenceFrame {@code ReferenceFrame} the new reference frame of this polygon.
* @param vertices {@code List<Point2d>} the list of points that is used to creates the vertices.
*/
public void setIncludingFrameAndUpdate(ReferenceFrame referenceFrame, List<Point2d> vertices)
{
 clear(referenceFrame);
 this.convexPolygon.addVertices(vertices, vertices.size());
 update();
}
origin: us.ihmc/IHMCRoboticsToolkit

public void setIncludingFrameAndUpdate(ReferenceFrame referenceFrame, Point2d[] vertices)
{
 clear(referenceFrame);
 this.convexPolygon.addVertices(vertices, vertices.length);
 update();
}
origin: us.ihmc/IHMCRoboticsToolkit

/**
* This method does:
* 1- {@code clear(vertices.get(0).getReferenceFrame())};
* 2- {@code addVerticesByProjectionOntoXYPlane(vertices, vertices.size())};
* 3- {@code update()}.
* @param referenceFrame {@code ReferenceFrame} the new reference frame of this polygon.
* @param vertices {@code List<FramePoint>} the list of points that is used to creates the vertices.
* @throws ReferenceFrameMismatchException
*/
public void setIncludingFrameByProjectionOntoXYPlaneAndUpdate(ReferenceFrame referenceFrame, List<FramePoint> vertices)
{
 int numberOfVertices = vertices.size();
 clear(referenceFrame);
 addVerticesByProjectionOntoXYPlane(vertices, numberOfVertices);
 update();
}
origin: us.ihmc/IHMCRoboticsToolkit

/**
* This method does:
* 1- {@code clear(referenceFrame)};
* 2- {@code addVertices(vertices)};
* 3- {@code update()}.
* @param referenceFrame {@code ReferenceFrame} the new reference frame of this polygon.
* @param vertices {@code double[>=numberOfVertices][>=2]} the array of points that is used to creates the vertices.
*/
public void setIncludingFrameAndUpdate(ReferenceFrame referenceFrame, double[][] vertices)
{
 clear(referenceFrame);
 this.convexPolygon.addVertices(vertices, vertices.length);
 update();
}
origin: us.ihmc/IHMCRoboticsToolkit

private void putYoValuesIntoFrameConvexPolygon2d()
{
 try
 {
   convexPolygon2dForReading.clear(referenceFrame);
   for (int i = 0; i < numVertices.getIntegerValue(); i++)
    convexPolygon2dForReading.addVertex(yoFramePoints.get(i).getFrameTuple2d());
   convexPolygon2dForReading.update();
 }
 catch (Exception e)
 {
   System.err.println("In YoFrameConvexPolygon2d.java: " + e.getClass().getSimpleName() + " while calling putYoValuesIntoFrameConvexPolygon2d().");
 }
}
origin: us.ihmc/IHMCRoboticsToolkit

/**
* This method does:
* 1- {@code clear(referenceFrame)};
* 2- {@code addVertices(otherPolygon)};
* 3- {@code update()}.
* <p/> TODO There is no need to call update() there, instead update everything from the other polygon to make it faster.<p/>
* @param referenceFrame {@code ReferenceFrame} the new reference frame of this polygon.
* @param otherPolygon {@code ConvexPolygon2d}
*/
public void setIncludingFrameAndUpdate(ReferenceFrame referenceFrame, ConvexPolygon2d otherPolygon)
{
 clear(referenceFrame);
 this.convexPolygon.addVertices(otherPolygon);
 update();
}
origin: us.ihmc/IHMCRoboticsToolkit

/**
* This method does:
* 1- {@code clear(vertices.get(0).getReferenceFrame())};
* 2- {@code addVerticesByProjectionOntoXYPlane(vertices, numberOfVertices)};
* 3- {@code update()}.
* @param referenceFrame {@code ReferenceFrame} the new reference frame of this polygon.
* @param vertices {@code List<FramePoint>} the list of points that is used to creates the vertices.
* @param numberOfVertices {@code int}.
* @throws ReferenceFrameMismatchException
*/
public void setIncludingFrameByProjectionOntoXYPlaneAndUpdate(ReferenceFrame referenceFrame, List<FramePoint> vertices, int numberOfVertices)
{
 clear(referenceFrame);
 addVerticesByProjectionOntoXYPlane(vertices, numberOfVertices);
 update();
}
origin: us.ihmc/IHMCRoboticsToolkit

/**
* This method does:
* 1- {@code clear()};
* 2- {@code addVertices(vertices, numberOfVertices)};
* 3- {@code update()}.
* @param vertices {@code List<FramePoint2d>} the list of points that is used to creates the vertices.
* @param numberOfVertices {@code int} that is used to determine the number of vertices of the polygon. Note the: {@code vertices.size()} can be greater or equal to numberOfVertices.
* @throws ReferenceFrameMismatchException
*/
public void setAndUpdate(List<FramePoint2d> vertices, int numberOfVertices)
{
 clear();
 addVertices(vertices, numberOfVertices);
 update();
}
origin: us.ihmc/IHMCRoboticsToolkit

/**
* This method does:
* 1- {@code clear()};
* 2- {@code addVertices(otherPolygon)};
* 3- {@code update()}.
* <p/> TODO There is no need to call update() there, instead update everything from the other polygon to make it faster.<p/>
* @param otherPolygon {@code FrameConvexPolygon2d}
* @throws ReferenceFrameMismatchException
*/
public void setAndUpdate(ConvexPolygon2d otherPolygon)
{
 clear();
 addVertices(otherPolygon);
 update();
}
origin: us.ihmc/IHMCRoboticsToolkit

/**
* This method does:
* 1- {@code clear()};
* 2- {@code addVerticesByProjectionOntoXYPlane(vertices, numberOfVertices)};
* 3- {@code update()}.
* @param vertices {@code List<FramePoint>} the list of points that is used to creates the vertices.
* @param numberOfVertices {@code int} that is used to determine the number of vertices of the polygon. Note the: {@code vertices.size()} can be greater or equal to numberOfVertices.
*/
public void setByProjectionOntoXYPlaneAndUpdate(List<FramePoint> vertices, int numberOfVertices)
{
 clear();
 addVerticesByProjectionOntoXYPlane(vertices, numberOfVertices);
 update();
}
origin: us.ihmc/IHMCRoboticsToolkit

/**
* This method does:
* 1- {@code clear()};
* 2- {@code addVertexByProjectionOntoXYPlane(vertices.get(i)};
* 3- {@code update()}.
* @param vertices {@code FramePoint[]} the array of points that is used to creates the vertices.
*/
public void setAndUpdate(FramePoint[] vertices)
{
 clear();
 for (int i = 0; i < vertices.length; i++)
 {
   addVertexByProjectionOntoXYPlane(vertices[i]);
 }
 update();
}
origin: us.ihmc/IHMCRoboticsToolkit

public boolean intersectionWith(FrameConvexPolygon2d secondConvexPolygon, FrameConvexPolygon2d intersectionToPack)
{
 checkReferenceFrameMatch(secondConvexPolygon);
 intersectionToPack.clear(secondConvexPolygon.getReferenceFrame());
 boolean success = convexPolygon.intersectionWith(secondConvexPolygon.convexPolygon, intersectionToPack.convexPolygon);
 return success;
}
origin: us.ihmc/CommonWalkingControlModules

public void computeSupportPolygon()
{
 contactPointsPolygon.clear(planeFrame);
 for (int i = 0; i < getTotalNumberOfContactPoints(); i++)
 {
   contactPoints.get(i).getPosition(tempContactPointPosition);
   contactPointsPolygon.addVertexByProjectionOntoXYPlane(tempContactPointPosition);
 }
 contactPointsPolygon.update();
}
origin: us.ihmc/IHMCRoboticsToolkit

/**
* This method does:
* 1- {@code clear(otherPolygon.getReferenceFrame())};
* 2- {@code addVertices(otherPolygon)};
* 3- {@code update()}.
* <p/> TODO There is no need to call update() there, instead update everything from the other polygon to make it faster.<p/>
* @param otherPolygon {@code FrameConvexPolygon2d}
*/
public void setIncludingFrameAndUpdate(FrameConvexPolygon2d otherPolygon)
{
 clear(otherPolygon.getReferenceFrame());
 addVertices(otherPolygon);
 update();
}
origin: us.ihmc/CommonWalkingControlModules

private void computeFootstepCentroid(FramePoint2d centroidToPack, Footstep footstep)
{
 predictedSupportPolygon.clear(footstep.getSoleReferenceFrame());
 addPredictedContactPointsToPolygon(footstep, predictedSupportPolygon);
 predictedSupportPolygon.update();
 predictedSupportPolygon.getCentroid(centroidToPack);
}
origin: us.ihmc/CommonWalkingControlModules

private void computePredictedSupportCentroid(FramePoint2d centroidToPack, Footstep footstep, Footstep nextFootstep)
{
 predictedSupportPolygon.clear(worldFrame);
 addPredictedContactPointsToPolygon(footstep, predictedSupportPolygon);
 addPredictedContactPointsToPolygon(nextFootstep, predictedSupportPolygon);
 predictedSupportPolygon.update();
 predictedSupportPolygon.getCentroid(centroidToPack);
}
origin: us.ihmc/IHMCRoboticsToolkit

  public static boolean combineDisjointPolygons(FrameConvexPolygon2d polygon1, FrameConvexPolygon2d polygon2, FrameConvexPolygon2d combinedPolygonToPack,
     FrameLineSegment2d connectingEdge1ToPack, FrameLineSegment2d connectingEdge2ToPack)
  {
   combinedPolygonToPack.clear(polygon1.getReferenceFrame());
   combinedPolygonToPack.checkReferenceFrameMatch(connectingEdge1ToPack);
   combinedPolygonToPack.checkReferenceFrameMatch(connectingEdge2ToPack);

   boolean success = combineDisjointPolygons(polygon1.convexPolygon, polygon2.convexPolygon, combinedPolygonToPack.convexPolygon,
      connectingEdge1ToPack.lineSegment, connectingEdge2ToPack.lineSegment);

   if (!success)
     return false;

//      combinedPolygonToPack.updateFramePoints();
   combinedPolygonToPack.update();

   return true;
  }

origin: us.ihmc/IHMCRoboticsToolkit

  public void shrinkConstantDistanceInto(FrameConvexPolygon2d polygonQ, double distance, FrameConvexPolygon2d framePolygonToPack)
  {      
   if (Math.abs(distance) < 1.0e-10)
   {
     framePolygonToPack.setIncludingFrameAndUpdate(polygonQ);
     return;
   }
   
   framePolygonToPack.clear(polygonQ.getReferenceFrame());
   framePolygonToPack.update();
   ConvexPolygon2d polygon2dToPack = framePolygonToPack.getConvexPolygon2d();
   shrinkConstantDistanceInto(polygonQ.getConvexPolygon2dCopy(), distance, polygon2dToPack);
//      framePolygonToPack.updateFramePoints();
   framePolygonToPack.update();
  }
}
origin: us.ihmc/CommonWalkingControlModules

private void fitLine()
{
 if (!footCoPOccupancyGrid.fitLineToData(line))
   return;
 lineL.setIncludingFrame(line);
 lineL.shiftToLeft(width/2.0);
 lineR.setIncludingFrame(line);
 lineR.shiftToRight(width/2.0);
 backupFootPolygon.set(shrunkFootPolygon);
 shrunkFootPolygon.clear();
 shrunkFootPolygon.addVertices(defaultFootPolygon.intersectionWith(lineL));
 shrunkFootPolygon.addVertices(defaultFootPolygon.intersectionWith(lineR));
 shrunkFootPolygon.update();
}
us.ihmc.robotics.geometryFrameConvexPolygon2dclear

Javadoc

After calling this method, the polygon has no vertex, area, or centroid. Note that calling that method doesn't generate garbage.

Popular methods of FrameConvexPolygon2d

  • <init>
    Creates an empty convex polygon attached to a reference frame, adds N new vertices using an array of
  • getNumberOfVertices
  • changeFrameAndProjectToXYPlane
  • getFrameVertex
  • isPointInside
    isPointInside Determines whether a point is inside the convex polygon (point in polygon test). Uses
  • getConvexPolygon2d
  • getVertex
  • intersectionWith
  • setIncludingFrameAndUpdate
    This method does: 1- clear(referenceFrame); 2- addVertices(vertices); 3- update().
  • addVertex
    Add a vertex to this polygon. Note that this method recycles memory.
  • addVertexByProjectionOntoXYPlane
    Add a vertex to this polygon after doing newVertex2d.changeFrameAndProjectToXYPlane(this.referenceFr
  • addVertices
  • addVertexByProjectionOntoXYPlane,
  • addVertices,
  • getCentroid,
  • getReferenceFrame,
  • isEmpty,
  • orthogonalProjection,
  • scale,
  • update,
  • addVertexAndChangeFrame

Popular in Java

  • Running tasks concurrently on multiple threads
  • addToBackStack (FragmentTransaction)
  • onCreateOptionsMenu (Activity)
  • onRequestPermissionsResult (Fragment)
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • Reference (javax.naming)
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now