Package org.robwork.sdurw_geometry
Class Model3DPtr
- java.lang.Object
-
- org.robwork.sdurw_geometry.Model3DPtr
-
public class Model3DPtr extends java.lang.Object
Ptr stores a pointer and optionally takes ownership of the value.
-
-
Constructor Summary
Constructors Constructor Description Model3DPtr()
Default constructor yielding a NULL-pointer.Model3DPtr(long cPtr, boolean cMemoryOwn)
Model3DPtr(Model3D 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 Model3D
__ref__()
Dereferencing operator.void
addGeometry(Model3D.Material mat, GeometryPtr geom)
add geometry to this model3dint
addMaterial(Model3D.Material mat)
all objects in a model use the materials defined on the modelint
addObject(SWIGTYPE_p_rw__core__PtrT_rw__geometry__Object3DGeneric_t obj)
add an Object to this Model3Dvoid
addTriMesh(Model3D.Material mat, TriMesh mesh)
add a triangle mesh to this model3dvoid
addTriMesh(Model3D.Material mat, TriMeshCPtr geom)
add a triangle mesh to this model3dModel3DCPtr
cptr()
void
delete()
Model3D
deref()
The pointer stored in the object.boolean
equals(Model3D p)
SWIGTYPE_p_std__vectorT_rw__geometry__Model3D__Material_t
get_materials()
The array of materials.SWIGTYPE_p_std__vectorT_rw__core__PtrT_rw__geometry__Object3DGeneric_t_t
get_objects()
The array of objects in the modelstatic long
getCPtr(Model3DPtr obj)
Model3D
getDeref()
Member access operator.java.lang.String
getFilePath()
get filePath of this model3dint
getMask()
get mask of this model3dModel3D.Material
getMaterial(java.lang.String matid)
get material with string id matidSWIGTYPE_p_std__vectorT_rw__geometry__Model3D__Material_t
getMaterials()
get all materials that are available in this modeljava.lang.String
getName()
get string identifier of this model3dSWIGTYPE_p_std__vectorT_rw__core__PtrT_rw__geometry__Object3DGeneric_t_t
getObjects()
get all objects that make out this modelSWIGTYPE_p_std__vectorT_rw__core__PtrT_rw__geometry__Model3D__Texture_t_t
getTextures()
Get/set the object TexturesTransform3D
getTransform()
get pose of this Model3Dboolean
hasMaterial(java.lang.String matid)
check if model has material with id matidboolean
isDynamic()
true if data in the model are expected to changeboolean
isNull()
checks if the pointer is nullboolean
isShared()
check if this Ptr has shared ownership or none
ownershipvoid
optimize(double smooth_angle)
optimize vertices and vertice normals
removes redundant vertices and recalculates all vertice normals based on the face normals
and the angle between face normals smooth_angle.void
optimize(double smooth_angle, Model3D.SmoothMethod method)
optimize vertices and vertice normals
removes redundant vertices and recalculates all vertice normals based on the face normals
and the angle between face normals smooth_angle.void
removeObject(java.lang.String name)
remove object with string id namevoid
scale(float scale)
void
set_materials(SWIGTYPE_p_std__vectorT_rw__geometry__Model3D__Material_t value)
The array of materials.void
set_objects(SWIGTYPE_p_std__vectorT_rw__core__PtrT_rw__geometry__Object3DGeneric_t_t value)
The array of objects in the modelvoid
setDynamic(boolean dynamic)
set to true if data in the model are expected to changevoid
setFilePath(java.lang.String name)
set filePath this model3dvoid
setMask(int mask)
set mask of this model3dvoid
setName(java.lang.String name)
set string identifier of this model3dvoid
setTransform(Transform3D t3d)
set the pose of this Model3DGeometryDataPtr
toGeometryData()
convert this model3d to a geometry.
-
-
-
Constructor Detail
-
Model3DPtr
public Model3DPtr(long cPtr, boolean cMemoryOwn)
-
Model3DPtr
public Model3DPtr()
Default constructor yielding a NULL-pointer.
-
Model3DPtr
public Model3DPtr(Model3D ptr)
Do not take ownership of ptr.
ptr can be null.
The constructor is implicit on purpose.
-
-
Method Detail
-
getCPtr
public static long getCPtr(Model3DPtr obj)
-
delete
public void delete()
-
deref
public Model3D deref()
The pointer stored in the object.
-
__ref__
public Model3D __ref__()
Dereferencing operator.
-
getDeref
public Model3D getDeref()
Member access operator.
-
equals
public boolean equals(Model3D 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 Model3DCPtr cptr()
-
optimize
public void optimize(double smooth_angle, Model3D.SmoothMethod method)
optimize vertices and vertice normals
removes redundant vertices and recalculates all vertice normals based on the face normals
and the angle between face normals smooth_angle.- Parameters:
smooth_angle
-method
-
-
optimize
public void optimize(double smooth_angle)
optimize vertices and vertice normals
removes redundant vertices and recalculates all vertice normals based on the face normals
and the angle between face normals smooth_angle.- Parameters:
smooth_angle
-
-
addObject
public int addObject(SWIGTYPE_p_rw__core__PtrT_rw__geometry__Object3DGeneric_t obj)
add an Object to this Model3D- Parameters:
obj
- [in] the geometric object to add.- Returns:
- index of object in model3d
-
addGeometry
public void addGeometry(Model3D.Material mat, GeometryPtr geom)
add geometry to this model3d- Parameters:
mat
- [in] the material properties to use for the geometry.geom
- [in] the geometry to add.
-
addTriMesh
public void addTriMesh(Model3D.Material mat, TriMesh mesh)
add a triangle mesh to this model3d- Parameters:
mat
- [in] the material properties to use for the mesh.mesh
- [in] the mesh geometry.
-
addTriMesh
public void addTriMesh(Model3D.Material mat, TriMeshCPtr geom)
add a triangle mesh to this model3d- Parameters:
mat
- [in] the material properties to use for the mesh.geom
- [in] the mesh geometry.
-
addMaterial
public int addMaterial(Model3D.Material mat)
all objects in a model use the materials defined on the model- Parameters:
mat
- [in] material to add.- Returns:
- id of the newly added material.
-
getMaterial
public Model3D.Material getMaterial(java.lang.String matid)
get material with string id matid- Parameters:
matid
- [in] string id- Returns:
- pointer to Matrial data
-
hasMaterial
public boolean hasMaterial(java.lang.String matid)
check if model has material with id matid- Parameters:
matid
- [in] string id of material- Returns:
- true if exists in model
-
removeObject
public void removeObject(java.lang.String name)
remove object with string id name- Parameters:
name
- [in] name of object to remove
-
scale
public void scale(float scale)
-
getMaterials
public SWIGTYPE_p_std__vectorT_rw__geometry__Model3D__Material_t getMaterials()
get all materials that are available in this model
-
getObjects
public SWIGTYPE_p_std__vectorT_rw__core__PtrT_rw__geometry__Object3DGeneric_t_t getObjects()
get all objects that make out this model
-
getTransform
public Transform3D getTransform()
get pose of this Model3D
-
setTransform
public void setTransform(Transform3D t3d)
set the pose of this Model3D
-
getName
public java.lang.String getName()
get string identifier of this model3d
-
getFilePath
public java.lang.String getFilePath()
get filePath of this model3d
-
setName
public void setName(java.lang.String name)
set string identifier of this model3d
-
setFilePath
public void setFilePath(java.lang.String name)
set filePath this model3d
-
getMask
public int getMask()
get mask of this model3d
-
setMask
public void setMask(int mask)
set mask of this model3d
-
toGeometryData
public GeometryDataPtr toGeometryData()
convert this model3d to a geometry. Notice that geometry does not hold any
color information.- Returns:
- a geometry of this model3d
-
isDynamic
public boolean isDynamic()
true if data in the model are expected to change
-
setDynamic
public void setDynamic(boolean dynamic)
set to true if data in the model are expected to change
-
getTextures
public SWIGTYPE_p_std__vectorT_rw__core__PtrT_rw__geometry__Model3D__Texture_t_t getTextures()
Get/set the object Textures- Returns:
- std::vector< rw::core::Ptr< Texture > >
-
set_materials
public void set_materials(SWIGTYPE_p_std__vectorT_rw__geometry__Model3D__Material_t value)
The array of materials.
-
get_materials
public SWIGTYPE_p_std__vectorT_rw__geometry__Model3D__Material_t get_materials()
The array of materials.
-
set_objects
public void set_objects(SWIGTYPE_p_std__vectorT_rw__core__PtrT_rw__geometry__Object3DGeneric_t_t value)
The array of objects in the model
-
get_objects
public SWIGTYPE_p_std__vectorT_rw__core__PtrT_rw__geometry__Object3DGeneric_t_t get_objects()
The array of objects in the model
-
-