60#include "DecimaterInfo.hh"
62#include "DecimaterToolbarWidget.hh"
64#include "DecimateThread.hh"
76#include <OpenMesh/Tools/Decimater/ModIndependentSetsT.hh>
80#include <ACG/Utils/SmartPointer.hh>
106 Q_PLUGIN_METADATA(IID
"org.OpenFlipper.Plugins.Plugin-Decimater")
110 void updateView()
override;
111 void updatedObject(
int _id,
const UpdateType& _type)
override;
112 void setSlotDescription(QString _slotName, QString _slotDescription,
113 QStringList _parameters, QStringList _descriptions)
override;
116 void log(
Logtype _type, QString _message)
override;
117 void log(QString _message)
override;
120 void pluginExists( QString _pluginName ,
bool& _exists )
override;
121 void functionExists( QString _pluginName , QString _functionName ,
bool& _exists )
override;
124 void addToolbox( QString _name , QWidget* _widget, QIcon* _icon )
override;
127 void scriptInfo( QString _functionName );
133 void startJob( QString _jobId, QString _description ,
int _min ,
int _max ,
bool _blocking =
false)
override;
134 void cancelJob(QString _jobId )
override;
135 void finishJob(QString _jobId )
override;
136 void setJobState(QString,
int)
override;
137 void setJobName(QString _jobId, QString _name )
override;
138 void setJobDescription(QString _jobId, QString _text )
override;
141 void jobCanceled(QString _jobId);
145 void initializePlugin()
override;
148 void slotObjectUpdated(
int _identifier ,
const UpdateType& _type )
override;
149 void slotObjectSelectionChanged(
int _identifier )
override;
151 void objectDeleted(
int _id)
override;
153 void slotAboutToRestore(
int _id)
override;
156 void noguiSupported( )
override {}
159 void canceledJob (
const QString _job )
override;
170 QString
name()
override {
return (QString(
"Decimater")); }
173 QString
description()
override {
return (QString(tr(
"Mesh Decimation ..."))); }
177 typedef DecimateThread::BaseDecimaterType BaseDecimaterType;
178 typedef DecimateThread::DecimaterType DecimaterType;
179 typedef DecimateThread::McDecimaterType McDecimaterType;
180 typedef DecimateThread::MixedDecimaterType MixedDecimaterType;
197 ptr::shared_ptr<BaseDecimaterType> decimater;
199 ModAspectRatioH hModAspectRatio;
200 ModEdgeLengthH hModEdgeLength;
201 ModHausdorffH hModHausdorff;
202 ModIndependentH hModIndependent;
203 ModNormalDeviationH hModNormalDeviation;
204 ModNormalFlippingH hModNormalFlipping;
205 ModQuadricH hModQuadric;
206 ModRoundnessH hModRoundness;
208 std::vector< ptr::shared_ptr<DecimaterInit> > decimater_objects_;
217 void slot_decimate_finished(
const QString &_jobId);
221 void slot_initialize_object(
int obj_id,
bool clear =
false);
232 void slotUpdateNormalDev ();
233 void slotUpdateVertices ();
234 void slotUpdateTriangles ();
235 void slotUpdateEdgeLength ();
241 void slotMixedCounterValueChanged(
double);
242 void slotMixedSliderValueChanged(
int);
243 void slotDisableDecimation();
261 void decimate(
int _objID, QVariantMap _constraints);
272 void decimate(
int _objID, QString _constraints);
275 QString version()
override {
return QString(
"1.0"); };
Logtype
Log types for Message Window.
Interface class for backup handling.
Interface class from which all plugins have to be created.
void slotUpdateRoundness(int _value)
roundness slider - spinbox sync
QString name() override
Name of the Plugin.
void decimate(int _objID, QVariantMap _constraints)
decimate an object
void slotUpdateDistance()
slider / spinbox updates
void slot_decimate()
decimating called from button in toolbox
void slotUpdateNumTriangles()
gets and sets the current maximum number of triangles
~DecimaterPlugin()
Default destructor.
void slotUpdateNumVertices()
update number of vertices information
void slot_initialize()
init called from button in toolbox
QString description() override
Description of the Plugin.
DecimaterToolbarWidget * tool_
Widget for Toolbox.
void slotUpdateAspectRatio(int _value)
sync between values of aspect ratio slider and spinbox in the toolbox
void pluginsInitialized() override
Initialization of the plugin when it is loaded by the core.
DecimaterPlugin()
Default constructor.
Interface for all plugins which want to Load or Save files and create Objects.
Interface for all Plugins which do logging to the logging window of the framework.
Use aspect ratio to control decimation.
Use edge length to control decimation.
Use Hausdorff distance to control decimation.
Use Normal deviation to control decimation.
Mesh decimation module computing collapse priority based on error quadrics.
Use Roundness of triangles to control decimation.
Interface class for Thread handling.
Interface class for exporting functions to python.
Interface to call functions across plugins.
Interface for all Plugins which provide scriptable Functions.
const UpdateType UPDATE_ALL(UpdateTypeSet(1))
Identifier for all updates.