Commit c492da0c authored by Emmanuel Promayon's avatar Emmanuel Promayon

FIXED code cleaning (this, includes) + add CamiTK licence

parent 1b12c6ed
/*****************************************************************************
* $CAMITK_LICENCE_BEGIN$
*
* CamiTK - Computer Assisted Medical Intervention ToolKit
* (c) 2001-2018 Univ. Grenoble Alpes, CNRS, TIMC-IMAG UMR 5525 (GMCAO)
*
* Visit http://camitk.imag.fr for more information
*
* This file is part of CamiTK.
*
* CamiTK is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* CamiTK 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 version 3 for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with CamiTK. If not, see <http://www.gnu.org/licenses/>.
*
* $CAMITK_LICENCE_END$
****************************************************************************/
// Local Includes
#include "Frame.h"
#include "Viewer.h"
// Includes from Vtk
#include <vtkCellData.h>
#include <vtkSmartPointer.h>
#include <vtkPointSet.h>
#include <vtkPoints.h>
#include <vtkPointData.h>
#include <vtkCellArray.h>
#include <vtkFloatArray.h>
#include <vtkPolyData.h>
#include <vtkTransformPolyDataFilter.h>
#include <vtkAbstractTransform.h>
#include <vtkAppendPolyData.h>
#include <vtkArrowSource.h>
#include <vtkMatrix4x4.h>
#include <vtkTransform.h>
#include <vtkTransformPolyDataFilter.h>
#include <vtkPolyDataMapper.h>
#include <vtkActor.h>
#include <vtkAxesActor.h>
#include <vtkTextProperty.h>
#include <vtkProperty2D.h>
#include <vtkCaptionActor2D.h>
#include <vtkTextActor.h>
// Local Includes
#include "Frame.h"
#include "Viewer.h"
namespace camitk {
int Frame::nbTotalFrames = 0;
......@@ -40,15 +49,15 @@ Frame::Frame(vtkSmartPointer<vtkTransform> transform, Frame* parentFrame) {
setParentFrame(parentFrame);
this->parentFrame = parentFrame;
this->transformWorldToMe->Identity();
this->transformWorldToMe->PostMultiply();
this->transformWorldToMe->Concatenate(transformParentToMe);
this->transformWorldToMe->Update();
transformWorldToMe->Identity();
transformWorldToMe->PostMultiply();
transformWorldToMe->Concatenate(transformParentToMe);
transformWorldToMe->Update();
if (this->parentFrame != nullptr) {
this->transformWorldToMe->Concatenate(this->parentFrame->getTransformFromWorld());
this->transformWorldToMe->Update();
this->parentFrame->addFrameChild(this);
transformWorldToMe->Concatenate(this->parentFrame->getTransformFromWorld());
transformWorldToMe->Update();
parentFrame->addFrameChild(this);
}
}
......@@ -58,21 +67,21 @@ void Frame::initAttributes() {
frameName = "Frame" + QString::number(nbTotalFrames);
nbTotalFrames ++;
this->axes = nullptr;
this->parentFrame = nullptr;
axes = nullptr;
parentFrame = nullptr;
this->transformParentToMe = vtkSmartPointer<vtkTransform>::New();
this->transformParentToMe->Identity();
transformParentToMe = vtkSmartPointer<vtkTransform>::New();
transformParentToMe->Identity();
this->transformWorldToMe = vtkSmartPointer<vtkTransform>::New();
this->transformWorldToMe->Identity();
this->transformWorldToMe->PostMultiply();
transformWorldToMe = vtkSmartPointer<vtkTransform>::New();
transformWorldToMe->Identity();
transformWorldToMe->PostMultiply();
this->representationTransformFilter = vtkSmartPointer<vtkTransformPolyDataFilter>::New();
this->representationTransformFilter->SetTransform(transformWorldToMe);
this->representationTransformFilter->GlobalWarningDisplayOff();
representationTransformFilter = vtkSmartPointer<vtkTransformPolyDataFilter>::New();
representationTransformFilter->SetTransform(transformWorldToMe);
representationTransformFilter->GlobalWarningDisplayOff();
this->childrenFrame.clear();
childrenFrame.clear();
}
......@@ -88,8 +97,8 @@ Frame::~Frame() {
f->setParentFrame(nullptr);
}
this->childrenFrame.clear();
this->frameViewers.clear();
childrenFrame.clear();
frameViewers.clear();
}
......@@ -101,7 +110,7 @@ const QString& Frame::getFrameName() const {
// ------------------- setFrameName ----------------------------------
void Frame::setFrameName(QString name) {
this->frameName = name;
frameName = name;
}
// ------------------- getParentFrame ----------------------------------
......@@ -152,16 +161,16 @@ void Frame::setParentFrame(InterfaceFrame* parent, bool keepTransform) {
parentFrame->removeFrameChild(this);
}
this->parentFrame = checkedParent;
this->transformWorldToMe->Identity();
this->transformWorldToMe->PostMultiply();
this->transformWorldToMe->Concatenate(transformParentToMe);
this->transformWorldToMe->Update();
parentFrame = checkedParent;
transformWorldToMe->Identity();
transformWorldToMe->PostMultiply();
transformWorldToMe->Concatenate(transformParentToMe);
transformWorldToMe->Update();
if (this->parentFrame != nullptr) {
this->transformWorldToMe->Concatenate(this->parentFrame->getTransformFromWorld());
this->transformWorldToMe->Update();
this->parentFrame->addFrameChild(this);
if (parentFrame != nullptr) {
transformWorldToMe->Concatenate(this->parentFrame->getTransformFromWorld());
transformWorldToMe->Update();
parentFrame->addFrameChild(this);
}
}
......
/*****************************************************************************
* $CAMITK_LICENCE_BEGIN$
*
* CamiTK - Computer Assisted Medical Intervention ToolKit
* (c) 2001-2018 Univ. Grenoble Alpes, CNRS, TIMC-IMAG UMR 5525 (GMCAO)
*
* Visit http://camitk.imag.fr for more information
*
* This file is part of CamiTK.
*
* CamiTK is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
*
* CamiTK 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 version 3 for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with CamiTK. If not, see <http://www.gnu.org/licenses/>.
*
* $CAMITK_LICENCE_END$
****************************************************************************/
#ifndef FRAME_H
#define FRAME_H
......
Markdown is supported
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