当前位置: 首页>>代码示例>>C++>>正文


C++ MapHandlerGen类代码示例

本文整理汇总了C++中MapHandlerGen的典型用法代码示例。如果您正苦于以下问题:C++ MapHandlerGen类的具体用法?C++ MapHandlerGen怎么用?C++ MapHandlerGen使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了MapHandlerGen类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: selectedMapBoundingBoxModified

void Surface_Selection_Plugin::selectedMapBoundingBoxModified()
{
	MapHandlerGen* map = static_cast<MapHandlerGen*>(QObject::sender());
	m_selectionRadiusBase = map->getBBdiagSize() / 50.0f;
	h_parameterSet[map].basePSradius = map->getBBdiagSize() / (std::sqrt(map->getNbOrbits(EDGE)));
	h_parameterSet[map].verticesScaleFactor = m_dockTab->slider_verticesScaleFactor->value() / 50.0f;
}
开发者ID:gitter-badger,项目名称:CGoGN,代码行数:7,代码来源:surface_selection.cpp

示例2: changeScalarVBO

void Surface_RenderScalar_Plugin::changeScalarVBO(const QString& view, const QString& map, const QString& vbo)
{
	View* v = m_schnapps->getView(view);
	MapHandlerGen* m = m_schnapps->getMap(map);
	if(v && m)
	{
		MapParameters& p = h_viewParameterSet[v][m];

		Utils::VBO* vbuf = m->getVBO(vbo);
		p.positionVBO = vbuf;

		if(vbuf)
		{
			MapHandler<PFP2>* mh = static_cast<MapHandler<PFP2>*>(m);
			const VertexAttribute<PFP2::REAL, PFP2::MAP>& attr = mh->getAttribute<PFP2::REAL, VERTEX>(QString::fromStdString(vbuf->name()));
			p.scalarMin = std::numeric_limits<float>::max();
			p.scalarMax = std::numeric_limits<float>::min();
			for(unsigned int i = attr.begin(); i != attr.end(); attr.next(i))
			{
				p.scalarMin = attr[i] < p.scalarMin ? attr[i] : p.scalarMin;
				p.scalarMax = attr[i] > p.scalarMax ? attr[i] : p.scalarMax;
			}
		}

		if(v->isSelectedView())
		{
			if(v->isLinkedToMap(m))	v->updateGL();
			if(m->isSelectedMap()) m_dockTab->updateMapParameters();
		}
	}
}
开发者ID:Peiffert,项目名称:CGoGN,代码行数:31,代码来源:surface_renderScalar.cpp

示例3: computeNormal

void Surface_DifferentialProperties_Plugin::computeNormalFromDialog()
{
	QList<QListWidgetItem*> currentItems = m_computeNormalDialog->list_maps->selectedItems();
	if(!currentItems.empty())
	{
		const QString& mapName = currentItems[0]->text();

		QString positionName = m_computeNormalDialog->combo_positionAttribute->currentText();

		QString normalName;
		if(m_computeNormalDialog->normalAttributeName->text().isEmpty())
			normalName = m_computeNormalDialog->combo_normalAttribute->currentText();
		else
			normalName = m_computeNormalDialog->normalAttributeName->text();

		bool autoUpdate = (currentItems[0]->checkState() == Qt::Checked);

		computeNormal(mapName, positionName, normalName, autoUpdate);

		// create VBO if asked
		if (m_computeNormalDialog->enableVBO->isChecked())
		{
			MapHandlerGen* mhg = getSCHNApps()->getMap(mapName);
			if (mhg != NULL)
				mhg->createVBO(normalName);
		}
	}
}
开发者ID:Peiffert,项目名称:CGoGN,代码行数:28,代码来源:surface_differentialProperties.cpp

示例4: changeNormalVBO

void Surface_Radiance_Plugin::changeNormalVBO(const QString& map, const QString& vbo)
{
	MapHandlerGen* m = m_schnapps->getMap(map);
	if(m)
	{
		Utils::VBO* vbuf = m->getVBO(vbo);
		h_mapParameterSet[m].normalVBO = vbuf;
		if(m->isSelectedMap())
			m_dockTab->updateMapParameters();
	}
}
开发者ID:sujithvg,项目名称:CGoGN,代码行数:11,代码来源:surface_radiance.cpp

示例5: DEBUG_SLOT

