50 #ifndef DECIMATERPLUGIN_HH
51 #define DECIMATERPLUGIN_HH
68 #include "DecimaterInfo.hh"
70 #include "DecimaterToolbarWidget.hh"
72 #include "DecimateThread.hh"
76 #include <OpenMesh/Tools/Decimater/MixedDecimaterT.hh>
84 #include <OpenMesh/Tools/Decimater/ModIndependentSetsT.hh>
88 #include <ACG/Utils/SmartPointer.hh>
112 #if QT_VERSION >= 0x050000
113 Q_PLUGIN_METADATA(IID
"org.OpenFlipper.Plugins.Plugin-Decimater")
119 void updatedObject(
int _id,
const UpdateType& _type);
120 void setSlotDescription(QString _slotName, QString _slotDescription,
121 QStringList _parameters, QStringList _descriptions);
124 void log(
Logtype _type, QString _message);
125 void log(QString _message);
128 void pluginExists( QString _pluginName ,
bool& _exists ) ;
129 void functionExists( QString _pluginName , QString _functionName ,
bool& _exists );
132 void addToolbox( QString _name , QWidget* _widget, QIcon* _icon );
135 void scriptInfo( QString _functionName );
141 void startJob( QString _jobId, QString _description ,
int _min ,
int _max ,
bool _blocking =
false);
142 void cancelJob(QString _jobId );
143 void finishJob(QString _jobId );
144 void setJobState(QString,
int);
145 void setJobName(QString _jobId, QString _name );
146 void setJobDescription(QString _jobId, QString _text );
149 void jobCanceled(QString _jobId);
153 void initializePlugin();
156 void slotObjectUpdated(
int _identifier ,
const UpdateType& _type );
157 void slotObjectSelectionChanged(
int _identifier );
159 void objectDeleted(
int _id);
161 void slotAboutToRestore(
int _id);
164 void noguiSupported( ) {} ;
178 QString
name(){
return (QString(
"Decimater")); };
181 QString
description() {
return (QString(tr(
"Mesh Decimation ..."))); };
185 typedef DecimateThread::BaseDecimaterType BaseDecimaterType;
186 typedef DecimateThread::DecimaterType DecimaterType;
187 typedef DecimateThread::McDecimaterType McDecimaterType;
188 typedef DecimateThread::MixedDecimaterType MixedDecimaterType;
205 ptr::shared_ptr<BaseDecimaterType> decimater;
207 ModAspectRatioH hModAspectRatio;
208 ModEdgeLengthH hModEdgeLength;
209 ModHausdorffH hModHausdorff;
210 ModIndependentH hModIndependent;
211 ModNormalDeviationH hModNormalDeviation;
212 ModNormalFlippingH hModNormalFlipping;
213 ModQuadricH hModQuadric;
214 ModRoundnessH hModRoundness;
216 std::vector< ptr::shared_ptr<DecimaterInit> > decimater_objects_;
225 void slot_decimate_finished(QString _jobId);
229 void slot_initialize_object(
int obj_id,
bool clear =
false);
240 void slotUpdateNormalDev ();
241 void slotUpdateVertices ();
242 void slotUpdateTriangles ();
243 void slotUpdateEdgeLength ();
249 void slotMixedCounterValueChanged(
double);
250 void slotMixedSliderValueChanged(
int);
251 void slotDisableDecimation();
269 void decimate(
int _objID, QVariantMap _constraints);
274 QString version() {
return QString(
"1.0"); };
279 #endif //DECIMATERPLUGIN_HH
void slotUpdateNumTriangles()
gets and sets the current maximum number of triangles
Interface to call functions across plugins.
QString description()
Description of the Plugin.
~DecimaterPlugin()
Default destructor.
DecimaterToolbarWidget * tool_
Widget for Toolbox.
void pluginsInitialized()
Initialization of the plugin when it is loaded by the core.
Interface for all plugins which want to Load or Save files and create Objects.
Interface for all Plugins which provide scriptable Functions.
Interface class for Thread handling.
Plugins can add its own toolbox to the main widget's toolbox area by using this interface.
void slot_initialize()
init called from button in toolbox
Interface class for backup handling.
Interface for all Plugins which do logging to the logging window of the framework.
void slotUpdateAspectRatio(int _value)
sync between values of aspect ratio slider and spinbox in the toolbox
DecimaterPlugin()
Default constructor.
void slotUpdateDistance()
slider / spinbox updates
void slotUpdateNumVertices()
update number of vertices information
Interface class from which all plugins have to be created.
Logtype
Log types for Message Window.
Use Roundness of triangles to control decimation.
Use Hausdorff distance to control decimation.
void slot_decimate()
decimating called from button in toolbox
Use edge length to control decimation.
const UpdateType UPDATE_ALL(UpdateTypeSet(1))
Identifier for all updates.
void canceledJob(QString _job)
A job has been canceled.
Use aspect ratio to control decimation.
void decimate(int _objID, QVariantMap _constraints)
decimate an object
Use Normal deviation to control decimation.
QString name()
Name of the Plugin.
void slotUpdateRoundness(int _value)
roundness slider - spinbox sync
Mesh decimation module computing collapse priority based on error quadrics.