Package org.robwork.sdurw_geometry
Class Object3DGeneric
- java.lang.Object
-
- org.robwork.sdurw_geometry.GeometryData
-
- org.robwork.sdurw_geometry.TriMesh
-
- org.robwork.sdurw_geometry.Object3DGeneric
-
public class Object3DGeneric extends TriMesh
An abstract 3d object consisting of geometry information, material and texture.
To reduce memory, the geometry is implemented slightly differently for different mesh
sizes. One of the concrete Object3D implementations should be used in practice.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Object3DGeneric.MaterialMapData
Mapping from triangles to materials.static class
Object3DGeneric.MaterialPolys
ordering polygons by material consumes more memmory but reduce switches between
textures.-
Nested classes/interfaces inherited from class org.robwork.sdurw_geometry.TriMesh
TriMesh.TriCenterIterator, TriMesh.VerticeIterator
-
Nested classes/interfaces inherited from class org.robwork.sdurw_geometry.GeometryData
GeometryData.GeometryType
-
-
Constructor Summary
Constructors Constructor Description Object3DGeneric(long cPtr, boolean cMemoryOwn)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SWIGTYPE_p_rw__core__PtrT_rw__geometry__Object3DGeneric_t
copy()
long
countFaces()
Get the number of faces.void
delete()
boolean
get_hasTexture()
true if any of the materials used has textureSWIGTYPE_p_std__vectorT_rw__core__PtrT_rw__geometry__Object3DGeneric_t_t
get_kids()
Child objects.boolean
get_mappedToFaces()
if true then the tex coodinates are mapped to faces and not vertices.SWIGTYPE_p_std__vectorT_rw__geometry__Object3DGeneric__MaterialMapData_t
get_materialMap()
maps material into a range of triangles.SWIGTYPE_p_std__vectorT_rw__core__PtrT_rw__geometry__Object3DGeneric__MaterialPolys_t_t
get_matPolys()
Polygons ordered according to material.java.lang.String
get_name()
name/id of objectSWIGTYPE_p_std__vectorT_rw__math__Vector3DT_float_t_t
get_normals()
Normal array, there must be exactly one normal per vertexint
get_parentObj()
index of parent objectSWIGTYPE_p_std__vectorT_rw__math__Vector2DT_float_t_t
get_texCoords()
Texture coordinate array, the texture coordinates can be mapped to
either vertices or faces.Vector2Df
get_texOffset()
Offset of texture.Vector2Df
get_texRepeat()
Repeat texture.Transform3Df
get_transform()
Transform of the object.SWIGTYPE_p_std__vectorT_rw__math__Vector3DT_float_t_t
get_vertices()
Vertice arraystatic long
getCPtr(Object3DGeneric obj)
SWIGTYPE_p_std__vectorT_rw__math__Vector3DT_float_t_t
getFaceVertices(long idx)
Returns vertices corresponding to the idx faceTriangle
getTriangle(long idx)
gets the triangle at index idx.void
getTriangle(long idx, Triangle dst)
gets the triangle at index idx.void
getTriangle(long idx, Triangle_f dst)
gets the triangle at index idx.GeometryData.GeometryType
getType()
the type of this primitiveboolean
hasTexture()
test if the object is texturedvoid
set_hasTexture(boolean value)
true if any of the materials used has texturevoid
set_kids(SWIGTYPE_p_std__vectorT_rw__core__PtrT_rw__geometry__Object3DGeneric_t_t value)
Child objects.void
set_mappedToFaces(boolean value)
if true then the tex coodinates are mapped to faces and not vertices.void
set_materialMap(SWIGTYPE_p_std__vectorT_rw__geometry__Object3DGeneric__MaterialMapData_t value)
maps material into a range of triangles.void
set_matPolys(SWIGTYPE_p_std__vectorT_rw__core__PtrT_rw__geometry__Object3DGeneric__MaterialPolys_t_t value)
Polygons ordered according to material.void
set_name(java.lang.String value)
name/id of objectvoid
set_normals(SWIGTYPE_p_std__vectorT_rw__math__Vector3DT_float_t_t value)
Normal array, there must be exactly one normal per vertexvoid
set_parentObj(int value)
index of parent objectvoid
set_texCoords(SWIGTYPE_p_std__vectorT_rw__math__Vector2DT_float_t_t value)
Texture coordinate array, the texture coordinates can be mapped to
either vertices or faces.void
set_texOffset(Vector2Df value)
Offset of texture.void
set_texRepeat(Vector2Df value)
Repeat texture.void
set_transform(Transform3Df value)
Transform of the object.void
set_vertices(SWIGTYPE_p_std__vectorT_rw__math__Vector3DT_float_t_t value)
Vertice arrayvoid
setMaterial(long material)
set the material used by addTriangles-
Methods inherited from class org.robwork.sdurw_geometry.TriMesh
clone, getCPtr, getSize, getTriMesh, getTriMesh, getVolume, isConvex, scale, setConvexEnabled, size
-
Methods inherited from class org.robwork.sdurw_geometry.GeometryData
getCPtr, toString
-
-
-
-
Method Detail
-
getCPtr
public static long getCPtr(Object3DGeneric obj)
-
set_name
public void set_name(java.lang.String value)
name/id of object
-
get_name
public java.lang.String get_name()
name/id of object
-
set_parentObj
public void set_parentObj(int value)
index of parent object
-
get_parentObj
public int get_parentObj()
index of parent object
-
set_hasTexture
public void set_hasTexture(boolean value)
true if any of the materials used has texture
-
get_hasTexture
public boolean get_hasTexture()
true if any of the materials used has texture
-
set_vertices
public void set_vertices(SWIGTYPE_p_std__vectorT_rw__math__Vector3DT_float_t_t value)
Vertice array
-
get_vertices
public SWIGTYPE_p_std__vectorT_rw__math__Vector3DT_float_t_t get_vertices()
Vertice array
-
set_normals
public void set_normals(SWIGTYPE_p_std__vectorT_rw__math__Vector3DT_float_t_t value)
Normal array, there must be exactly one normal per vertex
-
get_normals
public SWIGTYPE_p_std__vectorT_rw__math__Vector3DT_float_t_t get_normals()
Normal array, there must be exactly one normal per vertex
-
set_texCoords
public void set_texCoords(SWIGTYPE_p_std__vectorT_rw__math__Vector2DT_float_t_t value)
Texture coordinate array, the texture coordinates can be mapped to
either vertices or faces. The reason for this is that often vertices
share two or more texcoordinates and if mapping directly to vertices then additional
vertices is necessary.
-
get_texCoords
public SWIGTYPE_p_std__vectorT_rw__math__Vector2DT_float_t_t get_texCoords()
Texture coordinate array, the texture coordinates can be mapped to
either vertices or faces. The reason for this is that often vertices
share two or more texcoordinates and if mapping directly to vertices then additional
vertices is necessary.
-
set_mappedToFaces
public void set_mappedToFaces(boolean value)
if true then the tex coodinates are mapped to faces and not vertices. if false
then the texCoords are mapped to each vertice
-
get_mappedToFaces
public boolean get_mappedToFaces()
if true then the tex coodinates are mapped to faces and not vertices. if false
then the texCoords are mapped to each vertice
-
set_transform
public void set_transform(Transform3Df value)
Transform of the object.
-
get_transform
public Transform3Df get_transform()
Transform of the object.
-
set_kids
public void set_kids(SWIGTYPE_p_std__vectorT_rw__core__PtrT_rw__geometry__Object3DGeneric_t_t value)
Child objects.
-
get_kids
public SWIGTYPE_p_std__vectorT_rw__core__PtrT_rw__geometry__Object3DGeneric_t_t get_kids()
Child objects.
-
set_texOffset
public void set_texOffset(Vector2Df value)
Offset of texture.
-
get_texOffset
public Vector2Df get_texOffset()
Offset of texture.
-
set_texRepeat
public void set_texRepeat(Vector2Df value)
Repeat texture.
-
get_texRepeat
public Vector2Df get_texRepeat()
Repeat texture.
-
set_materialMap
public void set_materialMap(SWIGTYPE_p_std__vectorT_rw__geometry__Object3DGeneric__MaterialMapData_t value)
maps material into a range of triangles.
-
get_materialMap
public SWIGTYPE_p_std__vectorT_rw__geometry__Object3DGeneric__MaterialMapData_t get_materialMap()
maps material into a range of triangles.
-
set_matPolys
public void set_matPolys(SWIGTYPE_p_std__vectorT_rw__core__PtrT_rw__geometry__Object3DGeneric__MaterialPolys_t_t value)
Polygons ordered according to material.
-
get_matPolys
public SWIGTYPE_p_std__vectorT_rw__core__PtrT_rw__geometry__Object3DGeneric__MaterialPolys_t_t get_matPolys()
Polygons ordered according to material.
-
hasTexture
public boolean hasTexture()
test if the object is textured
-
setMaterial
public void setMaterial(long material)
set the material used by addTriangles- Parameters:
material
-
-
countFaces
public long countFaces()
Get the number of faces.- Returns:
- the number of faces.
-
getFaceVertices
public SWIGTYPE_p_std__vectorT_rw__math__Vector3DT_float_t_t getFaceVertices(long idx)
Returns vertices corresponding to the idx face- Parameters:
idx
- [in] Index of the face- Returns:
- List with vertices
-
getTriangle
public Triangle getTriangle(long idx)
gets the triangle at index idx.- Overrides:
getTriangle
in classTriMesh
- Parameters:
idx
- [in] the index of the triangle.- Returns:
- the triangle at index idx
-
getTriangle
public void getTriangle(long idx, Triangle dst)
gets the triangle at index idx.- Overrides:
getTriangle
in classTriMesh
- Parameters:
idx
- [in] the index of the triangle.dst
- [out] where to store the triangle at index idx
-
getTriangle
public void getTriangle(long idx, Triangle_f dst)
gets the triangle at index idx. Using Floating point presicion- Overrides:
getTriangle
in classTriMesh
- Parameters:
idx
- [in] the index of the triangle.dst
- [out] where to store the triangle at index idx
-
getType
public GeometryData.GeometryType getType()
the type of this primitive- Overrides:
getType
in classGeometryData
-
copy
public SWIGTYPE_p_rw__core__PtrT_rw__geometry__Object3DGeneric_t copy()
-
-