Commit Graph

77 Commits

Author SHA1 Message Date
Laurent Rineau 9f2384e77d - Remove demo/icons/Logos.qrc, replaced by demo/resources/CGAL.qrc, that
also contains :/cgal/help/about_CGAL.html
- Add include/CGAL/Qt/debug.h and src/CGALQt/debug.cpp, that will contain
  debug tools/functions. For the moment, they just define:
      void traverse_resources(const QString& name);
  that must be used like that:
      CGAL::Qt:traverse_resources(":/cgal"); // view CGAL resources
  or
      CGAL::Qt:traverse_resources(":"); // view all resources
  and displays the resources tree on std::cerr.
2008-07-04 13:10:02 +00:00
Laurent Rineau 95af17375f Call graphicsView->setMouseTracking(true). It seems to be on by default,
but the documentation does not say so.
2008-07-02 13:36:11 +00:00
Laurent Rineau be4a3ad225 Call graphicsView->setMouseTracking(true). It seems to be on by default,
but the documentation does not say so.
2008-07-02 13:35:45 +00:00
Laurent Rineau ad6dbd0209 Remove setMouseTracking. It seems to be on by default. 2008-07-02 13:32:49 +00:00
Laurent Rineau 8c017c943c Rename Constrained_delaunay_triangulation_2 into
Constrained_Delaunay_triangulation_2 (with capitalized "Delaunay", as in
the class name).
2008-07-02 13:31:42 +00:00
Andreas Fabri f2431c2d74 robustification 2008-07-02 11:21:51 +00:00
Andreas Fabri 36a8de6cf4 robustification 2008-07-02 09:10:59 +00:00
Laurent Rineau d1501f3c71 Polish the two demos.
Add a PNG file for "zoom-best-fit".
2008-07-01 21:59:46 +00:00
Laurent Rineau 5ddfd30c93 In src/CGALQt4:
- add the class CGAL::Qt::DemosMainWindow in libCGALQt4,
  - compile moc generated files separately

In demo/
  - new sub-directory demo/resources/ that contains, for now,
  about_CGAL.html
  - move the two triangulation demos from demo/GraphicsView to
  demo/Triangulation_2 (to prepare the inclusion in CGAL internal release).
  - For each demo, merge all .h and .cpp files. Each demo now has a ui
  file, a cpp file and a qrc file (and a html file for the "About demo..."
  menu entry).
  - rename the demos to Delaunay_triangulation_2(.exe) and
  Constrained_Delaunay_triangulation_2(.exe)
2008-07-01 13:18:39 +00:00
Laurent Rineau 4e9791b602 (Leftover of revision 43782.)
Remove toolBar2, that was added during the presentation at Inria, and
commited by error.
2008-06-28 09:29:55 +00:00
Laurent Rineau 0571512148 Polished demos.
- added an icons "insertPoint.png",
  - added a new html file for the about dialog of Delaunay triangulation,
  - the Voronoi diagram is now painted in blue,
  - add the button for Voronoi,
  - general cleaning of the code.
2008-06-27 13:20:55 +00:00
Laurent Rineau ec42da4230 Delaunay-voronoi demo. Not yet polished, but still. 2008-06-27 10:45:04 +00:00
Laurent Rineau bed7194768 Rename "delaunay" to "constrained_delaunay_triangulation" and "MainWindow"
to "Constrained_Delaunay_triangulation_MainWindow".
2008-06-26 16:22:45 +00:00
Laurent Rineau b731d74096 CGAL::Qt::GraphicsViewNavigation is no longer constructed from a
QGraphicsView*. It is now able to handle several graphics view at the same
time (just install several event filters).

New class CGAL::Qt::DemosMainWindow. That class has several protected
methods:
  void setupStatusBar();
  void addNavigation(QGraphicsView*);
  void setupOptionsMenu(QMenu* menu  = NULL);
  void addAboutCGAL(QMenu* menu  = NULL);
  void addAboutDemo(QString htmlResourceName, QMenu* menu  = NULL);

setupStatusBar() adds a label in the statusBar(), that is connected to the
navigation class, and shows the position of the mouse.