void Surface_Render_Plugin::boundingBoxModified()
{
	DEBUG_SLOT();
	MapHandlerGen* map = static_cast<MapHandlerGen*>(QObject::sender());

	QList<View*> views = map->getLinkedViews();
	foreach(View* v, views)
	{
		if (h_viewParameterSet.contains(v))
			h_viewParameterSet[v][map].basePSradius = map->getBBdiagSize() / (2 * std::sqrt(map->getNbOrbits(EDGE)));
	}
}
开发者ID:abletterer,项目名称:CGoGN-1,代码行数:12,代码来源:surface_render.cpp

示例6: mouseMove

void Surface_Selection_Plugin::mouseMove(View* view, QMouseEvent* event)
{
	if(m_selecting)
	{
		MapHandlerGen* mh = m_schnapps->getSelectedMap();
		const MapParameters& p = h_parameterSet[mh];
		if(p.positionAttribute.isValid())
		{
			unsigned int orbit = m_schnapps->getCurrentOrbit();
			CellSelectorGen* selector = m_schnapps->getSelectedSelector(orbit);
			if(selector)
			{
				QPoint pixel(event->x(), event->y());
				qglviewer::Vec orig;
				qglviewer::Vec dir;
				view->camera()->convertClickToLine(pixel, orig, dir);

				// compute coordinates of ray in map Frame
				qglviewer::Vec orig_inv = mh->getFrame()->coordinatesOf(orig);
				qglviewer::Vec dir_inv = mh->getFrame()->transformOf(dir);
				// apply inverse local map transfo
				glm::vec4 glmRayA = mh->getInverseTransfoMatrix()*glm::vec4(orig_inv.x, orig_inv.y, orig_inv.z, 1.0f);
				glm::vec4 glmAB = glm::transpose(mh->getInverseTransfoMatrix())*glm::vec4(dir_inv.x, dir_inv.y, dir_inv.z, 1.0f);
				// put in PFP::VEC3 format
				PFP2::VEC3 rayA(glmRayA.x, glmRayA.y, glmRayA.z);
				PFP2::VEC3 AB(glmAB.x, glmAB.y, glmAB.z);

				PFP2::MAP* map = static_cast<MapHandler<PFP2>*>(mh)->getMap();

				switch(orbit)
				{
					case VERTEX : {
						Algo::Selection::vertexRaySelection<PFP2>(*map, p.positionAttribute, rayA, AB, m_selectingVertex);
						break;
					}
					case EDGE : {
						Algo::Selection::edgeRaySelection<PFP2>(*map, p.positionAttribute, rayA, AB, m_selectingEdge);
						break;
					}
					case FACE : {
						Algo::Selection::faceRaySelection<PFP2>(*map, p.positionAttribute, rayA, AB, m_selectingFace);
						break;
					}
				}

				view->updateGL();
			}
		}
	}
}
开发者ID:gitter-badger,项目名称:CGoGN,代码行数:50,代码来源:surface_selection.cpp

示例7: changeExpansion

void Surface_RenderScalar_Plugin::changeExpansion(const QString& view, const QString& map, int i)
{
	View* v = m_schnapps->getView(view);
	MapHandlerGen* m = m_schnapps->getMap(map);
	if(v && m)
	{
		h_viewParameterSet[v][m].expansion = i;
		if(v->isSelectedView())
		{
			if(v->isLinkedToMap(m))	v->updateGL();
			if(m->isSelectedMap()) m_dockTab->updateMapParameters();
		}
	}
}
开发者ID:Peiffert,项目名称:CGoGN,代码行数:14,代码来源:surface_renderScalar.cpp

示例8: checkNbVerticesAndExport

void Surface_Radiance_Plugin::checkNbVerticesAndExport(Surface_Radiance_Plugin* p, const unsigned int* nbVertices)
{
	if (!p->exportNbVert.empty())
	{
		MapHandlerGen* mhg = p->currentlyDecimatedMap();
		if (*nbVertices == p->exportNbVert[p->nextExportIndex])
		{
			std::stringstream exportName;
			exportName << p->currentlyDecimatedMap()->getName().toStdString() << "_" << (p->currentDecimationHalf() ? "half_" : "full_") << (*nbVertices) << ".ply";
			std::cout << "export : " << exportName.str() << std::endl;
			p->exportPLY(mhg->getName(), "position", "normal", QString::fromStdString(exportName.str()));
			p->nextExportIndex++;
		}
	}
}
开发者ID:sujithvg,项目名称:CGoGN,代码行数:15,代码来源:surface_radiance.cpp

示例9: vertices_scale_factor_changed

