Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpenBoard
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lifo
Nicolas Ollinger
OpenBoard
Commits
1a8b5b1f
Commit
1a8b5b1f
authored
Sep 24, 2012
by
Claudio Valerio
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop' into claudio-dev
parents
90db246a
a17f31f3
Changes
15
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
1056 additions
and
10 deletions
+1056
-10
aristoTool.png
resources/images/toolPalette/aristoTool.png
+0
-0
index.html
resources/library/applications/OpenStreetMap.wgt/index.html
+27
-2
sankore.qrc
resources/sankore.qrc
+1
-0
UBBoardController.cpp
src/board/UBBoardController.cpp
+5
-0
UBBoardView.cpp
src/board/UBBoardView.cpp
+2
-0
UB.h
src/core/UB.h
+1
-0
UBGraphicsItemDelegate.cpp
src/domain/UBGraphicsItemDelegate.cpp
+1
-0
UBGraphicsScene.cpp
src/domain/UBGraphicsScene.cpp
+17
-0
UBGraphicsScene.h
src/domain/UBGraphicsScene.h
+1
-0
UBPlatformUtils_linux.cpp
src/frameworks/UBPlatformUtils_linux.cpp
+1
-0
UBGraphicsAristo.cpp
src/tools/UBGraphicsAristo.cpp
+828
-0
UBGraphicsAristo.h
src/tools/UBGraphicsAristo.h
+156
-0
UBToolsManager.cpp
src/tools/UBToolsManager.cpp
+6
-0
UBToolsManager.h
src/tools/UBToolsManager.h
+1
-0
tools.pri
src/tools/tools.pri
+9
-8
No files found.
resources/images/toolPalette/aristoTool.png
0 → 100644
View file @
1a8b5b1f
10.6 KB
resources/library/applications/OpenStreetMap.wgt/index.html
View file @
1a8b5b1f
...
...
@@ -68,7 +68,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* API identifier */
/*
Geonames
API identifier */
var
geonamesUser
=
"yimgo"
;
/* map variable will be used to manipulate the map. This will be initialized like an OpenLayers.Map object. */
...
...
@@ -149,6 +149,17 @@
});
}
function
importData
(
data
)
{
map
.
setCenter
(
new
OpenLayers
.
LonLat
(
data
[
"center"
][
"lon"
],
data
[
"center"
][
"lat"
]),
data
[
"zoom"
]);
}
function
exportData
()
{
if
(
window
.
sankore
)
sankore
.
setPreference
(
"osm"
,
JSON
.
stringify
({
center
:
map
.
getCenter
(),
zoom
:
map
.
getZoom
()}));
}
window
.
onload
=
function
()
{
map
=
new
OpenLayers
.
Map
({
div
:
"map"
...
...
@@ -198,7 +209,21 @@
map
.
setBaseLayer
(
newLayer
);
return
false
;
});
});
/* importing state from Sankoré preferences */
if
(
window
.
sankore
)
{
if
(
sankore
.
preference
(
"osm"
,
""
))
{
importData
(
JSON
.
parse
(
sankore
.
preference
(
"osm"
,
""
)));
}
}
/* exporting state when receiving a leave event */
if
(
window
.
widget
)
{
window
.
widget
.
onleave
=
function
()
{
exportData
();
}
}
};
-->
</script>
...
...
resources/sankore.qrc
View file @
1a8b5b1f
...
...
@@ -165,6 +165,7 @@
<file>images/toolPalette/triangleTool.png</file>
<file>images/toolPalette/protractorTool.png</file>
<file>images/toolPalette/compassTool.png</file>
<file>images/toolPalette/aristoTool.png</file>
<file>images/toolPalette/maskTool.png</file>
<file>images/toolPalette/magnifierTool.png</file>
<file>images/extraPalette/blackout.png</file>
...
...
src/board/UBBoardController.cpp
View file @
1a8b5b1f
...
...
@@ -1363,6 +1363,11 @@ UBItem *UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QStri
mActiveScene
->
addMask
(
pPos
);
UBDrawingController
::
drawingController
()
->
setStylusTool
(
UBStylusTool
::
Selector
);
}
else
if
(
sourceUrl
.
toString
()
==
UBToolsManager
::
manager
()
->
aristo
.
id
)
{
mActiveScene
->
addAristo
(
pPos
);
UBDrawingController
::
drawingController
()
->
setStylusTool
(
UBStylusTool
::
Selector
);
}
else
{
showMessage
(
tr
(
"Unknown tool type %1"
).
arg
(
sourceUrl
.
toString
()));
...
...
src/board/UBBoardView.cpp
View file @
1a8b5b1f
...
...
@@ -61,6 +61,7 @@
#include "tools/UBGraphicsCache.h"
#include "tools/UBGraphicsTriangle.h"
#include "tools/UBGraphicsProtractor.h"
#include "tools/UBGraphicsAristo.h"
#include "core/memcheck.h"
...
...
@@ -521,6 +522,7 @@ Here we determines cases when items should to get mouse press event at pressing
case
UBGraphicsTriangle
:
:
Type
:
case
UBGraphicsCompass
:
:
Type
:
case
UBGraphicsCache
:
:
Type
:
case
UBGraphicsAristo
:
:
Type
:
return
true
;
case
UBGraphicsDelegateFrame
:
:
Type
:
...
...
src/core/UB.h
View file @
1a8b5b1f
...
...
@@ -145,6 +145,7 @@ struct UBGraphicsItemType
TriangleItemType
,
MagnifierItemType
,
cacheItemType
,
AristoItemType
,
groupContainerType
,
ToolWidgetItemType
,
GraphicsWidgetItemType
,
...
...
src/domain/UBGraphicsItemDelegate.cpp
View file @
1a8b5b1f
...
...
@@ -58,6 +58,7 @@ DelegateButton::DelegateButton(const QString & fileName, QGraphicsItem* pDelegat
{
setAcceptedMouseButtons
(
Qt
::
LeftButton
);
setData
(
UBGraphicsItemData
::
ItemLayerType
,
QVariant
(
UBItemLayerType
::
Control
));
setCacheMode
(
QGraphicsItem
::
NoCache
);
/* because of SANKORE-1017: this allows pixmap to be refreshed when grabbing window, thus teacher screen is synchronized with main screen. */
}
DelegateButton
::~
DelegateButton
()
...
...
src/domain/UBGraphicsScene.cpp
View file @
1a8b5b1f
...
...
@@ -39,6 +39,7 @@
#include "tools/UBGraphicsTriangle.h"
#include "tools/UBGraphicsCurtainItem.h"
#include "tools/UBGraphicsCache.h"
#include "tools/UBGraphicsAristo.h"
#include "document/UBDocumentProxy.h"
...
...
@@ -1937,6 +1938,22 @@ void UBGraphicsScene::addCompass(QPointF center)
compass
->
setVisible
(
true
);
}
void
UBGraphicsScene
::
addAristo
(
QPointF
center
)
{
UBGraphicsAristo
*
aristo
=
new
UBGraphicsAristo
();
mTools
<<
aristo
;
aristo
->
setData
(
UBGraphicsItemData
::
ItemLayerType
,
QVariant
(
UBItemLayerType
::
Tool
));
addItem
(
aristo
);
QPointF
itemSceneCenter
=
aristo
->
sceneBoundingRect
().
center
();
aristo
->
moveBy
(
center
.
x
()
-
itemSceneCenter
.
x
(),
center
.
y
()
-
itemSceneCenter
.
y
());
aristo
->
setVisible
(
true
);
setModified
(
true
);
}
void
UBGraphicsScene
::
addCache
()
{
UBGraphicsCache
*
cache
=
new
UBGraphicsCache
();
...
...
src/domain/UBGraphicsScene.h
View file @
1a8b5b1f
...
...
@@ -216,6 +216,7 @@ class UBGraphicsScene: public UBCoreGraphicsScene, public UBItem
void
addCompass
(
QPointF
center
);
void
addTriangle
(
QPointF
center
);
void
addMagnifier
(
UBMagnifierParams
params
);
void
addAristo
(
QPointF
center
);
void
addMask
(
const
QPointF
&
center
=
QPointF
());
void
addCache
();
...
...
src/frameworks/UBPlatformUtils_linux.cpp
View file @
1a8b5b1f
...
...
@@ -17,6 +17,7 @@
#include <QtGui>
#include <unistd.h>
#include <X11/Xlib.h>
#include <X11/keysym.h>
...
...
src/tools/UBGraphicsAristo.cpp
0 → 100644
View file @
1a8b5b1f
This diff is collapsed.
Click to expand it.
src/tools/UBGraphicsAristo.h
0 → 100644
View file @
1a8b5b1f
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef UBGRAPHICSARISTO_H_
#define UBGRAPHICSARISTO_H_
#include "core/UB.h"
#include "domain/UBItem.h"
#include "domain/UBGraphicsScene.h"
#include "tools/UBAbstractDrawRuler.h"
#include <QtGlobal>
#include <QBrush>
#include <QCursor>
#include <QGraphicsPathItem>
#include <QGraphicsSceneHoverEvent>
#include <QGraphicsSceneMouseEvent>
#include <QGraphicsSvgItem>
#include <QObject>
#include <QPainter>
#include <QPainterPath>
#include <QPointF>
#include <QRectF>
#include <QStyleOptionGraphicsItem>
#include <QTransform>
#include <QWidget>
class
UBGraphicsAristo
:
public
UBAbstractDrawRuler
,
public
QGraphicsPathItem
,
public
UBItem
{
Q_OBJECT
public
:
UBGraphicsAristo
();
virtual
~
UBGraphicsAristo
();
enum
{
Type
=
UBGraphicsItemType
::
AristoItemType
};
enum
Tool
{
None
,
Move
,
Resize
,
Rotate
,
Close
,
MoveMarker
,
HorizontalFlip
};
enum
Orientation
{
Bottom
=
0
,
Top
,
Undefined
};
void
setOrientation
(
Orientation
orientation
);
void
setBoundingRect
(
QRectF
boundingRect
);
virtual
UBItem
*
deepCopy
()
const
;
virtual
void
copyItemParameters
(
UBItem
*
copy
)
const
;
virtual
void
StartLine
(
const
QPointF
&
scenePos
,
qreal
width
);
virtual
void
DrawLine
(
const
QPointF
&
position
,
qreal
width
);
virtual
void
EndLine
();
virtual
int
type
()
const
{
return
Type
;
}
UBGraphicsScene
*
scene
()
const
;
protected
:
virtual
void
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
styleOption
,
QWidget
*
widget
);
virtual
void
rotateAroundCenter
(
qreal
angle
);
virtual
void
resize
(
qreal
factor
);
virtual
QPointF
rotationCenter
()
const
;
virtual
QRectF
closeButtonRect
()
const
;
QRectF
hFlipRect
()
const
;
QRectF
markerButtonRect
()
const
;
QRectF
resizeButtonRect
()
const
;
QRectF
rotateRect
()
const
;
QCursor
flipCursor
()
const
;
QCursor
markerCursor
()
const
;
QCursor
resizeCursor
()
const
;
virtual
void
mousePressEvent
(
QGraphicsSceneMouseEvent
*
event
);
virtual
void
mouseMoveEvent
(
QGraphicsSceneMouseEvent
*
event
);
virtual
void
mouseReleaseEvent
(
QGraphicsSceneMouseEvent
*
event
);
virtual
void
hoverEnterEvent
(
QGraphicsSceneHoverEvent
*
event
);
virtual
void
hoverLeaveEvent
(
QGraphicsSceneHoverEvent
*
event
);
virtual
void
hoverMoveEvent
(
QGraphicsSceneHoverEvent
*
event
);
private
:
Tool
toolFromPos
(
QPointF
pos
);
QTransform
calculateRotationTransform
();
void
rotateAroundCenter
(
QTransform
&
transform
,
QPointF
center
);
void
calculatePoints
();
QPainterPath
determinePath
();
void
setItemsPos
();
void
makeGeometryChange
();
QBrush
fillBrush
()
const
;
void
paintGraduations
(
QPainter
*
painter
);
void
paintMarker
(
QPainter
*
painter
);
void
paintProtractorGraduations
(
QPainter
*
painter
);
void
paintRulerGraduations
(
QPainter
*
painter
);
inline
qreal
radius
()
const
{
return
sqrt
(((
B
.
x
()
-
A
.
x
())
*
(
B
.
x
()
-
A
.
x
()))
+
((
B
.
y
()
-
A
.
y
())
*
(
B
.
y
()
-
A
.
y
())))
*
9
/
16
-
20
;
}
bool
mMarking
;
bool
mResizing
;
bool
mRotating
;
Orientation
mOrientation
;
qreal
mRotatedAngle
;
qreal
mMarkerAngle
;
qreal
mStartAngle
;
qreal
mSpan
;
QGraphicsSvgItem
*
mHFlipSvgItem
;
QGraphicsSvgItem
*
mMarkerSvgItem
;
QGraphicsSvgItem
*
mResizeSvgItem
;
QGraphicsSvgItem
*
mRotateSvgItem
;
QPointF
A
,
B
,
C
;
static
const
int
sArcAngleMargin
=
5
;
static
const
Orientation
sDefaultOrientation
;
static
const
QRectF
sDefaultRect
;
};
#endif
/* UBGRAPHICSARISTO_H_ */
src/tools/UBToolsManager.cpp
View file @
1a8b5b1f
...
...
@@ -91,6 +91,12 @@ UBToolsManager::UBToolsManager(QObject *parent)
mDescriptors
<<
cache
;
// --------------------------------------------------------------------------------
aristo
.
id
=
"uniboardTool://uniboard.mnemis.com/aristo"
;
aristo
.
icon
=
QPixmap
(
":/images/toolPalette/aristoTool.png"
);
aristo
.
label
=
tr
(
"Aristo"
);
aristo
.
version
=
"1.0"
;
mToolsIcon
.
insert
(
aristo
.
id
,
":/images/toolPalette/aristoTool.png"
);
mDescriptors
<<
aristo
;
}
UBToolsManager
::~
UBToolsManager
()
...
...
src/tools/UBToolsManager.h
View file @
1a8b5b1f
...
...
@@ -76,6 +76,7 @@ class UBToolsManager : public QObject
UBToolDescriptor
triangle
;
UBToolDescriptor
magnifier
;
UBToolDescriptor
cache
;
UBToolDescriptor
aristo
;
QString
iconFromToolId
(
QString
id
)
{
return
mToolsIcon
.
value
(
id
);}
...
...
src/tools/tools.pri
View file @
1a8b5b1f
HEADERS += src/tools/UBGraphicsRuler.h \
src/tools/UBGraphicsTriangle.h \
HEADERS += src/tools/UBGraphicsRuler.h \
src/tools/UBGraphicsTriangle.h \
src/tools/UBGraphicsProtractor.h \
src/tools/UBGraphicsCompass.h \
src/tools/UBGraphicsAristo.h \
src/tools/UBToolsManager.h \
src/tools/UBGraphicsCurtainItem.h \
src/tools/UBGraphicsCurtainItemDelegate.h \
src/tools/UBAbstractDrawRuler.h \
src/tools/UBGraphicsCache.h
SOURCES
+=
src/tools/UBGraphicsRuler.cpp \
src/tools/UBGraphicsTriangle.cpp \
src/tools/UBGraphicsCache.h
SOURCES
+=
src/tools/UBGraphicsRuler.cpp \
src/tools/UBGraphicsTriangle.cpp \
src/tools/UBGraphicsProtractor.cpp \
src/tools/UBGraphicsCompass.cpp \
src/tools/UBGraphicsAristo.cpp \
src/tools/UBToolsManager.cpp \
src/tools/UBGraphicsCurtainItem.cpp \
src/tools/UBGraphicsCurtainItemDelegate.cpp \
src/tools/UBAbstractDrawRuler.cpp \
src/tools/UBGraphicsCache.cpp
src/tools/UBGraphicsCache.cpp
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment