mirror of https://github.com/CGAL/cgal
Adding the missing doc files
This commit is contained in:
parent
111f3b666b
commit
e7c5ff1dbe
|
|
@ -0,0 +1,91 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>BasicDialog</class>
|
||||
<widget class="QDialog" name="BasicDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Number to display :</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>BasicDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>BasicDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>BasicDockWidget</class>
|
||||
<widget class="QDockWidget" name="BasicDockWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>392</width>
|
||||
<height>302</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>DockWidget</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="dockWidgetContents">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Number to display :</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="spinBox"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<property name="text">
|
||||
<string>Print</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
|
@ -0,0 +1,96 @@
|
|||
#include <CGAL/Three/Polyhedron_demo_plugin_interface.h>
|
||||
#include <QApplication>
|
||||
#include <QObject>
|
||||
#include <QAction>
|
||||
#include <QMainWindow>
|
||||
#include <QInputDialog>
|
||||
#include "Messages_interface.h"
|
||||
#include "CGAL/Three/Scene_group_item.h"
|
||||
#include "Scene_plane_item.h"
|
||||
|
||||
//This plugin crates an action in Operations that displays "Hello World" in the 'console' dockwidet.
|
||||
class BasicItemPlugin :
|
||||
public QObject,
|
||||
public CGAL::Three::Polyhedron_demo_plugin_interface
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(CGAL::Three::Polyhedron_demo_plugin_interface)
|
||||
Q_PLUGIN_METADATA(IID "com.geometryfactory.PolyhedronDemo.PluginInterface/1.0")
|
||||
public:
|
||||
//! [applicable]
|
||||
//This plugin is only applicable if there is at exactly one selected item.
|
||||
bool applicable(QAction*) const
|
||||
{
|
||||
return scene->selectionIndices().size() ==1;
|
||||
}
|
||||
//! [applicable]
|
||||
//the list of the actions of the plugin.
|
||||
QList<QAction*> actions() const
|
||||
{
|
||||
return _actions;
|
||||
}
|
||||
//this acts like a constructor for the plugin. It gets the references to the mainwindow and the scene, and connects the action.
|
||||
void init(QMainWindow* mainWindow, CGAL::Three::Scene_interface* sc )
|
||||
{
|
||||
//get the references
|
||||
this->scene = sc;
|
||||
this->mw = mainWindow;
|
||||
|
||||
//creates the action
|
||||
QAction *actionHelloWorld= new QAction(QString("Hello World"), mw);
|
||||
//specifies the subMenu
|
||||
actionHelloWorld->setProperty("submenuName", "Basic");
|
||||
//links the action
|
||||
if(actionHelloWorld) {
|
||||
connect(actionHelloWorld, SIGNAL(triggered()),
|
||||
this, SLOT(helloWorld()));
|
||||
_actions << actionHelloWorld;
|
||||
}
|
||||
}
|
||||
|
||||
void init(QMainWindow* mw, CGAL::Three::Scene_interface* sc, Messages_interface* mi)
|
||||
{
|
||||
//gets the reference to the message interface, to display text in the console widget
|
||||
this->messageInterface = mi;
|
||||
init(mw, sc);
|
||||
}
|
||||
private Q_SLOTS:
|
||||
|
||||
|
||||
void helloWorld()
|
||||
{ //! [use]
|
||||
//get a reference to the selected item.
|
||||
CGAL::Three::Scene_item *item = scene->item(scene->mainSelectionIndex());
|
||||
messageInterface->information(QString("The selected item's name is : %1").arg(item->name()));
|
||||
//! [use]
|
||||
//! [additem]
|
||||
//creates a plane item
|
||||
Scene_plane_item *new_item = new Scene_plane_item(scene);
|
||||
new_item->setName("Trivial Plane");
|
||||
new_item->setColor(Qt::blue);
|
||||
new_item->setNormal(0.0,0.0,1.0);
|
||||
scene->addItem(new_item);
|
||||
//! [additem]
|
||||
//! [group]
|
||||
//clears the selection to avoid adding unwanted items to the group.
|
||||
scene->setSelectedItem(-1);
|
||||
//Creates a new group
|
||||
Scene_group_item *group = new Scene_group_item("New group");
|
||||
//Then gives it its children
|
||||
scene->changeGroup(item, group);
|
||||
scene->changeGroup(new_item,group);
|
||||
//adds it to the scene
|
||||
scene->add_group(group);
|
||||
//! [group]
|
||||
}
|
||||
|
||||
private:
|
||||
QList<QAction*> _actions;
|
||||
Messages_interface* messageInterface;
|
||||
//The reference to the scene
|
||||
CGAL::Three::Scene_interface* scene;
|
||||
//The reference to the main window
|
||||
QMainWindow* mw;
|
||||
};
|
||||
|
||||
#include "Basic_item_plugin.moc"
|
||||
|
|
@ -0,0 +1,111 @@
|
|||
#include "ui_Basic_dock_widget.h"
|
||||
#include <CGAL/Three/Polyhedron_demo_plugin_interface.h>
|
||||
#include <QApplication>
|
||||
#include <QObject>
|
||||
#include <QAction>
|
||||
#include <QMainWindow>
|
||||
#include "Messages_interface.h"
|
||||
|
||||
//! [dock]
|
||||
class DockWidget :
|
||||
public QDockWidget,
|
||||
public Ui::BasicDockWidget
|
||||
{
|
||||
public:
|
||||
DockWidget(QString name, QWidget *parent)
|
||||
:QDockWidget(name,parent)
|
||||
{
|
||||
setupUi(this);
|
||||
}
|
||||
};
|
||||
//! [dock]
|
||||
//This plugin crates an action in Operations that displays "Hello World" in the 'console' dockwidet.
|
||||
class BasicPlugin :
|
||||
public QObject,
|
||||
public CGAL::Three::Polyhedron_demo_plugin_interface
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(CGAL::Three::Polyhedron_demo_plugin_interface)
|
||||
Q_PLUGIN_METADATA(IID "com.geometryfactory.PolyhedronDemo.PluginInterface/1.0")
|
||||
public:
|
||||
//decides if the plugin's actions will be displayed or not.
|
||||
bool applicable(QAction*) const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
//the list of the actions of the plugin.
|
||||
QList<QAction*> actions() const
|
||||
{
|
||||
return _actions;
|
||||
}
|
||||
//! [init]
|
||||
//this acts like a constructor for the plugin. It gets the references to the mainwindow and the scene, and connects the action.
|
||||
void init(QMainWindow* mainWindow, CGAL::Three::Scene_interface* sc )
|
||||
{
|
||||
//get the references
|
||||
this->scene = sc;
|
||||
this->mw = mainWindow;
|
||||
|
||||
//creates the action
|
||||
QAction *actionHelloWorld= new QAction(QString("Hello World"), mw);
|
||||
//specifies the subMenu
|
||||
actionHelloWorld->setProperty("submenuName", "Basic");
|
||||
//links the action
|
||||
if(actionHelloWorld) {
|
||||
connect(actionHelloWorld, SIGNAL(triggered()),
|
||||
this, SLOT(helloWorld()));
|
||||
_actions << actionHelloWorld;
|
||||
}
|
||||
|
||||
dock_widget = new DockWidget("Print a number", mw);
|
||||
dock_widget->setVisible(false); // do not show at the beginning
|
||||
|
||||
mw->addDockWidget(Qt::LeftDockWidgetArea, dock_widget);
|
||||
|
||||
connect(dock_widget->pushButton, SIGNAL(clicked(bool)),
|
||||
this, SLOT(on_dock_button_clicked()));
|
||||
|
||||
}
|
||||
//! [init]
|
||||
|
||||
void init(QMainWindow* mw, CGAL::Three::Scene_interface* sc, Messages_interface* mi)
|
||||
{
|
||||
//gets the reference to the message interface, to display text in the console widget
|
||||
this->messageInterface = mi;
|
||||
init(mw, sc);
|
||||
}
|
||||
private Q_SLOTS:
|
||||
//! [action]
|
||||
void helloWorld()
|
||||
{
|
||||
// dock widget should be instancied in init()
|
||||
if(dock_widget->isVisible()) { dock_widget->hide(); }
|
||||
else { dock_widget->show(); }
|
||||
}
|
||||
|
||||
void on_dock_button_clicked()
|
||||
{
|
||||
messageInterface->information(QString("Here is your number :%1").arg(dock_widget->spinBox->value()));
|
||||
|
||||
}
|
||||
//! [action]
|
||||
//! [closure]
|
||||
void closure()
|
||||
{
|
||||
dock_widget->hide();
|
||||
}
|
||||
//! [closure]
|
||||
private:
|
||||
QList<QAction*> _actions;
|
||||
Messages_interface* messageInterface;
|
||||
DockWidget* dock_widget;
|
||||
//The reference to the scene
|
||||
CGAL::Three::Scene_interface* scene;
|
||||
//The reference to the main window
|
||||
QMainWindow* mw;
|
||||
};
|
||||
|
||||
#include "Dock_widget_plugin.moc"
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,86 @@
|
|||
#include <CGAL/Three/Polyhedron_demo_plugin_interface.h>
|
||||
#include <QApplication>
|
||||
#include <QObject>
|
||||
#include <QAction>
|
||||
#include <QMainWindow>
|
||||
#include <QInputDialog>
|
||||
#include "Messages_interface.h"
|
||||
#include "Scene_plane_item.h"
|
||||
#include <CGAL/Three/Scene_group_item.h>
|
||||
|
||||
//This plugin crates an action in Operations that displays "Hello World" in the 'console' dockwidet.
|
||||
class GroupItemPlugin :
|
||||
public QObject,
|
||||
public CGAL::Three::Polyhedron_demo_plugin_interface
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(CGAL::Three::Polyhedron_demo_plugin_interface)
|
||||
Q_PLUGIN_METADATA(IID "com.geometryfactory.PolyhedronDemo.PluginInterface/1.0")
|
||||
public:
|
||||
//This plugin is only applicable if there is at exactly one selected item.
|
||||
bool applicable(QAction*) const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
//the list of the actions of the plugin.
|
||||
QList<QAction*> actions() const
|
||||
{
|
||||
return _actions;
|
||||
}
|
||||
//this acts like a constructor for the plugin. It gets the references to the mainwindow and the scene, and connects the action.
|
||||
void init(QMainWindow* mainWindow, CGAL::Three::Scene_interface* sc )
|
||||
{
|
||||
//get the references
|
||||
this->scene = sc;
|
||||
this->mw = mainWindow;
|
||||
|
||||
//creates the action
|
||||
QAction *actionHelloWorld= new QAction(QString("Hello World"), mw);
|
||||
//specifies the subMenu
|
||||
actionHelloWorld->setProperty("submenuName", "Basic");
|
||||
//links the action
|
||||
if(actionHelloWorld) {
|
||||
connect(actionHelloWorld, SIGNAL(triggered()),
|
||||
this, SLOT(helloWorld()));
|
||||
_actions << actionHelloWorld;
|
||||
}
|
||||
}
|
||||
|
||||
void init(QMainWindow* mw, CGAL::Three::Scene_interface* sc, Messages_interface* mi)
|
||||
{
|
||||
//gets the reference to the message interface, to display text in the console widget
|
||||
this->messageInterface = mi;
|
||||
init(mw, sc);
|
||||
}
|
||||
private Q_SLOTS:
|
||||
|
||||
|
||||
void helloWorld()
|
||||
{
|
||||
//creates an item
|
||||
Scene_plane_item *child = new Scene_plane_item(scene);
|
||||
child->setName("Trivial Plane");
|
||||
child->setColor(Qt::blue);
|
||||
child->setNormal(0.0,0.0,1.0);
|
||||
scene->addItem(child);
|
||||
//clears the selection to avoid adding unwanted items to the group.
|
||||
scene->setSelectedItem(-1);
|
||||
//Creates a new group
|
||||
Scene_group_item *group = new Scene_group_item("New group");
|
||||
//Then gives it its children
|
||||
scene->changeGroup(child, group);
|
||||
//adds it to the scene
|
||||
scene->add_group(group);
|
||||
|
||||
}
|
||||
|
||||
private:
|
||||
QList<QAction*> _actions;
|
||||
Messages_interface* messageInterface;
|
||||
//The reference to the scene
|
||||
CGAL::Three::Scene_interface* scene;
|
||||
//The reference to the main window
|
||||
QMainWindow* mw;
|
||||
};
|
||||
|
||||
#include "Group_item_plugin.moc"
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 219 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 203 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 38 KiB |
Loading…
Reference in New Issue