RobWorkProject
24.12.4-
|
A TriMesh with better interactions with the underlying data, and more capabilities. More...
#include <SimpleTriMesh.hpp>
Inherits TriMesh.
Public Types | |
using | Ptr = rw::core::Ptr< SimpleTriMesh > |
Public Types inherited from TriMesh | |
typedef rw::core::Ptr< TriMesh > | Ptr |
smart pointer type to this class | |
Public Types inherited from GeometryData | |
enum | GeometryType { PointCloud , LineMesh , PlainTriMesh , IdxTriMesh , SpherePrim , BoxPrim , OBBPrim , AABBPrim , LinePrim , PointPrim , PyramidPrim , ConePrim , TrianglePrim , CylinderPrim , TubePrim , PlanePrim , RayPrim , Implicit , Quadratic , UserType } |
geometry data types | |
typedef rw::core::Ptr< GeometryData > | Ptr |
smart pointer type to this class | |
typedef rw::core::Ptr< const GeometryData > | CPtr |
const smart pointer type to this class | |
Public Member Functions | |
SimpleTriMesh (TriMeshData::Ptr data=NULL) | |
Construct an empty TriMesh if data is null else take ownership of data. More... | |
virtual | ~SimpleTriMesh () |
if the internal data object is not a shared pointer the data is deleted, when the destructor is called | |
SimpleTriMesh (const SimpleTriMesh ©) | |
Copy the data from an existing trimesh. More... | |
SimpleTriMesh (const SimpleTriMesh &&tmp) | |
Transfere the data from a temporary TriMesh. This will simply copy the shared pointer to the data object. More... | |
SimpleTriMesh (const rw::core::Ptr< SimpleTriMesh > ©) | |
Copy the data from an existing trimesh. More... | |
SimpleTriMesh (const rw::geometry::TriMesh ©) | |
Copy the data from an existing trimesh. More... | |
SimpleTriMesh (rw::geometry::GeometryData ©) | |
Copy the data from an existing trimesh. More... | |
SimpleTriMesh (rw::geometry::GeometryData &©) | |
Copy the data from an existing trimesh. More... | |
SimpleTriMesh (const rw::core::Ptr< rw::geometry::GeometryData > ©) | |
Copy the data from an existing trimesh. More... | |
SimpleTriMesh (const rw::core::Ptr< rw::geometry::TriMesh > ©) | |
Copy the data from an existing trimesh. More... | |
virtual rw::geometry::Triangle< double > | getTriangle (size_t idx) const |
gets the triangle at index idx. More... | |
virtual void | getTriangle (size_t idx, rw::geometry::Triangle< double > &dst) const |
gets the triangle at index idx. More... | |
virtual void | getTriangle (size_t idx, rw::geometry::Triangle< float > &dst) const |
gets the triangle at index idx. Using Floating point presicion More... | |
virtual size_t | size () const |
gets the number of triangles in the triangle array. | |
virtual rw::core::Ptr< TriMesh > | clone () const |
make a clone of this triangle mesh More... | |
virtual void | scale (double scale) |
Scale all vertices in the mesh. | |
virtual void | scale (const rw::math::Vector3D< double > &scale) |
Scale all vertices in the mesh. More... | |
virtual GeometryType | getType () const |
the type of this primitive | |
virtual rw::core::Ptr< TriMesh > | getTriMesh (bool forceCopy=true) |
gets a trimesh representation of this geometry data. More... | |
ReferencedTriangle | triangle (size_t idx) const |
get triangle at index idx. Changes to the triangle will be reflected in this mesh More... | |
size_t | triangles () const |
get number of triangles More... | |
ReferencedVertice | vertice (size_t idx) const |
get vertice at index idx. Changes to the vertice will be reflected in this mesh More... | |
size_t | vertices () const |
number of vertices in this mesh More... | |
void | resize (size_t triangles, size_t vertices) |
Change the number of vertices and triangles in this mesh. More... | |
TriMeshData::Ptr | getData () const |
get direct access to the data container | |
CSGEngine::Ptr | getCSGEngine () const |
get the current CSGEngine More... | |
void | setCSGEngine (CSGEngine::Ptr engine) |
set CSG engine More... | |
std::vector< SimpleTriMesh > | separateMeshes () const |
Check if there are non-connected meshes inside this mesh. If ther are then seperate and return them. non-connected means that you have meshes that does not share a triangluar edge. More... | |
SimpleTriMesh | combine (const SimpleTriMesh &mesh) const |
combine two meshes. OBS! this is not a union operation has all vertices and triangles are just directly copied over More... | |
SimpleTriMesh & | operator*= (const rw::math::Transform3D< double > &trans) |
Move this TriMesh. More... | |
SimpleTriMesh | operator* (const rw::math::Transform3D< double > &trans) const |
Create a copy of the TriMesh and move it. More... | |
SimpleTriMesh | operator+ (const SimpleTriMesh &rhs) const |
Compute the Union of two TriMeshes, into a new TriMesh. More... | |
SimpleTriMesh & | operator+= (const SimpleTriMesh &rhs) |
Compute the Union of two TriMeshes, into this TriMesh. More... | |
SimpleTriMesh | operator- (const SimpleTriMesh &rhs) const |
Compute the Difference of two TriMeshes, into a new TriMesh. More... | |
SimpleTriMesh & | operator-= (const SimpleTriMesh &rhs) |
Compute the Difference of two TriMeshes, into this TriMesh. More... | |
SimpleTriMesh | operator& (const SimpleTriMesh &rhs) const |
Compute the Intersection of two TriMeshes, into a new TriMesh. More... | |
SimpleTriMesh & | operator&= (const SimpleTriMesh &rhs) |
Compute the Intersection of two TriMeshes, into this TriMesh. More... | |
SimpleTriMesh | operator^ (const SimpleTriMesh &rhs) const |
Compute the Symetric Difference of two TriMeshes, into a new TriMesh. More... | |
SimpleTriMesh & | operator^= (const SimpleTriMesh &rhs) |
Compute the Symetric Difference of two TriMeshes, into this TriMesh. More... | |
SimpleTriMesh & | operator= (TriMeshData::Ptr data) |
set the current data pointer equal to the new one More... | |
SimpleTriMesh & | operator= (const SimpleTriMesh ©) |
Copy the data from an existing trimesh. More... | |
SimpleTriMesh & | operator= (const SimpleTriMesh &&tmp) |
Transfere the data from a temporary TriMesh. This will simply copy the shared pointer to the data object. More... | |
SimpleTriMesh & | operator= (const rw::core::Ptr< SimpleTriMesh > ©) |
Copy the data from an existing trimesh. More... | |
SimpleTriMesh & | operator= (const rw::geometry::TriMesh ©) |
Copy the data from an existing trimesh. More... | |
SimpleTriMesh & | operator= (rw::geometry::GeometryData ©) |
Copy the data from an existing trimesh. More... | |
SimpleTriMesh & | operator= (rw::geometry::GeometryData &©) |
Copy the data from an existing trimesh. More... | |
SimpleTriMesh & | operator= (const rw::core::Ptr< rw::geometry::GeometryData > ©) |
Copy the data from an existing trimesh. More... | |
SimpleTriMesh & | operator= (const rw::core::Ptr< rw::geometry::TriMesh > ©) |
Copy the data from an existing trimesh. More... | |
Public Member Functions inherited from TriMesh | |
virtual | ~TriMesh () |
destructor | |
virtual size_t | getSize () const |
gets the number of triangles in the triangle array. | |
rw::core::Ptr< TriMesh > | getTriMesh (bool forceCopy=true) |
gets a trimesh representation of this geometry data. More... | |
rw::core::Ptr< const TriMesh > | getTriMesh (bool forceCopy=true) const |
gets a trimesh representation of this geometry data. More... | |
virtual bool | isConvex () |
test if this geometry data is convex More... | |
void | setConvexEnabled (bool isConvex) |
double | getVolume () const |
calculate a volume of this triangle mesh | |
Public Member Functions inherited from GeometryData | |
virtual | ~GeometryData () |
Destructor. | |
Additional Inherited Members | |
Static Public Member Functions inherited from GeometryData | |
static std::string | toString (GeometryType type) |
format GeometryType to string More... | |
A TriMesh with better interactions with the underlying data, and more capabilities.
SimpleTriMesh | ( | TriMeshData::Ptr | data = NULL | ) |
Construct an empty TriMesh if data is null else take ownership of data.
data | [in] the data to take ownership of. If now shared pointer, then the destructor cleans it up |
SimpleTriMesh | ( | const SimpleTriMesh & | copy | ) |
Copy the data from an existing trimesh.
copy | the object to be copied |
SimpleTriMesh | ( | const SimpleTriMesh && | tmp | ) |
Transfere the data from a temporary TriMesh. This will simply copy the shared pointer to the data object.
tmp | the object to take the data from |
SimpleTriMesh | ( | const rw::core::Ptr< SimpleTriMesh > & | copy | ) |
Copy the data from an existing trimesh.
copy | the object to be copied |
SimpleTriMesh | ( | const rw::geometry::TriMesh & | copy | ) |
Copy the data from an existing trimesh.
copy | the object to be copied |
SimpleTriMesh | ( | rw::geometry::GeometryData & | copy | ) |
Copy the data from an existing trimesh.
copy | the object to be copied |
SimpleTriMesh | ( | rw::geometry::GeometryData && | copy | ) |
Copy the data from an existing trimesh.
copy | the object to be copied |
SimpleTriMesh | ( | const rw::core::Ptr< rw::geometry::GeometryData > & | copy | ) |
Copy the data from an existing trimesh.
copy | the object to be copied |
SimpleTriMesh | ( | const rw::core::Ptr< rw::geometry::TriMesh > & | copy | ) |
Copy the data from an existing trimesh.
copy | the object to be copied |
|
virtual |
SimpleTriMesh combine | ( | const SimpleTriMesh & | mesh | ) | const |
combine two meshes. OBS! this is not a union operation has all vertices and triangles are just directly copied over
mesh | [in] the mesh, that his mesh should be combined with |
|
inline |
get the current CSGEngine
|
virtual |
gets the triangle at index idx.
idx | [in] the index of the triangle. |
Implements TriMesh.
|
virtual |
gets the triangle at index idx.
idx | [in] the index of the triangle. |
dst | [out] where to store the triangle at index idx |
Implements TriMesh.
|
virtual |
gets the triangle at index idx. Using Floating point presicion
idx | [in] the index of the triangle. |
dst | [out] where to store the triangle at index idx |
Implements TriMesh.
|
virtual |
gets a trimesh representation of this geometry data.
The trimesh that is returned is by default a copy, which means ownership is transfered to the caller. Specifying forceCopy to false will enable copy by reference and ownership is not necesarilly transfered. This is more efficient, though pointer is only alive as long as this GeometryData is alive.
Implements GeometryData.
SimpleTriMesh operator& | ( | const SimpleTriMesh & | rhs | ) | const |
Compute the Intersection of two TriMeshes, into a new TriMesh.
rhs | [in] the TriMesh to create a Intersection with |
rw::core::Exception | if no CSGEngine can be found |
SimpleTriMesh& operator&= | ( | const SimpleTriMesh & | rhs | ) |
Compute the Intersection of two TriMeshes, into this TriMesh.
rhs | [in] the TriMesh to create a Intersection with |
rw::core::Exception | if no CSGEngine can be found |
SimpleTriMesh operator* | ( | const rw::math::Transform3D< double > & | trans | ) | const |
SimpleTriMesh& operator*= | ( | const rw::math::Transform3D< double > & | trans | ) |
SimpleTriMesh operator+ | ( | const SimpleTriMesh & | rhs | ) | const |
Compute the Union of two TriMeshes, into a new TriMesh.
rhs | [in] the TriMesh to create a union with |
rw::core::Exception | if no CSGEngine can be found |
SimpleTriMesh& operator+= | ( | const SimpleTriMesh & | rhs | ) |
Compute the Union of two TriMeshes, into this TriMesh.
rhs | [in] the TriMesh to create a union with |
rw::core::Exception | if no CSGEngine can be found |
SimpleTriMesh operator- | ( | const SimpleTriMesh & | rhs | ) | const |
Compute the Difference of two TriMeshes, into a new TriMesh.
rhs | [in] the TriMesh to create a difference with |
rw::core::Exception | if no CSGEngine can be found |
SimpleTriMesh& operator-= | ( | const SimpleTriMesh & | rhs | ) |
Compute the Difference of two TriMeshes, into this TriMesh.
rhs | [in] the TriMesh to create a Difference with |
rw::core::Exception | if no CSGEngine can be found |
SimpleTriMesh& operator= | ( | const rw::core::Ptr< rw::geometry::GeometryData > & | copy | ) |
Copy the data from an existing trimesh.
copy | the object to be copied |
SimpleTriMesh& operator= | ( | const rw::core::Ptr< rw::geometry::TriMesh > & | copy | ) |
Copy the data from an existing trimesh.
copy | the object to be copied |
SimpleTriMesh& operator= | ( | const rw::core::Ptr< SimpleTriMesh > & | copy | ) |
Copy the data from an existing trimesh.
copy | the object to be copied |
SimpleTriMesh& operator= | ( | const rw::geometry::TriMesh & | copy | ) |
Copy the data from an existing trimesh.
copy | the object to be copied |
SimpleTriMesh& operator= | ( | const SimpleTriMesh && | tmp | ) |
Transfere the data from a temporary TriMesh. This will simply copy the shared pointer to the data object.
tmp | the object to take the data from |
SimpleTriMesh& operator= | ( | const SimpleTriMesh & | copy | ) |
Copy the data from an existing trimesh.
copy | the object to be copied |
SimpleTriMesh& operator= | ( | rw::geometry::GeometryData && | copy | ) |
Copy the data from an existing trimesh.
copy | the object to be copied |
SimpleTriMesh& operator= | ( | rw::geometry::GeometryData & | copy | ) |
Copy the data from an existing trimesh.
copy | the object to be copied |
SimpleTriMesh& operator= | ( | TriMeshData::Ptr | data | ) |
set the current data pointer equal to the new one
data | [in] the data to take ownership of. If not shared pointer, then the destructor cleans it up |
SimpleTriMesh operator^ | ( | const SimpleTriMesh & | rhs | ) | const |
Compute the Symetric Difference of two TriMeshes, into a new TriMesh.
rhs | [in] the TriMesh to create a Symetric Difference with |
rw::core::Exception | if no CSGEngine can be found |
SimpleTriMesh& operator^= | ( | const SimpleTriMesh & | rhs | ) |
Compute the Symetric Difference of two TriMeshes, into this TriMesh.
rhs | [in] the TriMesh to create a Symetric Difference with |
rw::core::Exception | if no CSGEngine can be found |
void resize | ( | size_t | triangles, |
size_t | vertices | ||
) |
Change the number of vertices and triangles in this mesh.
triangles | the amount of triangles in the mesh |
vertices | the amount of vertices in the mesh |
|
virtual |
Scale all vertices in the mesh.
scale | [in] how each axis should be scaled. |
std::vector<SimpleTriMesh> separateMeshes | ( | ) | const |
Check if there are non-connected meshes inside this mesh. If ther are then seperate and return them. non-connected means that you have meshes that does not share a triangluar edge.
|
inline |
set CSG engine
engine | [in] pointer to the new engine |
ReferencedTriangle triangle | ( | size_t | idx | ) | const |
get triangle at index idx. Changes to the triangle will be reflected in this mesh
idx | index of the triangle |
size_t triangles | ( | ) | const |
get number of triangles
ReferencedVertice vertice | ( | size_t | idx | ) | const |
get vertice at index idx. Changes to the vertice will be reflected in this mesh
idx | the index of the wanted vertice |
size_t vertices | ( | ) | const |
number of vertices in this mesh