Package org.robwork.sdurw
Class ObjectPtr
- java.lang.Object
-
- org.robwork.sdurw.ObjectPtr
-
public class ObjectPtr extends java.lang.Object
Ptr stores a pointer and optionally takes ownership of the value.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
__ref__()
Dereferencing operator.void
addFrame(Frame frame)
associate a frame to this Object.void
delete()
Object
deref()
The pointer stored in the object.boolean
equals(Object p)
Frame
getBase()
get base frame of this objectVector3Dd
getCOM(State state)
get center of mass of this objectstatic long
getCPtr(ObjectPtr obj)
Object
getDeref()
Member access operator.FrameVector
getFrames()
get all associated frames of this objectGeometryPtrVector
getGeometry()
get default geometriesGeometryPtrVector
getGeometry(State state)
get geometry of this objectInertiaMatrixd
getInertia(State state)
returns the inertia matrix of this body calculated around COM with the orientation
of the base frame.double
getMass(State state)
get mass in Kg of this objectModel3DPtrVector
getModels()
get the default modelsModel3DPtrVector
getModels(State state)
get visualization models of this objectjava.lang.String
getName()
get name of this object.StateStructurePtr
getStateStructure()
Get the state structure.boolean
isNull()
checks if the pointer is nullboolean
isRegistered()
Check if object has registered its state.boolean
isShared()
check if this Ptr has shared ownership or none
ownershipvoid
registerIn(State state)
initialize this stateless data to a specific statevoid
registerIn(StateStructurePtr state)
register this stateless object in a statestructure.void
unregister()
unregisters all state data of this stateless object
-
-
-
Constructor Detail
-
ObjectPtr
public ObjectPtr(long cPtr, boolean cMemoryOwn)
-
ObjectPtr
public ObjectPtr()
Default constructor yielding a NULL-pointer.
-
ObjectPtr
public ObjectPtr(Object ptr)
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
-
-
Method Detail
-
getCPtr
public static long getCPtr(ObjectPtr obj)
-
delete
public void delete()
-
deref
public Object deref()
The pointer stored in the object.
-
__ref__
public Object __ref__()
Dereferencing operator.
-
getDeref
public Object getDeref()
Member access operator.
-
equals
public boolean equals(Object 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
-
getName
public java.lang.String getName()
get name of this object. Name is always the same as the name of the
base frame.- Returns:
- name of object.
-
getBase
public Frame getBase()
get base frame of this object- Returns:
- base frame of object
-
getFrames
public FrameVector getFrames()
get all associated frames of this object- Returns:
- a vector of frames
-
addFrame
public void addFrame(Frame frame)
associate a frame to this Object.- Parameters:
frame
- [in] frame to associate to object
-
getGeometry
public GeometryPtrVector getGeometry()
get default geometries- Returns:
- geometry for collision detection
-
getGeometry
public GeometryPtrVector getGeometry(State state)
get geometry of this object- Returns:
- geometry for collision detection.
-
getModels
public Model3DPtrVector getModels()
get the default models- Returns:
- models for vizualization
-
getModels
public Model3DPtrVector getModels(State state)
get visualization models of this object- Returns:
- models for visualization
-
getMass
public double getMass(State state)
get mass in Kg of this object- Returns:
- mass in kilo grams
-
getCOM
public Vector3Dd getCOM(State state)
get center of mass of this object- Parameters:
state
- [in] the state in which to get center of mass- Returns:
-
getInertia
public InertiaMatrixd getInertia(State state)
returns the inertia matrix of this body calculated around COM with the orientation
of the base frame.
-
registerIn
public void registerIn(State state)
initialize this stateless data to a specific state- Parameters:
state
- [in] the state in which to register the data.
Note: the data will be registered in the state structure of the state
and any copies or other instances of the state will therefore also
contain the added states.
-
registerIn
public void registerIn(StateStructurePtr state)
register this stateless object in a statestructure.
-
unregister
public void unregister()
unregisters all state data of this stateless object
-
getStateStructure
public StateStructurePtr getStateStructure()
Get the state structure.- Returns:
- the state structure.
-
isRegistered
public boolean isRegistered()
Check if object has registered its state.- Returns:
- true if registered, false otherwise.
-
-