예제 #1
0
void ZFramework3D::slot_load_laplacian()
{
	QString fileName = QFileDialog::getOpenFileName(this,
		tr("Load eigen vector"),
		QDir::currentPath(),
		tr("TXT File(*.txt);;"
		"All Files (*)"));
	ZMeshSpace::ZMeshAlgorithms* handler = ZDataManager::getDataManager()->getAlgorithmHandler();
	ZMeshSpace::Mesh3D* mesh = ZDataManager::getDataManager()->getMesh();
	handler->setMesh(mesh);

	if(!fileName.isEmpty())
		handler->loadEigenVector(fileName.toLocal8Bit());
	QGLViewerWidget* wiget = this->ui.widget;
	MeshRenderer* mr = (MeshRenderer*)wiget->getRenderer();
	mr->setRenderType(RENDER_TYPE_VERTEX_COLOR);
	updateViews();
}
예제 #2
0
void ZFramework3D::slot_update_render_opt()
{
	//updateUi();
	QGLViewerWidget* wiget = this->ui.widget;
	MeshRenderer* mr = (MeshRenderer*)wiget->getRenderer();
	ZMeshSpace::ZMeshAlgorithms* handler = ZDataManager::getDataManager()->getAlgorithmHandler();

	mr->setRenderWireFrame(ui.cbRenderWireframe->isChecked());
	mr->setRenderType(ui.cobRenderType->currentText().toStdString());
	mr->getRenderOption().show_iso_lines = ui.cbIsoLines->isChecked();
	mr->getRenderOption().show_iso_plane = ui.cbShowIsoLines->isChecked();
	mr->getRenderOption().translucent = ui.cbTransparency->isChecked();
	mr->getRenderOption().strRenderIsoPlaneMethod = ui.cobIsoLines->currentText().toStdString();
	mr->getRenderOption().show_kmeans_center_plane = ui.cbShowKmeanPlane->isChecked();
	mr->getRenderOption().show_iso_plane_plane_list = ui.cbClusteredLines->isChecked();
	mr->getRenderOption().show_face_normals = ui.cbShowNormals->isChecked();
	ui.cobIsoLines->setEnabled(ui.cbShowIsoLines->isChecked());

	mr->getRenderOption().show_iso_line_by_id = ui.cbOneByOne->isChecked();
	ui.hSliderIsoLine->setEnabled(ui.cbOneByOne->isChecked());
	ui.labelIsoLineIdx->setEnabled(ui.cbOneByOne->isChecked());

	mr->getRenderOption().show_cvt_init_samples = ui.cbShowCVTSamples->isChecked();
	mr->getRenderOption().show_cvt_delaunay = ui.cbShowCVTDelaunay->isChecked();
	mr->getRenderOption().show_cvt_voronoi = ui.cbShowCVTVoronoi->isChecked();
	mr->getRenderOption().show_cvt_clippingRegion = ui.cbShowCVTClippingRegion->isChecked();
	mr->getRenderOption().show_cvt_voronoi_vertices = ui.cbShowCVTVoronoiVertices->isChecked();
	mr->getRenderOption().show_cvt_vertices = ui.cbShowCVTDelaunayVertices->isChecked();

	int curPos = ui.hSliderIsoLine->sliderPosition();
	handler->setCurrentIsoLineIdx(curPos);
	bool bCluster = (ui.cobIsoLines->currentText()==render_type(RENDER_TYPE_IP_LINES_BY_CLUSTERID));
	QString str;//("IsoLineIdx: ");
	str = bCluster ? ("ClusterId: ") : ("IsoLineIdx: ");
	str += QString::number(curPos);
	ui.labelIsoLineIdx->setText(str);
	updateViews();
}
예제 #3
0
void ZFramework3D::slot_load_eigen()
{
	ZMeshSpace::ZMeshAlgorithms* handler = ZDataManager::getDataManager()->getAlgorithmHandler();
	ZMeshSpace::Mesh3D* mesh = ZDataManager::getDataManager()->getMesh();
	handler->setMesh(mesh);

	QString fileName = QFileDialog::getOpenFileName(this,
		tr("Load Eigen file"),
		QDir::currentPath(),
		tr("EIG File(*.eig);;"
		"All Files(*.*)"));
	if (!fileName.isEmpty())
	{
		handler->loadEigenVectors(fileName.toLocal8Bit());
		qDebug("Save Laplacian done!\n");

		QGLViewerWidget* wiget = this->ui.widget;
		MeshRenderer* mr = (MeshRenderer*)wiget->getRenderer();
		mr->setRenderType(RENDER_TYPE_VERTEX_COLOR);
		slot_change_idx();
		//updateViews();
	}
}
예제 #4
0
void ZFramework3D::slot_compute_laplacian()
{
	ZMeshSpace::ZMeshAlgorithms* handler = ZDataManager::getDataManager()->getAlgorithmHandler();
	ZMeshSpace::Mesh3D* mesh = ZDataManager::getDataManager()->getMesh();
	QString strType = ui.cobLaplacianType->currentText();
	ZMeshSpace::ZMeshAlgorithms::LaplacianType type = ZMeshSpace::ZMeshAlgorithms::COTANGENT;
	if (strType==QString("Uniform"))
	{
		type = ZMeshSpace::ZMeshAlgorithms::UNIFORM;
	}
	else if (strType==QString("Cotangent"))
	{
		type = ZMeshSpace::ZMeshAlgorithms::COTANGENT;
	}
	handler->setMesh(mesh);
	handler->setLaplacianType(type);
	handler->computeLaplacian();
	handler->computeEigens();
	QGLViewerWidget* wiget = this->ui.widget;
	MeshRenderer* mr = (MeshRenderer*)wiget->getRenderer();
	mr->setRenderType(RENDER_TYPE_VERTEX_COLOR);
	qDebug("Compute Laplacian done!\n");
}