addNavigation(QGraphicsView* v) adds a navigation class to the view v.

setupOptionsMenu(QMenu* m  = NULL) adds two options "Use OpenGL" and
"Use antialiasing" to the menu m. If m==0, a menu named "Options" is searched
for, or created if it does not exists.

addAboutCGAL(QMenu* m  = NULL) adds an entry "About CGAL..." to the menu
m. If m==0, a "Help" menu is searched for or created.

addAboutDemo(QString htmlResourceName, QMenu* m  = NULL) adds an entre
"About the demo...", to the menu m. If m==0, a "Help" menu is searched for
or created. If the entry is clicked, a popup dialog shows the content of
the resource/file whose name is in htmlResourceName.
Example:
  addAboutDemo(":/cgal/help/about_triangulation.html")
2008-06-26 15:19:44 +00:00
Laurent Rineau 1740edf306 - Anti-aliasing is quite slow (but in OpenGL mode). It is deactivated by
default.

- Add a temp message in the status bar when the aliasing mode is changed.
2008-06-26 11:47:21 +00:00
Laurent Rineau cb540abc20 - Remove actionToto and actionDisplay_Nearest_Neighbor (added during the
presentation at Inria, and commited by error).
- Add actionUse_Antialiasing in the Options menu.
2008-06-26 10:22:14 +00:00
Laurent Rineau 0d62ce2202 Exclude the "min demo" from "make all". 2008-06-26 10:19:33 +00:00
Andreas Fabri e54fcaa58c Reorganize classes in a namespace and directory called Qt 2008-06-26 08:07:36 +00:00
Andreas Fabri d159174d2c after presentation at Inria 2008-06-25 20:03:48 +00:00
Andreas Fabri 153144ab17 after presentation at Inria 2008-06-25 19:55:27 +00:00
Andreas Fabri 2d3816ec73 after presentation at Inria 2008-06-25 19:54:33 +00:00
Laurent Rineau 519cb27584 A QtInput must be constructed with a parent (that can be 0).
Thus a QtPolylineInput must also be constructed with a parent!
2008-06-24 14:32:03 +00:00
Laurent Rineau 44e8f0fdc1 Remove Delaunay-Voronoi stuff. 2008-06-24 14:16:39 +00:00
Laurent Rineau c8b36d6419 I had switched left and right by error! 2008-06-24 14:16:22 +00:00
Laurent Rineau a1892acb54 Minor modifications:
- clear the mouse coordinates QLabel, at the very beginning,
  - turn the vertical axe upside down.
2008-06-24 13:55:41 +00:00
Laurent Rineau 52c828657c - Store a Vertex_handle, as the hint, instead of a Face_handle: Vertex_handle
survive to insert(), Face_handle do not.
- vh->face() is used as the Face_handle hint, if vh!=Vertex_handle().
2008-06-24 12:52:27 +00:00
Laurent Rineau 7d811a656b Display circumcircles even if the triangulation is contrained. 2008-06-24 12:26:31 +00:00
Laurent Rineau 0b1d985e33 Code review in MainWindow:
- Add dgi and vgi at the beginning, and use show()/hide() instead of
    addItem/removeItem.
  - Merge connectActions() into MainWindow's constructor. That is clearer
    like that.
  - Add comments in the constructor.
  - Rewrite the two action handlers aboutCGAL and aboutDemo: use html file
    in a resource. That works! The "About CGAL" dialog now has a big shiny
    CGAL logo! :-)
2008-06-20 16:52:41 +00:00
Laurent Rineau 819de032cc Partially revert revision 43718:
once an item is added to a scene, the scene is responsible for its
  deletion!
2008-06-20 16:26:35 +00:00
Laurent Rineau 32a5519e5f (Fix the previous commit.)
QObjects must have parents!
2008-06-20 15:49:27 +00:00
Laurent Rineau e51aa26320 QObjects must have parents! 2008-06-20 15:46:40 +00:00
Laurent Rineau f7eb596370 Do not eat the move event! 2008-06-20 15:41:46 +00:00
Laurent Rineau c115427e74 Code review:
- add a destructor to destroyed circle, which is not a QObject
  - use fh as a hint.
