diff --git a/PreProcessing/MeshGrading(OpenFlipper)/CMakeLists.txt b/PreProcessing/MeshGrading(OpenFlipper)/CMakeLists.txt index ea6efcc5..a7446a53 100644 --- a/PreProcessing/MeshGrading(OpenFlipper)/CMakeLists.txt +++ b/PreProcessing/MeshGrading(OpenFlipper)/CMakeLists.txt @@ -1,2 +1,4 @@ include (plugin) -openflipper_plugin (INSTALLDATA Icons) +openflipper_plugin (PYTHONINTERFACE + INSTALLDATA Icons + TYPES TRIANGLEMESH) diff --git a/PreProcessing/MeshGrading(OpenFlipper)/MeshGradingPlugin.cc b/PreProcessing/MeshGrading(OpenFlipper)/MeshGradingPlugin.cc index 98ea7511..33122e14 100644 --- a/PreProcessing/MeshGrading(OpenFlipper)/MeshGradingPlugin.cc +++ b/PreProcessing/MeshGrading(OpenFlipper)/MeshGradingPlugin.cc @@ -90,15 +90,17 @@ thread_(0) /// init the Toolbox void MeshGradingPlugin::initializePlugin() { - tool_ = new MeshGradingToolBox(); + if ( OpenFlipper::Options::gui()) { + tool_ = new MeshGradingToolBox(); - QSize size(300, 300); - tool_->resize(size); + QSize size(300, 300); + tool_->resize(size); - connect(tool_->meshGradingButton, SIGNAL(clicked()), this, SLOT(slotMeshGradingButtonClicked()) ); + connect(tool_->meshGradingButton, SIGNAL(clicked()), this, SLOT(slotMeshGradingButtonClicked()) ); - toolIcon_ = new QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"MeshGrading.png"); - emit addToolbox( tr("Mesh Grading") , tool_, toolIcon_ ); + toolIcon_ = new QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"MeshGrading.png"); + emit addToolbox( tr("Mesh Grading") , tool_, toolIcon_ ); + } } void MeshGradingPlugin::slotMeshGradingButtonClicked() { @@ -112,6 +114,9 @@ void MeshGradingPlugin::slotMeshGradingButtonClicked() { if (tool_->ear_right->isChecked()){ ear_ = 2; } + if (tool_->ear_both->isChecked()){ + ear_ = 3; + } if (tool_->POWalpha->isChecked()){ gradingFunction_ = 1; diff --git a/PreProcessing/MeshGrading(OpenFlipper)/MeshGradingPlugin.hh b/PreProcessing/MeshGrading(OpenFlipper)/MeshGradingPlugin.hh index 822fdb5b..8d32fc90 100644 --- a/PreProcessing/MeshGrading(OpenFlipper)/MeshGradingPlugin.hh +++ b/PreProcessing/MeshGrading(OpenFlipper)/MeshGradingPlugin.hh @@ -81,6 +81,7 @@ #include #include #include +#include #include #include #include @@ -97,7 +98,7 @@ class MeshGradingPlugin : public QObject, BaseInterface, BackupInterface , ToolboxInterface, LoggingInterface, - RPCInterface, ProcessInterface, ScriptInterface + RPCInterface, ProcessInterface, ScriptInterface, PythonInterface { Q_OBJECT Q_INTERFACES(BaseInterface) @@ -107,6 +108,7 @@ Q_INTERFACES(RPCInterface) Q_INTERFACES(ProcessInterface) Q_INTERFACES(ScriptInterface) Q_INTERFACES(BackupInterface) +Q_INTERFACES(PythonInterface) #if QT_VERSION >= 0x050000 Q_PLUGIN_METADATA(IID "org.OpenFlipper.Plugins.Plugin-MeshGrading") @@ -156,7 +158,7 @@ public : MeshGradingPlugin(); ~MeshGradingPlugin() {}; - QString name() { return (QString("Mesh Grading")); }; + QString name() { return (QString("MeshGrading")); }; // This has to be one word as it is used as a variable name by the python api QString description( ) { return (QString("Pre-processing for Mesh2HRTF (a-priori mesh-grading).")); }; //GUI @@ -190,6 +192,7 @@ public slots: public slots: QString version() { return QString("1.0"); }; + void noguiSupported() {} }; #endif //MESHGRADINGPLUGIN_HH diff --git a/PreProcessing/MeshGrading(OpenFlipper)/MeshGradingT.cc b/PreProcessing/MeshGrading(OpenFlipper)/MeshGradingT.cc index 028aea57..8d8de089 100644 --- a/PreProcessing/MeshGrading(OpenFlipper)/MeshGradingT.cc +++ b/PreProcessing/MeshGrading(OpenFlipper)/MeshGradingT.cc @@ -88,42 +88,49 @@ template< class MeshT > void MeshGrading< MeshT >::grading( MeshT& _mesh, const double _minEdgeLengthGlobal, const double _maxEdgeLengthGlobal, const unsigned int _ear, const unsigned int _gradingFunction, const double _gradingOrder ) { - typename MeshT::Point earVertex; - earVertex[0]=100.0; - earVertex[1]=0.0; - earVertex[2]=100.0; + typename MeshT::Point earVertexLeft; + earVertexLeft[0]=100.0; + earVertexLeft[1]=0.0; + earVertexLeft[2]=100.0; + typename MeshT::Point earVertexRight; + earVertexRight[0]=100.0; + earVertexRight[1]=0.0; + earVertexRight[2]=100.0; typename MeshT::VertexIter v_it; typename MeshT::VertexIter v_end = _mesh.vertices_end(); - if (_ear==1) + if (_ear==1 || _ear==3) { for (v_it = _mesh.vertices_begin(); v_it != v_end; ++v_it) { typename MeshT::Point currentVertex = _mesh.point(*v_it); if (currentVertex[1]>0) { - if (sqrt(currentVertex[0]*currentVertex[0]+currentVertex[2]*currentVertex[2])<=sqrt(earVertex[0]*earVertex[0]+earVertex[2]*earVertex[2])) + if (sqrt(currentVertex[0]*currentVertex[0]+currentVertex[2]*currentVertex[2])<=sqrt(earVertexLeft[0]*earVertexLeft[0]+earVertexLeft[2]*earVertexLeft[2])) { - earVertex=currentVertex; + earVertexLeft=currentVertex; } } } } - if (_ear==2) + if (_ear==2 || _ear==3) { for (v_it = _mesh.vertices_begin(); v_it != v_end; ++v_it) { typename MeshT::Point currentVertex = _mesh.point(*v_it); if (currentVertex[1]<0) { - if (sqrt(currentVertex[0]*currentVertex[0]+currentVertex[2]*currentVertex[2])<=sqrt(earVertex[0]*earVertex[0]+earVertex[2]*earVertex[2])) + if (sqrt(currentVertex[0]*currentVertex[0]+currentVertex[2]*currentVertex[2])<=sqrt(earVertexRight[0]*earVertexRight[0]+earVertexRight[2]*earVertexRight[2])) { - earVertex=currentVertex; + earVertexRight=currentVertex; } } } } - std::cout << earVertex[0] << ' ' << earVertex[1] << ' ' << earVertex[2] << ' ' << std::endl; + + std::cout << earVertexLeft[0] << ' ' << earVertexLeft[1] << ' ' << earVertexLeft[2] << ' ' << std::endl; + std::cout << earVertexRight[0] << ' ' << earVertexRight[1] << ' ' << earVertexRight[2] << ' ' << std::endl; + MeshT meshCopy = _mesh; OpenMeshTriangleBSPT< MeshT >* triangleBSP = getTriangleBSP(meshCopy); @@ -134,11 +141,11 @@ void MeshGrading< MeshT >::grading( MeshT& _mesh, const double _minEdgeLengthGlo std::cout << "Iteration = " << i << std::endl; - splitLongEdges(_mesh, _minEdgeLengthGlobal, _maxEdgeLengthGlobal, earVertex, _gradingFunction, _gradingOrder); + splitLongEdges(_mesh, _minEdgeLengthGlobal, _maxEdgeLengthGlobal, earVertexLeft, earVertexRight, _ear, _gradingFunction, _gradingOrder); if (prgEmt_) prgEmt_->sendProgressSignal(i + 0.2); - collapseShortEdges(_mesh, _minEdgeLengthGlobal, _maxEdgeLengthGlobal, earVertex, _gradingFunction, _gradingOrder); + collapseShortEdges(_mesh, _minEdgeLengthGlobal, _maxEdgeLengthGlobal, earVertexLeft, earVertexRight, _ear, _gradingFunction, _gradingOrder); if (prgEmt_) prgEmt_->sendProgressSignal(i + 0.4); @@ -178,17 +185,51 @@ OpenMeshTriangleBSPT< MeshT >* MeshGrading< MeshT >::getTriangleBSP(MeshT& _mesh // return pointer to triangle bsp return triangle_bsp; } +template< class MeshT> +double MeshGrading::compute_distance(const typename MeshT::Point vec_midpoint, const unsigned int _ear,const typename MeshT::Point earVertex, const typename MeshT::Point earVertexLeft, const typename MeshT::Point earVertexRight){ + double distance; + + if(_ear == 1 || _ear == 2){ + typename MeshT::Point vec_distance = vec_midpoint - earVertex; + distance = sqrt(vec_distance.sqrnorm()); + }else{ + typename MeshT::Point vec_distance_left = vec_midpoint - earVertexLeft; + typename MeshT::Point vec_distance_right = vec_midpoint - earVertexRight; + const double distance_left = sqrt(vec_distance_left.sqrnorm()); + const double distance_right = sqrt(vec_distance_right.sqrnorm()); + if(distance_left < distance_right){ + distance = distance_left; + }else{ + distance = distance_right; + } + } + return distance; +} /// performs edge splits until all edges are shorter than the threshold template< class MeshT > -void MeshGrading< MeshT >::splitLongEdges( MeshT& _mesh, const double _minEdgeLengthGlobal, const double _maxEdgeLengthGlobal, const typename MeshT::Point earVertex, const unsigned int _gradingFunction, const double _gradingOrder ) +void MeshGrading< MeshT >::splitLongEdges( MeshT& _mesh, const double _minEdgeLengthGlobal, const double _maxEdgeLengthGlobal, const typename MeshT::Point earVertexLeft, const typename MeshT::Point earVertexRight, const unsigned int _ear, const unsigned int _gradingFunction, const double _gradingOrder ) { double maxEdgeLength = 0; - double distance = 0; double grading = 0; - const double headwidth = sqrt(earVertex.sqrnorm())*2; + typename MeshT::Point earVertex; + double headwidth; + + if(_ear == 1){ + headwidth = sqrt(earVertexLeft.sqrnorm())*2; + earVertex = earVertexLeft; + } + if(_ear == 2){ + headwidth = sqrt(earVertexRight.sqrnorm())*2; + earVertex = earVertexRight; + } + if(_ear == 3){ + headwidth = sqrt((earVertexLeft - earVertexRight).sqrnorm()); + } + + typename MeshT::EdgeIter e_it; typename MeshT::EdgeIter e_end = _mesh.edges_end(); @@ -203,11 +244,10 @@ void MeshGrading< MeshT >::splitLongEdges( MeshT& _mesh, const double _minEdgeLe const typename MeshT::Point vec_edge = _mesh.point(v1) - _mesh.point(v0); const typename MeshT::Point vec_midpoint = (_mesh.point(v1) + _mesh.point(v0))/2; - typename MeshT::Point vec_distance = vec_midpoint - earVertex; - distance = sqrt(vec_distance.sqrnorm()); + const double distance = compute_distance(vec_midpoint, _ear, earVertex, earVertexLeft, earVertexRight); grading=distance/headwidth; - + switch(_gradingFunction) { case 1: @@ -250,15 +290,27 @@ void MeshGrading< MeshT >::splitLongEdges( MeshT& _mesh, const double _minEdgeLe /// collapse edges shorter than minEdgeLength if collapsing doesn't result in new edge longer than maxEdgeLength template< class MeshT > -void MeshGrading< MeshT >::collapseShortEdges( MeshT& _mesh, const double _minEdgeLengthGlobal, const double _maxEdgeLengthGlobal, const typename MeshT::Point earVertex, const unsigned int _gradingFunction, const double _gradingOrder ) +void MeshGrading< MeshT >::collapseShortEdges( MeshT& _mesh, const double _minEdgeLengthGlobal, const double _maxEdgeLengthGlobal, const typename MeshT::Point earVertexLeft, const typename MeshT::Point earVertexRight, const unsigned int _ear, const unsigned int _gradingFunction, const double _gradingOrder ) { double minEdgeLength = 0; double maxEdgeLength = 0; - double distance = 0; double grading = 0; - const double headwidth = sqrt(earVertex.sqrnorm())*2; + typename MeshT::Point earVertex; + double headwidth; + + if(_ear == 1){ + headwidth = sqrt(earVertexLeft.sqrnorm())*2; + earVertex = earVertexLeft; + } + if(_ear == 2){ + headwidth = sqrt(earVertexRight.sqrnorm())*2; + earVertex = earVertexRight; + } + if(_ear == 3){ + headwidth = sqrt((earVertexLeft - earVertexRight).sqrnorm()); + } //add checked property OpenMesh::EPropHandleT< bool > checked; @@ -293,8 +345,7 @@ void MeshGrading< MeshT >::collapseShortEdges( MeshT& _mesh, const double _minEd const typename MeshT::Point vec_edge = _mesh.point(v1) - _mesh.point(v0); const typename MeshT::Point vec_midpoint = (_mesh.point(v1) + _mesh.point(v0))/2; - typename MeshT::Point vec_distance = vec_midpoint - earVertex; - double distance = sqrt(vec_distance.sqrnorm()); + const double distance = compute_distance(vec_midpoint, _ear, earVertex, earVertexLeft, earVertexRight); const double edgeLength = vec_edge.sqrnorm(); diff --git a/PreProcessing/MeshGrading(OpenFlipper)/MeshGradingT.hh b/PreProcessing/MeshGrading(OpenFlipper)/MeshGradingT.hh index 7fcba756..091cd373 100644 --- a/PreProcessing/MeshGrading(OpenFlipper)/MeshGradingT.hh +++ b/PreProcessing/MeshGrading(OpenFlipper)/MeshGradingT.hh @@ -88,12 +88,14 @@ public: private: - void splitLongEdges( MeshT& _mesh, const double _minEdgeLengthGlobal, const double _maxEdgeLengthGlobal, const typename MeshT::Point earVertex, const unsigned int _gradingFunction, const double _gradingOrder ); + void splitLongEdges( MeshT& _mesh, const double _minEdgeLengthGlobal, const double _maxEdgeLengthGlobal, const typename MeshT::Point earVertexLeft, const typename MeshT::Point earVertexRight, const unsigned int _ear, const unsigned int _gradingFunction, const double _gradingOrder); - void collapseShortEdges( MeshT& _mesh, const double _minEdgeLengthGlobal, const double _maxEdgeLengthGlobal, const typename MeshT::Point earVertex, const unsigned int _gradingFunction, const double _gradingOrder ); + void collapseShortEdges( MeshT& _mesh, const double _minEdgeLengthGlobal, const double _maxEdgeLengthGlobal, const typename MeshT::Point earVertexLeft, const typename MeshT::Point earVertexRight, const unsigned int _ear, const unsigned int _gradingFunction, const double _gradingOrder); void equalizeValences( MeshT& _mesh ); + double compute_distance(const typename MeshT::Point vec_midpoint, const unsigned int _ear,const typename MeshT::Point earVertex, const typename MeshT::Point earVertexLeft, const typename MeshT::Point earVertexRight); + inline int targetValence( MeshT& _mesh, const typename MeshT::VertexHandle& _vh ); diff --git a/PreProcessing/MeshGrading(OpenFlipper)/MeshGradingToolbox.hh b/PreProcessing/MeshGrading(OpenFlipper)/MeshGradingToolbox.hh index ad28ace6..2b768b45 100644 --- a/PreProcessing/MeshGrading(OpenFlipper)/MeshGradingToolbox.hh +++ b/PreProcessing/MeshGrading(OpenFlipper)/MeshGradingToolbox.hh @@ -71,7 +71,9 @@ * * \*===========================================================================*/ -#include "ui_toolbox.hh" +#pragma once + +#include "ui_toolbox.h" #if QT_VERSION >= 0x050000 #include diff --git a/PreProcessing/MeshGrading(OpenFlipper)/ProgressEmitter.cc b/PreProcessing/MeshGrading(OpenFlipper)/ProgressEmitter.cc new file mode 100644 index 00000000..7f130815 --- /dev/null +++ b/PreProcessing/MeshGrading(OpenFlipper)/ProgressEmitter.cc @@ -0,0 +1,53 @@ +/*===========================================================================*\ +* * +* OpenFlipper * + * Copyright (c) 2001-2015, RWTH-Aachen University * + * Department of Computer Graphics and Multimedia * + * All rights reserved. * + * www.openflipper.org * + * * + *---------------------------------------------------------------------------* + * This file is part of OpenFlipper. * + *---------------------------------------------------------------------------* + * * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * 1. Redistributions of source code must retain the above copyright notice, * + * this list of conditions and the following disclaimer. * + * * + * 2. Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * * + * 3. Neither the name of the copyright holder nor the names of its * + * contributors may be used to endorse or promote products derived from * + * this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * + * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER * + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +\*===========================================================================*/ + +#include "ProgressEmitter.hh" + +ProgressEmitter::ProgressEmitter(QString _jobId) : jobId_(_jobId) {}; + +void ProgressEmitter::sendProgressSignal(double _percent) { + emit signalJobState(jobId_, (int)_percent); +} + +void ProgressEmitter::sendChangeDescriptionSignal(QString _description) { + emit changeDescription(jobId_, _description); +} + diff --git a/PreProcessing/MeshGrading(OpenFlipper)/ProgressEmitter.hh b/PreProcessing/MeshGrading(OpenFlipper)/ProgressEmitter.hh index 3bbe42d3..ef38b9d5 100644 --- a/PreProcessing/MeshGrading(OpenFlipper)/ProgressEmitter.hh +++ b/PreProcessing/MeshGrading(OpenFlipper)/ProgressEmitter.hh @@ -71,11 +71,9 @@ * * \*===========================================================================*/ -#ifndef PROGRESSEMITTER_HH -#define PROGRESSEMITTER_HH +#pragma once #include -#include class ProgressEmitter : public QObject { @@ -86,19 +84,13 @@ class ProgressEmitter : public QObject void changeDescription(QString _jobId, QString _description); public: - ProgressEmitter(QString _jobId) : jobId_(_jobId) {} + explicit ProgressEmitter(QString _jobId); - void sendProgressSignal(double _percent) { - emit signalJobState(jobId_, (int)_percent); - } + void sendProgressSignal(double _percent); - void sendChangeDescriptionSignal(QString _description) { - emit changeDescription(jobId_, _description); - } + void sendChangeDescriptionSignal(QString _description); private: QString jobId_; }; - -#endif //PROGRESSEMITTER_HH diff --git a/PreProcessing/MeshGrading(OpenFlipper)/PythonInterface/Python.cc b/PreProcessing/MeshGrading(OpenFlipper)/PythonInterface/Python.cc new file mode 100644 index 00000000..a1942f6a --- /dev/null +++ b/PreProcessing/MeshGrading(OpenFlipper)/PythonInterface/Python.cc @@ -0,0 +1,95 @@ + +/*===========================================================================*\ +* * +* OpenFlipper * + * Copyright (c) 2001-2015, RWTH-Aachen University * + * Department of Computer Graphics and Multimedia * + * All rights reserved. * + * www.openflipper.org * + * * + *---------------------------------------------------------------------------* + * This file is part of OpenFlipper. * + *---------------------------------------------------------------------------* + * * + * Redistribution and use in source and binary forms, with or without * + * modification, are permitted provided that the following conditions * + * are met: * + * * + * 1. Redistributions of source code must retain the above copyright notice, * + * this list of conditions and the following disclaimer. * + * * + * 2. Redistributions in binary form must reproduce the above copyright * + * notice, this list of conditions and the following disclaimer in the * + * documentation and/or other materials provided with the distribution. * + * * + * 3. Neither the name of the copyright holder nor the names of its * + * contributors may be used to endorse or promote products derived from * + * this software without specific prior written permission. * + * * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * + * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER * + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * +* * +\*===========================================================================*/ + +#include +#include + + +#include +#include +#include + +#include +#include + +namespace py = pybind11; + + + +PYBIND11_EMBEDDED_MODULE(MeshGrading, m) { + + QObject* pluginPointer = getPluginPointer("MeshGrading"); + + if (!pluginPointer) { + std::cerr << "Error Getting plugin pointer for Plugin-MeshGrading" << std::endl; + return; + } + + MeshGradingPlugin* plugin = qobject_cast(pluginPointer); + + if (!plugin) { + std::cerr << "Error converting plugin pointer for Plugin-MeshGrading" << std::endl; + return; + } + + // Export our core. Make sure that the c++ worlds core object is not deleted if + // the python side gets deleted!! + py::class_< MeshGradingPlugin,std::unique_ptr > meshGrading(m, "MeshGrading"); + + // On the c++ side we will just return the existing core instance + // and prevent the system to recreate a new core as we need + // to work on the existing one. + meshGrading.def(py::init([plugin]() { return plugin; })); + + meshGrading.def("meshGrading", &MeshGradingPlugin::meshGrading, + QCoreApplication::translate("PythonDocMeshGrading","Pre-processing for Mesh2HRTF (a-priori mesh-grading).").toLatin1().data(), + py::arg(QCoreApplication::translate("PythonDocMeshGrading","ID of the object").toLatin1().data()), + py::arg(QCoreApplication::translate("PythonDocMeshGrading","min edge length").toLatin1().data()), + py::arg(QCoreApplication::translate("PythonDocMeshGrading","max edge length").toLatin1().data()), + py::arg(QCoreApplication::translate("PythonDocMeshGrading","ear (left=1, right=2, both=3)").toLatin1().data()), + py::arg(QCoreApplication::translate("PythonDocMeshGrading","gradingFunction").toLatin1().data()), + py::arg(QCoreApplication::translate("PythonDocMeshGrading","gradingOrder").toLatin1().data()) + ); + + +} + diff --git a/PreProcessing/MeshGrading(OpenFlipper)/toolbox.ui b/PreProcessing/MeshGrading(OpenFlipper)/toolbox.ui index ba7f1f25..ef533fff 100644 --- a/PreProcessing/MeshGrading(OpenFlipper)/toolbox.ui +++ b/PreProcessing/MeshGrading(OpenFlipper)/toolbox.ui @@ -17,179 +17,184 @@ Form - + + + + A-priori mesh-grading for Mesh2HRTF + + + + + + + Select the ear: + + - + + + Note that the interaural axis has to be aligned with the y-axis! + - A-priori mesh-grading for Mesh2HRTF + left + + + true - - - Select the ear: + + + Note that the interaural axis has to be aligned with the y-axis! + + + right - - - - - Note that the interautal axis has to be aligned with the y-axis! - - - left - - - true - - - - - - - Note that the interautal axis has to be aligned with the y-axis! - - - right - - - - - - - Select the grading function: + + + Note that the interaural axis has to be aligned with the y-axis! + + + both - - - - - Power-function based grading - - - POWalpha - - - true - - - - - - - Raised-cosine based grading - - - COSalpha - - - - - - - - - - Grading Order: - - - - - - - 1 - - - 16 - - - 1 - - - - - - - - + + + + + + + Select the grading function: + + - - - Global target edge length (in m): + + + Power-function based grading + + + POWalpha + + + true - - - - - - - Minimum: - - - - - - - 4 - - - 1.000000000000000 - - - 0.000100000000000 - - - 0.001000000000000 - - - - - - - - - - - Maximum: - - - - - - - 4 - - - 1.000000000000000 - - - 0.000100000000000 - - - 0.001000000000000 - - - - - - - + + + Raised-cosine based grading + - Start + COSalpha - + + + + + + Grading Order: + + + + + + + 1 + + + 16 + + + 1 + + + + + + + + + + + + Global target edge length (in m): + + + + + + + + Minimum: + + + + + + + 4 + + + 1.000000000000000 + + + 0.000100000000000 + + + 0.001000000000000 + + + + + + + + + + + Maximum: + + + + + + + 4 + + + 1.000000000000000 + + + 0.000100000000000 + + + 0.001000000000000 + + + + + + + + + + + + Start + + + diff --git a/history.txt b/history.txt index e084958d..b8c22ccc 100644 --- a/history.txt +++ b/history.txt @@ -14,7 +14,9 @@ *** DEVELOPMENT STATUS *** *** v0.3.2 -- big fix in ExportMesh2HRTF.py (Tickets #13, #15, and #23 on sourcefourge) +- big fix and improvements in PreProcessing/MeshGrading (ticket #25, commit r38) +- bug fix in ExportMesh2HRTF.py (Tickets #13, #15, and #23 on sourcefourge) +- fixed a bug Output2HRTF_Main.m. Now the low frequency HRTF should at 0 dB if using reciprocal simulation and if setting reference = true in Output2HRTF.m, which is auto-generated when exporting from blender. *** v0.3.1 - bug fix in NumCalc