Page MenuHomec4science

contact_cluster_collection.hh
No OneTemporary

File Metadata

Created
Sat, May 25, 05:06

contact_cluster_collection.hh

/**
*
* @author Guillaume Anciaux <guillaume.anciaux@epfl.ch>
*
* @section LICENSE
*
* Copyright (©) 2016 EPFL (Ecole Polytechnique Fédérale de
* Lausanne) Laboratory (LSMS - Laboratoire de Simulation en Mécanique des
* Solides)
*
* Tamaas is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version.
*
* Tamaas is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
* A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Tamaas. If not, see <http://www.gnu.org/licenses/>.
*
*/
/* -------------------------------------------------------------------------- */
#ifndef __CONTACT_CLUSTER_COLLECTION_HH__
#define __CONTACT_CLUSTER_COLLECTION_HH__
/* -------------------------------------------------------------------------- */
#include "contact_area.hh"
#include "contact_cluster.hh"
/* -------------------------------------------------------------------------- */
__BEGIN_TAMAAS__
class ContactClusterCollection {
/* ------------------------------------------------------------------------ */
/* Constructors/Destructors */
/* ------------------------------------------------------------------------ */
public:
ContactClusterCollection(ContactArea & area);
virtual ~ContactClusterCollection();
/* ------------------------------------------------------------------------ */
/* Methods */
/* ------------------------------------------------------------------------ */
public:
/// dump information about clusters to file
void dumpClusterInfoToFile(const std::string & filename);
Real getTotalArea();
Real getTotalPerimeter();
Real getNbClustersWithHole();
Real getNbClusters();
std::vector<Real> getAreas();
std::vector<Real> getMassCenters(UInt i);
std::vector<Real> getPerimeters();
std::vector<Real> getCompactnesses();
std::vector<Real> getInterPixelPerimeters();
std::vector<Real> getDiscretePerimeters();
std::vector<Real> getNbHoles();
//std::vector<Real> getRIs();
std::vector<Real> getColors();
/// write one file per cluster
void dumpAllClusters(const std::string & prefix);
/* ------------------------------------------------------------------------ */
/* Class Members */
/* ------------------------------------------------------------------------ */
private:
//! the vector of clusters
std::vector<ContactCluster> clusters;
//! the input area where to extract all the clusters
ContactArea & area;
//! the total area
UInt TotalArea;
//! the total perimeter
UInt TotalPerimeter;
//! the number of clusters with holes
UInt NumberOfClustersWithHoles;
};
/* -------------------------------------------------------------------------- */
__END_TAMAAS__
#endif /* __CONTACT_CLUSTER_COLLECTION_HH__ */

Event Timeline