mirror of https://github.com/CGAL/cgal
1.3.63 - 20/01/2004 [rursu]
----------------------------------------
I have added two new layers:
Navigation_layer.h, Custom_zoom_layer.h
I have updated the doc too.
This commit is contained in:
parent
4e89287da1
commit
bff3e8691f
|
|
@ -1,3 +1,9 @@
|
|||
1.3.63 - 20/01/2004 [rursu]
|
||||
----------------------------------------
|
||||
I have added two new layers:
|
||||
Navigation_layer.h, Custom_zoom_layer.h
|
||||
I have updated the doc too.
|
||||
|
||||
1.3.62 - 21/11/2003
|
||||
----------------------------------------
|
||||
We don't have time for ROTATIONS support, so we roll back the
|
||||
|
|
|
|||
|
|
@ -0,0 +1,45 @@
|
|||
% +------------------------------------------------------------------------+
|
||||
% | CGAL Reference Manual: Reference manual for Qt_widget.tex
|
||||
% +------------------------------------------------------------------------+
|
||||
% |
|
||||
% | 03.01.2001 Radu Ursu
|
||||
% |
|
||||
% | \RCSdef{\qtwidgetRev}{$Revision$}
|
||||
% | \RCSdefDate{\qtwidgetDate}{$Date$}
|
||||
% +------------------------------------------------------------------------+
|
||||
|
||||
% +-----------------------------------------------------+
|
||||
\begin{ccRefClass}{Custom_zoom_layer}
|
||||
|
||||
\ccInclude{CGAL/IO/Custom_zoom_layer.h}
|
||||
|
||||
\ccInheritsFrom
|
||||
\ccc{Custom_zoom_layer}
|
||||
|
||||
\ccGlue
|
||||
|
||||
\ccCreation
|
||||
\ccCreationVariable{zoom_layer}
|
||||
\ccSetTwoColumns{Custom_zoom_layer}{}
|
||||
|
||||
\ccConstructor{Custom_zoom_layer(QObject* parent = 0, const char* name =
|
||||
0);}{\ccc{parent} is the parent widget and \ccc{name} is the name you
|
||||
give to this layer.}
|
||||
|
||||
The standard toolbar already provide zooming functionality, but this layer
|
||||
comes to complete the latest.
|
||||
When this layer is attached and active, zooming functionality could be used anytime. To zoom in x2 you must press the + key on your keyboard. To zoom
|
||||
out x2 you must press the - key on your keyboard. You can also use the mouse
|
||||
to zoom to a region defined by one rectangle. To define the rectangle you
|
||||
must press Ctrl+LeftMouseButton for the first corner of the rectangle, you
|
||||
may release, then move, then press Ctrl+LeftMouseButton once again to define
|
||||
the second corner.
|
||||
|
||||
|
||||
\end{ccRefClass}
|
||||
|
||||
% +-----------------------------------------------------+
|
||||
% EOF
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
% +------------------------------------------------------------------------+
|
||||
% | CGAL Reference Manual: Reference manual for Qt_widget.tex
|
||||
% +------------------------------------------------------------------------+
|
||||
% |
|
||||
% | 03.01.2001 Radu Ursu
|
||||
% |
|
||||
% | \RCSdef{\qtwidgetRev}{$Revision$}
|
||||
% | \RCSdefDate{\qtwidgetDate}{$Date$}
|
||||
% +------------------------------------------------------------------------+
|
||||
|
||||
% +-----------------------------------------------------+
|
||||
\begin{ccRefClass}{Naviagtion_layer}
|
||||
|
||||
\ccInclude{CGAL/IO/Navigation_layer.h}
|
||||
|
||||
\ccInheritsFrom
|
||||
\ccc{Qt_widget_layer}
|
||||
|
||||
\ccGlue
|
||||
|
||||
\ccCreation
|
||||
\ccCreationVariable{nav_layer}
|
||||
\ccSetTwoColumns{Navigation_layer}{}
|
||||
|
||||
\ccConstructor{Navigation_layer(QObject* parent = 0, const char* name =
|
||||
0);}{\ccc{parent} is the parent widget and \ccc{name} is the name you
|
||||
give to this layer.}
|
||||
|
||||
This layer is used to provide basic navigation control over the
|
||||
\ccc{Qt_widget}. When this layer is attached and active, you may use
|
||||
the arrows to navigate the equivalent in world coordinates of 10 pixels
|
||||
in the desired direction. You can also use the PageUp, PageDown keys to
|
||||
scroll the equivalent in world coordinates of half screenheight on the Y axes.
|
||||
|
||||
|
||||
\end{ccRefClass}
|
||||
|
||||
% +-----------------------------------------------------+
|
||||
% EOF
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -21,6 +21,8 @@
|
|||
\input{Qt_widget_ref/Qt_widget_get_iso_rectangle.tex}
|
||||
\input{Qt_widget_ref/Qt_widget_get_polygon.tex}
|
||||
\input{Qt_widget_ref/Qt_widget_get_simple_polygon.tex}
|
||||
\input{Qt_widget_ref/Navigation_layer.tex}
|
||||
\input{Qt_widget_ref/Custom_zoom_layer.tex}
|
||||
\input{Qt_widget_ref/Standard_toolbar.tex}
|
||||
\input{Qt_widget_ref/Qt_widget_history.tex}
|
||||
\input{Qt_widget_ref/Qt_help_window.tex}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,45 @@
|
|||
% +------------------------------------------------------------------------+
|
||||
% | CGAL Reference Manual: Reference manual for Qt_widget.tex
|
||||
% +------------------------------------------------------------------------+
|
||||
% |
|
||||
% | 03.01.2001 Radu Ursu
|
||||
% |
|
||||
% | \RCSdef{\qtwidgetRev}{$Revision$}
|
||||
% | \RCSdefDate{\qtwidgetDate}{$Date$}
|
||||
% +------------------------------------------------------------------------+
|
||||
|
||||
% +-----------------------------------------------------+
|
||||
\begin{ccRefClass}{Custom_zoom_layer}
|
||||
|
||||
\ccInclude{CGAL/IO/Custom_zoom_layer.h}
|
||||
|
||||
\ccInheritsFrom
|
||||
\ccc{Custom_zoom_layer}
|
||||
|
||||
\ccGlue
|
||||
|
||||
\ccCreation
|
||||
\ccCreationVariable{zoom_layer}
|
||||
\ccSetTwoColumns{Custom_zoom_layer}{}
|
||||
|
||||
\ccConstructor{Custom_zoom_layer(QObject* parent = 0, const char* name =
|
||||
0);}{\ccc{parent} is the parent widget and \ccc{name} is the name you
|
||||
give to this layer.}
|
||||
|
||||
The standard toolbar already provide zooming functionality, but this layer
|
||||
comes to complete the latest.
|
||||
When this layer is attached and active, zooming functionality could be used anytime. To zoom in x2 you must press the + key on your keyboard. To zoom
|
||||
out x2 you must press the - key on your keyboard. You can also use the mouse
|
||||
to zoom to a region defined by one rectangle. To define the rectangle you
|
||||
must press Ctrl+LeftMouseButton for the first corner of the rectangle, you
|
||||
may release, then move, then press Ctrl+LeftMouseButton once again to define
|
||||
the second corner.
|
||||
|
||||
|
||||
\end{ccRefClass}
|
||||
|
||||
% +-----------------------------------------------------+
|
||||
% EOF
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
% +------------------------------------------------------------------------+
|
||||
% | CGAL Reference Manual: Reference manual for Qt_widget.tex
|
||||
% +------------------------------------------------------------------------+
|
||||
% |
|
||||
% | 03.01.2001 Radu Ursu
|
||||
% |
|
||||
% | \RCSdef{\qtwidgetRev}{$Revision$}
|
||||
% | \RCSdefDate{\qtwidgetDate}{$Date$}
|
||||
% +------------------------------------------------------------------------+
|
||||
|
||||
% +-----------------------------------------------------+
|
||||
\begin{ccRefClass}{Naviagtion_layer}
|
||||
|
||||
\ccInclude{CGAL/IO/Navigation_layer.h}
|
||||
|
||||
\ccInheritsFrom
|
||||
\ccc{Qt_widget_layer}
|
||||
|
||||
\ccGlue
|
||||
|
||||
\ccCreation
|
||||
\ccCreationVariable{nav_layer}
|
||||
\ccSetTwoColumns{Navigation_layer}{}
|
||||
|
||||
\ccConstructor{Navigation_layer(QObject* parent = 0, const char* name =
|
||||
0);}{\ccc{parent} is the parent widget and \ccc{name} is the name you
|
||||
give to this layer.}
|
||||
|
||||
This layer is used to provide basic navigation control over the
|
||||
\ccc{Qt_widget}. When this layer is attached and active, you may use
|
||||
the arrows to navigate the equivalent in world coordinates of 10 pixels
|
||||
in the desired direction. You can also use the PageUp, PageDown keys to
|
||||
scroll the equivalent in world coordinates of half screenheight on the Y axes.
|
||||
|
||||
|
||||
\end{ccRefClass}
|
||||
|
||||
% +-----------------------------------------------------+
|
||||
% EOF
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -21,6 +21,8 @@
|
|||
\input{Qt_widget_ref/Qt_widget_get_iso_rectangle.tex}
|
||||
\input{Qt_widget_ref/Qt_widget_get_polygon.tex}
|
||||
\input{Qt_widget_ref/Qt_widget_get_simple_polygon.tex}
|
||||
\input{Qt_widget_ref/Navigation_layer.tex}
|
||||
\input{Qt_widget_ref/Custom_zoom_layer.tex}
|
||||
\input{Qt_widget_ref/Standard_toolbar.tex}
|
||||
\input{Qt_widget_ref/Qt_widget_history.tex}
|
||||
\input{Qt_widget_ref/Qt_help_window.tex}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,81 @@
|
|||
// Copyright (c) 1997-2000 Utrecht University (The Netherlands),
|
||||
// ETH Zurich (Switzerland), Freie Universitaet Berlin (Germany),
|
||||
// INRIA Sophia-Antipolis (France), Martin-Luther-University Halle-Wittenberg
|
||||
// (Germany), Max-Planck-Institute Saarbruecken (Germany), RISC Linz (Austria),
|
||||
// and Tel-Aviv University (Israel). All rights reserved.
|
||||
//
|
||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public License as
|
||||
// published by the Free Software Foundation; version 2.1 of the License.
|
||||
// See the file LICENSE.LGPL distributed with CGAL.
|
||||
//
|
||||
// Licensees holding a valid commercial license may use this file in
|
||||
// accordance with the commercial license agreement provided with the software.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// $Source$
|
||||
// $Revision$ $Date$
|
||||
// $Name$
|
||||
//
|
||||
// Author(s) : Radu Ursu
|
||||
|
||||
#ifndef CGAL_CUSTOM_ZOOM_LAYER_H
|
||||
#define CGAL_CUSTOM_ZOOM_LAYER_H
|
||||
|
||||
#include <CGAL/IO/Qt_widget_zoomrect.h>
|
||||
|
||||
class Custom_zoom_layer : public CGAL::Qt_widget_zoomrect{
|
||||
public:
|
||||
Custom_zoom_layer(QObject* parent = 0, const char* name = 0)
|
||||
: Qt_widget_zoomrect(parent, name){}
|
||||
|
||||
protected:
|
||||
void keyPressEvent(QKeyEvent *e){
|
||||
if ( e->key() == Qt::Key_Plus ){
|
||||
widget->zoom(2);
|
||||
} else if ( e->key() == Qt::Key_Minus){
|
||||
widget->zoom(0.5);
|
||||
}
|
||||
}
|
||||
void mousePressEvent(QMouseEvent *e)
|
||||
{
|
||||
if(e->button() == Qt::LeftButton
|
||||
&& (e->state() & Qt::ControlButton))
|
||||
{
|
||||
if (!on_first){
|
||||
first_x = e->x();
|
||||
first_y = e->y();
|
||||
on_first = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
void mouseReleaseEvent(QMouseEvent *e)
|
||||
{
|
||||
if(e->button() == Qt::LeftButton
|
||||
&& (e->state() & Qt::ControlButton))
|
||||
{
|
||||
if((e->x() != first_x) && (e->y() != first_y)) {
|
||||
double x, y, xfirst2, yfirst2;
|
||||
widget->x_real(e->x(), x); widget->y_real(e->y(), y);
|
||||
widget->x_real(first_x, xfirst2); widget->y_real(first_y, yfirst2);
|
||||
double xmin, xmax, ymin, ymax;
|
||||
if(x < xfirst2) {xmin = x; xmax = xfirst2;}
|
||||
else {xmin = xfirst2; xmax = x;};
|
||||
if(y < yfirst2) {ymin = y; ymax = yfirst2;}
|
||||
else {ymin = yfirst2; ymax = y;};
|
||||
widget->set_window(xmin, xmax, ymin, ymax);
|
||||
on_first = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
void activating(){
|
||||
widget->setFocusPolicy(QWidget::ClickFocus);
|
||||
oldcursor = widget->cursor();
|
||||
widget->setCursor(crossCursor);
|
||||
}
|
||||
QCursor oldcursor;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
// Copyright (c) 1997-2000 Utrecht University (The Netherlands),
|
||||
// ETH Zurich (Switzerland), Freie Universitaet Berlin (Germany),
|
||||
// INRIA Sophia-Antipolis (France), Martin-Luther-University Halle-Wittenberg
|
||||
// (Germany), Max-Planck-Institute Saarbruecken (Germany), RISC Linz (Austria),
|
||||
// and Tel-Aviv University (Israel). All rights reserved.
|
||||
//
|
||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public License as
|
||||
// published by the Free Software Foundation; version 2.1 of the License.
|
||||
// See the file LICENSE.LGPL distributed with CGAL.
|
||||
//
|
||||
// Licensees holding a valid commercial license may use this file in
|
||||
// accordance with the commercial license agreement provided with the software.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// $Source$
|
||||
// $Revision$ $Date$
|
||||
// $Name$
|
||||
//
|
||||
// Author(s) : Radu Ursu
|
||||
|
||||
#ifndef CGAL_NAVIGATION_LAYER_H
|
||||
#define CGAL_NAVIGATION_LAYER_H
|
||||
|
||||
#include <CGAL/IO/Qt_widget_layer.h>
|
||||
|
||||
class Navigation_layer : public CGAL::Qt_widget_layer {
|
||||
public:
|
||||
Navigation_layer(QObject *parent=0, const char* name=0)
|
||||
: Qt_widget_layer(parent, name){}
|
||||
void draw(){};
|
||||
protected:
|
||||
void keyPressEvent(QKeyEvent *e){
|
||||
const double dx = widget->x_real(10) - widget->x_real(0);
|
||||
const double dy = widget->y_real(10) - widget->y_real(0);
|
||||
const double ypage = widget->y_max() - widget->y_min();
|
||||
if ( e->key() == Qt::Key_Left ){
|
||||
widget->move_center(dx, 0);
|
||||
} else if ( e->key() == Qt::Key_Right ){
|
||||
widget->move_center(-dx, 0);
|
||||
} else if ( e->key() == Qt::Key_Down ){
|
||||
widget->move_center(0, -dy);
|
||||
} else if ( e->key() == Qt::Key_Up ){
|
||||
widget->move_center(0, dy);
|
||||
} else if ( e->key() == Qt::Key_Prior ){ //PageUp
|
||||
widget->move_center(0, -ypage/2);
|
||||
} else if ( e->key() == Qt::Key_Next ){ //PageDown
|
||||
widget->move_center(0, ypage/2);
|
||||
}
|
||||
}
|
||||
void activating(){
|
||||
widget->setFocusPolicy(QWidget::ClickFocus);
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
Loading…
Reference in New Issue