Package org.robwork.sdurw_models
Class WorkCellCPtr
- java.lang.Object
-
- org.robwork.sdurw_models.WorkCellCPtr
-
public class WorkCellCPtr extends java.lang.Object
Ptr stores a pointer and optionally takes ownership of the value.
-
-
Constructor Summary
Constructors Constructor Description WorkCellCPtr()
Default constructor yielding a NULL-pointer.WorkCellCPtr(long cPtr, boolean cMemoryOwn)
WorkCellCPtr(WorkCell 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 WorkCell
__ref__()
Dereferencing operator.void
delete()
WorkCell
deref()
The pointer stored in the object.boolean
equals(WorkCell p)
ControllerModelPtr
findController(java.lang.String name)
Returns controller with the specified name.
If multiple controlelrs has the same name, the first controller
encountered will be returned.DevicePtr
findDevice(java.lang.String name)
The device named name of the workcell.
NULL is returned if there is no such device.
Frame
findFrame(java.lang.String name)
Returns frame with the specified name.
If multiple frames has the same name, the first frame encountered
will be returned.ObjectPtr
findObject(java.lang.String name)
The object named name of the workcell.
NULL is returned if there is no such object.
SensorModelPtr
findSensor(java.lang.String name)
Returns sensor with the specified name.
If multiple sensors has the same name, the first sensor
encountered will be returned.java.lang.String
getCalibrationFilename()
Returns the filename of the calibration associated to the
work cell.
Returns an empty string in case no calibration is associated.
To load the file use the getFilePath()+getCalibrationFilename()
to get the absolute locationControllerModelPtrVector
getControllers()
Returns all controllers in workcellstatic long
getCPtr(WorkCellCPtr obj)
State
getDefaultState()
Returns a default StateWorkCell
getDeref()
Member access operator.DevicePtrVector
getDevices()
Returns a reference to a vector with pointers to the
Device(s) in the WorkCell
java.lang.String
getFilename()
Returns the full path and filename of the workcell.
If the workcell is loaded from file, then this method returns the
full filename.java.lang.String
getFilePath()
Returns the path of where the work cell is located
If the workcell is not loaded from file, it returns an empty
stringFrameVector
getFrames()
Returns all frames in workcelljava.lang.String
getName()
The name of the workcell or the empty string if no name
was provided.ObjectPtrVector
getObjects()
Returns all object in the work cell
VectorSensorModelPtr
getSensors()
Returns all frames in workcellFrame
getWorldFrame()
Returns pointer to the world frame
boolean
isNull()
checks if the pointer is nullboolean
isShared()
check if this Ptr has shared ownership or none
ownership
-
-
-
Constructor Detail
-
WorkCellCPtr
public WorkCellCPtr(long cPtr, boolean cMemoryOwn)
-
WorkCellCPtr
public WorkCellCPtr()
Default constructor yielding a NULL-pointer.
-
WorkCellCPtr
public WorkCellCPtr(WorkCell ptr)
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
-
-
Method Detail
-
getCPtr
public static long getCPtr(WorkCellCPtr obj)
-
delete
public void delete()
-
deref
public WorkCell deref()
The pointer stored in the object.
-
__ref__
public WorkCell __ref__()
Dereferencing operator.
-
getDeref
public WorkCell getDeref()
Member access operator.
-
equals
public boolean equals(WorkCell 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()
The name of the workcell or the empty string if no name
was provided.- Returns:
- the name of the workcell
-
getWorldFrame
public Frame getWorldFrame()
Returns pointer to the world frame
- Returns:
- Pointer to the world frame
-
getDevices
public DevicePtrVector getDevices()
Returns a reference to a vector with pointers to the
Device(s) in the WorkCell
- Returns:
- const vector with pointers to rw::models::Device(s).
-
findFrame
public Frame findFrame(java.lang.String name)
Returns frame with the specified name.
If multiple frames has the same name, the first frame encountered
will be returned. If no frame is found, the method returns NULL.
- Parameters:
name
- [in] name of Frame.
- Returns:
- The frame with name name or NULL if no such frame.
-
getFrames
public FrameVector getFrames()
Returns all frames in workcell- Returns:
- List of all frames
-
findDevice
public DevicePtr findDevice(java.lang.String name)
The device named name of the workcell.
NULL is returned if there is no such device.
- Parameters:
name
- [in] The device name
- Returns:
- The device named name or NULL if no such device.
-
getDefaultState
public State getDefaultState()
Returns a default State- Returns:
- default State
-
findSensor
public SensorModelPtr findSensor(java.lang.String name)
Returns sensor with the specified name.
If multiple sensors has the same name, the first sensor
encountered will be returned. If no sensor is found, the method
returns NULL.
- Parameters:
name
- [in] name of sensor.
- Returns:
- The sensor with name name or NULL if no such sensor.
-
getSensors
public VectorSensorModelPtr getSensors()
Returns all frames in workcell- Returns:
- List of all frames
-
findController
public ControllerModelPtr findController(java.lang.String name)
Returns controller with the specified name.
If multiple controlelrs has the same name, the first controller
encountered will be returned. If no controller is found, the
method returns NULL.
- Parameters:
name
- [in] name of controller.
- Returns:
- The controller with name name or NULL if no such
controller.
-
getControllers
public ControllerModelPtrVector getControllers()
Returns all controllers in workcell- Returns:
- List of all controllers
-
getObjects
public ObjectPtrVector getObjects()
Returns all object in the work cell
- Returns:
- All object in work cell
-
findObject
public ObjectPtr findObject(java.lang.String name)
The object named name of the workcell.
NULL is returned if there is no such object.
- Parameters:
name
- [in] The object name
- Returns:
- The object named name or NULL if no such object.
-
getFilename
public java.lang.String getFilename()
Returns the full path and filename of the workcell.
If the workcell is loaded from file, then this method returns the
full filename. Otherwise it returns an empty string.
-
getFilePath
public java.lang.String getFilePath()
Returns the path of where the work cell is located
If the workcell is not loaded from file, it returns an empty
string
-
getCalibrationFilename
public java.lang.String getCalibrationFilename()
Returns the filename of the calibration associated to the
work cell.
Returns an empty string in case no calibration is associated.
To load the file use the getFilePath()+getCalibrationFilename()
to get the absolute location
-
-