Package org.robwork.sdurw_kinematics
Class StateSetupPtr
- java.lang.Object
-
- org.robwork.sdurw_kinematics.StateSetupPtr
-
public class StateSetupPtr extends java.lang.ObjectPtr stores a pointer and optionally takes ownership of the value.
-
-
Constructor Summary
Constructors Constructor Description StateSetupPtr()Default constructor yielding a NULL-pointer.StateSetupPtr(long cPtr, boolean cMemoryOwn)StateSetupPtr(StateSetup 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 StateSetup__ref__()Dereferencing operator.StateSetupCPtrcptr()voiddelete()StateSetupderef()The pointer stored in the object.booleanequals(StateSetup p)intgetCacheIdx(int id)Get the position in cache list where state data with id is stored.intgetCacheIdx(StateData data)Get the position in cache list where data is stored.intgetChildListIdx(FrameCPtr parent)gets the index that maps a frame parent into
all its daf children.static longgetCPtr(StateSetupPtr obj)intgetDAFIdx(FrameCPtr daf)gets the index that maps a DAF into its
position in the TreeState daf listFrameVectorgetDafs()gets the list of DAFs that are valid in this state setupStateSetupgetDeref()Member access operator.FramegetFrame(int id)gets the frame with index idxintgetMaxCacheIdx()Get the maximum number of caches possible.intgetMaxChildListIdx()gets the number of valid frames in the state setupintgetMaxDAFIdx()gets the nr of valid DAFs in the state setupintgetOffset(StateData data)The position in QState at which the configuration for frame
is stored.VectorStateDataPtrgetStateData()gets all valid state data of the state setup.StateStructuregetTree()gets the state structure that the state setup is part
of.intgetVersion()gets the version of the StateSetupbooleanisNull()checks if the pointer is nullbooleanisShared()check if this Ptr has shared ownership or none
ownershipintsize()The total number of doubles allocated by all valid
state data in the StateSetup.
-
-
-
Constructor Detail
-
StateSetupPtr
public StateSetupPtr(long cPtr, boolean cMemoryOwn)
-
StateSetupPtr
public StateSetupPtr()
Default constructor yielding a NULL-pointer.
-
StateSetupPtr
public StateSetupPtr(StateSetup ptr)
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
-
-
Method Detail
-
getCPtr
public static long getCPtr(StateSetupPtr obj)
-
delete
public void delete()
-
deref
public StateSetup deref()
The pointer stored in the object.
-
__ref__
public StateSetup __ref__()
Dereferencing operator.
-
getDeref
public StateSetup getDeref()
Member access operator.
-
equals
public boolean equals(StateSetup 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 StateSetupCPtr cptr()
-
getOffset
public int getOffset(StateData data)
The position in QState at which the configuration for frame
is stored.
-
getCacheIdx
public int getCacheIdx(StateData data)
Get the position in cache list where data is stored.- Parameters:
data- [in] the data to look for.- Returns:
- the id or a negative value if not found.
-
getCacheIdx
public int getCacheIdx(int id)
Get the position in cache list where state data with id is stored.- Parameters:
id- [in] state data id.- Returns:
- the id or a negative value if not found.
-
size
public int size()
The total number of doubles allocated by all valid
state data in the StateSetup.- Returns:
- the total number of allocated doubles
Note: This number equals the length of the QState array.
-
getVersion
public int getVersion()
gets the version of the StateSetup- Returns:
- the version of the state setup
-
getFrame
public Frame getFrame(int id)
gets the frame with index idx- Parameters:
id- [in] the unique id of the frame- Returns:
- the frame with id id, else NULL
-
getChildListIdx
public int getChildListIdx(FrameCPtr parent)
gets the index that maps a frame parent into
all its daf children.- Parameters:
parent- [in] the parent to the children list- Returns:
- index into the childlist array in tree state
-
getMaxChildListIdx
public int getMaxChildListIdx()
gets the number of valid frames in the state setup
-
getDafs
public FrameVector getDafs()
gets the list of DAFs that are valid in this state setup- Returns:
- list of DAFs
-
getDAFIdx
public int getDAFIdx(FrameCPtr daf)
gets the index that maps a DAF into its
position in the TreeState daf list- Parameters:
daf- [in] the daf frame- Returns:
- index into the TreeState daf list
-
getMaxDAFIdx
public int getMaxDAFIdx()
gets the nr of valid DAFs in the state setup- Returns:
- nr of valid DAFs
-
getTree
public StateStructure getTree()
gets the state structure that the state setup is part
of.- Returns:
- state structure
-
getStateData
public VectorStateDataPtr getStateData()
gets all valid state data of the state setup.- Returns:
- list of valid state datas
Note: elements in the list is invalid if they are NULL
-
getMaxCacheIdx
public int getMaxCacheIdx()
Get the maximum number of caches possible.- Returns:
- number of caches.
-
-