Package org.robwork.sdurw_geometry
Class BSphere_fPtr
- java.lang.Object
-
- org.robwork.sdurw_geometry.BSphere_fPtr
-
public class BSphere_fPtr extends java.lang.ObjectPtr stores a pointer and optionally takes ownership of the value.
-
-
Constructor Summary
Constructors Constructor Description BSphere_fPtr()Default constructor yielding a NULL-pointer.BSphere_fPtr(long cPtr, boolean cMemoryOwn)BSphere_fPtr(BSphere_f 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_f__ref__()Dereferencing operator.floatcalcArea()get the surface areafloatcalcVolume()get the volumeBSphere_fCPtrcptr()voiddelete()BSphere_fderef()The pointer stored in the object.booleanequals(BSphere_f p)BSphere_ffitEigen(GeometryDataPtr tris)BSphere_ffitEigen(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_ffitEigen(TriMeshPtr tris)static longgetCPtr(BSphere_fPtr obj)BSphere_fgetDeref()Member access operator.Vector3DfgetPosition()get the position of the sphere centerfloatgetRadius()get the sphere radiusfloatgetRadiusSqr()get the sphere radius^2booleanisNull()checks if the pointer is nullbooleanisShared()check if this Ptr has shared ownership or none
ownershipvoidsetPosition(Vector3Df p3d)set the sphere center coordinatejava.lang.StringtoString()
-
-
-
Constructor Detail
-
BSphere_fPtr
public BSphere_fPtr(long cPtr, boolean cMemoryOwn)
-
BSphere_fPtr
public BSphere_fPtr()
Default constructor yielding a NULL-pointer.
-
BSphere_fPtr
public BSphere_fPtr(BSphere_f ptr)
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
-
-
Method Detail
-
getCPtr
public static long getCPtr(BSphere_fPtr obj)
-
delete
public void delete()
-
deref
public BSphere_f deref()
The pointer stored in the object.
-
__ref__
public BSphere_f __ref__()
Dereferencing operator.
-
getDeref
public BSphere_f getDeref()
Member access operator.
-
equals
public boolean equals(BSphere_f 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 BSphere_fCPtr cptr()
-
getPosition
public Vector3Df getPosition()
get the position of the sphere center- Returns:
- a Vector3D with the center coordinates
-
setPosition
public void setPosition(Vector3Df p3d)
set the sphere center coordinate- Parameters:
p3d- [in] the new center coordinates
-
getRadius
public float getRadius()
get the sphere radius- Returns:
- sphere radius
-
getRadiusSqr
public float getRadiusSqr()
get the sphere radius^2- Returns:
- sphere radius^2
-
calcArea
public float calcArea()
get the surface area- Returns:
- surface area
-
calcVolume
public float calcVolume()
get the volume- Returns:
- volume
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
fitEigen
public BSphere_f 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_f fitEigen(TriMeshPtr tris)
-
fitEigen
public BSphere_f fitEigen(GeometryDataPtr tris)
-
-