Package org.robwork.sdurw_geometry
Class BSpherePtr
- java.lang.Object
-
- org.robwork.sdurw_geometry.BSpherePtr
-
public class BSpherePtr extends java.lang.Object
Ptr stores a pointer and optionally takes ownership of the value.
-
-
Constructor Summary
Constructors Constructor Description BSpherePtr()
Default constructor yielding a NULL-pointer.BSpherePtr(long cPtr, boolean cMemoryOwn)
BSpherePtr(BSphere ptr)
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description BSphere
__ref__()
Dereferencing operator.double
calcArea()
get the surface areadouble
calcVolume()
get the volumeBSphereCPtr
cptr()
void
delete()
BSphere
deref()
The pointer stored in the object.boolean
equals(BSphere p)
BSphere
fitEigen(GeometryDataPtr tris)
BSphere
fitEigen(TriMesh tris)
fit a sphere in $O(n)$ to a triangle mesh using Principal Component Analysis (PCA)
where the eigen values of the vertices are used to compute the center of the sphere
using the vector with the maximum spread (largest eigenvalue).BSphere
fitEigen(TriMeshPtr tris)
static long
getCPtr(BSpherePtr obj)
BSphere
getDeref()
Member access operator.Vector3D
getPosition()
get the position of the sphere centerdouble
getRadius()
get the sphere radiusdouble
getRadiusSqr()
get the sphere radius^2boolean
isNull()
checks if the pointer is nullboolean
isShared()
check if this Ptr has shared ownership or none
ownershipvoid
setPosition(Vector3D p3d)
set the sphere center coordinatejava.lang.String
toString()
-
-
-
Constructor Detail
-
BSpherePtr
public BSpherePtr(long cPtr, boolean cMemoryOwn)
-
BSpherePtr
public BSpherePtr()
Default constructor yielding a NULL-pointer.
-
BSpherePtr
public BSpherePtr(BSphere ptr)
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
-
-
Method Detail
-
getCPtr
public static long getCPtr(BSpherePtr obj)
-
delete
public void delete()
-
deref
public BSphere deref()
The pointer stored in the object.
-
__ref__
public BSphere __ref__()
Dereferencing operator.
-
getDeref
public BSphere getDeref()
Member access operator.
-
equals
public boolean equals(BSphere 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
-
cptr
public BSphereCPtr cptr()
-
getPosition
public Vector3D getPosition()
get the position of the sphere center- Returns:
- a Vector3D with the center coordinates
-
setPosition
public void setPosition(Vector3D p3d)
set the sphere center coordinate- Parameters:
p3d
- [in] the new center coordinates
-
getRadius
public double getRadius()
get the sphere radius- Returns:
- sphere radius
-
getRadiusSqr
public double getRadiusSqr()
get the sphere radius^2- Returns:
- sphere radius^2
-
calcArea
public double calcArea()
get the surface area- Returns:
- surface area
-
calcVolume
public double calcVolume()
get the volume- Returns:
- volume
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
fitEigen
public BSphere fitEigen(TriMesh tris)
fit a sphere in $O(n)$ to a triangle mesh using Principal Component Analysis (PCA)
where the eigen values of the vertices are used to compute the center of the sphere
using the vector with the maximum spread (largest eigenvalue).- Parameters:
tris
- [in] input mesh- Returns:
- bounding sphere
-
fitEigen
public BSphere fitEigen(TriMeshPtr tris)
-
fitEigen
public BSphere fitEigen(GeometryDataPtr tris)
-
-