#include <CGAL/IO/Qt_widget_layer.h>
| |
The default constructor. The parameters parent and name
are passed to the QObject constructor.
|
|
| |
|
| |
|
|
|
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| These virtual functions can be overloaded in the derived class. They are called by the Qt_widget to which the layer is attached. |
|
| Returns true if this layer is active. |
|
| This virtual member function must be overloaded. This is where the drawing code goes. |
|
| This slot is provided to change the layer's state from activated to deactivated and reverse if it is triggered. The layer is activated if s is 2, or it is deactivated if s is 0. These values match with the signal stateChanged(int) in the QButton widget. |
|
| This slot is provided to change the layer's state from activated to deactivated and reverse if it is triggered. The layer is activated if b is true, or it is deactivated if b is false. These values match with the signal toggled(bool) in the QButton widget. |
|
| Activate and return true if it was not active. |
|
| Deactivate and return true if it was active. |
|
| The widget a layer is attached to or 0 otherwise. |
|
| You should overload this function if you want to have initializing code for your layer. This function is called every time the layer is activated. |
|
| You should overload this function if you want to write clean up code for your layer. This function is called every time the layer is deactivated. |
|
| This signal is emitted every time this layer is activated. |
|
| This signal is emitted every time this layer is deactivated. |
#include <CGAL/IO/Qt_widget_layer.h> namespace CGAL { template <class T> class Qt_layer_show_points : public Qt_widget_layer { public: typedef typename T::Point Point; typedef typename T::Segment Segment; typedef typename T::Vertex Vertex; typedef typename T::Vertex_iterator Vertex_iterator; Qt_layer_show_points(T &t) : tr(t){}; void draw() { Vertex_iterator it = tr.vertices_begin(), beyond = tr.vertices_end(); *widget << CGAL::GREEN << CGAL::PointSize (3) << CGAL::PointStyle (CGAL::DISC); while(it != beyond) { *widget << (*it).point(); ++it; } }; private: T &tr; };//end class } // namespace CGAL