本文整理汇总了C++中MapHandlerGen::getName方法的典型用法代码示例。如果您正苦于以下问题:C++ MapHandlerGen::getName方法的具体用法?C++ MapHandlerGen::getName怎么用?C++ MapHandlerGen::getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MapHandlerGen
的用法示例。
在下文中一共展示了MapHandlerGen::getName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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++;
}
}
}
示例2: attributeModified
void Surface_DifferentialProperties_Plugin::attributeModified(unsigned int orbit, QString nameAttr)
{
if(orbit == VERTEX)
{
MapHandlerGen* map = static_cast<MapHandlerGen*>(QObject::sender());
if(computeNormalLastParameters.contains(map->getName()))
{
ComputeNormalParameters& params = computeNormalLastParameters[map->getName()];
if(params.autoUpdate && params.positionName == nameAttr)
computeNormal(map->getName(), params.positionName, params.normalName, true);
}
if(computeCurvatureLastParameters.contains(map->getName()))
{
ComputeCurvatureParameters& params = computeCurvatureLastParameters[map->getName()];
if(params.autoUpdate && (params.positionName == nameAttr || params.normalName == nameAttr))
computeCurvature(
map->getName(),
params.positionName, params.normalName,
params.KmaxName, params.kmaxName, params.KminName, params.kminName, params.KnormalName,
true
);
}
}
}
示例3: importFromFile
MapHandlerGen* Surface_Radiance_Plugin::importFromFile(const QString& fileName)
{
QFileInfo fi(fileName);
if(fi.exists())
{
MapHandlerGen* mhg = m_schnapps->addMap(fi.baseName(), 2);
if(mhg)
{
MapHandler<PFP2>* mh = static_cast<MapHandler<PFP2>*>(mhg);
PFP2::MAP* map = mh->getMap();
MeshTablesSurface_Radiance importer(*map);
if (!importer.importPLY<Utils::SphericalHarmonics<PFP2::REAL, PFP2::VEC3> >(fileName.toStdString()))
{
std::cout << "could not import " << fileName.toStdString() << std::endl;
return NULL;
}
CGoGN::Algo::Surface::Import::importMesh<PFP2>(*map, importer);
// get vertex position attribute
VertexAttribute<PFP2::VEC3, PFP2::MAP> position = map->getAttribute<PFP2::VEC3, VERTEX, PFP2::MAP>("position") ;
VertexAttribute<PFP2::VEC3, PFP2::MAP> normal = map->getAttribute<PFP2::VEC3, VERTEX, PFP2::MAP>("normal");
mh->registerAttribute(position);
mh->registerAttribute(normal);
MapParameters& mapParams = h_mapParameterSet[mhg];
mapParams.nbVertices = Algo::Topo::getNbOrbits<VERTEX>(*map);
mapParams.radiance = map->getAttribute<Utils::SphericalHarmonics<PFP2::REAL, PFP2::VEC3>, VERTEX, PFP2::MAP>("radiance") ;
mapParams.radianceTexture = new Utils::Texture<2, Geom::Vec3f>(GL_FLOAT);
mapParams.param = map->checkAttribute<Geom::Vec2i, VERTEX, PFP2::MAP>("param");
// create texture
unsigned int nbv_nbc = Algo::Topo::getNbOrbits<VERTEX>(*map) * Utils::SphericalHarmonics<PFP2::REAL, PFP2::VEC3>::get_nb_coefs();
unsigned int size = 1;
while (size * size < nbv_nbc)
size <<= 1;
mapParams.radianceTexture->create(Geom::Vec2i(size, size));
// fill texture
unsigned int count = 0;
foreach_cell<VERTEX>(*map, [&] (Vertex v)
{
unsigned int i = count / size;
unsigned int j = count % size;
mapParams.param[v] = Geom::Vec2i(i, j) ; // first index for current vertex
for (int l = 0 ; l <= Utils::SphericalHarmonics<PFP2::REAL, PFP2::VEC3>::get_resolution() ; ++l)
{
for (int m = -l ; m <= l ; ++m)
{
i = count / size;
j = count % size;
(*(mapParams.radianceTexture))(i,j) = mapParams.radiance[v].get_coef(l, m);
++count;
}
}
}) ;
// resulting texture : SH00_vx0, SH1-1_vx0, ..., SHlm_vx0, SH00_vx1, SH1-1_vx1, ..., SHlm_vx1, etc.
// resulting param : param[vxI] points to SH00_vxI
// the size of the texture is needed to know where to do the divisions and modulos.
mapParams.radianceTexture->update();
// uncomment this line to be able to load multiple objects with different SH basis
// (decimation will be unavailable)
// map->removeAttribute(mapParams.radiance);
mapParams.paramVBO = new Utils::VBO();
mapParams.paramVBO->updateData(mapParams.param);
mapParams.radiancePerVertexShader = new Utils::ShaderRadiancePerVertex(Utils::SphericalHarmonics<PFP2::REAL, PFP2::VEC3>::get_resolution());
registerShader(mapParams.radiancePerVertexShader);
}
this->pythonRecording("importFile", mhg->getName(), fi.baseName());
return mhg;
}
else
return NULL;
}