2008-06-20 15:39:18 +00:00
Laurent Rineau af51cec326 Code review:
- Use fh as an hint, to avoid to localize the moving point without hint
    each time it moves.
  - Code factorisation between mousePressEvent and mouseMoveEvent.
2008-06-20 15:03:49 +00:00
Laurent Rineau 78dffac531 - Merge/Move QtPolylineInput_non_templated_base.* files into
QtPolylineInput.*

  The need to split QtPolylineInput into a templated class and a
  non-template base class exists, but there is not need to split the header
  into two headers. QtPolylineInput_non_templated_base can be seen as an
  auxiliary class of QtPolylineInput.

- Turn Point_2<K> into K::Point_2 in <CGAL/IO/QtConverter.h>, to avoid the
  inclusion of <CGAL/Point_2.h>.

- Put most Qt Resource files into the CGALQt4 library, instead of linking
  them into the demo.
2008-06-20 10:10:44 +00:00
Laurent Rineau b873a87c96 - Move two cpp file into src/CGALQt4/
- Build a library "CGAL-Qt4".

I do not now yet how to include that library into the set of libraries of
CGAL.
2008-06-18 14:38:38 +00:00
Laurent Rineau 87e1ef1427 Remove the almost empty .cpp wrappers around .moc files. The moc-generated
files are now compiled directly.
2008-06-18 13:35:08 +00:00
Laurent Rineau 899630711b Remove MainWindow.rcc, which is a generated file. 2008-06-18 11:00:45 +00:00
Laurent Rineau 40f5ba9ec6 Move some header to include/CGAL/IO/, and rename the corresponding classes:
- "Qt" as prefix, instead of a simple "Q",
  - no "_2" suffix.

(Next commit will be the move of some .cpp files to src/CGALQt4/ and the
creation of a new CGAL library.)
2008-06-18 10:57:39 +00:00
Laurent Rineau dcd3efa221 - QNavigation2 is merge into QNavigation.
- QTriangulationVerticesGraphicsItem_2 is merged into
  QTriangulationGraphicsItem_2.
- Better event filtering in QNavigation.
- Remove QDatastructure. MainWindow is now responsible for inserting
  objects (points, polylines) into the triangulation.
- In MainWindow.h: include less headers. Use forward declarations when
  possible.
- In MainWindow.cpp and MainWindow.ui: 
     - add a "Recenter" action, that allows to center and scale the
       viewport on the triangulation,
     - add shortcuts and mnemonic to actions.
- Allow the use of the OpenGL QPaintEngine, instead of the traditional one.
2008-06-18 09:45:36 +00:00
Andreas Fabri 734d550728 Circle input handler 2008-06-16 21:40:18 +00:00
Laurent Rineau 06189aeaa4 Correct the bug that i introduced in QPolylineInput_2<K> with
revision 43589.
2008-06-13 16:48:28 +00:00
Laurent Rineau 620539ee4e The "Zoom rectangle" is implemented (as an experiment in min.cpp).
Not the nice transparent "CGAL yellow" color. :-)
2008-06-13 16:36:10 +00:00
Laurent Rineau 5cd6938492 Updated version of the minimal test demo:
- The arrow keys (up, down, left, right) work as expected, now. When they
  are used, the sceneRect of the view if extended.
2008-06-13 13:48:33 +00:00
Laurent Rineau c827149db8 Cosmetic changes (add a comment, modify another one, add a one-line block
after an "if")
2008-06-13 09:43:16 +00:00
Laurent Rineau 069aa9beab I forgot the moc file! 2008-06-13 08:56:11 +00:00
Laurent Rineau 7d86267ea0 - Add a minimal demo: min.cpp
- Make CGAL required, and not optional!
2008-06-13 08:49:27 +00:00
Andreas Fabri aecb9992cd A small program to test graphics view features 2008-06-13 08:15:57 +00:00
Andreas Fabri a11e64b39e got rid of the wrappers of the CGAL datastructures 2008-06-12 20:33:06 +00:00
Andreas Fabri 2b3d38dd9e These proxies were an overkill 2008-06-12 20:20:08 +00:00