removed layers and put them in triangulation_2_constrained_layers.h
added support for new window
removed namespace CGAL from this demo
Alpha_shapes_2
when pressing New_window, the viewport fits the bounding box
Triangulation_2
when pressing New_window, the viewport fits the bounding box
- the possibility to activate/deactivate alpha_shape layer at run time
- the possibility to activate/deactivate image layer at run time
- all the output layers have been moved in alpha_shapes_2_layers.h file
- when moving vertex, the alpha_shape reflect changes
- the new window slot is working well now
- the possibility to input alpha greater than 1
double tempmin = min(width(), height());
double div = min(xmax-xmin, ymax-ymin);
to build the scales the min should have been divided by MIN not by MAX
simplified operations in x_real
border, one can use a QFrame parent of the Qt_widget. It will be probably
more efficient. Thank to Radu for not having agreed to easily: it
prevended my from doing an error. ;-)
functions set ranges (xmin,ymin,xmax,ymax) with constant center. Arguments
where always equal to xcenter, ycenter thus they were uneeded.
- Use drawContents(QPainter*), the protected method of QFrame called by
QFrame::paintEvent(...). paintEvent(...) is no longer overridden.
- Added comments in include/CGAL/IO/Qt_widget.h to explain the role of
private functions. It was increasingly difficult to understand the code.
- New void Qt_widget::frameChanged() function, that resize the pixmap if
the frame border is changed.
- It now derives from QToolBar, as it should have since the beginning.
- The constructor has now additional facultative parameters:
Dock = DockTop,
bool newLine = true,
const char* name = 0
With Qt-3, the first parameter is
QMainWindow::ToolBarDock=QMainWindow::Top
- The header file has been cleaned from uneeded includes or pointer
declarations.
- The backward compatibility has been preserved by adapted default values.
- I have filled bug #36 for as a reminder for documentation changes.
but is quite small actually:
Qt_widget now derives from QFrame instead of QWidget. The differences are
that:
- the Qt_widget can have a border, like a QFrame
- the drawing area is not the whole Qt_widget but the contentsRect()
rectangle, which is the widget without its border.
As, by default, the border is null, it should change anything for
compatibility. By default, a QFrame is like a QWidget.
doesn't go into the package.
While developping Qt_widget, the libCGALQt.a file shouldn't be moved into
the CGAL installation! That's why is should be commented.
Under unix, to use this last version anyway, use:
make CUSTOM_LIBPATH="/path/to/Qt_widget/src/CGALQt"
instead of make. It works with GNU Make at least.
Scavenging LEDA, we provide the identical functionality in the CGAL classes Leda_like_handle and Leda_like_rep. If LEDA is not available or CGAL_NO_LEDA_HANDLE is set, Handle and Rep correspond to these types.
typedef Leda_like_handle Handle;
typedef Leda_like_rep Rep;
Solved bug in output operator for segment in Qt_widget. The operator compute the intersection between the segment and the iso_rectangle using Simple_cartesian<double> kernel.
bool does_eat_events;
When you use attach_standard for attaching a layer, this field is true.
The show_mouse_coordinates have this member made false by the standard toolbar.
The widget send the events to the other active layers attached only if there is no other standard_layer active that eat events.
< R::FT xr1, yr1, xr2, yr2;
---
> typename R::FT xr1, yr1, xr2, yr2;
These lines will have to be fixed soon because
FT xr1=w.x_real(0)
assumes that R::FT has a constructor from a double, whereas it is not in
the FT concept!
use the old x_real function because the new one is too slow in doing the transformation (use GMP if CGAL_USE_GMP is defined)
we should document the old one too, it will never be removed.
set_scales() was using geometry() whereas geometry() is not sure to be correct
when the widget is not visible.
Here are the explainations, in french:
-------------
> Dans Qt_widget::set_scales(), Radu se base sur geometry() pour modifier
> xmin, xmax, etc., mais malheureusement geometry() n'a pas forc�ment de
> sens quand le widget n'est pas visible (avant le premier show()
> appell�).
Le principe du patch c'est que set_scale() ne fait rien si le widget
n'est pas visible, mais met un bool�en (set_scale_must_be_done) � true.
Quand le widget apparait, la m�thode showEvent regarde si
set_scale_must_be_done=true, et appelle set_scale(). De plus,
set_scale_center() ne fait rien si set_scale_must_be_done=true car
set_scales() doit toujours avoir �t� appell� avant de bouger le centre.
for compatibility.
Move the template function definition to Qt_widget.h and remove it from
Qt_widget.C and let the specialisation for Gmpz into the .C file
can choose with \ccc{set_window} member function. The scale of the
objects you can visualize is computed and maintained the same for both
axes to keep the aspect ratio of the objects. If you are not using
\ccc{gmp} you should use \ccc{x_real} or \ccc{y_real} to get the real
world coordinates, represented as a double, for your screen
coordinates. If you are using \ccc{gmp} you can use the other verions
of these two functions: \ccc{x_real_rational} and
\ccc{y_real_rational}, with \ccc{Gmpq} return type. You may need it
when you work with rationals. The double from the other function could
be more complex and can make you loose speed.
\ccMethod{double x_real(int x) const;}{Returns the \ccc{x} real world
coordinate of the \ccc{Qt_widget}.}
\ccMethod{Gmpq y_real(int y) const;}{Returns the \ccc{y} real world
coordinate of the \ccc{Qt_widget}.}
\ccMethod{Gmpq x_real_rational(int x) const;}{Returns the \ccc{x} real world
coordinate of the \ccc{Qt_widget}. Defined only if you built it with CGAL_USE_GMP.}
\ccMethod{Gmpq y_real_rational(int y) const;}{Returns the \ccc{y} real world
coordinate of the \ccc{Qt_widget}. Defined only if you built it with CGAL_USE_GMP.}
Those 2 return an Gmpq object. The conversion between screen coordinates and real world coordinates return a more simple number (rational), a Gmpq object.
I put that in the doc either.
The conversion from screen coordinates in real word coordinates could be
done via x_real_rational or x_real. Those functions try to use simplest rational in interval.