void Selection_DockTab::vertices_scale_factor_changed(int i)
{
	if (!updating_ui_)
	{
		View* view = schnapps_->get_selected_view();
		MapHandlerGen* map = schnapps_->get_selected_map();
		if (view && map)
		{
			MapParameters& p = plugin_->get_parameters(view, map);
			p.set_vertex_scale_factor(i / 50.0);
			for (View* view : map->get_linked_views())
				view->update();
		}
	}
}
开发者ID:etienneschmitt,项目名称:SCHNApps,代码行数:15,代码来源:selection_dock_tab.cpp

示例10: color_changed

void Selection_DockTab::color_changed(int i)
{
	if (!updating_ui_)
	{
		View* view = schnapps_->get_selected_view();
		MapHandlerGen* map = schnapps_->get_selected_map();
		if (view && map)
		{
			MapParameters& p = plugin_->get_parameters(view, map);
			p.set_color(combo_color->color());
			for (View* view : map->get_linked_views())
				view->update();
		}
	}
}
开发者ID:etienneschmitt,项目名称:SCHNApps,代码行数:15,代码来源:selection_dock_tab.cpp

示例11: changePositionVBO

void Surface_RenderScalar_Plugin::changePositionVBO(const QString& view, const QString& map, const QString& vbo)
{
	View* v = m_schnapps->getView(view);
	MapHandlerGen* m = m_schnapps->getMap(map);
	if(v && m)
	{
		Utils::VBO* vbuf = m->getVBO(vbo);
		h_viewParameterSet[v][m].positionVBO = vbuf;
		if(v->isSelectedView())
		{
			if(v->isLinkedToMap(m))	v->updateGL();
			if(m->isSelectedMap()) m_dockTab->updateMapParameters();
		}
	}
}
开发者ID:Peiffert,项目名称:CGoGN,代码行数:15,代码来源:surface_renderScalar.cpp

示例12: changeSelectionMethod

void Surface_Selection_Plugin::changeSelectionMethod(const QString& map, unsigned int method)
{
	MapHandlerGen* m = m_schnapps->getMap(map);
	if(m)
	{
		h_parameterSet[m].selectionMethod = SelectionMethod(method);
		if(m->isSelectedMap())
			m_dockTab->updateMapParameters();
	}
	View* v = m_schnapps->getSelectedView();
	if (v)
	{
		if (v->isLinkedToMap(m))
			v->updateGL();
	}
}
开发者ID:gitter-badger,项目名称:CGoGN,代码行数:16,代码来源:surface_selection.cpp

示例13: changeSelectedColor

void Surface_Selection_Plugin::changeSelectedColor( const QString& map, const QString& col)
{
	MapHandlerGen* m = m_schnapps->getMap(map);
	if (m)
	{
		h_parameterSet[m].color = QColor(col);
		if (m->isSelectedMap())
			m_dockTab->updateMapParameters();

		View* v = m_schnapps->getSelectedView();
		if (v)
		{
			if (v->isLinkedToMap(m))
				v->updateGL();
		}
	}
}
开发者ID:gitter-badger,项目名称:CGoGN,代码行数:17,代码来源:surface_selection.cpp

示例14: changeNormalAttribute

void Surface_Selection_Plugin::changeNormalAttribute(const QString& map, const QString& name)
{
	MapHandlerGen* m = m_schnapps->getMap(map);
	if(m)
	{
		MapHandler<PFP2>* mh = static_cast<MapHandler<PFP2>*>(m);
		h_parameterSet[m].normalAttribute = mh->getAttribute<PFP2::VEC3, VERTEX>(name);
		if(m->isSelectedMap())
			m_dockTab->updateMapParameters();
	}
	View* v = m_schnapps->getSelectedView();
	if (v)
	{
		if (v->isLinkedToMap(m))
			v->updateGL();
	}
}
开发者ID:gitter-badger,项目名称:CGoGN,代码行数:17,代码来源:surface_selection.cpp

示例15: selected_map_vertex_attribute_added

void Selection_DockTab::selected_map_vertex_attribute_added(const QString& name)
{
	updating_ui_ = true;

	QString vec3_type_name = QString::fromStdString(cgogn::name_of_type(VEC3()));

	MapHandlerGen* map = schnapps_->get_selected_map();
	const MapHandlerGen::ChunkArrayContainer<cgogn::numerics::uint32>* container = map->const_attribute_container(Vertex_Cell);
	QString attribute_type_name = QString::fromStdString(container->get_chunk_array(name.toStdString())->type_name());

	if (attribute_type_name == vec3_type_name)
	{
		combo_positionAttribute->addItem(name);
		combo_normalAttribute->addItem(name);
	}

	updating_ui_ = false;
}
开发者ID:etienneschmitt,项目名称:SCHNApps,代码行数:18,代码来源:selection_dock_tab.cpp


注:本文中的MapHandlerGen类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。