Package org.robwork.sdurw_geometry
Class GeometryUtilPtr
- java.lang.Object
-
- org.robwork.sdurw_geometry.GeometryUtilPtr
-
public class GeometryUtilPtr extends java.lang.Object
Ptr stores a pointer and optionally takes ownership of the value.
-
-
Constructor Summary
Constructors Constructor Description GeometryUtilPtr()
Default constructor yielding a NULL-pointer.GeometryUtilPtr(long cPtr, boolean cMemoryOwn)
GeometryUtilPtr(GeometryUtil 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 GeometryUtil
__ref__()
Dereferencing operator.double
calcMaxDist(VectorGeometryPtr geoms, Vector3D center, FramePtr ref, State state)
calculates the max distance to any triangle in the geoms, from some point
centerGeometryUtilCPtr
cptr()
void
delete()
GeometryUtil
deref()
The pointer stored in the object.boolean
equals(GeometryUtil p)
Vector3D
estimateCOG(TriMesh trimesh)
Estimates the center of gravity (COG) of a triangle mesh.Vector3D
estimateCOG(TriMesh trimesh, Transform3D t3d)
Estimates the center of gravity (COG) of a triangle mesh.Vector3D
estimateCOG(VectorGeometryPtr geoms)
Estimates the center of gravity (COG) of a list of geometries.
The COG will be found relative to the geometry frame.
Note: The geometries should be defined relative to the same frame - otherwise the
result will not make sense.
Vector3D
estimateCOG(VectorGeometryPtr geoms, FramePtr ref, State state)
Estimates the center of gravity (COG) of a list of geometries.
The COG will be given relative to the given reference frame.
InertiaMatrixd
estimateInertia(double mass, VectorGeometryPtr geoms)
Estimates the inertia of a list of geometries.
The inertia is described relative to the geometry reference frame.
The reftrans parameter can however be used to transform the geometries.
Note: The geometries should be defined relative to the same frame - otherwise the
result will not make sense.
InertiaMatrixd
estimateInertia(double mass, VectorGeometryPtr geoms, FramePtr ref, State state)
Estimates the inertia of a list of geometries.
The inertia is described relative to the ref coordinate system
The reftrans parameter can however be used to transform the geometries.
InertiaMatrixd
estimateInertia(double mass, VectorGeometryPtr geoms, FramePtr ref, State state, Transform3D reftrans)
Estimates the inertia of a list of geometries.
The inertia is described relative to the ref coordinate system
The reftrans parameter can however be used to transform the geometries.
InertiaMatrixd
estimateInertia(double mass, VectorGeometryPtr geoms, Transform3D reftrans)
Estimates the inertia of a list of geometries.
The inertia is described relative to the geometry reference frame.
The reftrans parameter can however be used to transform the geometries.
Note: The geometries should be defined relative to the same frame - otherwise the
result will not make sense.
SWIGTYPE_p_std__pairT_rw__math__Vector3DT_double_t_rw__math__InertiaMatrixT_double_t_t
estimateInertiaCOG(double mass, VectorGeometryPtr geoms, FramePtr ref, State state)
Estimates the inertia and center of gravity (COG) of a list of geometries.
The inertia is described relative to the ref coordinate system translated to COG.
The reftrans parameter can however be used to transform the geometries.
SWIGTYPE_p_std__pairT_rw__math__Vector3DT_double_t_rw__math__InertiaMatrixT_double_t_t
estimateInertiaCOG(double mass, VectorGeometryPtr geoms, FramePtr ref, State state, Transform3D reftrans)
Estimates the inertia and center of gravity (COG) of a list of geometries.
The inertia is described relative to the ref coordinate system translated to COG.
The reftrans parameter can however be used to transform the geometries.
double
estimateVolume(TriMesh trimesh)
Estimates the volume of a trimesh.double
estimateVolume(VectorGeometryPtr geoms)
Estimates the volume of a list of geometries.
Note: If geometries are overlapping, the overlapping regions will count twice in the
volume.FrameVector
getAnchoredChildFrames(FramePtr parent, State state)
util function that locates all frames in the sub tree of parent
that is staticly connected and that has geometry information.FrameVector
getAnchoredFrames(Frame f, State state)
util function that locates all frames that is staticly connected to f
and that has geometry information.static long
getCPtr(GeometryUtilPtr obj)
GeometryUtil
getDeref()
Member access operator.Vector3D
getDimensions(GeometryPtr geometry)
Returns the dimensions of geometryVector3D
getDimensions(TriMeshPtr trimesh)
Returns the dimensions of trimeshSWIGTYPE_p_std__pairT_rw__math__Vector3DT_double_t_rw__math__Vector3DT_double_t_t
getExtremumDistances(TriMeshPtr trimesh)
Returns the extremum distances for the vertices of the TriMesh given the specified
transformationSWIGTYPE_p_std__pairT_rw__math__Vector3DT_double_t_rw__math__Vector3DT_double_t_t
getExtremumDistances(TriMeshPtr trimesh, Transform3D t3d)
Returns the extremum distances for the vertices of the TriMesh given the specified
transformationboolean
isNull()
checks if the pointer is nullboolean
isShared()
check if this Ptr has shared ownership or none
ownership
-
-
-
Constructor Detail
-
GeometryUtilPtr
public GeometryUtilPtr(long cPtr, boolean cMemoryOwn)
-
GeometryUtilPtr
public GeometryUtilPtr()
Default constructor yielding a NULL-pointer.
-
GeometryUtilPtr
public GeometryUtilPtr(GeometryUtil ptr)
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
-
-
Method Detail
-
getCPtr
public static long getCPtr(GeometryUtilPtr obj)
-
delete
public void delete()
-
deref
public GeometryUtil deref()
The pointer stored in the object.
-
__ref__
public GeometryUtil __ref__()
Dereferencing operator.
-
getDeref
public GeometryUtil getDeref()
Member access operator.
-
equals
public boolean equals(GeometryUtil 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 GeometryUtilCPtr cptr()
-
estimateVolume
public double estimateVolume(VectorGeometryPtr geoms)
Estimates the volume of a list of geometries.
Note: If geometries are overlapping, the overlapping regions will count twice in the
volume.- Parameters:
geoms
- [in] the list of geometries.- Returns:
- the total volume of the geometries.
-
estimateVolume
public double estimateVolume(TriMesh trimesh)
Estimates the volume of a trimesh.- Parameters:
trimesh
- [in] the trimesh.- Returns:
- the total volume of the trimesh.
-
estimateInertiaCOG
public SWIGTYPE_p_std__pairT_rw__math__Vector3DT_double_t_rw__math__InertiaMatrixT_double_t_t estimateInertiaCOG(double mass, VectorGeometryPtr geoms, FramePtr ref, State state, Transform3D reftrans)
Estimates the inertia and center of gravity (COG) of a list of geometries.
The inertia is described relative to the ref coordinate system translated to COG.
The reftrans parameter can however be used to transform the geometries.
- Parameters:
mass
- [in] the total mass of all geometries.geoms
- [in] the list of geometries.ref
- [in] the reference frame for the geometries (if NULL, it is assumed that
the geometries are defined relative to the same frame).state
- [in] state used to retrieve the current location of geometries relative to
the reference frame (only used if ref is given).reftrans
- [in] (optional) used to transform the geometry before calculation of the
inertia.- Returns:
- the center of gravity relative to the ref frame and the inertia around
the center of gravity (in the coordinate frame of the ref frame).
-
estimateInertiaCOG
public SWIGTYPE_p_std__pairT_rw__math__Vector3DT_double_t_rw__math__InertiaMatrixT_double_t_t estimateInertiaCOG(double mass, VectorGeometryPtr geoms, FramePtr ref, State state)
Estimates the inertia and center of gravity (COG) of a list of geometries.
The inertia is described relative to the ref coordinate system translated to COG.
The reftrans parameter can however be used to transform the geometries.
- Parameters:
mass
- [in] the total mass of all geometries.geoms
- [in] the list of geometries.ref
- [in] the reference frame for the geometries (if NULL, it is assumed that
the geometries are defined relative to the same frame).state
- [in] state used to retrieve the current location of geometries relative to
the reference frame (only used if ref is given).
- Returns:
- the center of gravity relative to the ref frame and the inertia around
the center of gravity (in the coordinate frame of the ref frame).
-
estimateInertia
public InertiaMatrixd estimateInertia(double mass, VectorGeometryPtr geoms, FramePtr ref, State state, Transform3D reftrans)
Estimates the inertia of a list of geometries.
The inertia is described relative to the ref coordinate system
The reftrans parameter can however be used to transform the geometries.
- Parameters:
mass
- [in] the total mass of all geometries.geoms
- [in] the list of geometries.ref
- [in] the reference frame for the geometries (if NULL, it is assumed that
the geometries are defined relative to the same frame).state
- [in] state used to retrieve the current location of geometries relative to
the reference frame (only used if ref is given).reftrans
- [in] (optional) used to transform the geometry before calculation of the
inertia.- Returns:
- the inertia around relative to the ref frame.
-
estimateInertia
public InertiaMatrixd estimateInertia(double mass, VectorGeometryPtr geoms, FramePtr ref, State state)
Estimates the inertia of a list of geometries.
The inertia is described relative to the ref coordinate system
The reftrans parameter can however be used to transform the geometries.
- Parameters:
mass
- [in] the total mass of all geometries.geoms
- [in] the list of geometries.ref
- [in] the reference frame for the geometries (if NULL, it is assumed that
the geometries are defined relative to the same frame).state
- [in] state used to retrieve the current location of geometries relative to
the reference frame (only used if ref is given).
- Returns:
- the inertia around relative to the ref frame.
-
estimateInertia
public InertiaMatrixd estimateInertia(double mass, VectorGeometryPtr geoms, Transform3D reftrans)
Estimates the inertia of a list of geometries.
The inertia is described relative to the geometry reference frame.
The reftrans parameter can however be used to transform the geometries.
Note: The geometries should be defined relative to the same frame - otherwise the
result will not make sense.
- Parameters:
mass
- [in] the total mass of all geometries.geoms
- [in] the list of geometries.reftrans
- [in] (optional) used to transform the geometry before calculation of the
inertia.- Returns:
- the inertia matrix relative to the reference frame.
-
estimateInertia
public InertiaMatrixd estimateInertia(double mass, VectorGeometryPtr geoms)
Estimates the inertia of a list of geometries.
The inertia is described relative to the geometry reference frame.
The reftrans parameter can however be used to transform the geometries.
Note: The geometries should be defined relative to the same frame - otherwise the
result will not make sense.
- Parameters:
mass
- [in] the total mass of all geometries.geoms
- [in] the list of geometries.
- Returns:
- the inertia matrix relative to the reference frame.
-
estimateCOG
public Vector3D estimateCOG(VectorGeometryPtr geoms)
Estimates the center of gravity (COG) of a list of geometries.
The COG will be found relative to the geometry frame.
Note: The geometries should be defined relative to the same frame - otherwise the
result will not make sense.
- Parameters:
geoms
- [in] the list of geometries.- Returns:
- the center of gravity for the geometries.
-
estimateCOG
public Vector3D estimateCOG(VectorGeometryPtr geoms, FramePtr ref, State state)
Estimates the center of gravity (COG) of a list of geometries.
The COG will be given relative to the given reference frame.
- Parameters:
geoms
- [in] the list of geometries.ref
- [in] the reference frame.state
- [in] the state which gives the position of the geometries relative to the
reference frame.- Returns:
- the center of gravity for the geometries.
-
estimateCOG
public Vector3D estimateCOG(TriMesh trimesh, Transform3D t3d)
Estimates the center of gravity (COG) of a triangle mesh.- Parameters:
trimesh
- [in] the triangle mesh.t3d
- [in] (optional) make a transformation of the trimesh.- Returns:
- the center of gravity of the mesh.
-
estimateCOG
public Vector3D estimateCOG(TriMesh trimesh)
Estimates the center of gravity (COG) of a triangle mesh.- Parameters:
trimesh
- [in] the triangle mesh.
- Returns:
- the center of gravity of the mesh.
-
calcMaxDist
public double calcMaxDist(VectorGeometryPtr geoms, Vector3D center, FramePtr ref, State state)
calculates the max distance to any triangle in the geoms, from some point
center- Parameters:
geoms
- [in] the geometries containing the trianglescenter
- [in] the point to calculate the distance fromref
- [in] the reference frame.state
-- Returns:
- the maximum distance to any triangle in the geometries
-
getAnchoredFrames
public FrameVector getAnchoredFrames(Frame f, State state)
util function that locates all frames that is staticly connected to f
and that has geometry information.
-
getAnchoredChildFrames
public FrameVector getAnchoredChildFrames(FramePtr parent, State state)
util function that locates all frames in the sub tree of parent
that is staticly connected and that has geometry information.
-
getExtremumDistances
public SWIGTYPE_p_std__pairT_rw__math__Vector3DT_double_t_rw__math__Vector3DT_double_t_t getExtremumDistances(TriMeshPtr trimesh, Transform3D t3d)
Returns the extremum distances for the vertices of the TriMesh given the specified
transformation- Parameters:
trimesh
- [in] TriMesh to find extremum distances fort3d
- [in] Transformation of the vertices- Returns:
- Pair containing the lower and upper extremum distances of the vertices.
-
getExtremumDistances
public SWIGTYPE_p_std__pairT_rw__math__Vector3DT_double_t_rw__math__Vector3DT_double_t_t getExtremumDistances(TriMeshPtr trimesh)
Returns the extremum distances for the vertices of the TriMesh given the specified
transformation- Parameters:
trimesh
- [in] TriMesh to find extremum distances for
- Returns:
- Pair containing the lower and upper extremum distances of the vertices.
-
getDimensions
public Vector3D getDimensions(GeometryPtr geometry)
Returns the dimensions of geometry- Parameters:
geometry
- [in] Geometry to analyse- Returns:
- Dimensions in the x,y and z directions.
-
getDimensions
public Vector3D getDimensions(TriMeshPtr trimesh)
Returns the dimensions of trimesh- Parameters:
trimesh
- [in] TriMesh to analyse- Returns:
- Dimensions in the x,y and z directions.
-
-