Commit 4266a0c6 authored by Pierre Kraemer's avatar Pierre Kraemer

add plugin surface_differentialProperties

parent 79d7fc0c
......@@ -80,7 +80,7 @@ To compile CGoGN:
WITH_QT (T)
-> to minimize dependencies and compilation time
FORCE_MR (1)
FORCE_MR (0)
-> allows the compilation in 2 modes: mono-resolution(0), multi-resolution(1)
ONELIB (F)
......
......@@ -2,3 +2,4 @@ cmake_minimum_required(VERSION 2.8)
ADD_SUBDIRECTORY(surface_import)
ADD_SUBDIRECTORY(surface_render)
ADD_SUBDIRECTORY(surface_differentialProperties)
......@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 2.8)
SET( PLUGIN_NAME DifferentialProperties )
SET( PLUGIN_ROOT_DIR ${SCHNApps_ROOT_DIR}/Plugins/differentialProperties )
SET( PLUGIN_ROOT_DIR ${SCHNApps_ROOT_DIR}/Plugins/surface_differentialProperties )
INCLUDE_DIRECTORIES(
${PLUGIN_ROOT_DIR}/include
......@@ -25,9 +25,9 @@ file(
SET(
PLUGIN_QOBJECT_FILES
${PLUGIN_ROOT_DIR}/include/differentialProperties.h
${PLUGIN_ROOT_DIR}/include/computeNormalDialog.h
${PLUGIN_ROOT_DIR}/include/computeCurvatureDialog.h
${PLUGIN_ROOT_DIR}/include/surface_differentialProperties.h
${PLUGIN_ROOT_DIR}/include/dialog_computeNormal.h
${PLUGIN_ROOT_DIR}/include/dialog_computeCurvature.h
)
include( ${SCHNApps_ROOT_DIR}/Plugins/plugins_cmake.txt )
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ComputeCurvatureDialog</class>
<widget class="QDialog" name="ComputeCurvatureDialog">
<class>Dialog_ComputeCurvature</class>
<widget class="QDialog" name="Dialog_ComputeCurvature">
<property name="geometry">
<rect>
<x>0</x>
......@@ -15,7 +15,7 @@
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QListWidget" name="mapList"/>
<widget class="QListWidget" name="list_maps"/>
</item>
<item row="1" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
......@@ -321,7 +321,7 @@
<connection>
<sender>button_ok</sender>
<signal>clicked()</signal>
<receiver>ComputeCurvatureDialog</receiver>
<receiver>Dialog_ComputeCurvature</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
......@@ -337,7 +337,7 @@
<connection>
<sender>button_cancel</sender>
<signal>clicked()</signal>
<receiver>ComputeCurvatureDialog</receiver>
<receiver>Dialog_ComputeCurvature</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
......
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ComputeNormalDialog</class>
<widget class="QDialog" name="ComputeNormalDialog">
<class>Dialog_ComputeNormal</class>
<widget class="QDialog" name="Dialog_ComputeNormal">
<property name="geometry">
<rect>
<x>0</x>
......@@ -15,7 +15,7 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QListWidget" name="mapList"/>
<widget class="QListWidget" name="list_maps"/>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
......@@ -110,7 +110,7 @@
<connection>
<sender>button_ok</sender>
<signal>clicked()</signal>
<receiver>ComputeNormalDialog</receiver>
<receiver>Dialog_ComputeNormal</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
......@@ -126,7 +126,7 @@
<connection>
<sender>button_cancel</sender>
<signal>clicked()</signal>
<receiver>ComputeNormalDialog</receiver>
<receiver>Dialog_ComputeNormal</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
......
#ifndef _COMPUTECURVATURE_DIALOG_H_
#define _COMPUTECURVATURE_DIALOG_H_
#ifndef _DIALOG_COMPUTECURVATURE_H_
#define _DIALOG_COMPUTECURVATURE_H_
#include "ui_computeCurvatureDialog.h"
#include "ui_dialog_computeCurvature.h"
namespace CGoGN
{
......@@ -9,18 +9,18 @@ namespace CGoGN
namespace SCHNApps
{
class Window;
class SCHNApps;
class MapHandlerGen;
class ComputeCurvatureDialog : public QDialog, public Ui::ComputeCurvatureDialog
class Dialog_ComputeCurvature : public QDialog, public Ui::Dialog_ComputeCurvature
{
Q_OBJECT
public:
ComputeCurvatureDialog(Window* w);
Dialog_ComputeCurvature(SCHNApps* s);
private:
Window* m_window;
SCHNApps* m_schnapps;
MapHandlerGen* m_selectedMap;
public slots:
......
#ifndef _COMPUTENORMAL_DIALOG_H_
#define _COMPUTENORMAL_DIALOG_H_
#ifndef _DIALOG_COMPUTENORMAL_H_
#define _DIALOG_COMPUTENORMAL_H_
#include "ui_computeNormalDialog.h"
#include "ui_dialog_computeNormal.h"
namespace CGoGN
{
......@@ -9,18 +9,18 @@ namespace CGoGN
namespace SCHNApps
{
class Window;
class SCHNApps;
class MapHandlerGen;
class ComputeNormalDialog : public QDialog, public Ui::ComputeNormalDialog
class Dialog_ComputeNormal : public QDialog, public Ui::Dialog_ComputeNormal
{
Q_OBJECT
public:
ComputeNormalDialog(Window* w);
Dialog_ComputeNormal(SCHNApps* s);
private:
Window* m_window;
SCHNApps* m_schnapps;
MapHandlerGen* m_selectedMap;
public slots:
......
#ifndef _DIFFERENTIALPROPERTIES_PLUGIN_H_
#define _DIFFERENTIALPROPERTIES_PLUGIN_H_
#ifndef _SURFACE_DIFFERENTIALPROPERTIES_PLUGIN_H_
#define _SURFACE_DIFFERENTIALPROPERTIES_PLUGIN_H_
#include "plugin.h"
#include "plugin_processing.h"
#include "computeNormalDialog.h"
#include "computeCurvatureDialog.h"
#include "dialog_computeNormal.h"
#include "dialog_computeCurvature.h"
namespace CGoGN
{
using namespace CGoGN;
using namespace SCHNApps;
namespace SCHNApps
{
class DifferentialPropertiesPlugin : public Plugin
class Surface_DifferentialProperties_Plugin : public PluginProcessing
{
Q_OBJECT
Q_INTERFACES(CGoGN::SCHNApps::Plugin)
public:
DifferentialPropertiesPlugin()
{
setProvidesRendering(false);
}
Surface_DifferentialProperties_Plugin()
{}
~DifferentialPropertiesPlugin()
~Surface_DifferentialProperties_Plugin()
{}
virtual bool enable();
virtual void disable() {}
virtual void redraw(View *view) {}
virtual void keyPress(View* view, QKeyEvent* event) {}
virtual void keyRelease(View* view, QKeyEvent* event) {}
virtual void mousePress(View* view, QMouseEvent* event) {}
virtual void mouseRelease(View* view, QMouseEvent* event) {}
virtual void mouseMove(View* view, QMouseEvent* event) {}
virtual void wheelEvent(View* view, QWheelEvent* event) {}
public slots:
private slots:
void mapAdded(MapHandlerGen* map);
void mapRemoved(MapHandlerGen* map);
void attributeModified(unsigned int orbit, QString nameAttr);
......@@ -48,6 +38,7 @@ public slots:
void computeNormalFromDialog();
void computeCurvatureFromDialog();
public slots:
void computeNormal(const QString& mapName,
const QString& positionAttributeName = "position",
const QString& normalAttributeName = "normal",
......@@ -68,8 +59,8 @@ public slots:
);
private:
ComputeNormalDialog* m_computeNormalDialog;
ComputeCurvatureDialog* m_computeCurvatureDialog;
Dialog_ComputeNormal* m_computeNormalDialog;
Dialog_ComputeCurvature* m_computeCurvatureDialog;
QAction* m_computeNormalAction;
QAction* m_computeCurvatureAction;
......@@ -111,4 +102,8 @@ private:
QHash<QString, ComputeCurvatureParameters> computeCurvatureLastParameters;
};
} // namespace SCHNApps
} // namespace CGoGN
#endif
#include "computeCurvatureDialog.h"
#include "dialog_computeCurvature.h"
#include "differentialProperties.h"
#include "window.h"
#include "surface_differentialProperties.h"
#include "schnapps.h"
#include "mapHandler.h"
namespace CGoGN
......@@ -10,8 +10,8 @@ namespace CGoGN
namespace SCHNApps
{
ComputeCurvatureDialog::ComputeCurvatureDialog(Window* w) :
m_window(w),
Dialog_ComputeCurvature::Dialog_ComputeCurvature(SCHNApps* s) :
m_schnapps(s),
m_selectedMap(NULL)
{
setupUi(this);
......@@ -22,25 +22,24 @@ ComputeCurvatureDialog::ComputeCurvatureDialog(Window* w) :
kminAttributeName->setText("kmin");
KnormalAttributeName->setText("Knormal");
connect(m_window, SIGNAL(mapAdded(MapHandlerGen*)), this, SLOT(addMapToList(MapHandlerGen*)));
connect(m_window, SIGNAL(mapRemoved(MapHandlerGen*)), this, SLOT(removeMapFromList(MapHandlerGen*)));
connect(m_schnapps, SIGNAL(mapAdded(MapHandlerGen*)), this, SLOT(addMapToList(MapHandlerGen*)));
connect(m_schnapps, SIGNAL(mapRemoved(MapHandlerGen*)), this, SLOT(removeMapFromList(MapHandlerGen*)));
connect(mapList, SIGNAL(itemSelectionChanged()), this, SLOT(selectedMapChanged()));
connect(list_maps, SIGNAL(itemSelectionChanged()), this, SLOT(selectedMapChanged()));
const QList<MapHandlerGen*>& maps = m_window->getMapsList();
foreach(MapHandlerGen* map, maps)
foreach(MapHandlerGen* map, m_schnapps->getMapSet().values())
{
QListWidgetItem* item = new QListWidgetItem(map->getName(), mapList);
QListWidgetItem* item = new QListWidgetItem(map->getName(), list_maps);
item->setCheckState(Qt::Unchecked);
}
}
void ComputeCurvatureDialog::selectedMapChanged()
void Dialog_ComputeCurvature::selectedMapChanged()
{
if(m_selectedMap)
disconnect(m_selectedMap, SIGNAL(attributeAdded(unsigned int, const QString&)), this, SLOT(addAttributeToList(unsigned int, const QString&)));
QList<QListWidgetItem*> currentItems = mapList->selectedItems();
QList<QListWidgetItem*> currentItems = list_maps->selectedItems();
if(!currentItems.empty())
{
combo_positionAttribute->clear();
......@@ -52,49 +51,30 @@ void ComputeCurvatureDialog::selectedMapChanged()
combo_kminAttribute->clear();
const QString& mapname = currentItems[0]->text();
MapHandlerGen* mh = m_window->getMap(mapname);
MapHandlerGen* mh = m_schnapps->getMap(mapname);
QString vec3TypeName = QString::fromStdString(nameOfType(PFP2::VEC3()));
QString realTypeName = QString::fromStdString(nameOfType(PFP2::REAL()));
unsigned int j = 0;
unsigned int k = 0;
const AttributeHash& attribs = mh->getAttributesList(VERTEX);
for(AttributeHash::const_iterator i = attribs.constBegin(); i != attribs.constEnd(); ++i)
const AttributeSet& attribs = mh->getAttributeSet(VERTEX);
for(AttributeSet::const_iterator i = attribs.constBegin(); i != attribs.constEnd(); ++i)
{
if(i.value() == vec3TypeName)
{
combo_positionAttribute->addItem(i.key());
if(i.key() == "position") // try to select a position attribute named "position"
combo_positionAttribute->setCurrentIndex(j);
combo_normalAttribute->addItem(i.key());
if(i.key() == "normal") // try to select a normal attribute named "normal"
combo_normalAttribute->setCurrentIndex(j);
combo_KmaxAttribute->addItem(i.key());
if(i.key() == "Kmax") // try to select a normal attribute named "Kmax"
combo_KmaxAttribute->setCurrentIndex(j);
combo_KminAttribute->addItem(i.key());
if(i.key() == "Kmin") // try to select a normal attribute named "Kmin"
combo_KminAttribute->setCurrentIndex(j);
combo_KnormalAttribute->addItem(i.key());
if(i.key() == "Knormal") // try to select a normal attribute named "Knormal"
combo_KnormalAttribute->setCurrentIndex(j);
++j;
}
else if(i.value() == realTypeName)
{
combo_kmaxAttribute->addItem(i.key());
if(i.key() == "kmax") // try to select a normal attribute named "kmax"
combo_kmaxAttribute->setCurrentIndex(k);
combo_kminAttribute->addItem(i.key());
if(i.key() == "kmin") // try to select a normal attribute named "kmin"
combo_kminAttribute->setCurrentIndex(k);
++k;
}
......@@ -107,15 +87,15 @@ void ComputeCurvatureDialog::selectedMapChanged()
m_selectedMap = NULL;
}
void ComputeCurvatureDialog::addMapToList(MapHandlerGen* m)
void Dialog_ComputeCurvature::addMapToList(MapHandlerGen* m)
{
QListWidgetItem* item = new QListWidgetItem(m->getName(), mapList);
QListWidgetItem* item = new QListWidgetItem(m->getName(), list_maps);
item->setCheckState(Qt::Unchecked);
}
void ComputeCurvatureDialog::removeMapFromList(MapHandlerGen* m)
void Dialog_ComputeCurvature::removeMapFromList(MapHandlerGen* m)
{
QList<QListWidgetItem*> items = mapList->findItems(m->getName(), Qt::MatchExactly);
QList<QListWidgetItem*> items = list_maps->findItems(m->getName(), Qt::MatchExactly);
if(!items.empty())
delete items[0];
......@@ -126,7 +106,7 @@ void ComputeCurvatureDialog::removeMapFromList(MapHandlerGen* m)
}
}
void ComputeCurvatureDialog::addAttributeToList(unsigned int orbit, const QString& nameAttr)
void Dialog_ComputeCurvature::addAttributeToList(unsigned int orbit, const QString& nameAttr)
{
QString vec3TypeName = QString::fromStdString(nameOfType(PFP2::VEC3()));
QString realTypeName = QString::fromStdString(nameOfType(PFP2::REAL()));
......
#include "computeNormalDialog.h"
#include "dialog_computeNormal.h"
#include "differentialProperties.h"
#include "window.h"
#include "surface_differentialProperties.h"
#include "schnapps.h"
#include "mapHandler.h"
namespace CGoGN
......@@ -10,56 +10,50 @@ namespace CGoGN
namespace SCHNApps
{
ComputeNormalDialog::ComputeNormalDialog(Window* w) :
m_window(w),
Dialog_ComputeNormal::Dialog_ComputeNormal(SCHNApps* s) :
m_schnapps(s),
m_selectedMap(NULL)
{
setupUi(this);
normalAttributeName->setText("normal");
connect(m_window, SIGNAL(mapAdded(MapHandlerGen*)), this, SLOT(addMapToList(MapHandlerGen*)));
connect(m_window, SIGNAL(mapRemoved(MapHandlerGen*)), this, SLOT(removeMapFromList(MapHandlerGen*)));
connect(m_schnapps, SIGNAL(mapAdded(MapHandlerGen*)), this, SLOT(addMapToList(MapHandlerGen*)));
connect(m_schnapps, SIGNAL(mapRemoved(MapHandlerGen*)), this, SLOT(removeMapFromList(MapHandlerGen*)));
connect(mapList, SIGNAL(itemSelectionChanged()), this, SLOT(selectedMapChanged()));
connect(list_maps, SIGNAL(itemSelectionChanged()), this, SLOT(selectedMapChanged()));
const QList<MapHandlerGen*>& maps = m_window->getMapsList();
foreach(MapHandlerGen* map, maps)
foreach(MapHandlerGen* map, m_schnapps->getMapSet().values())
{
QListWidgetItem* item = new QListWidgetItem(map->getName(), mapList);
QListWidgetItem* item = new QListWidgetItem(map->getName(), list_maps);
item->setCheckState(Qt::Unchecked);
}
}
void ComputeNormalDialog::selectedMapChanged()
void Dialog_ComputeNormal::selectedMapChanged()
{
if(m_selectedMap)
disconnect(m_selectedMap, SIGNAL(attributeAdded(unsigned int, const QString&)), this, SLOT(addAttributeToList(unsigned int, const QString&)));
QList<QListWidgetItem*> currentItems = mapList->selectedItems();
QList<QListWidgetItem*> currentItems = list_maps->selectedItems();
if(!currentItems.empty())
{
combo_positionAttribute->clear();
combo_normalAttribute->clear();
const QString& mapname = currentItems[0]->text();
MapHandlerGen* mh = m_window->getMap(mapname);
MapHandlerGen* mh = m_schnapps->getMap(mapname);
QString vec3TypeName = QString::fromStdString(nameOfType(PFP2::VEC3()));
unsigned int j = 0;
const AttributeHash& attribs = mh->getAttributesList(VERTEX);
for(AttributeHash::const_iterator i = attribs.constBegin(); i != attribs.constEnd(); ++i)
const AttributeSet& attribs = mh->getAttributeSet(VERTEX);
for(AttributeSet::const_iterator i = attribs.constBegin(); i != attribs.constEnd(); ++i)
{
if(i.value() == vec3TypeName)
{
combo_positionAttribute->addItem(i.key());
if(i.key() == "position") // try to select a position attribute named "position"
combo_positionAttribute->setCurrentIndex(j);
combo_normalAttribute->addItem(i.key());
if(i.key() == "normal") // try to select a normal attribute named "normal"
combo_normalAttribute->setCurrentIndex(j);
++j;
}
......@@ -72,15 +66,15 @@ void ComputeNormalDialog::selectedMapChanged()
m_selectedMap = NULL;
}
void ComputeNormalDialog::addMapToList(MapHandlerGen* m)
void Dialog_ComputeNormal::addMapToList(MapHandlerGen* m)
{
QListWidgetItem* item = new QListWidgetItem(m->getName(), mapList);
QListWidgetItem* item = new QListWidgetItem(m->getName(), list_maps);
item->setCheckState(Qt::Unchecked);
}
void ComputeNormalDialog::removeMapFromList(MapHandlerGen* m)
void Dialog_ComputeNormal::removeMapFromList(MapHandlerGen* m)
{
QList<QListWidgetItem*> items = mapList->findItems(m->getName(), Qt::MatchExactly);
QList<QListWidgetItem*> items = list_maps->findItems(m->getName(), Qt::MatchExactly);
if(!items.empty())
delete items[0];
......@@ -91,7 +85,7 @@ void ComputeNormalDialog::removeMapFromList(MapHandlerGen* m)
}
}
void ComputeNormalDialog::addAttributeToList(unsigned int orbit, const QString& nameAttr)
void Dialog_ComputeNormal::addAttributeToList(unsigned int orbit, const QString& nameAttr)
{
QString vec3TypeName = QString::fromStdString(nameOfType(PFP2::VEC3()));
......
#include "differentialProperties.h"
#include "surface_differentialProperties.h"
#include "mapHandler.h"
#include "Algo/Geometry/normal.h"
#include "Algo/Geometry/curvature.h"
bool DifferentialPropertiesPlugin::enable()
namespace CGoGN
{
m_computeNormalDialog = new ComputeNormalDialog(m_window);
m_computeCurvatureDialog = new ComputeCurvatureDialog(m_window);
namespace SCHNApps
{
bool Surface_DifferentialProperties_Plugin::enable()
{
m_computeNormalDialog = new Dialog_ComputeNormal(m_schnapps);
m_computeCurvatureDialog = new Dialog_ComputeCurvature(m_schnapps);
m_computeNormalAction = new QAction("Compute Normal", this);
m_computeCurvatureAction = new QAction("Compute Curvature", this);
addMenuAction("Surface;Differential Properties;Compute Normal", m_computeNormalAction);
addMenuAction("Surface;Differential Properties;Compute Curvature", m_computeCurvatureAction);
m_schnapps->addMenuAction(this, "Surface;Differential Properties;Compute Normal", m_computeNormalAction);
m_schnapps->addMenuAction(this, "Surface;Differential Properties;Compute Curvature", m_computeCurvatureAction);
connect(m_computeNormalAction, SIGNAL(triggered()), this, SLOT(openComputeNormalDialog()));
connect(m_computeCurvatureAction, SIGNAL(triggered()), this, SLOT(openComputeCurvatureDialog()));
......@@ -25,23 +31,23 @@ bool DifferentialPropertiesPlugin::enable()
connect(m_computeCurvatureDialog, SIGNAL(accepted()), this, SLOT(computeCurvatureFromDialog()));
connect(m_computeCurvatureDialog->button_apply, SIGNAL(clicked()), this, SLOT(computeCurvatureFromDialog()));
connect(m_window, SIGNAL(mapAdded(MapHandlerGen*)), this, SLOT(mapAdded(MapHandlerGen*)));
connect(m_window, SIGNAL(mapRemoved(MapHandlerGen*)), this, SLOT(mapRemoved(MapHandlerGen*)));
connect(m_schnapps, SIGNAL(mapAdded(MapHandlerGen*)), this, SLOT(mapAdded(MapHandlerGen*)));
connect(m_schnapps, SIGNAL(mapRemoved(MapHandlerGen*)), this, SLOT(mapRemoved(MapHandlerGen*)));
return true;
}
void DifferentialPropertiesPlugin::mapAdded(MapHandlerGen *map)
void Surface_DifferentialProperties_Plugin::mapAdded(MapHandlerGen *map)
{
connect(map, SIGNAL(attributeModified(unsigned int, QString)), this, SLOT(attributeModified(unsigned int, QString)));
}
void DifferentialPropertiesPlugin::mapRemoved(MapHandlerGen *map)
void Surface_DifferentialProperties_Plugin::mapRemoved(MapHandlerGen *map)
{
disconnect(map, SIGNAL(attributeModified(unsigned int, QString)), this, SLOT(attributeModified(unsigned int, QString)));
}
void DifferentialPropertiesPlugin::attributeModified(unsigned int orbit, QString nameAttr)
void Surface_DifferentialProperties_Plugin::attributeModified(unsigned int orbit, QString nameAttr)
{
if(orbit == VERTEX)
{
......@@ -66,19 +72,19 @@ void DifferentialPropertiesPlugin::attributeModified(unsigned int orbit, QString
}
}
void DifferentialPropertiesPlugin::openComputeNormalDialog()
void Surface_DifferentialProperties_Plugin::openComputeNormalDialog()
{
m_computeNormalDialog->show();
}
void DifferentialPropertiesPlugin::openComputeCurvatureDialog()
void Surface_DifferentialProperties_Plugin::openComputeCurvatureDialog()
{
m_computeCurvatureDialog->show();
}
void DifferentialPropertiesPlugin::computeNormalFromDialog()
void Surface_DifferentialProperties_Plugin::computeNormalFromDialog()
{
QList<QListWidgetItem*> currentItems = m_computeNormalDialog->mapList->selectedItems();
QList<QListWidgetItem*> currentItems = m_computeNormalDialog->list_maps->selectedItems();
if(!currentItems.empty())
{
const QString& mapName = currentItems[0]->text();
......@@ -97,9 +103,9 @@ void DifferentialPropertiesPlugin::computeNormalFromDialog()
}
}
void DifferentialPropertiesPlugin::computeCurvatureFromDialog()
void Surface_DifferentialProperties_Plugin::computeCurvatureFromDialog()
{
QList<QListWidgetItem*> currentItems = m_computeCurvatureDialog->mapList->selectedItems();
QList<QListWidgetItem*> currentItems = m_computeCurvatureDialog->list_maps->selectedItems();
if(!currentItems.empty())
{
const QString& mapName = currentItems[0]->text();
......@@ -151,13 +157,13 @@ void DifferentialPropertiesPlugin::computeCurvatureFromDialog()
}
}
void DifferentialPropertiesPlugin::computeNormal(
void Surface_DifferentialProperties_Plugin::computeNormal(
const QString& mapName,
const QString& positionAttributeName,
const QString& normalAttributeName,
bool autoUpdate)
{
MapHandler<PFP2>* mh = static_cast<MapHandler<PFP2>*>(m_window->getMap(mapName));
MapHandler<PFP2>* mh = static_cast<MapHandler<PFP2>*>(m_schnapps->getMap(mapName));
if(mh == NULL)
return;
......@@ -175,12 +181,10 @@ void DifferentialPropertiesPlugin::computeNormal(
computeNormalLastParameters[mapName] =
ComputeNormalParameters(positionAttributeName, normalAttributeName, autoUpdate);
mh->createVBO(normal);
mh->notifyAttributeModification(normal);
}
void DifferentialPropertiesPlugin::computeCurvature(
void Surface_DifferentialProperties_Plugin::computeCurvature(
const QString& mapName,
const QString& positionAttributeName,
const QString& normalAttributeName,
......@@ -193,7 +197,7 @@ void DifferentialPropertiesPlugin::computeCurvature(
bool compute_kgaussian,
bool autoUpdate)
{
MapHandler<PFP2>* mh = static_cast<MapHandler<PFP2>*>(m_window->getMap(mapName));
MapHandler<PFP2>* mh = static_cast<MapHandler<PFP2>*>(m_schnapps->getMap(mapName));
if(mh == NULL)
return;
......@@ -239,12 +243,6 @@ void DifferentialPropertiesPlugin::computeCurvature(
KmaxAttributeName, kmaxAttributeName, KminAttributeName, kminAttributeName, KnormalAttributeName,
compute_kmean, compute_kgaussian, autoUpdate);
mh->createVBO(Kmax);
mh->createVBO(kmax);
mh->createVBO(Kmin);
mh->createVBO(kmin);
mh->createVBO(Knormal);
mh->notifyAttributeModification(Kmax);
mh->notifyAttributeModification(kmax);
mh->notifyAttributeModification(Kmin);
......@@ -260,7 +258,6 @@ void DifferentialPropertiesPlugin::computeCurvature(
for(unsigned int i = kmin.begin(); i != kmin.end(); kmin.next(i))
kmean[i] = (kmin[i] + kmax[i]) / 2.0;
mh->createVBO(kmean);
mh->notifyAttributeModification(kmean);
}
......@@ -273,13 +270,16 @@ void DifferentialPropertiesPlugin::computeCurvature(
for(unsigned int i = kmin.begin(); i != kmin.end(); kmin.next(i))
kgaussian[i] = kmin[i] * kmax[i];
mh->createVBO(kgaussian);
mh->notifyAttributeModification(kgaussian);
}
}
#ifndef DEBUG
Q_EXPORT_PLUGIN2(DifferentialPropertiesPlugin, DifferentialPropertiesPlugin)
Q_EXPORT_PLUGIN2(Surface_DifferentialProperties_Plugin, Surface_DifferentialProperties_Plugin)
#else
Q_EXPORT_PLUGIN2(DifferentialPropertiesPluginD, DifferentialPropertiesPlugin)
Q_EXPORT_PLUGIN2(Surface_DifferentialProperties_PluginD, Surface_DifferentialProperties_Plugin)
#endif
} // namespace SCHNApps
} // namespace CGoGN