ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
Cloth Class Reference

#include <Cloth.h>

Collaboration diagram for Cloth:

Public Member Functions

ParticlegetParticle (int x, int y)
 
const ParticlegetParticle (int x, int y) const
 
ParticlegetParticleByIndex (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="")
 
ccMeshtoMesh () 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
 

Detailed Description

Definition at line 44 of file Cloth.h.

Constructor & Destructor Documentation

◆ Cloth()

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 
)

Member Function Documentation

◆ addForce()

void Cloth::addForce ( const Vec3 direction)

Definition at line 187 of file Cloth.cpp.

Referenced by CSF::do_filtering().

◆ findUnmovablePoint()

void Cloth::findUnmovablePoint ( const std::vector< XY > &  connected,
const std::vector< double > &  heightvals,
std::vector< int > &  edgePoints 
)

◆ getHeightvals()

std::vector<double>& Cloth::getHeightvals ( )
inline

Definition at line 97 of file Cloth.h.

Referenced by CSF::do_filtering().

◆ getParticle() [1/2]

Particle& Cloth::getParticle ( int  x,
int  y 
)
inline

◆ getParticle() [2/2]

const Particle& Cloth::getParticle ( int  x,
int  y 
) const
inline

Definition at line 80 of file Cloth.h.

References num_particles_width.

◆ getParticleByIndex() [1/2]

Particle& Cloth::getParticleByIndex ( int  index)
inline

Definition at line 83 of file Cloth.h.

Referenced by Rasterization::RasterTerrain().

◆ getParticleByIndex() [2/2]

const Particle Cloth::getParticleByIndex ( int  index) const
inline

Definition at line 84 of file Cloth.h.

◆ getSize()

int Cloth::getSize ( ) const
inline

Definition at line 93 of file Cloth.h.

References num_particles_height, and num_particles_width.

Referenced by Rasterization::RasterTerrain(), and toMesh().

◆ handle_slop_connected()

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.

◆ movableFilter()

void Cloth::movableFilter ( )

◆ saveMovableToFile()

void Cloth::saveMovableToFile ( std::string  path = "")

Definition at line 453 of file Cloth.cpp.

References QtCompat::endl(), and cloudViewer::t::geometry::path.

◆ saveToFile()

void Cloth::saveToFile ( std::string  path = "")

Definition at line 434 of file Cloth.cpp.

References QtCompat::endl(), and cloudViewer::t::geometry::path.

◆ setheightvals()

void Cloth::setheightvals ( const std::vector< double > &  heightvals)
inline

Definition at line 112 of file Cloth.h.

◆ terrainCollision()

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().

◆ timeStep()

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().

◆ toMesh()

Member Data Documentation

◆ num_particles_height

int Cloth::num_particles_height

◆ num_particles_width

◆ origin_pos

Vec3 Cloth::origin_pos

Definition at line 90 of file Cloth.h.

Referenced by Cloth(), Cloud2CloudDist::Compute(), and Rasterization::RasterTerrain().

◆ step_x

double Cloth::step_x

Definition at line 91 of file Cloth.h.

Referenced by Cloth(), Cloud2CloudDist::Compute(), and Rasterization::RasterTerrain().

◆ step_y

double Cloth::step_y

Definition at line 91 of file Cloth.h.

Referenced by Cloth(), Cloud2CloudDist::Compute(), and Rasterization::RasterTerrain().


The documentation for this class was generated from the following files: