#pragma once /*========================================================================= medInria Copyright (c) INRIA 2013 - 2020. All rights reserved. See LICENSE.txt for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. =========================================================================*/ #include #include #include class medRemeshingToolBoxPrivate; /*! \brief Toolbox to refine, decimate, smooth, change the number of polygons in a mesh. * * This toolbox has several named widgets which can be accessed in python pipelines:\n\n * "topologyRadioButton" : QRadioButton\n * "resetButton" : QPushButton */ class MEDREMESHINGPLUGIN_EXPORT medRemeshingToolBox : public medAbstractSelectableToolBox { Q_OBJECT MED_TOOLBOX_INTERFACE("Remeshing", "Tools for refining/decimating meshes.", <<"Meshing") public: enum ProcessName { REFINE, DECIMATE, SMOOTH, MANUAL }; medRemeshingToolBox(QWidget *parent = nullptr); ~medRemeshingToolBox(); medAbstractData *processOutput(); static bool registered(); dtkPlugin *plugin(); void displayNewNumberOfCells(dtkSmartPointer output); void displayChanges(dtkSmartPointer output); double getNumberOfCells(dtkSmartPointer data); void displayComputedMesh(dtkSmartPointer output); void decimateMesh(double factor, dtkSmartPointer data = nullptr); void refineMesh(double factor, dtkSmartPointer data = nullptr); signals: void success(); void failure(); public slots: void reset(); void launchDecimate(); void launchRefine(); void imposeNbOfTriangles(); void updateView(); void clearAndUpdate(); void smoothMesh(); protected slots : void clear(); void addMeshToView(); void cantDecimateMore(); void allowDecimate(); //! Decimation is allowed if the topology button is uncheck void allowDecimateIfTopologyButtonUnchecked(bool checked); void disableButtons(bool val); void displayCastFailure(); private: medRemeshingToolBoxPrivate *d; };