File: Scene_implicit_function_item.h

package info (click to toggle)
cgal 6.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 144,912 kB
  • sloc: cpp: 810,858; ansic: 208,477; sh: 493; python: 411; makefile: 286; javascript: 174
file content (61 lines) | stat: -rw-r--r-- 1,831 bytes parent folder | download | duplicates (3)
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
56
57
58
59
60
61
#ifndef SCENE_IMPLICIT_FUNCTION_ITEM_H
#define SCENE_IMPLICIT_FUNCTION_ITEM_H

#include <CGAL/Three/Scene_item_rendering_helper.h>
#include <CGAL/Three/Scene_interface.h>
#include "Scene_implicit_function_item_config.h"
#include "implicit_functions/Implicit_function_interface.h"
#include "Color_ramp.h"
#include <CGAL/Qt/manipulatedFrame.h>
#include <Viewer.h>

#define SCENE_IMPLICIT_GRID_SIZE 120

struct Scene_implicit_function_item_priv;

class SCENE_IMPLICIT_FUNCTION_ITEM_EXPORT Scene_implicit_function_item
  : public CGAL::Three::Scene_item_rendering_helper
{
  Q_OBJECT

  typedef CGAL::qglviewer::ManipulatedFrame ManipulatedFrame;

public:
  Scene_implicit_function_item(Implicit_function_interface*);
  virtual ~Scene_implicit_function_item();

  Implicit_function_interface* function() const ;

  bool isFinite() const { return true; }
  bool isEmpty() const { return false; }
  void compute_bbox() const;

  Scene_implicit_function_item* clone() const { return nullptr; }

  // rendering mode
  virtual bool supportsRenderingMode(RenderingMode m) const;
  virtual bool manipulatable() const { return true; }
  virtual ManipulatedFrame* manipulatedFrame();



  // actually draw() is also overloaded to detect when the cut plane is moved
  virtual void draw()const {}
  virtual void draw(CGAL::Three::Viewer_interface*) const;
  virtual void drawEdges(CGAL::Three::Viewer_interface*) const;

  virtual QString toolTip() const;
  virtual void invalidateOpenGLBuffers();
  void initializeBuffers(CGAL::Three::Viewer_interface *) const;
  void computeElements() const;
public Q_SLOTS:
  void plane_was_moved();
  void compute_function_grid() const;
  void updateCutPlane();

protected:
  friend struct Scene_implicit_function_item_priv;
  Scene_implicit_function_item_priv* d;
};

#endif // SCENE_IMPLICIT_FUNCTION_ITEM