Ejemplo n.º 1
0
//this constructs an initial mesh from a data file
Mesh::Mesh(int s, vector<Vertex*> v, vector<Face*> f){
	stage = s;
	box_min.set(10000, 10000, 10000);
	box_max.set(-10000, -10000, -10000);
	stage = s;
	
	for(vector<Face*> :: iterator it = f.begin(); it != f.end(); it++) faces.insert(pair<int, Face*> ((*it)->getId(), *it));
	for(vector<Vertex*> :: iterator it = v.begin(); it != v.end(); it++){
		vList.push_back(*it);
		twin_vertices.insert(pair<int, int> ((*it)->getId(), (*it)->getId())); // to start, everything points to itself
	} 

	box_min.set(10000, 10000, 10000);
	box_max.set(-10000, -10000, -10000);
	
	//update Bounding box
	for(vector<Vertex*> :: iterator it = vList.begin(); it != vList.end(); it++){
		updateMins(box_min, (*it)->getPoint());
		updateMaxs(box_max, (*it)->getPoint());
	}

	constructTopology();
	updateMeshData();

//	setFacePointers();
//	updateNormals();
}
Ejemplo n.º 2
0
void ofxSkeleton::draw(){
    
	updateMeshData();
    
	texture->bind();
	mesh.draw();
	texture->unbind();
}
Ejemplo n.º 3
0
vtkPolyData* rtEPDataObject::getMeshData() {
  if (phaseExists(m_currentPhase)) {
    updateMeshData(m_currentPhase);
    return m_phaseDataList.value(m_currentPhase).meshData;
  } else {
    rtApplication::instance().getMessageHandle()->error(__LINE__, __FILE__, QString("Phase does not exist: ").append(QString::number(m_currentPhase)));
    return NULL;
  }
}
Ejemplo n.º 4
0
void rtEPDataObject::updateObjectNow() {
  QList<int> phaseList = m_phaseDataList.keys();

  m_optionsWidget.applyProgressBar->setRange(0, phaseList.size());
  m_optionsWidget.applyProgressBar->reset();
  QApplication::instance()->processEvents();
  for (int ix1=0; ix1<phaseList.size(); ix1++) {
    updateMeshData(phaseList.at(ix1));
    updatePointData(phaseList.at(ix1));
    m_optionsWidget.applyProgressBar->setValue(ix1);
    QApplication::instance()->processEvents();
  }
  m_optionsWidget.applyProgressBar->setValue(phaseList.size());
}
Ejemplo n.º 5
0
Mesh::Mesh(int s, Mesh* old, vector<Delta*> changes){

	stage = s;
	
	map<int, Face*> f = old->getFaces();
	vector<Vertex*> v = old->getVList();
	map<int, int> t = old->getTwins();
	
	for(map<int, Face*> :: iterator it = f.begin(); it != f.end(); it++) faces.insert(*it);
	for(vector<Vertex*> :: iterator it = v.begin(); it != v.end(); it++){
		vList.push_back(new Vertex(*it));
	} 

	for(map<int, int> :: iterator it = t.begin(); it != t.end(); it++) twin_vertices.insert(*it);

	subdivide();
	//linkChildren();
	addModifications(changes);
	updateMeshData();
}