Commit 3d21d81f authored by saubatn's avatar saubatn
Browse files

NEW : Split Decimation classes into 2 separated files

git-svn-id: svn+ssh://scm.forge.imag.fr/var/lib/gforge/chroot/scmrepos/svn/camitk/trunk/camitk@122 ec899d31-69d1-42ba-9299-647d76f65fb3
parent 13ad2cb8
/*****************************************************************************
$CAMITK_LICENCE_BEGIN$
CamiTK - Computer Assisted Medical Intervention ToolKit
Visit http://camitk.imag.fr for more information
Copyright (C) 2012 Celine Fouard, Emmanuel Promayon, Yannick Keraval
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301 USA
$CAMITK_LICENCE_END$
*****************************************************************************/
#include "Decimation.h"
#include "DecimationDialog.h"
// -------------------- Decimation constructor --------------------
Decimation::Decimation(ActionExtension *extension) : Action(extension){
this->setName("Decimation");
this->setDescription("Decimate mesh data");
this->setComponent("MeshComponent");
this->setFamily("Decimation");
this->addTag("Decimation");
this->addTag("Simplify");
this->setEmbedded(true);
// lazy instanciation
myWidget = NULL;
}
// -------------------- Decimation destructor --------------------
Decimation::~Decimation() {
if (myWidget)
delete myWidget;
}
// -------------------- getWidget --------------------
QWidget * Decimation::getWidget() {
if (myWidget)
delete myWidget;
MeshComponent * mc = NULL;
myWidget = new DecimationDialog(dynamic_cast<MeshComponent *>(targetComponents.last()));
return myWidget;
}
\ No newline at end of file
/*****************************************************************************
$CAMITK_LICENCE_BEGIN$
CamiTK - Computer Assisted Medical Intervention ToolKit
Visit http://camitk.imag.fr for more information
Copyright (C) 2012 Celine Fouard, Emmanuel Promayon, Yannick Keraval
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301 USA
$CAMITK_LICENCE_END$
*****************************************************************************/
#ifndef DECIMATION_H
#define DECIMATION_H
#include <QObject>
#include <Action.h>
using namespace camitk;
class Decimation : public Action {
public:
/// the constructor
Decimation(ActionExtension*);
/// the destructor
virtual ~Decimation();
/// this method creates and returns the widget containing the user interface for the action
virtual QWidget * getWidget();
private:
/// method called when the action is applied
virtual void apply() {};
/// action widget
QWidget *myWidget;
};
#endif // DECIMATION_H
\ No newline at end of file
......@@ -54,7 +54,7 @@ private :
/// the mesh to use
MeshComponent *targetMesh;
} ;
#endif // DECIMATIONDIALOG_H
......
......@@ -24,8 +24,8 @@ $CAMITK_LICENCE_END$
*****************************************************************************/
#include "DecimationExtension.h"
#include "DecimationDialog.h"
#include "Decimation.h"
#include "Action.h"
#include "Application.h"
// --------------- declare the extension -------------------
......@@ -36,32 +36,5 @@ void DecimationExtension::init() {
registerNewAction(Decimation);
}
// -------------------- Decimation constructor --------------------
Decimation::Decimation(ActionExtension *extension) : Action(extension){
this->setName("Decimation");
this->setDescription("Decimate mesh data");
this->setComponent("MeshComponent");
this->setFamily("Decimation");
this->addTag("Decimation");
this->addTag("Simplify");
this->setEmbedded(true);
// lazy instanciation
myWidget = NULL;
}
// -------------------- Decimation destructor --------------------
Decimation::~Decimation() {
if (myWidget)
delete myWidget;
}
// -------------------- getWidget --------------------
QWidget * Decimation::getWidget() {
if (myWidget)
delete myWidget;
MeshComponent * mc = NULL;
myWidget = new DecimationDialog(dynamic_cast<MeshComponent *>(targetComponents.last()));
return myWidget;
}
......@@ -28,7 +28,6 @@ $CAMITK_LICENCE_END$
#define DECIMATION_EXTENSION_H
#include <QObject>
#include <Action.h>
#include <ActionExtension.h>
using namespace camitk;
......@@ -55,26 +54,4 @@ public:
};
class Decimation : public Action {
public:
/// the constructor
Decimation(ActionExtension*);
/// the destructor
virtual ~Decimation();
/// this method creates and returns the widget containing the user interface for the action
virtual QWidget * getWidget();
private:
/// method called when the action is applied
virtual void apply() {};
/// action widget
QWidget *myWidget;
};
#endif // DECIMATION_EXTENSION_H
\ No newline at end of file
Supports Markdown
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