File: Scene_aff_transformed_item.cpp

package info (click to toggle)
cgal 6.1.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 144,952 kB
  • sloc: cpp: 811,597; ansic: 208,576; sh: 493; python: 411; makefile: 286; javascript: 174
file content (55 lines) | stat: -rw-r--r-- 930 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#include "Scene_aff_transformed_item.h"

#include <CGAL/Three/Viewer_interface.h>
#include <CGAL/Three/Three.h>

#include <QApplication>

using namespace CGAL::Three;

Scene_aff_transformed_item::
Scene_aff_transformed_item(const CGAL::qglviewer::Vec& pos)
{
  d = new Scene_aff_transformed_item_priv(pos);
}

Scene_aff_transformed_item::
~Scene_aff_transformed_item()
{
  delete d;
}

void
Scene_aff_transformed_item::
itemAboutToBeDestroyed(Scene_item *item)
{
  Scene_item::itemAboutToBeDestroyed(item);
  if(d && item == this)
  {
    if(d->frame)
    {
      delete d->frame;
      d->frame = nullptr;
    }
  }
}

void
Scene_aff_transformed_item::
setFMatrix(double matrix[16])
{
  for(int i=0; i<16; ++i)
    d->f_matrix.data()[i] = float(matrix[i]);
}

bool
Scene_aff_transformed_item::
keyPressEvent(QKeyEvent* e)
{
  if(e->key() == Qt::Key_S)
  {
    Q_EMIT applyTransformation();
    return true;
  }
  return false;
}