void lemur::cluster::CentroidCluster::add(const ClusterElt &elt) { bool firstOne = (size == 0); Cluster::add(elt); ClusterRep *rep = new ClusterRep(elt.id, ind); // VIOLATING ENCAPSULATION. Bleah! updateCentroid(rep->getRep(), firstOne); delete(rep); }
Point3F WorldEditorSelection::getBoxBottomCenter() { updateCentroid(); Point3F bottomCenter = mBoxCentroid; bottomCenter.z -= mBoxBounds.len_z() * 0.5f; return bottomCenter; }
//-------------------------------------------------------------- void OpenNIPerson::update( ofxOpenNIUser & user ){ updateCentroid(user.getCenter(), true); if ( user.getUseSkeleton() ){ skeleton.clear(); for ( int i=0; i<user.getNumLimbs(); i++){ skeleton.push_back( user.getLimb((Limb) i) ); } } Person::update(); }
void lemur::cluster::CentroidCluster::add(vector<lemur::api::DOCID_T> docids) { bool firstOne = (size == 0); // don't use add for efficiency's sake (single update of centroid). ClusterElt fred; for (int i = 0; i < docids.size(); i++) { fred.id = docids[i]; fred.myType = DOC_ELT; ids.push_back(fred); size++; } ClusterRep *rep = new ClusterRep(docids, ind); // VIOLATING ENCAPSULATION. Bleah! updateCentroid(rep->getRep(), firstOne); delete(rep); }
const Box3F & WorldEditorSelection::getBoxBounds() { updateCentroid(); return(mBoxBounds); }
const Point3F & WorldEditorSelection::getBoxCentroid() { updateCentroid(); return(mBoxCentroid); }
bool WorldEditorSelection::containsGlobalBounds() { updateCentroid(); return mContainsGlobalBounds; }