Class PlaneCPtr


  • public class PlaneCPtr
    extends java.lang.Object
    Ptr stores a pointer and optionally takes ownership of the value.
    • Constructor Summary

      Constructors 
      Constructor Description
      PlaneCPtr()
      Default constructor yielding a NULL-pointer.
      PlaneCPtr​(long cPtr, boolean cMemoryOwn)  
      PlaneCPtr​(Plane ptr)
      Do not take ownership of ptr.

      ptr can be null.

      The constructor is implicit on purpose.
    • Constructor Detail

      • PlaneCPtr

        public PlaneCPtr​(long cPtr,
                         boolean cMemoryOwn)
      • PlaneCPtr

        public PlaneCPtr()
        Default constructor yielding a NULL-pointer.
      • PlaneCPtr

        public PlaneCPtr​(Plane ptr)
        Do not take ownership of ptr.

        ptr can be null.

        The constructor is implicit on purpose.
    • Method Detail

      • getCPtr

        public static long getCPtr​(PlaneCPtr obj)
      • delete

        public void delete()
      • deref

        public Plane deref()
        The pointer stored in the object.
      • __ref__

        public Plane __ref__()
        Dereferencing operator.
      • getDeref

        public Plane getDeref()
        Member access operator.
      • equals

        public boolean equals​(Plane p)
      • isShared

        public boolean isShared()
        check if this Ptr has shared ownership or none
        ownership
        Returns:
        true if Ptr has shared ownership, false if it has no ownership.
      • isNull

        public boolean isNull()
        checks if the pointer is null
        Returns:
        Returns true if the pointer is null
      • distance

        public double distance​(Vector3D point)
        Calculates the shortest distance from point to plane.

        The distance includes the sign s.t. a negative distance corresponds to point
        being behind the plane and a positive distance in front of the plane.

        Parameters:
        point -
      • distance

        public double distance​(Plane plane)
        Default metric for computing the difference between 2 planes
        Parameters:
        plane - [in]
      • intersection

        public Vector3D intersection​(Vector3D p1,
                                     Vector3D p2)
        Calculates the intersection between the line and plane.

        The line defined by p1 and p2 is considered infinitely long.
        Throws a rw::core::Exception if the line is parallel to the plane.

        Parameters:
        p1 - [in] point 1 on the line
        p2 - [in] point 2 on the line
      • createMesh

        public TriMeshPtr createMesh​(int resolution)
      • createMesh

        public TriMeshPtr createMesh​(int resolution,
                                     double size)
        Create a triangle mesh representing the plane.

        Provides the posibility to specify the size of the plan.
        Parameters:
        resolution - [in] Resolution of the mesh (not applicable for a plane)
        size - [in] Size of the plane.
      • getParameters

        public Q getParameters()