Structural deformable models
|
#include <MStruct.h>
Public Member Functions | |
MStructure (const std::string &name="", StructTable *psTable=NULL) | |
MStructure (const MStructure &rhs) | |
~MStructure () | |
void | clear () |
MStructure & | operator= (const MStructure &rhs) |
void | setName (const std::string &name) |
const std::string & | getName () const |
void | setSize (float size) |
float | getSize () const |
void | setModel (const Model &model) |
const Model & | getModel () const |
Model & | getModel () |
void | setWeight (float weight) |
float | getWeight () const |
void | attachStructTable (StructTable *psTable) |
StructTable * | getStructTable () |
const Searcher & | getSearcher () const |
const Winner * | getWinner (dword wid) const |
bool | isFrame () const |
operator bool () const | |
void | addSubStruct (const SubStructure &substruct) |
const SubStructure & | getSubStruct (const std::string sname) const |
bool | hasSubStruct (const std::string sname) const |
const SubStructure & | getSupStruct (const std::string sname) const |
bool | hasSupStruct (const std::string sname) const |
bool | read (ParseFile &is) |
void | write (std::ostream &os) const |
void | showStats (const SubStructure &subs, std::ostream &os=std::cout) const |
std::string | getInfoFilename (const std::string &suffix) const |
bool | getRefModel (dword id, Model &model) const |
void | setRefModel (dword id, const Model &model) |
bool | getRefProp (dword id, PropVec &prop) const |
void | setRefProp (dword id, const PropVec &prop) |
template<class Iter > | |
dword | getRefModelIDs (Iter iter) const |
dword | loadRefProp () |
void | saveRefProp () const |
void | buildAllStats () |
bool | buildMasterModel (float scscale=1.f) |
void | rebuildExpMap () |
void | verifyWinnerRating () |
const ExpectationMap & | getExpMap () const |
bool | stepSearch (float dt) |
Protected Member Functions | |
void | refSubSuper (bool doclear=false) |
bool | addExpectation (const SubStructure &subs, ExpectationMap &expmap, bool inverse=false) const |
Protected Attributes | |
StructTable * | m_PStructTable |
std::string | m_Name |
Model | m_Model |
float | m_Size |
stdradius in mm More... | |
std::map< std::string, SubStructure > | m_SubStructures |
std::map< std::string, SubStructure * > | m_SupStructures |
std::map< dword, PropVec > | m_RefProp |
Searcher | m_Searcher |
float | m_Weight |
Winner | m_FrameWinner |
Friends | |
class | StructTable |
ParseFile & | operator>> (ParseFile &is, MStructure &st) |
std::ostream & | operator<< (std::ostream &os, const MStructure &st) |
MStructure::MStructure | ( | const std::string & | name = "" , |
StructTable * | psTable = NULL |
||
) |
Definition at line 24 of file MStruct.cpp.
References Model::attachDataset(), StructTable::getDataset(), StructTable::getSensors(), m_Model, m_PStructTable, Model::mergeSensorCollection(), and setName().
MStructure::MStructure | ( | const MStructure & | rhs | ) |
MStructure::~MStructure | ( | ) |
|
protected |
Definition at line 373 of file MStruct.cpp.
References ExpectationMap::add(), DMatrix< T >::at(), dmutil::avg(), ExpectationMap::correctLBUB(), DUMP, SubStructure::generateEMDist(), Model::getDataScale(), StructTable::getDataset(), ExpectationMap::getEDist(), Searcher::getGeneration(), EMDRect::getLB(), SubStructure::getLBUB(), Model::getNode(), Model::getProperties(), getPropScale(), Model::getQualityOfFit(), getSearchPara(), EMDistribution::getShootCount(), EMDRect::getUB(), Searcher::getWinList(), isFrame(), Winner::m_BestRating, m_FrameWinner, SearcherParams::m_MaxShoot, SubStructure::m_Mode, Winner::m_Model, SubStructure::m_Pivot, m_PStructTable, SubStructure::m_RateWeight, m_Searcher, Winner::m_WinnerID, DMatrix< T >::max(), DMatrix< T >::min(), SubStructure::MODE_NOSPAWN, NULL, EMDistribution::setCreator(), EMDistribution::setIntegral(), EMDRect::setLB(), setPropPos(), setPropScale(), EMDistribution::setShootCount(), EMDRect::setUB(), and dmutil::stdev().
Referenced by rebuildExpMap().
void MStructure::addSubStruct | ( | const SubStructure & | substruct | ) |
Definition at line 87 of file MStruct.cpp.
References m_Name, SubStructure::m_SubStructName, and m_SubStructures.
Referenced by read().
|
inline |
void MStructure::buildAllStats | ( | ) |
Definition at line 232 of file MStruct.cpp.
References SubStructure::analyseTF(), VVector< T, D >::begin(), buildMasterModel(), Model::convertPointToMM(), Model::getCenter(), getInfoFilename(), Model::getNNodes(), Model::getNode(), getPropPos(), getPropTF(), getRefModel(), getRefModelIDs(), getRefProp(), StructTable::getStructs(), SubStructure::m_Mode, m_Model, m_Name, SubStructure::m_Pivot, m_PStructTable, SubStructure::m_SubStructName, m_SubStructures, SubStructure::MODE_SHOWSTATS, setPropPos(), DMatrix< T >::setRange(), showStats(), VVector< T, D >::size(), and toString().
Referenced by Brain::doCommand().
bool MStructure::buildMasterModel | ( | float | scscale = 1.f | ) |
Definition at line 283 of file MStruct.cpp.
References dmutil::abs(), Model::getDataScale(), Model::getEdge(), Model::getLiveliness(), Model::getNEdges(), getRefModel(), getRefModelIDs(), ParticleParam::global, ParticleParam::imgforce, Edge::lengthRatio(), m_Model, Model::phys, Edge::restlength, Model::scale(), SHAPEADAPTTIMESTEP, ParticleParam::springconst, Edge::springconstant, and Model::updateParticles().
Referenced by buildAllStats().
void MStructure::clear | ( | ) |
Definition at line 61 of file MStruct.cpp.
References Model::clear(), m_FrameWinner, m_Model, m_Name, m_RefProp, m_Size, Winner::m_StructName, m_SubStructures, m_SupStructures, and m_Weight.
Referenced by read(), and ~MStructure().
|
inline |
Definition at line 109 of file MStruct.h.
References dmutil::inverse(), and StructTable::stepSearch().
string MStructure::getInfoFilename | ( | const std::string & | suffix | ) | const |
Definition at line 157 of file MStruct.cpp.
References StructTable::getFilename(), m_Name, and m_PStructTable.
Referenced by buildAllStats(), Brain::doCommand(), getRefModel(), loadRefProp(), saveRefProp(), setRefModel(), and showStats().
|
inline |
|
inline |
Definition at line 63 of file MStruct.h.
Referenced by StructPath::getWinner(), Brain::load(), StructTable::read(), and Brain::triggerTest().
Definition at line 167 of file MStruct.cpp.
References getInfoFilename(), Model::readFile(), and toString().
Referenced by buildAllStats(), buildMasterModel(), Brain::load(), showStats(), and Brain::triggerTest().
dword MStructure::getRefModelIDs | ( | Iter | iter | ) | const |
Definition at line 131 of file MStruct.h.
References FFind::findFiles(), and fromString().
Referenced by buildAllStats(), buildMasterModel(), Brain::doCommand(), showStats(), and Brain::triggerTest().
Definition at line 174 of file MStruct.cpp.
References m_RefProp.
Referenced by buildAllStats(), showStats(), and Brain::triggerTest().
|
inline |
Definition at line 73 of file MStruct.h.
Referenced by StructTable::findBestConnection(), Brain::triggerTest(), and verifyWinnerRating().
|
inline |
|
inline |
Definition at line 79 of file MStruct.h.
|
inline |
Definition at line 83 of file MStruct.h.
Referenced by StructPath::print().
|
inline |
Definition at line 70 of file MStruct.h.
Referenced by StructTable::findBestConnection(), and StructPath::print().
Definition at line 80 of file MStruct.cpp.
References Searcher::getWinner(), isFrame(), m_FrameWinner, m_Searcher, and Winner::WID_FRAME.
Referenced by StructTable::findBestConnection(), StructPath::getWinner(), and StructPath::print().
|
inline |
Definition at line 81 of file MStruct.h.
|
inline |
Definition at line 85 of file MStruct.h.
References SubStructure::read(), and StructTable::write().
Referenced by StructPath::print().
|
inline |
Definition at line 75 of file MStruct.h.
Referenced by addExpectation(), getWinner(), stepSearch(), and verifyWinnerRating().
dword MStructure::loadRefProp | ( | ) |
Definition at line 198 of file MStruct.cpp.
References fromString(), getInfoFilename(), ParseFile::getKey(), ParseFile::getNextLine(), ParseFile::getValue(), and m_RefProp.
Referenced by read().
MStructure & MStructure::operator= | ( | const MStructure & | rhs | ) |
Definition at line 45 of file MStruct.cpp.
References m_FrameWinner, m_Model, m_Name, m_PStructTable, m_RefProp, m_Size, m_SubStructures, m_SupStructures, and m_Weight.
Referenced by MStructure().
bool MStructure::read | ( | ParseFile & | is | ) |
Definition at line 94 of file MStruct.cpp.
References addSubStruct(), clear(), ParseFile::error(), fromString(), ParseFile::getKey(), ParseFile::getNextLine(), ParseFile::getPath(), ParseFile::getValue(), loadRefProp(), m_Model, m_Name, m_Searcher, m_Size, m_Weight, ParseFile::pushLine(), SubStructure::read(), Model::readFile(), setName(), ParseFile::setParseError(), Searcher::setShapeWeight(), and STRUCT_SHAPEWEIGHT.
Referenced by StructTable::read().
void MStructure::rebuildExpMap | ( | ) |
Definition at line 482 of file MStruct.cpp.
References ExpectationMap::add(), addExpectation(), ExpectationMap::clear(), ExpectationMap::correctLBUB(), DUMP, StructTable::getDataset(), Searcher::getExpectationMap(), Model::getPropertiesMM(), getPropScale(), ExpectationMap::getRepresentative(), StructTable::getStructs(), EMDistribution::m_Integral, m_Model, m_Name, M_PI, m_PStructTable, m_Searcher, m_SubStructures, m_SupStructures, ExpectationMap::markAllOld(), Searcher::setExpectationMap(), EMDRect::setLB(), Model::setName(), setPropDir(), setPropPos(), setPropScale(), ExpectationMap::setRepresentative(), and EMDRect::setUB().
|
protected |
Definition at line 359 of file MStruct.cpp.
References StructTable::getStructs(), m_Name, m_PStructTable, m_SubStructures, and m_SupStructures.
void MStructure::saveRefProp | ( | ) | const |
Definition at line 218 of file MStruct.cpp.
References getInfoFilename(), and m_RefProp.
Referenced by ~MStructure().
|
inline |
void MStructure::setName | ( | const std::string & | name | ) |
Definition at line 73 of file MStruct.cpp.
References m_FrameWinner, m_Name, Winner::m_StructName, Winner::m_WinnerID, and Winner::WID_FRAME.
Referenced by MStructure(), and read().
Definition at line 188 of file MStruct.cpp.
References Model::convertPropToMM(), getInfoFilename(), Model::getProperties(), m_RefProp, toString(), and Model::writeFile().
Referenced by Brain::doCommand(), and Brain::triggerTest().
Definition at line 183 of file MStruct.cpp.
References m_RefProp.
Referenced by Brain::doCommand(), and Brain::triggerTest().
void MStructure::showStats | ( | const SubStructure & | subs, |
std::ostream & | os = std::cout |
||
) | const |
Definition at line 561 of file MStruct.cpp.
References DMatrix< T >::at(), dmutil::avg(), VVector< T, D >::begin(), Model::convertPointToMM(), DUMP, SubStructure::generateEMDist(), Model::getCenter(), getIdentityPropTF(), getInfoFilename(), Model::getNNodes(), Model::getNode(), getPropPos(), getPropTF(), getRefModel(), getRefModelIDs(), getRefProp(), getSearchPara(), StructTable::getStructs(), SubStructure::m_Mean, m_Model, m_Name, SubStructure::m_Pivot, m_PStructTable, SubStructure::m_Sigma, SubStructure::m_Stdev, SubStructure::m_SubStructName, SubStructure::m_SupStructName, DMatrix< T >::max(), DMatrix< T >::min(), EMDistribution::ratePropVec(), setPropPos(), DMatrix< T >::setRange(), VVector< T, D >::size(), dmutil::stdev(), and toString().
Referenced by buildAllStats().
bool MStructure::stepSearch | ( | float | dt | ) |
void MStructure::verifyWinnerRating | ( | ) |
Definition at line 531 of file MStruct.cpp.
References getSearcher(), StructTable::getStructs(), Searcher::getWinList(), Searcher::getWinner(), isFrame(), m_Name, m_PStructTable, and m_Searcher.
void MStructure::write | ( | std::ostream & | os | ) | const |
Definition at line 132 of file MStruct.cpp.
References Model::getFilename(), StructTable::getPath(), Searcher::getShapeWeight(), m_Model, m_Name, m_PStructTable, m_Searcher, m_Size, m_SubStructures, m_Weight, and STRUCT_SHAPEWEIGHT.
|
friend |
|
friend |
|
friend |
|
protected |
Definition at line 127 of file MStruct.h.
Referenced by addExpectation(), clear(), getWinner(), operator=(), and setName().
|
protected |
Definition at line 120 of file MStruct.h.
Referenced by buildAllStats(), buildMasterModel(), clear(), MStructure(), operator=(), read(), rebuildExpMap(), showStats(), and write().
|
protected |
Definition at line 119 of file MStruct.h.
Referenced by addSubStruct(), buildAllStats(), clear(), getInfoFilename(), operator=(), read(), rebuildExpMap(), refSubSuper(), setName(), showStats(), verifyWinnerRating(), and write().
|
protected |
Definition at line 118 of file MStruct.h.
Referenced by addExpectation(), buildAllStats(), getInfoFilename(), MStructure(), operator=(), rebuildExpMap(), refSubSuper(), showStats(), verifyWinnerRating(), and write().
Definition at line 124 of file MStruct.h.
Referenced by clear(), getRefProp(), loadRefProp(), operator=(), saveRefProp(), setRefModel(), setRefProp(), and ~MStructure().
|
protected |
Definition at line 125 of file MStruct.h.
Referenced by addExpectation(), getWinner(), read(), rebuildExpMap(), stepSearch(), verifyWinnerRating(), and write().
|
protected |
|
protected |
Definition at line 122 of file MStruct.h.
Referenced by addSubStruct(), buildAllStats(), clear(), StructTable::findBestConnection(), operator=(), rebuildExpMap(), refSubSuper(), and write().
|
protected |
Definition at line 123 of file MStruct.h.
Referenced by clear(), operator=(), rebuildExpMap(), and refSubSuper().
|
protected |