Commit 8d7b97a3 authored by Pierre Kraemer's avatar Pierre Kraemer

SCHNApps: register attributes of all orbits after import

parent 05d029d7
......@@ -39,13 +39,16 @@ MapHandlerGen* Surface_Import_Plugin::importFromFile(const QString& fileName)
std::vector<std::string> attrNames;
Algo::Surface::Import::importMesh<PFP2>(*map, fileName.toStdString(), attrNames);
AttributeContainer& cont = map->getAttributeContainer<VERTEX>();
std::vector<std::string> names;
std::vector<std::string> types;
cont.getAttributesNames(names);
cont.getAttributesTypes(types);
for(unsigned int i = 0; i < names.size(); ++i)
mhg->registerAttribute(VERTEX, QString::fromStdString(names[i]), QString::fromStdString(types[i]));
for (unsigned int orbit = VERTEX; orbit <= VOLUME; orbit++)
{
AttributeContainer& cont = map->getAttributeContainer(orbit);
std::vector<std::string> names;
std::vector<std::string> types;
cont.getAttributesNames(names);
cont.getAttributesTypes(types);
for(unsigned int i = 0; i < names.size(); ++i)
mhg->registerAttribute(orbit, QString::fromStdString(names[i]), QString::fromStdString(types[i]));
}
}
return mhg;
}
......
......@@ -216,10 +216,8 @@ MapHandlerGen* Surface_Radiance_Plugin::importFromFile(const QString& fileName)
// 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");
// update corresponding VBO & emit attribute update signal
mh->notifyAttributeModification(position);
mh->notifyAttributeModification(normal);
mh->registerAttribute(position);
mh->registerAttribute(normal);
MapParameters& mapParams = h_mapParameterSet[mhg];
......
......@@ -24,7 +24,7 @@ Surface_Selection_Plugin::Surface_Selection_Plugin() :
bool Surface_Selection_Plugin::enable()
{
// magic line that init static variables of GenericMap in the plugins
GenericMap::copyAllStatics(m_schnapps->getStaticPointers());
GenericMap::copyAllStatics(m_schnapps->getStaticPointers());
m_dockTab = new Surface_Selection_DockTab(m_schnapps, this);
m_schnapps->addPluginDockTab(this, m_dockTab, "Surface_Selection");
......@@ -491,11 +491,6 @@ void Surface_Selection_Plugin::selectedMapChanged(MapHandlerGen *prev, MapHandle
connect(cur, SIGNAL(connectivityModified()), this, SLOT(selectedMapConnectivityModified()));
m_selectionRadius = cur->getBBdiagSize() / 50.0f;
}
if (cur==NULL)
m_dockTab->setDisabled(true);
else
m_dockTab->setDisabled(false);
}
void Surface_Selection_Plugin::updateSelectedCellsRendering()
......
......@@ -39,15 +39,16 @@ MapHandlerGen* Volume_Import_Plugin::importFromFile(const QString& fileName)
std::vector<std::string> attrNames ;
Algo::Volume::Import::importMesh<PFP3>(*map, fileName.toStdString(), attrNames);
// // get vertex position attribute
// VertexAttribute<PFP3::VEC3, PFP3::MAP> position = map->getAttribute<PFP3::VEC3, VERTEX, PFP3::MAP>(attrNames[0]);
// mh->registerAttribute(position);
// // update corresponding VBO & emit attribute update signal
// mh->notifyAttributeModification(position);
// // compute map bounding box
// mh->updateBB(position);
for (unsigned int orbit = VERTEX; orbit <= VOLUME; orbit++)
{
AttributeContainer& cont = map->getAttributeContainer(orbit);
std::vector<std::string> names;
std::vector<std::string> types;
cont.getAttributesNames(names);
cont.getAttributesTypes(types);
for(unsigned int i = 0; i < names.size(); ++i)
mhg->registerAttribute(orbit, QString::fromStdString(names[i]), QString::fromStdString(types[i]));
}
}
return mhg;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment