1 // Copyright (c) 2009,2010,2012,2015  GeometryFactory Sarl (France)
2 // All rights reserved.
3 //
4 // This file is part of CGAL (www.cgal.org).
5 //
6 // $URL: https://github.com/CGAL/cgal/blob/v5.3/Three/include/CGAL/Three/Scene_print_item_interface.h $
7 // $Id: Scene_print_item_interface.h 3b70343 2020-11-16T16:19:43+01:00 Maxime Gimeno
8 // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
9 //
10 // Author(s)     : Maxime GIMENO
11 
12 #ifndef SCENE_PRINT_ITEM_INTERFACE_H
13 #define SCENE_PRINT_ITEM_INTERFACE_H
14 
15 #include <CGAL/license/Three.h>
16 #include <QtPlugin>
17 #include <QPoint>
18 namespace CGAL
19 {
20 namespace Three {
21   class Viewer_interface;
22   class Scene_item;
23 
24 
25 //! An item that wants to print its primitive IDs must derive from this interface.
26 class Scene_print_item_interface {
27 public:
~Scene_print_item_interface()28   virtual ~Scene_print_item_interface(){}
29  //! Finds the spot the closest to `point` and prints the id of the corresponding Primitive (vertex, edge or face).
30  virtual void printPrimitiveId(QPoint, CGAL::Three::Viewer_interface*) = 0;
31 
32   //! Prints all the vertices ids if their number is not too high. The limit is
33   //! editable in the View menu of the application.
34   //! \returns `false` if the number of ids is too high to be displayed.
35   virtual bool printVertexIds() const= 0;
36   //! Prints all the edges ids if their number is not too high. The limit is
37   //! editable in the View menu of the application.
38   //! \returns `false` if the number of ids is too high to be displayed.
39   virtual bool printEdgeIds() const= 0;
40   //! Prints all the faces ids if their number is not too high. The limit is
41   //! editable in the View menu of the application.
42   //! \returns `false` if the number of ids is too high to be displayed.
43   virtual bool printFaceIds() const= 0;
44   //! Prints all the primitive ids if their number is not too high. The limit is
45   //! editable in the View menu of the application.
46   virtual void printAllIds() = 0;
47   //! \brief tests if an id should be displayed or not.
48   //!
49   //! \returns true if the Id should be displayed
50   //! \returns false if the Id should not be displayed (if it is hidden for example)
51   virtual bool testDisplayId(double, double, double, CGAL::Three::Viewer_interface*)const = 0;
52 
53   //! \brief tests if this item should display its ids.
54   //!
55   //! The default behavior is to only display ids of the currently selected item (\see mainSelectionIndex()).
56   //! This function allows to override this behavior.
57   //! @param test_item the currently tested TextListItem.
58   //! \return true if this item should display its ids when `test_item` is tested.
59   virtual bool shouldDisplayIds(CGAL::Three::Scene_item* test_item)const = 0;
60 };
61 }
62 }
63 
64 Q_DECLARE_INTERFACE(CGAL::Three::Scene_print_item_interface, "com.geometryfactory.PolyhedronDemo.PrintInterface/1.0")
65 #endif // SCENE_PRINT_ITEM_INTERFACE_H
66 
67