Commit 33897e26 authored by Jan Möbius's avatar Jan Möbius
Browse files

Scripting description corrected

Function name typos corrected
Depth passed through scripting
Removed scriptinterface



git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free-Staging@16360 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 48ceef07
......@@ -107,24 +107,29 @@ void PoissonPlugin::initializePlugin(){
void PoissonPlugin::pluginsInitialized()
{
std::cout << "set slot description" << std::endl;
emit setSlotDescription("poissonReconstruct(int)",tr("Reconstruct a triangle mesh from the given object."),
emit setSlotDescription("poissonReconstruct(int,int)",tr("Reconstruct a triangle mesh from the given object."),
QStringList(tr("ObjectId;depth").split(';')),QStringList(tr("ObjectId of the object;octree depth").split(';')));
emit setSlotDescription("poissonReconstruct(IdList,int)",tr("Reconstruct one triangle mesh from the given objects."),
QStringList(tr("IdList;depth").split(';')),QStringList(tr("Id of the objects;octree depth").split(';')));
emit setSlotDescription("poissonReconstruct(int)",tr("Reconstruct a triangle mesh from the given object. (Octree depth defaults to 7)"),
QStringList(tr("ObjectId")),QStringList(tr("ObjectId of the object")));
emit setSlotDescription("poissonReconstruct(IdList)",tr("Reconstruct one triangle mesh from the given objects."),
emit setSlotDescription("poissonReconstruct(IdList)",tr("Reconstruct one triangle mesh from the given objects. (Octree depth defaults to 7)"),
QStringList(tr("IdList")),QStringList(tr("Id of the objects")));
}
void PoissonPlugin::poissionReconstruct(int _id)
void PoissonPlugin::poissonReconstruct(int _id, int _depth)
{
IdList list(1,_id);
poissionReconstruct(list);
poissonReconstruct(list, _depth);
}
void PoissonPlugin::poissionReconstruct(IdList _ids)
void PoissonPlugin::poissonReconstruct(IdList _ids, int _depth)
{
unsigned int n_points = 0;
//datacontainer for the algorithm
//holds two 3D vectors in 6 columns, first the position, followed by the normal of the point
// Data container for the algorithm
// holds two 3D vectors in 6 columns, first the position, followed by the normal of the point
std::vector< Real > pt_data;
//get data from objects
......@@ -179,9 +184,15 @@ void PoissonPlugin::poissionReconstruct(IdList _ids)
//Splat cloud
else if( obj->dataType() == DATA_SPLATCLOUD)
{
// Get poly mesh
// Get splat cloud mesh
SplatCloud* cloud = PluginFunctions::splatCloud(obj);
if ( ! cloud->hasNormals() ) {
emit log(LOGERR,"Splat cloud has no normals. Skipping it");
continue;
}
n_points += cloud->numSplats();
pt_data.reserve( n_points );
......@@ -218,7 +229,7 @@ void PoissonPlugin::poissionReconstruct(IdList _ids)
ACG::PoissonReconstructionT<TriMesh> pr;
ACG::PoissonReconstructionT<TriMesh>::Parameter params;
params.Depth = tool_->depthBox->value();
params.Depth = _depth;
if ( pr.run( pt_data, *final_mesh, params ) ) {
emit log(LOGINFO,"Reconstruction succeeded");
......@@ -236,12 +247,14 @@ void PoissonPlugin::poissionReconstruct(IdList _ids)
void PoissonPlugin::slotPoissonReconstruct(){
IdList ids;
for ( PluginFunctions::ObjectIterator o_it(PluginFunctions::TARGET_OBJECTS,(DATA_TRIANGLE_MESH | DATA_POLY_MESH)) ;o_it != PluginFunctions::objectsEnd(); ++o_it)
for ( PluginFunctions::ObjectIterator o_it(PluginFunctions::TARGET_OBJECTS,(DATA_TRIANGLE_MESH | DATA_POLY_MESH | DATA_SPLATCLOUD )) ;o_it != PluginFunctions::objectsEnd(); ++o_it)
{
ids.push_back(o_it->id());
}
poissionReconstruct(ids);
const int depth = tool_->depthBox->value();
poissonReconstruct(ids,depth);
}
......
......@@ -50,11 +50,10 @@
#include <OpenFlipper/BasePlugin/ToolboxInterface.hh>
#include <OpenFlipper/BasePlugin/LoggingInterface.hh>
#include <OpenFlipper/BasePlugin/LoadSaveInterface.hh>
#include <OpenFlipper/BasePlugin/ScriptInterface.hh>
#include "PoissonToolbox.hh"
class PoissonPlugin : public QObject, BaseInterface, ToolboxInterface, LoadSaveInterface, LoggingInterface, AboutInfoInterface, ScriptInterface
class PoissonPlugin : public QObject, BaseInterface, ToolboxInterface, LoadSaveInterface, LoggingInterface, AboutInfoInterface
{
Q_OBJECT
Q_INTERFACES(BaseInterface)
......@@ -62,12 +61,13 @@ Q_INTERFACES(ToolboxInterface)
Q_INTERFACES(LoggingInterface)
Q_INTERFACES(LoadSaveInterface)
Q_INTERFACES(AboutInfoInterface)
Q_INTERFACES(ScriptInterface)
signals:
//BaseInterface
signals:
void updateView();
void setSlotDescription(QString _slotName, QString _slotDescription,
QStringList _parameters, QStringList _descriptions);
//LoggingInterface:
void log( Logtype _type, QString _message );
......@@ -85,9 +85,6 @@ signals:
//AboutInfoInterface
void addAboutInfo(QString _text, QString _tabName );
//ScriptInterface
void setSlotDescription(QString _slotName, QString _slotDescription,
QStringList _parameters, QStringList _descriptions);
private slots:
......@@ -97,13 +94,14 @@ private slots:
private slots:
/// Button slot iterating over all targets and passing them to the correct functions
void slotPoissonReconstruct();
public slots:
void poissionReconstruct(int _id);
void poissonReconstruct(int _id, int _depth = 7);
void poissionReconstruct(IdList _ids);
void poissonReconstruct(IdList _ids, int _depth = 7);
public :
PoissonPlugin();
......
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