![]() |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
#include <Cloth.h>

Public Member Functions | |
| Particle & | getParticle (int x, int y) |
| const Particle & | getParticle (int x, int y) const |
| Particle & | getParticleByIndex (int index) |
| const Particle | getParticleByIndex (int index) const |
| int | getSize () const |
| std::vector< double > & | getHeightvals () |
| Cloth (const Vec3 &origin_pos, int num_particles_width, int num_particles_height, double step_x, double step_y, double smoothThreshold, double heightThreshold, int rigidness, double time_step) | |
| void | setheightvals (const std::vector< double > &heightvals) |
| double | timeStep () |
| void | addForce (const Vec3 &direction) |
| void | terrainCollision () |
| void | movableFilter () |
| void | findUnmovablePoint (const std::vector< XY > &connected, const std::vector< double > &heightvals, std::vector< int > &edgePoints) |
| void | handle_slop_connected (const std::vector< int > &edgePoints, const std::vector< XY > &connected, const std::vector< std::vector< int >> &neighbors, const std::vector< double > &heightvals) |
| void | saveToFile (std::string path="") |
| void | saveMovableToFile (std::string path="") |
| ccMesh * | toMesh () const |
| Converts the cloth to a CC mesh structure. More... | |
Public Attributes | |
| int | num_particles_width |
| int | num_particles_height |
| Vec3 | origin_pos |
| double | step_x |
| double | step_y |
| Cloth::Cloth | ( | const Vec3 & | origin_pos, |
| int | num_particles_width, | ||
| int | num_particles_height, | ||
| double | step_x, | ||
| double | step_y, | ||
| double | smoothThreshold, | ||
| double | heightThreshold, | ||
| int | rigidness, | ||
| double | time_step | ||
| ) |
Definition at line 24 of file Cloth.cpp.
References getParticle(), num_particles_height, num_particles_width, origin_pos, step_x, step_y, Vec3::x, Vec3::y, and Vec3::z.
| void Cloth::addForce | ( | const Vec3 & | direction | ) |
Definition at line 187 of file Cloth.cpp.
Referenced by CSF::do_filtering().
| void Cloth::findUnmovablePoint | ( | const std::vector< XY > & | connected, |
| const std::vector< double > & | heightvals, | ||
| std::vector< int > & | edgePoints | ||
| ) |
Definition at line 318 of file Cloth.cpp.
References abs(), getParticle(), Particle::isMovable(), Particle::makeUnmovable(), num_particles_height, num_particles_width, Particle::pos, and Vec3::y.
|
inline |
Definition at line 97 of file Cloth.h.
Referenced by CSF::do_filtering().
|
inline |
Definition at line 77 of file Cloth.h.
References num_particles_width.
Referenced by Cloth(), Cloud2CloudDist::Compute(), Rasterization::findHeightValByScanline(), findUnmovablePoint(), movableFilter(), and Rasterization::RasterTerrain().
|
inline |
Definition at line 80 of file Cloth.h.
References num_particles_width.
|
inline |
Definition at line 83 of file Cloth.h.
Referenced by Rasterization::RasterTerrain().
|
inline |
|
inline |
Definition at line 93 of file Cloth.h.
References num_particles_height, and num_particles_width.
Referenced by Rasterization::RasterTerrain(), and toMesh().
| void Cloth::handle_slop_connected | ( | const std::vector< int > & | edgePoints, |
| const std::vector< XY > & | connected, | ||
| const std::vector< std::vector< int >> & | neighbors, | ||
| const std::vector< double > & | heightvals | ||
| ) |
Definition at line 393 of file Cloth.cpp.
References abs(), fabs(), and num_particles_width.
| void Cloth::movableFilter | ( | ) |
Definition at line 214 of file Cloth.cpp.
References getParticle(), Particle::isMovable(), Particle::isVisited, num_particles_height, and num_particles_width.
Referenced by CSF::do_filtering().
| void Cloth::saveMovableToFile | ( | std::string | path = "" | ) |
Definition at line 453 of file Cloth.cpp.
References QtCompat::endl(), and cloudViewer::t::geometry::path.
| void Cloth::saveToFile | ( | std::string | path = "" | ) |
Definition at line 434 of file Cloth.cpp.
References QtCompat::endl(), and cloudViewer::t::geometry::path.
|
inline |
| void Cloth::terrainCollision | ( | ) |
Definition at line 198 of file Cloth.cpp.
References Particle::makeUnmovable(), Particle::offsetPos(), Particle::pos, and Vec3::y.
Referenced by CSF::do_filtering().
| double Cloth::timeStep | ( | ) |
This is an important methods where the time is progressed one time step for the entire cloth. This includes calling satisfyConstraint() for every constraint, and calling timeStep() for all particles
issues/909
Definition at line 146 of file Cloth.cpp.
References abs().
Referenced by CSF::do_filtering().
| ccMesh * Cloth::toMesh | ( | ) | const |
Converts the cloth to a CC mesh structure.
Definition at line 104 of file Cloth.cpp.
References ccHObject::addChild(), cloudViewer::PointCloudTpl< T >::addPoint(), ccMesh::addTriangle(), getSize(), num_particles_height, num_particles_width, Particle::pos, ccMesh::reserve(), ccPointCloud::reserve(), ccObject::setEnabled(), Vec3::x, Vec3::y, and Vec3::z.
Referenced by CSF::do_filtering().
| int Cloth::num_particles_height |
Definition at line 89 of file Cloth.h.
Referenced by Cloth(), CSF::do_filtering(), Rasterization::findHeightValByScanline(), findUnmovablePoint(), getSize(), movableFilter(), and toMesh().
| int Cloth::num_particles_width |
Definition at line 88 of file Cloth.h.
Referenced by Cloth(), CSF::do_filtering(), Rasterization::findHeightValByScanline(), findUnmovablePoint(), getParticle(), getSize(), handle_slop_connected(), movableFilter(), and toMesh().
| Vec3 Cloth::origin_pos |
Definition at line 90 of file Cloth.h.
Referenced by Cloth(), Cloud2CloudDist::Compute(), and Rasterization::RasterTerrain().
| double Cloth::step_x |
Definition at line 91 of file Cloth.h.
Referenced by Cloth(), Cloud2CloudDist::Compute(), and Rasterization::RasterTerrain().
| double Cloth::step_y |
Definition at line 91 of file Cloth.h.
Referenced by Cloth(), Cloud2CloudDist::Compute(), and Rasterization::RasterTerrain().