mirror of
https://github.com/creyD/intelliphoto.git
synced 2026-04-12 19:40:28 +02:00
Merge branch 'dev-history' into 'dev-merge'
Dev history See merge request creyd/intelliphoto!55
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<diagram program="umlet" version="14.3.0">
|
||||
<zoom_level>10</zoom_level>
|
||||
<zoom_level>14</zoom_level>
|
||||
<element>
|
||||
<id>UMLGeneric</id>
|
||||
<coordinates>
|
||||
<x>530</x>
|
||||
<y>70</y>
|
||||
<w>100</w>
|
||||
<h>30</h>
|
||||
<x>378</x>
|
||||
<y>14</y>
|
||||
<w>140</w>
|
||||
<h>42</h>
|
||||
</coordinates>
|
||||
<panel_attributes>_:PaintingArea_</panel_attributes>
|
||||
<additional_attributes/>
|
||||
@@ -15,10 +15,10 @@
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>570</x>
|
||||
<y>90</y>
|
||||
<w>30</w>
|
||||
<h>70</h>
|
||||
<x>434</x>
|
||||
<y>42</y>
|
||||
<w>42</w>
|
||||
<h>98</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=.</panel_attributes>
|
||||
<additional_attributes>10.0;10.0;10.0;50.0</additional_attributes>
|
||||
@@ -26,10 +26,10 @@
|
||||
<element>
|
||||
<id>UMLActor</id>
|
||||
<coordinates>
|
||||
<x>340</x>
|
||||
<y>60</y>
|
||||
<w>60</w>
|
||||
<h>110</h>
|
||||
<x>112</x>
|
||||
<y>0</y>
|
||||
<w>84</w>
|
||||
<h>154</h>
|
||||
</coordinates>
|
||||
<panel_attributes/>
|
||||
<additional_attributes/>
|
||||
@@ -37,10 +37,10 @@
|
||||
<element>
|
||||
<id>UMLGeneric</id>
|
||||
<coordinates>
|
||||
<x>360</x>
|
||||
<y>140</y>
|
||||
<w>20</w>
|
||||
<h>780</h>
|
||||
<x>140</x>
|
||||
<y>112</y>
|
||||
<w>28</w>
|
||||
<h>1092</h>
|
||||
</coordinates>
|
||||
<panel_attributes/>
|
||||
<additional_attributes/>
|
||||
@@ -48,10 +48,10 @@
|
||||
<element>
|
||||
<id>UMLGeneric</id>
|
||||
<coordinates>
|
||||
<x>570</x>
|
||||
<y>140</y>
|
||||
<w>20</w>
|
||||
<h>780</h>
|
||||
<x>434</x>
|
||||
<y>112</y>
|
||||
<w>28</w>
|
||||
<h>1092</h>
|
||||
</coordinates>
|
||||
<panel_attributes/>
|
||||
<additional_attributes/>
|
||||
@@ -59,10 +59,10 @@
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>370</x>
|
||||
<y>140</y>
|
||||
<w>220</w>
|
||||
<h>40</h>
|
||||
<x>154</x>
|
||||
<y>112</y>
|
||||
<w>308</w>
|
||||
<h>56</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=<-
|
||||
MouseLeftPressed(event)</panel_attributes>
|
||||
@@ -71,10 +71,10 @@ MouseLeftPressed(event)</panel_attributes>
|
||||
<element>
|
||||
<id>UMLGeneric</id>
|
||||
<coordinates>
|
||||
<x>780</x>
|
||||
<y>140</y>
|
||||
<w>20</w>
|
||||
<h>780</h>
|
||||
<x>728</x>
|
||||
<y>112</y>
|
||||
<w>28</w>
|
||||
<h>1092</h>
|
||||
</coordinates>
|
||||
<panel_attributes/>
|
||||
<additional_attributes/>
|
||||
@@ -82,32 +82,10 @@ MouseLeftPressed(event)</panel_attributes>
|
||||
<element>
|
||||
<id>UMLGeneric</id>
|
||||
<coordinates>
|
||||
<x>740</x>
|
||||
<y>70</y>
|
||||
<w>100</w>
|
||||
<h>30</h>
|
||||
</coordinates>
|
||||
<panel_attributes>_:IntelliTool_</panel_attributes>
|
||||
<additional_attributes/>
|
||||
</element>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>780</x>
|
||||
<y>90</y>
|
||||
<w>30</w>
|
||||
<h>70</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=.</panel_attributes>
|
||||
<additional_attributes>10.0;10.0;10.0;50.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>UMLGeneric</id>
|
||||
<coordinates>
|
||||
<x>950</x>
|
||||
<y>70</y>
|
||||
<w>100</w>
|
||||
<h>30</h>
|
||||
<x>672</x>
|
||||
<y>14</y>
|
||||
<w>140</w>
|
||||
<h>42</h>
|
||||
</coordinates>
|
||||
<panel_attributes>_:IntelliToolPen_</panel_attributes>
|
||||
<additional_attributes/>
|
||||
@@ -115,10 +93,10 @@ MouseLeftPressed(event)</panel_attributes>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>990</x>
|
||||
<y>90</y>
|
||||
<w>30</w>
|
||||
<h>70</h>
|
||||
<x>728</x>
|
||||
<y>42</y>
|
||||
<w>42</w>
|
||||
<h>98</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=.</panel_attributes>
|
||||
<additional_attributes>10.0;10.0;10.0;50.0</additional_attributes>
|
||||
@@ -126,10 +104,32 @@ MouseLeftPressed(event)</panel_attributes>
|
||||
<element>
|
||||
<id>UMLGeneric</id>
|
||||
<coordinates>
|
||||
<x>990</x>
|
||||
<y>140</y>
|
||||
<w>20</w>
|
||||
<h>770</h>
|
||||
<x>966</x>
|
||||
<y>14</y>
|
||||
<w>140</w>
|
||||
<h>42</h>
|
||||
</coordinates>
|
||||
<panel_attributes>_:IntelliTool_</panel_attributes>
|
||||
<additional_attributes/>
|
||||
</element>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>1022</x>
|
||||
<y>42</y>
|
||||
<w>42</w>
|
||||
<h>98</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=.</panel_attributes>
|
||||
<additional_attributes>10.0;10.0;10.0;50.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>UMLGeneric</id>
|
||||
<coordinates>
|
||||
<x>1022</x>
|
||||
<y>112</y>
|
||||
<w>28</w>
|
||||
<h>1078</h>
|
||||
</coordinates>
|
||||
<panel_attributes/>
|
||||
<additional_attributes/>
|
||||
@@ -137,10 +137,10 @@ MouseLeftPressed(event)</panel_attributes>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>370</x>
|
||||
<y>430</y>
|
||||
<w>220</w>
|
||||
<h>40</h>
|
||||
<x>154</x>
|
||||
<y>518</y>
|
||||
<w>308</w>
|
||||
<h>56</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=<-
|
||||
updateInterface()</panel_attributes>
|
||||
@@ -149,10 +149,10 @@ updateInterface()</panel_attributes>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>580</x>
|
||||
<y>160</y>
|
||||
<w>220</w>
|
||||
<h>40</h>
|
||||
<x>448</x>
|
||||
<y>140</y>
|
||||
<w>308</w>
|
||||
<h>56</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=<-
|
||||
MouseLeftPressed(event)</panel_attributes>
|
||||
@@ -161,10 +161,10 @@ MouseLeftPressed(event)</panel_attributes>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>790</x>
|
||||
<y>180</y>
|
||||
<w>220</w>
|
||||
<h>40</h>
|
||||
<x>742</x>
|
||||
<y>168</y>
|
||||
<w>308</w>
|
||||
<h>56</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=<-
|
||||
MouseLeftPressed(event)</panel_attributes>
|
||||
@@ -173,10 +173,10 @@ MouseLeftPressed(event)</panel_attributes>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>370</x>
|
||||
<y>300</y>
|
||||
<w>220</w>
|
||||
<h>40</h>
|
||||
<x>154</x>
|
||||
<y>336</y>
|
||||
<w>308</w>
|
||||
<h>56</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=<-
|
||||
MouseMove(event)</panel_attributes>
|
||||
@@ -185,22 +185,22 @@ MouseMove(event)</panel_attributes>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>580</x>
|
||||
<y>320</y>
|
||||
<w>220</w>
|
||||
<h>40</h>
|
||||
<x>448</x>
|
||||
<y>364</y>
|
||||
<w>308</w>
|
||||
<h>56</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=<-
|
||||
MouseMove(koordinates)</panel_attributes>
|
||||
MouseMove(coordinates)</panel_attributes>
|
||||
<additional_attributes>200.0;20.0;10.0;20.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>UMLFrame</id>
|
||||
<coordinates>
|
||||
<x>290</x>
|
||||
<y>250</y>
|
||||
<w>840</w>
|
||||
<h>240</h>
|
||||
<x>42</x>
|
||||
<y>266</y>
|
||||
<w>1176</w>
|
||||
<h>336</h>
|
||||
</coordinates>
|
||||
<panel_attributes>loop
|
||||
--
|
||||
@@ -215,34 +215,34 @@ until MouseLeftReleased(event) or MouseRightPressed(event)
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>790</x>
|
||||
<y>340</y>
|
||||
<w>220</w>
|
||||
<h>40</h>
|
||||
<x>742</x>
|
||||
<y>392</y>
|
||||
<w>308</w>
|
||||
<h>56</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=<-
|
||||
MouseMove(koordinates)</panel_attributes>
|
||||
MouseMove(coordinates)</panel_attributes>
|
||||
<additional_attributes>200.0;20.0;10.0;20.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>580</x>
|
||||
<y>400</y>
|
||||
<w>430</w>
|
||||
<h>40</h>
|
||||
<x>448</x>
|
||||
<y>476</y>
|
||||
<w>308</w>
|
||||
<h>56</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=<-
|
||||
DrwaLineToKoordinates()</panel_attributes>
|
||||
<additional_attributes>10.0;20.0;410.0;20.0</additional_attributes>
|
||||
DrwaLineToCoordinates()</panel_attributes>
|
||||
<additional_attributes>10.0;20.0;200.0;20.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>UMLFrame</id>
|
||||
<coordinates>
|
||||
<x>290</x>
|
||||
<y>520</y>
|
||||
<w>840</w>
|
||||
<h>350</h>
|
||||
<x>42</x>
|
||||
<y>644</y>
|
||||
<w>1176</w>
|
||||
<h>490</h>
|
||||
</coordinates>
|
||||
<panel_attributes>alt
|
||||
--
|
||||
@@ -262,10 +262,10 @@ DrwaLineToKoordinates()</panel_attributes>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>370</x>
|
||||
<y>550</y>
|
||||
<w>220</w>
|
||||
<h>40</h>
|
||||
<x>154</x>
|
||||
<y>686</y>
|
||||
<w>308</w>
|
||||
<h>56</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=<-
|
||||
MouseLeftReleased(event)</panel_attributes>
|
||||
@@ -274,10 +274,10 @@ MouseLeftReleased(event)</panel_attributes>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>580</x>
|
||||
<y>570</y>
|
||||
<w>220</w>
|
||||
<h>40</h>
|
||||
<x>448</x>
|
||||
<y>714</y>
|
||||
<w>308</w>
|
||||
<h>56</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=<-
|
||||
MouseLeftReleased(event)</panel_attributes>
|
||||
@@ -286,10 +286,10 @@ MouseLeftReleased(event)</panel_attributes>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>790</x>
|
||||
<y>590</y>
|
||||
<w>220</w>
|
||||
<h>40</h>
|
||||
<x>742</x>
|
||||
<y>742</y>
|
||||
<w>308</w>
|
||||
<h>56</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=<-
|
||||
MouseLeftReleased(event)</panel_attributes>
|
||||
@@ -298,22 +298,22 @@ MouseLeftReleased(event)</panel_attributes>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>580</x>
|
||||
<y>630</y>
|
||||
<w>430</w>
|
||||
<h>40</h>
|
||||
<x>448</x>
|
||||
<y>798</y>
|
||||
<w>308</w>
|
||||
<h>56</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=<-
|
||||
MergeSubLayer()</panel_attributes>
|
||||
<additional_attributes>10.0;20.0;410.0;20.0</additional_attributes>
|
||||
<additional_attributes>10.0;20.0;200.0;20.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>580</x>
|
||||
<x>448</x>
|
||||
<y>210</y>
|
||||
<w>430</w>
|
||||
<h>40</h>
|
||||
<w>602</w>
|
||||
<h>56</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=<-
|
||||
CreateSubLayer()</panel_attributes>
|
||||
@@ -322,10 +322,10 @@ CreateSubLayer()</panel_attributes>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>370</x>
|
||||
<y>720</y>
|
||||
<w>220</w>
|
||||
<h>40</h>
|
||||
<x>154</x>
|
||||
<y>924</y>
|
||||
<w>308</w>
|
||||
<h>56</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=<-
|
||||
MouseRightPressed(event)</panel_attributes>
|
||||
@@ -334,10 +334,10 @@ MouseRightPressed(event)</panel_attributes>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>580</x>
|
||||
<y>740</y>
|
||||
<w>220</w>
|
||||
<h>40</h>
|
||||
<x>448</x>
|
||||
<y>952</y>
|
||||
<w>308</w>
|
||||
<h>56</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=<-
|
||||
MouseRightPressed(event)</panel_attributes>
|
||||
@@ -346,10 +346,10 @@ MouseRightPressed(event)</panel_attributes>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>790</x>
|
||||
<y>760</y>
|
||||
<w>220</w>
|
||||
<h>40</h>
|
||||
<x>742</x>
|
||||
<y>980</y>
|
||||
<w>308</w>
|
||||
<h>56</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=<-
|
||||
MouseRightPressed(event)</panel_attributes>
|
||||
@@ -358,22 +358,22 @@ MouseRightPressed(event)</panel_attributes>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>580</x>
|
||||
<y>790</y>
|
||||
<w>430</w>
|
||||
<h>40</h>
|
||||
<x>448</x>
|
||||
<y>1022</y>
|
||||
<w>308</w>
|
||||
<h>56</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=<-
|
||||
DeleteSubLayer()</panel_attributes>
|
||||
<additional_attributes>10.0;20.0;410.0;20.0</additional_attributes>
|
||||
<additional_attributes>10.0;20.0;200.0;20.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>370</x>
|
||||
<y>660</y>
|
||||
<w>220</w>
|
||||
<h>40</h>
|
||||
<x>154</x>
|
||||
<y>840</y>
|
||||
<w>308</w>
|
||||
<h>56</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=<-
|
||||
updateInterface()</panel_attributes>
|
||||
@@ -382,13 +382,49 @@ updateInterface()</panel_attributes>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>370</x>
|
||||
<y>820</y>
|
||||
<w>220</w>
|
||||
<h>40</h>
|
||||
<x>154</x>
|
||||
<y>1064</y>
|
||||
<w>308</w>
|
||||
<h>56</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=<-
|
||||
updateInterface()</panel_attributes>
|
||||
<additional_attributes>10.0;20.0;200.0;20.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>742</x>
|
||||
<y>448</y>
|
||||
<w>308</w>
|
||||
<h>56</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=<-
|
||||
()</panel_attributes>
|
||||
<additional_attributes>10.0;20.0;200.0;20.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>742</x>
|
||||
<y>770</y>
|
||||
<w>308</w>
|
||||
<h>56</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=<-
|
||||
()</panel_attributes>
|
||||
<additional_attributes>10.0;20.0;200.0;20.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>742</x>
|
||||
<y>1008</y>
|
||||
<w>308</w>
|
||||
<h>56</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=<-
|
||||
()</panel_attributes>
|
||||
<additional_attributes>10.0;20.0;200.0;20.0</additional_attributes>
|
||||
</element>
|
||||
</diagram>
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<diagram program="umlet" version="14.3.0">
|
||||
<zoom_level>10</zoom_level>
|
||||
<zoom_level>14</zoom_level>
|
||||
<element>
|
||||
<id>UMLGeneric</id>
|
||||
<coordinates>
|
||||
<x>630</x>
|
||||
<y>80</y>
|
||||
<w>100</w>
|
||||
<h>30</h>
|
||||
<x>392</x>
|
||||
<y>56</y>
|
||||
<w>140</w>
|
||||
<h>42</h>
|
||||
</coordinates>
|
||||
<panel_attributes>_:PaintingArea_</panel_attributes>
|
||||
<additional_attributes/>
|
||||
@@ -15,10 +15,10 @@
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>670</x>
|
||||
<y>100</y>
|
||||
<w>30</w>
|
||||
<h>70</h>
|
||||
<x>448</x>
|
||||
<y>84</y>
|
||||
<w>42</w>
|
||||
<h>98</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=.</panel_attributes>
|
||||
<additional_attributes>10.0;10.0;10.0;50.0</additional_attributes>
|
||||
@@ -26,10 +26,10 @@
|
||||
<element>
|
||||
<id>UMLActor</id>
|
||||
<coordinates>
|
||||
<x>440</x>
|
||||
<y>70</y>
|
||||
<w>60</w>
|
||||
<h>110</h>
|
||||
<x>126</x>
|
||||
<y>42</y>
|
||||
<w>84</w>
|
||||
<h>154</h>
|
||||
</coordinates>
|
||||
<panel_attributes/>
|
||||
<additional_attributes/>
|
||||
@@ -37,10 +37,10 @@
|
||||
<element>
|
||||
<id>UMLGeneric</id>
|
||||
<coordinates>
|
||||
<x>460</x>
|
||||
<y>150</y>
|
||||
<w>20</w>
|
||||
<h>490</h>
|
||||
<x>154</x>
|
||||
<y>154</y>
|
||||
<w>28</w>
|
||||
<h>686</h>
|
||||
</coordinates>
|
||||
<panel_attributes/>
|
||||
<additional_attributes/>
|
||||
@@ -48,10 +48,10 @@
|
||||
<element>
|
||||
<id>UMLGeneric</id>
|
||||
<coordinates>
|
||||
<x>670</x>
|
||||
<y>150</y>
|
||||
<w>20</w>
|
||||
<h>490</h>
|
||||
<x>448</x>
|
||||
<y>154</y>
|
||||
<w>28</w>
|
||||
<h>686</h>
|
||||
</coordinates>
|
||||
<panel_attributes/>
|
||||
<additional_attributes/>
|
||||
@@ -59,10 +59,10 @@
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>470</x>
|
||||
<y>150</y>
|
||||
<w>220</w>
|
||||
<h>40</h>
|
||||
<x>168</x>
|
||||
<y>154</y>
|
||||
<w>308</w>
|
||||
<h>56</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=<-
|
||||
MouseLeftPressed(event)</panel_attributes>
|
||||
@@ -71,10 +71,10 @@ MouseLeftPressed(event)</panel_attributes>
|
||||
<element>
|
||||
<id>UMLGeneric</id>
|
||||
<coordinates>
|
||||
<x>880</x>
|
||||
<y>150</y>
|
||||
<w>20</w>
|
||||
<h>490</h>
|
||||
<x>742</x>
|
||||
<y>154</y>
|
||||
<w>28</w>
|
||||
<h>686</h>
|
||||
</coordinates>
|
||||
<panel_attributes/>
|
||||
<additional_attributes/>
|
||||
@@ -82,32 +82,10 @@ MouseLeftPressed(event)</panel_attributes>
|
||||
<element>
|
||||
<id>UMLGeneric</id>
|
||||
<coordinates>
|
||||
<x>840</x>
|
||||
<y>80</y>
|
||||
<w>100</w>
|
||||
<h>30</h>
|
||||
</coordinates>
|
||||
<panel_attributes>_:IntelliTool_</panel_attributes>
|
||||
<additional_attributes/>
|
||||
</element>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>880</x>
|
||||
<y>100</y>
|
||||
<w>30</w>
|
||||
<h>70</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=.</panel_attributes>
|
||||
<additional_attributes>10.0;10.0;10.0;50.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>UMLGeneric</id>
|
||||
<coordinates>
|
||||
<x>1050</x>
|
||||
<y>80</y>
|
||||
<w>100</w>
|
||||
<h>30</h>
|
||||
<x>686</x>
|
||||
<y>56</y>
|
||||
<w>140</w>
|
||||
<h>42</h>
|
||||
</coordinates>
|
||||
<panel_attributes>_:IntelliToolPlain_</panel_attributes>
|
||||
<additional_attributes/>
|
||||
@@ -115,10 +93,10 @@ MouseLeftPressed(event)</panel_attributes>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>1090</x>
|
||||
<y>100</y>
|
||||
<w>30</w>
|
||||
<h>70</h>
|
||||
<x>742</x>
|
||||
<y>84</y>
|
||||
<w>42</w>
|
||||
<h>98</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=.</panel_attributes>
|
||||
<additional_attributes>10.0;10.0;10.0;50.0</additional_attributes>
|
||||
@@ -126,10 +104,32 @@ MouseLeftPressed(event)</panel_attributes>
|
||||
<element>
|
||||
<id>UMLGeneric</id>
|
||||
<coordinates>
|
||||
<x>1090</x>
|
||||
<y>150</y>
|
||||
<w>20</w>
|
||||
<h>490</h>
|
||||
<x>980</x>
|
||||
<y>56</y>
|
||||
<w>140</w>
|
||||
<h>42</h>
|
||||
</coordinates>
|
||||
<panel_attributes>_:IntelliTool_</panel_attributes>
|
||||
<additional_attributes/>
|
||||
</element>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>1036</x>
|
||||
<y>84</y>
|
||||
<w>42</w>
|
||||
<h>98</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=.</panel_attributes>
|
||||
<additional_attributes>10.0;10.0;10.0;50.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>UMLGeneric</id>
|
||||
<coordinates>
|
||||
<x>1036</x>
|
||||
<y>154</y>
|
||||
<w>28</w>
|
||||
<h>686</h>
|
||||
</coordinates>
|
||||
<panel_attributes/>
|
||||
<additional_attributes/>
|
||||
@@ -137,10 +137,10 @@ MouseLeftPressed(event)</panel_attributes>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>680</x>
|
||||
<y>170</y>
|
||||
<w>220</w>
|
||||
<h>40</h>
|
||||
<x>462</x>
|
||||
<y>182</y>
|
||||
<w>308</w>
|
||||
<h>56</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=<-
|
||||
MouseLeftPressed(event)</panel_attributes>
|
||||
@@ -149,10 +149,10 @@ MouseLeftPressed(event)</panel_attributes>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>890</x>
|
||||
<y>190</y>
|
||||
<w>220</w>
|
||||
<h>40</h>
|
||||
<x>756</x>
|
||||
<y>210</y>
|
||||
<w>308</w>
|
||||
<h>56</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=<-
|
||||
MouseLeftPressed(event)</panel_attributes>
|
||||
@@ -161,22 +161,22 @@ MouseLeftPressed(event)</panel_attributes>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>680</x>
|
||||
<y>220</y>
|
||||
<w>430</w>
|
||||
<h>40</h>
|
||||
<x>462</x>
|
||||
<y>252</y>
|
||||
<w>308</w>
|
||||
<h>56</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=<-
|
||||
CreateSubLayer()</panel_attributes>
|
||||
<additional_attributes>10.0;20.0;410.0;20.0</additional_attributes>
|
||||
<additional_attributes>10.0;20.0;200.0;20.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>470</x>
|
||||
<y>280</y>
|
||||
<w>220</w>
|
||||
<h>40</h>
|
||||
<x>168</x>
|
||||
<y>336</y>
|
||||
<w>308</w>
|
||||
<h>56</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=<-
|
||||
MouseLeftReleased(event)</panel_attributes>
|
||||
@@ -185,10 +185,10 @@ MouseLeftReleased(event)</panel_attributes>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>680</x>
|
||||
<y>300</y>
|
||||
<w>220</w>
|
||||
<h>40</h>
|
||||
<x>462</x>
|
||||
<y>364</y>
|
||||
<w>308</w>
|
||||
<h>56</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=<-
|
||||
MouseLeftReleased(event)</panel_attributes>
|
||||
@@ -197,10 +197,10 @@ MouseLeftReleased(event)</panel_attributes>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>890</x>
|
||||
<y>320</y>
|
||||
<w>220</w>
|
||||
<h>40</h>
|
||||
<x>756</x>
|
||||
<y>392</y>
|
||||
<w>308</w>
|
||||
<h>56</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=<-
|
||||
MouseLeftReleased(event)</panel_attributes>
|
||||
@@ -209,22 +209,22 @@ MouseLeftReleased(event)</panel_attributes>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>680</x>
|
||||
<y>360</y>
|
||||
<w>430</w>
|
||||
<h>40</h>
|
||||
<x>462</x>
|
||||
<y>448</y>
|
||||
<w>308</w>
|
||||
<h>56</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=<-
|
||||
MergeSubLayer()</panel_attributes>
|
||||
<additional_attributes>10.0;20.0;410.0;20.0</additional_attributes>
|
||||
<additional_attributes>10.0;20.0;200.0;20.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>470</x>
|
||||
<y>390</y>
|
||||
<w>220</w>
|
||||
<h>40</h>
|
||||
<x>168</x>
|
||||
<y>490</y>
|
||||
<w>308</w>
|
||||
<h>56</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=<-
|
||||
updateInterface()</panel_attributes>
|
||||
@@ -233,10 +233,10 @@ updateInterface()</panel_attributes>
|
||||
<element>
|
||||
<id>UMLFrame</id>
|
||||
<coordinates>
|
||||
<x>390</x>
|
||||
<y>250</y>
|
||||
<w>840</w>
|
||||
<h>350</h>
|
||||
<x>56</x>
|
||||
<y>294</y>
|
||||
<w>1176</w>
|
||||
<h>490</h>
|
||||
</coordinates>
|
||||
<panel_attributes>alt
|
||||
--
|
||||
@@ -256,10 +256,10 @@ updateInterface()</panel_attributes>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>470</x>
|
||||
<y>450</y>
|
||||
<w>220</w>
|
||||
<h>40</h>
|
||||
<x>168</x>
|
||||
<y>574</y>
|
||||
<w>308</w>
|
||||
<h>56</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=<-
|
||||
MouseRightPressed(event)</panel_attributes>
|
||||
@@ -268,10 +268,10 @@ MouseRightPressed(event)</panel_attributes>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>470</x>
|
||||
<y>550</y>
|
||||
<w>220</w>
|
||||
<h>40</h>
|
||||
<x>168</x>
|
||||
<y>714</y>
|
||||
<w>308</w>
|
||||
<h>56</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=<-
|
||||
updateInterface()</panel_attributes>
|
||||
@@ -280,22 +280,22 @@ updateInterface()</panel_attributes>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>680</x>
|
||||
<y>520</y>
|
||||
<w>430</w>
|
||||
<h>40</h>
|
||||
<x>462</x>
|
||||
<y>672</y>
|
||||
<w>308</w>
|
||||
<h>56</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=<-
|
||||
DeleteSubLayer()</panel_attributes>
|
||||
<additional_attributes>10.0;20.0;410.0;20.0</additional_attributes>
|
||||
<additional_attributes>10.0;20.0;200.0;20.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>680</x>
|
||||
<y>470</y>
|
||||
<w>220</w>
|
||||
<h>40</h>
|
||||
<x>462</x>
|
||||
<y>602</y>
|
||||
<w>308</w>
|
||||
<h>56</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=<-
|
||||
MouseRightPressed(event)</panel_attributes>
|
||||
@@ -304,13 +304,49 @@ MouseRightPressed(event)</panel_attributes>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>890</x>
|
||||
<y>490</y>
|
||||
<w>220</w>
|
||||
<h>40</h>
|
||||
<x>756</x>
|
||||
<y>630</y>
|
||||
<w>308</w>
|
||||
<h>56</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=<-
|
||||
MouseRightPressed(event)</panel_attributes>
|
||||
<additional_attributes>200.0;20.0;10.0;20.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>756</x>
|
||||
<y>238</y>
|
||||
<w>308</w>
|
||||
<h>56</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=<-
|
||||
CreateSubLayer()</panel_attributes>
|
||||
<additional_attributes>10.0;20.0;200.0;20.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>756</x>
|
||||
<y>420</y>
|
||||
<w>308</w>
|
||||
<h>56</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=<-
|
||||
()</panel_attributes>
|
||||
<additional_attributes>10.0;20.0;200.0;20.0</additional_attributes>
|
||||
</element>
|
||||
<element>
|
||||
<id>Relation</id>
|
||||
<coordinates>
|
||||
<x>756</x>
|
||||
<y>658</y>
|
||||
<w>308</w>
|
||||
<h>56</h>
|
||||
</coordinates>
|
||||
<panel_attributes>lt=<-
|
||||
()</panel_attributes>
|
||||
<additional_attributes>10.0;20.0;200.0;20.0</additional_attributes>
|
||||
</element>
|
||||
</diagram>
|
||||
|
||||
1
knownBugs.txt
Normal file
1
knownBugs.txt
Normal file
@@ -0,0 +1 @@
|
||||
history tool doesnt load polygon data on undo iff project was loaded
|
||||
@@ -3,8 +3,10 @@
|
||||
#include "IntelliPhotoGui.h"
|
||||
#include "Layer/PaintingArea.h"
|
||||
|
||||
#include "QEvent"
|
||||
#include "QCloseEvent"
|
||||
#include <QEvent>
|
||||
#include <QCloseEvent>
|
||||
#include <QDebug>
|
||||
#include <string>
|
||||
|
||||
// IntelliPhotoGui constructor
|
||||
IntelliPhotoGui::IntelliPhotoGui(){
|
||||
@@ -18,8 +20,7 @@ IntelliPhotoGui::IntelliPhotoGui(){
|
||||
setIntelliStyle();
|
||||
// Size the app
|
||||
resize(600,600);
|
||||
showMaximized();
|
||||
setDefaultToolValue();
|
||||
setDefaultValues();
|
||||
}
|
||||
|
||||
// User tried to close the app
|
||||
@@ -50,10 +51,28 @@ void IntelliPhotoGui::slotOpen(){
|
||||
// If we have a file name load the image and place
|
||||
// it in the paintingArea
|
||||
if (!fileName.isEmpty()) {
|
||||
paintingArea->open(fileName);
|
||||
UpdateGui();
|
||||
}
|
||||
}
|
||||
bool rightFileType =true;
|
||||
if(fileName.size()>=4){
|
||||
QString endung(".idf");
|
||||
int length = fileName.size();
|
||||
for(int i=0; i<4; i++){
|
||||
if(endung[i]!=fileName[length-4+i]){
|
||||
rightFileType = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(rightFileType){
|
||||
IntelliDatamanager::loadProject(paintingArea,fileName);
|
||||
UpdateGui();
|
||||
|
||||
}
|
||||
else{
|
||||
paintingArea->open(fileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Called when the user clicks Save As in the menu
|
||||
@@ -82,7 +101,7 @@ void IntelliPhotoGui::slotCreateNewRasterLayer(){
|
||||
|
||||
// Create New Layer
|
||||
if (ok1&&ok2) {
|
||||
paintingArea->addLayer(width,height,0,0,IntelliImage::ImageType::RASTERIMAGE);
|
||||
paintingArea->addLayer(width,height,0,0,255,ImageType::RASTERIMAGE);
|
||||
UpdateGui();
|
||||
}
|
||||
}
|
||||
@@ -101,7 +120,7 @@ void IntelliPhotoGui::slotCreateNewShapedLayer(){
|
||||
|
||||
// Create New Layer
|
||||
if (ok1&&ok2) {
|
||||
paintingArea->addLayer(width, height, 0, 0, IntelliImage::ImageType::SHAPEDIMAGE);
|
||||
paintingArea->addLayer(width, height, 0, 0,255, ImageType::SHAPEDIMAGE);
|
||||
UpdateGui();
|
||||
}
|
||||
}
|
||||
@@ -118,6 +137,8 @@ void IntelliPhotoGui::slotChangeDim(){
|
||||
|
||||
int height = IntelliInputDialog::getInt("New Canvas Size", "Height:", 600, 1, 50000, 1, &ok2);
|
||||
|
||||
|
||||
|
||||
// Change dimension
|
||||
if (ok1&&ok2) {
|
||||
paintingArea->setLayerDimensions(width,height);
|
||||
@@ -327,6 +348,14 @@ void IntelliPhotoGui::slotSetInnerAlpha(){
|
||||
}
|
||||
}
|
||||
|
||||
void IntelliPhotoGui::slotGoBack(){
|
||||
paintingArea->historyGoBack();
|
||||
}
|
||||
|
||||
void IntelliPhotoGui::slotGoForward(){
|
||||
paintingArea->historyGoForward();
|
||||
}
|
||||
|
||||
// Define menu actions that call functions
|
||||
void IntelliPhotoGui::createActions(){
|
||||
// Get a list of the supported file formats
|
||||
@@ -356,6 +385,14 @@ void IntelliPhotoGui::createActions(){
|
||||
actionSaveAs.append(pngSaveAction);
|
||||
pngSaveAction->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_S));
|
||||
|
||||
QAction*projectSaveAction = new QAction("Projekt", this);
|
||||
projectSaveAction->setData("idf");
|
||||
// When clicked call IntelliPhotoGui::save()
|
||||
connect(projectSaveAction, SIGNAL(triggered()), this, SLOT(slotSave()));
|
||||
// Attach each PNG in save Menu
|
||||
actionSaveAs.append(projectSaveAction);
|
||||
projectSaveAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_S));
|
||||
|
||||
// Create exit action and tie to IntelliPhotoGui::close()
|
||||
actionExit = new QAction(tr("&Exit"), this);
|
||||
actionExit->setShortcuts(QKeySequence::Quit);
|
||||
@@ -525,6 +562,14 @@ void IntelliPhotoGui::createActions(){
|
||||
actionSetInnerAlpha = new QAction(tr("&Set Inner Alpha"),this);
|
||||
actionSetInnerAlpha->setShortcut(QKeySequence(Qt::ALT + Qt::Key_A));
|
||||
connect(actionSetInnerAlpha, SIGNAL(triggered()), this, SLOT(slotSetInnerAlpha()));
|
||||
|
||||
actionGoBack = new QAction(tr("&Go back"),this);
|
||||
actionGoBack->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Z));
|
||||
connect(actionGoBack, SIGNAL(triggered()), this, SLOT(slotGoBack()));
|
||||
|
||||
actionGoForward = new QAction(tr("&Go forward"),this);
|
||||
actionGoForward->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Y));
|
||||
connect(actionGoForward, SIGNAL(triggered()), this, SLOT(slotGoForward()));
|
||||
}
|
||||
|
||||
// Create the menubar
|
||||
@@ -550,6 +595,7 @@ void IntelliPhotoGui::createMenus(){
|
||||
layerCreationMenu = new QMenu(tr("&Create new Layer"), this);
|
||||
layerCreationMenu->addAction(actionCreateNewRasterLayer);
|
||||
layerCreationMenu->addAction(actionCreateNewShapedLayer);
|
||||
|
||||
// Attach all actions to Layer
|
||||
layerMenu = new QMenu(tr("&Layer"), this);
|
||||
layerMenu->addMenu(layerCreationMenu);
|
||||
@@ -597,6 +643,8 @@ void IntelliPhotoGui::createMenus(){
|
||||
|
||||
// Attach all actions to Options
|
||||
optionMenu = new QMenu(tr("&Options"), this);
|
||||
optionMenu->addAction(actionGoBack);
|
||||
optionMenu->addAction(actionGoForward);
|
||||
optionMenu->addMenu(layerMenu);
|
||||
optionMenu->addMenu(toolMenu);
|
||||
optionMenu->addSeparator();
|
||||
@@ -626,7 +674,7 @@ void IntelliPhotoGui::createGui(){
|
||||
// create Gui elements
|
||||
// get and set max width and height
|
||||
paintingArea = new PaintingArea(1280, 720);
|
||||
paintingArea->DummyGui = this;
|
||||
paintingArea->guiReference = this;
|
||||
|
||||
preview = QPixmap(":/Icons/Buttons/icons/circle-tool.svg");
|
||||
CircleButton = new QPushButton();
|
||||
@@ -740,8 +788,14 @@ void IntelliPhotoGui::createGui(){
|
||||
QString String = QString("%1x%2").arg(paintingArea->Canvas->width()).arg(paintingArea->Canvas->height());
|
||||
dimCanvas->setText(String);
|
||||
|
||||
ScrollArea = new QScrollArea(this);
|
||||
ScrollArea->setBackgroundRole(QPalette::Dark);
|
||||
ScrollArea->setWidget(paintingArea);
|
||||
ScrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
|
||||
ScrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
|
||||
|
||||
// set gui elements
|
||||
mainLayout->addWidget(paintingArea,1,1,20,1);
|
||||
mainLayout->addWidget(ScrollArea,1,1,20,1);
|
||||
mainLayout->addWidget(CircleButton,1,2,1,1);
|
||||
mainLayout->addWidget(FloodFillButton,1,3,1,1);
|
||||
mainLayout->addWidget(LineButton,2,2,1,1);
|
||||
@@ -761,6 +815,7 @@ void IntelliPhotoGui::createGui(){
|
||||
mainLayout->addWidget(dimActive,13,2,1,2);
|
||||
mainLayout->addWidget(dimCanvas,14,2,1,2);
|
||||
mainLayout->setHorizontalSpacing(0);
|
||||
|
||||
}
|
||||
|
||||
void IntelliPhotoGui::setIntelliStyle(){
|
||||
@@ -817,11 +872,15 @@ bool IntelliPhotoGui::saveFile(const QByteArray &fileFormat){
|
||||
return false;
|
||||
} else {
|
||||
// Call for the file to be saved
|
||||
if(fileFormat == "idf"){
|
||||
return IntelliDatamanager::saveProject(paintingArea, fileName);
|
||||
|
||||
}
|
||||
return paintingArea->save(fileName, fileFormat.constData());
|
||||
}
|
||||
}
|
||||
|
||||
void IntelliPhotoGui::setDefaultToolValue(){
|
||||
void IntelliPhotoGui::setDefaultValues(){
|
||||
slotEnterPressed();
|
||||
}
|
||||
|
||||
@@ -846,7 +905,9 @@ void IntelliPhotoGui::UpdateGui(){
|
||||
tmp.fill(Qt::transparent);
|
||||
preview = preview.fromImage(tmp);
|
||||
}
|
||||
ActiveLayerImageLabel->setPixmap(preview.scaled(Buttonsize * 2));
|
||||
|
||||
|
||||
ActiveLayerImageLabel->setPixmap(preview.scaled(Buttonsize * 2));
|
||||
|
||||
string = QString("background-color: %1").arg(paintingArea->colorPicker.getFirstColor().name());
|
||||
FirstColorButton->setStyleSheet(string);
|
||||
|
||||
@@ -14,7 +14,9 @@
|
||||
#include <QTextEdit>
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#include <QScrollArea>
|
||||
#include "IntelliInputDialog.h"
|
||||
#include "IntelliHelper/IntelliDatamanager.h"
|
||||
|
||||
//for unit testing
|
||||
class UnitTest;
|
||||
@@ -95,11 +97,15 @@ void slotSetInnerAlpha();
|
||||
|
||||
void slotResetTools();
|
||||
|
||||
void slotGoBack();
|
||||
void slotGoForward();
|
||||
|
||||
private:
|
||||
|
||||
//setup functions for gui
|
||||
void createActions();
|
||||
void createMenus();
|
||||
void createGui();
|
||||
// Set the style of the GUI
|
||||
void setIntelliStyle();
|
||||
|
||||
// Will check if changes have occurred since last save
|
||||
@@ -107,13 +113,19 @@ bool maybeSave();
|
||||
// Opens the Save dialog and saves
|
||||
bool saveFile(const QByteArray &fileFormat);
|
||||
|
||||
void setDefaultToolValue();
|
||||
//basic to set tool values to begin
|
||||
void setDefaultValues();
|
||||
|
||||
// What we'll draw on
|
||||
PaintingArea* paintingArea;
|
||||
|
||||
const QSize Buttonsize = QSize(35,35);
|
||||
//used to display a preview of the active layer
|
||||
QPixmap preview;
|
||||
|
||||
//size of all buttons
|
||||
const QSize Buttonsize = QSize(35,35);
|
||||
|
||||
//buttons used for gui
|
||||
QPushButton* CircleButton;
|
||||
QPushButton* FloodFillButton;
|
||||
QPushButton* LineButton;
|
||||
@@ -121,35 +133,42 @@ QPushButton* PenButton;
|
||||
QPushButton* PlainButton;
|
||||
QPushButton* PolygonButton;
|
||||
QPushButton* RectangleButton;
|
||||
QLabel* WidthLine;
|
||||
QLabel* innerAlphaLine;
|
||||
QLineEdit* EditLineWidth;
|
||||
QLineEdit* EditLineInnerAlpha;
|
||||
QIntValidator* ValidatorLineWidth;
|
||||
QIntValidator* ValidatorInnerAlpha;
|
||||
|
||||
QPushButton* FirstColorButton;
|
||||
QPushButton* SecondColorButton;
|
||||
QPushButton* SwitchColorButton;
|
||||
|
||||
QLabel* ActiveLayerLine;
|
||||
QLabel* ActiveLayerImageLabel;
|
||||
|
||||
QPushButton* dimActive;
|
||||
QPushButton* dimCanvas;
|
||||
|
||||
//labels used for gui
|
||||
QLabel* WidthLine;
|
||||
QLabel* innerAlphaLine;
|
||||
QLabel* ActiveLayerLine;
|
||||
QLabel* ActiveLayerImageLabel;
|
||||
|
||||
//scroll area to display canvas
|
||||
QScrollArea* ScrollArea;
|
||||
|
||||
//line edits used for gui
|
||||
QLineEdit* EditLineWidth;
|
||||
QLineEdit* EditLineInnerAlpha;
|
||||
|
||||
//int validator used for gui
|
||||
QIntValidator* ValidatorLineWidth;
|
||||
QIntValidator* ValidatorInnerAlpha;
|
||||
|
||||
|
||||
// The menu widgets
|
||||
QMenu*saveAsMenu;
|
||||
QMenu*fileMenu;
|
||||
QMenu*renderMenu;
|
||||
QMenu*optionMenu;
|
||||
QMenu*layerCreationMenu;
|
||||
QMenu*layerMenu;
|
||||
QMenu*colorMenu;
|
||||
QMenu*toolCreationMenu;
|
||||
QMenu*toolSettingsMenu;
|
||||
QMenu*toolMenu;
|
||||
QMenu*helpMenu;
|
||||
QMenu* saveAsMenu;
|
||||
QMenu* fileMenu;
|
||||
QMenu* renderMenu;
|
||||
QMenu* optionMenu;
|
||||
QMenu* layerCreationMenu;
|
||||
QMenu* layerMenu;
|
||||
QMenu* colorMenu;
|
||||
QMenu* toolCreationMenu;
|
||||
QMenu* toolSettingsMenu;
|
||||
QMenu* toolMenu;
|
||||
QMenu* helpMenu;
|
||||
|
||||
// All the actions that can occur
|
||||
// meta image actions (need further modularisation)
|
||||
@@ -175,7 +194,9 @@ QAction* actionCreatePolygonTool;
|
||||
QAction* actionCreateFloodFillTool;
|
||||
|
||||
// dimension actions
|
||||
QAction*actionChangeDim;
|
||||
QAction* actionChangeDim;
|
||||
QAction* actionSetWidth;
|
||||
QAction* actionSetInnerAlpha;
|
||||
|
||||
// dialog actions
|
||||
QAction* actionAboutDialog;
|
||||
@@ -195,11 +216,14 @@ QAction* actionMovePositionRight;
|
||||
QAction* actionMoveLayerUp;
|
||||
QAction* actionMoveLayerDown;
|
||||
|
||||
// Actions tied to specific file formats
|
||||
// actions tied to specific file formats
|
||||
QList<QAction*> actionSaveAs;
|
||||
|
||||
QAction* actionSetWidth;
|
||||
QAction* actionSetInnerAlpha;
|
||||
|
||||
|
||||
// history actions
|
||||
QAction* actionGoBack;
|
||||
QAction* actionGoForward;
|
||||
|
||||
// main GUI elements
|
||||
QWidget* centralGuiWidget;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include <QSize>
|
||||
#include <QPainter>
|
||||
|
||||
IntelliImage::IntelliImage(int width, int height, bool fastRendererOn)
|
||||
IntelliImage:: IntelliImage(int width, int height, bool fastRendererOn)
|
||||
: imageData(QSize(width, height), fastRendererOn ? QImage::Format_Indexed8 : QImage::Format_ARGB32){
|
||||
if(fastRendererOn) {
|
||||
imageData = imageData.convertToFormat(QImage::Format_ARGB32);
|
||||
@@ -15,6 +15,7 @@ IntelliImage::IntelliImage(int width, int height, bool fastRendererOn)
|
||||
|
||||
}
|
||||
|
||||
|
||||
IntelliImage::~IntelliImage(){
|
||||
|
||||
}
|
||||
@@ -158,3 +159,15 @@ void IntelliImage::updateRendererSetting(bool fastRendererOn){
|
||||
this->imageData = imageData.convertToFormat(QImage::Format_ARGB32);
|
||||
}
|
||||
}
|
||||
|
||||
int IntelliImage::getWidth() const{
|
||||
return imageData.width();
|
||||
}
|
||||
|
||||
int IntelliImage::getHeight() const{
|
||||
return imageData.height();
|
||||
}
|
||||
|
||||
bool IntelliImage::isFastRendering() const{
|
||||
return this->fastRenderering;
|
||||
}
|
||||
|
||||
@@ -16,6 +16,14 @@ class UnitTest;
|
||||
|
||||
class IntelliTool;
|
||||
|
||||
/*!
|
||||
* \brief The Types, which an Image can be.
|
||||
*/
|
||||
enum class ImageType {
|
||||
RASTERIMAGE,
|
||||
SHAPEDIMAGE
|
||||
};
|
||||
|
||||
/*!
|
||||
* \brief An abstract class which manages the basic IntelliImage operations.
|
||||
*/
|
||||
@@ -24,14 +32,6 @@ friend UnitTest;
|
||||
friend IntelliTool;
|
||||
public:
|
||||
|
||||
/*!
|
||||
* \brief The Types, which an Image can be.
|
||||
*/
|
||||
enum class ImageType {
|
||||
RASTERIMAGE,
|
||||
SHAPEDIMAGE
|
||||
};
|
||||
|
||||
protected:
|
||||
void resizeImage(QImage*image, const QSize &newSize);
|
||||
|
||||
@@ -59,6 +59,7 @@ public:
|
||||
*/
|
||||
IntelliImage(int width, int height, bool fastRendererOn);
|
||||
|
||||
|
||||
/*!
|
||||
* \brief An Abstract Destructor.
|
||||
*/
|
||||
@@ -170,6 +171,12 @@ virtual QImage getImageData();
|
||||
*/
|
||||
virtual void setImageData(const QImage& newData);
|
||||
|
||||
virtual int getWidth() const;
|
||||
|
||||
virtual int getHeight() const;
|
||||
|
||||
virtual bool isFastRendering() const;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -5,18 +5,28 @@
|
||||
|
||||
IntelliRasterImage::IntelliRasterImage(int width, int height, bool fastRendererOn)
|
||||
: IntelliImage(width, height, fastRendererOn){
|
||||
TypeOfImage = IntelliImage::ImageType::RASTERIMAGE;
|
||||
TypeOfImage = ImageType::RASTERIMAGE;
|
||||
this->fastRenderering = fastRendererOn;
|
||||
}
|
||||
|
||||
|
||||
IntelliRasterImage* IntelliRasterImage::copy(const IntelliRasterImage& image){
|
||||
this->TypeOfImage = ImageType::RASTERIMAGE;
|
||||
IntelliRasterImage* raster = new IntelliRasterImage(imageData.width(), imageData.height(), this->fastRenderering);
|
||||
raster->imageData.copy(0,0,image.getWidth(),image.getWidth());
|
||||
return raster;
|
||||
}
|
||||
|
||||
|
||||
|
||||
IntelliRasterImage::~IntelliRasterImage(){
|
||||
|
||||
}
|
||||
|
||||
IntelliImage* IntelliRasterImage::getDeepCopy(){
|
||||
IntelliRasterImage* raster = new IntelliRasterImage(imageData.width(), imageData.height(), false);
|
||||
IntelliRasterImage* raster = new IntelliRasterImage(imageData.width(), imageData.height(), this->fastRenderering);
|
||||
raster->imageData.fill(Qt::transparent);
|
||||
raster->TypeOfImage = IntelliImage::ImageType::RASTERIMAGE;
|
||||
raster->TypeOfImage = ImageType::RASTERIMAGE;
|
||||
return raster;
|
||||
}
|
||||
|
||||
@@ -49,3 +59,7 @@ QImage IntelliRasterImage::getDisplayable(const QSize& displaySize, int alpha){
|
||||
void IntelliRasterImage::setPolygon(const std::vector<QPoint>& polygonData){
|
||||
return;
|
||||
}
|
||||
|
||||
std::vector<QPoint> IntelliRasterImage::getPolygon(){
|
||||
return std::vector<QPoint>();
|
||||
}
|
||||
|
||||
@@ -26,6 +26,8 @@ public:
|
||||
*/
|
||||
IntelliRasterImage(int width, int height, bool fastRendererOn);
|
||||
|
||||
IntelliRasterImage* copy(const IntelliRasterImage& image);
|
||||
|
||||
/*!
|
||||
* \brief An Destructor.
|
||||
*/
|
||||
@@ -57,6 +59,12 @@ virtual IntelliImage* getDeepCopy() override;
|
||||
* \param polygonData - The Vertices of the Polygon. Nothing happens.
|
||||
*/
|
||||
virtual void setPolygon(const std::vector<QPoint>& polygonData) override;
|
||||
|
||||
/*!
|
||||
* \brief getPolygon
|
||||
* \return returns the points of the polygon
|
||||
*/
|
||||
virtual std::vector<QPoint> getPolygon();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -6,10 +6,17 @@
|
||||
|
||||
IntelliShapedImage::IntelliShapedImage(int width, int height, bool fastRendererOn)
|
||||
: IntelliRasterImage(width, height, fastRendererOn){
|
||||
TypeOfImage = IntelliImage::ImageType::SHAPEDIMAGE;
|
||||
TypeOfImage = ImageType::SHAPEDIMAGE;
|
||||
this->fastRenderering = fastRendererOn;
|
||||
}
|
||||
|
||||
IntelliShapedImage* IntelliShapedImage::copy(const IntelliShapedImage& image){
|
||||
this->TypeOfImage = ImageType::SHAPEDIMAGE;
|
||||
IntelliShapedImage* shaped = new IntelliShapedImage(imageData.width(), imageData.height(), this->fastRenderering);
|
||||
shaped->imageData.copy(0,0,image.getWidth(),image.getWidth());
|
||||
return shaped;
|
||||
}
|
||||
|
||||
IntelliShapedImage::~IntelliShapedImage(){
|
||||
|
||||
}
|
||||
@@ -19,10 +26,10 @@ QImage IntelliShapedImage::getDisplayable(int alpha){
|
||||
}
|
||||
|
||||
IntelliImage* IntelliShapedImage::getDeepCopy(){
|
||||
IntelliShapedImage* shaped = new IntelliShapedImage(imageData.width(), imageData.height(), false);
|
||||
IntelliShapedImage* shaped = new IntelliShapedImage(imageData.width(), imageData.height(), this->fastRenderering);
|
||||
shaped->setPolygon(this->polygonData);
|
||||
shaped->imageData.fill(Qt::transparent);
|
||||
shaped->TypeOfImage = IntelliImage::ImageType::SHAPEDIMAGE;
|
||||
shaped->TypeOfImage = ImageType::SHAPEDIMAGE;
|
||||
return shaped;
|
||||
}
|
||||
|
||||
@@ -111,3 +118,7 @@ void IntelliShapedImage::setPolygon(const std::vector<QPoint>& polygonData){
|
||||
calculateVisiblity();
|
||||
return;
|
||||
}
|
||||
|
||||
std::vector<QPoint> IntelliShapedImage::getPolygon(){
|
||||
return polygonData;
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@ public:
|
||||
*/
|
||||
IntelliShapedImage(int width, int height, bool fastRendererOn);
|
||||
|
||||
IntelliShapedImage* copy(const IntelliShapedImage& image);
|
||||
/*!
|
||||
* \brief An Destructor.
|
||||
*/
|
||||
@@ -77,6 +78,14 @@ virtual std::vector<QPoint> getPolygonData() override {
|
||||
* \param polygonData - The Vertices of the Polygon. Just Planar Polygons are allowed.
|
||||
*/
|
||||
virtual void setPolygon(const std::vector<QPoint>& polygonData) override;
|
||||
|
||||
|
||||
/*!
|
||||
* \brief getPolygon
|
||||
* \return returns the data of the polygon as points
|
||||
*/
|
||||
virtual std::vector<QPoint> getPolygon() override;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
101
src/IntelliHelper/IntelliDatamanager.cpp
Normal file
101
src/IntelliHelper/IntelliDatamanager.cpp
Normal file
@@ -0,0 +1,101 @@
|
||||
#include "IntelliDatamanager.h"
|
||||
#include "Layer/PaintingArea.h"
|
||||
|
||||
bool IntelliDatamanager::saveProject(PaintingArea* Canvas, QString filePath){
|
||||
QFile openFile(filePath);
|
||||
|
||||
if(openFile.open(QIODevice::WriteOnly)){
|
||||
|
||||
QTextStream out(&openFile);
|
||||
std::vector<LayerObject>* layerBundle = Canvas->getLayerBundle();
|
||||
size_t numberOfLayers = layerBundle->size();
|
||||
out << 7 << endl; //version tag
|
||||
out << Canvas->getRenderSettings() << " ";
|
||||
out << Canvas->getMaxWidth() << " " << Canvas->getMaxHeight() << endl; //dimensions of canvas
|
||||
out << numberOfLayers << endl; //number of layers
|
||||
for(size_t i = 0; i<numberOfLayers; i++){
|
||||
int width = layerBundle->at(i).width;
|
||||
int height = layerBundle->at(i).height;
|
||||
out << width << endl; //width
|
||||
out << height << endl; //height
|
||||
out << layerBundle->at(i).widthOffset << endl; //widthOffset
|
||||
out << layerBundle->at(i).heightOffset << endl; //HeightOffset
|
||||
out << layerBundle->at(i).alpha << endl; //alpha of layer
|
||||
if(layerBundle->at(i).image->getTypeOfImage() == ImageType::RASTERIMAGE){
|
||||
out << 0 << " ";
|
||||
}else{
|
||||
out << 1 << " ";
|
||||
}
|
||||
std::vector<QPoint> points = layerBundle->at(i).image->getPolygonData();
|
||||
out << points.size() << " ";
|
||||
for(size_t j = 0; j<points.size(); j++){
|
||||
out << points.at(j).x() << " " << points.at(j).y() << " ";
|
||||
}
|
||||
for(int j=0; j<height; j++){
|
||||
for(int k = 0; k<width; k++){
|
||||
QColor pixColor = layerBundle->at(i).image->getImageData().pixelColor(j,k);
|
||||
out << pixColor.red() << " " << pixColor.green() << " " << pixColor.blue() << " " << pixColor.alpha() << " ";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
out << "\nFormat designed and approved by IntelliPhoto Team 7. All rigths reserved.";
|
||||
openFile.close();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IntelliDatamanager::loadProject(PaintingArea* Canvas, QString filePath){
|
||||
QFile openFile(filePath);
|
||||
Canvas->deleteAllLayers();
|
||||
if(openFile.open(QIODevice::ReadOnly)){
|
||||
QTextStream in(&openFile);
|
||||
|
||||
float version;
|
||||
int rendersetting;
|
||||
int widthCanvas, heightCanvas, numberOffLayers;
|
||||
in >> version;
|
||||
in >> rendersetting;
|
||||
in >> widthCanvas >> heightCanvas;
|
||||
in >> numberOffLayers;
|
||||
|
||||
Canvas->setLayerDimensions(widthCanvas, heightCanvas);
|
||||
for(int i=0; i<numberOffLayers; i++){
|
||||
int width, height, widthOffset, heightOffset, alpha;
|
||||
in >> width >> height >> widthOffset >> heightOffset >> alpha;
|
||||
|
||||
int typeFlag;
|
||||
size_t numberOfPoints;
|
||||
std::vector<QPoint> polyPoints;
|
||||
|
||||
in >> typeFlag >> numberOfPoints;
|
||||
if(typeFlag==0){
|
||||
Canvas->addLayer(width, height, widthOffset, heightOffset, alpha, ImageType::RASTERIMAGE);
|
||||
}else{
|
||||
Canvas->addLayer(width, height, widthOffset, heightOffset, alpha, ImageType::SHAPEDIMAGE);
|
||||
}
|
||||
polyPoints.reserve(numberOfPoints);
|
||||
for(size_t j=0; j<numberOfPoints; j++){
|
||||
int x, y;
|
||||
in >> x >> y;
|
||||
polyPoints.push_back(QPoint(x,y));
|
||||
}
|
||||
Canvas->setPolygonDataToActive(polyPoints);
|
||||
|
||||
for(int j=0; j<height; j++){
|
||||
for(int k = 0; k<width; k++){
|
||||
int red, green, blue, alpha;
|
||||
in >> red >> green >> blue >> alpha;
|
||||
Canvas->setPixelToActive(QColor(red, green, blue, alpha), QPoint(j, k));
|
||||
}
|
||||
}
|
||||
}
|
||||
Canvas->setRenderSettings(static_cast<bool>(rendersetting));
|
||||
openFile.close();
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
16
src/IntelliHelper/IntelliDatamanager.h
Normal file
16
src/IntelliHelper/IntelliDatamanager.h
Normal file
@@ -0,0 +1,16 @@
|
||||
#ifndef INTELLIDATAMANAGER_H
|
||||
#define INTELLIDATAMANAGER_H
|
||||
|
||||
#include <QFile>
|
||||
#include <QDebug>
|
||||
|
||||
class PaintingArea;
|
||||
|
||||
namespace IntelliDatamanager{
|
||||
|
||||
bool loadProject(PaintingArea* Canvas, QString filePath = "unnamed.idf");
|
||||
bool saveProject(PaintingArea* Canvas, QString filePath = "unnamed.idf");
|
||||
|
||||
}
|
||||
|
||||
#endif // INTELLIDATAMANAGER_H
|
||||
@@ -22,6 +22,7 @@ SOURCES += \
|
||||
Image/IntelliRasterImage.cpp \
|
||||
Image/IntelliShapedImage.cpp \
|
||||
IntelliHelper/IntelliColorPicker.cpp \
|
||||
IntelliHelper/IntelliDatamanager.cpp \
|
||||
IntelliHelper/IntelliRenderSettings.cpp \
|
||||
IntelliHelper/IntelliToolsettings.cpp \
|
||||
IntelliHelper/IntelliTriangulation.cpp \
|
||||
@@ -43,6 +44,7 @@ HEADERS += \
|
||||
Image/IntelliRasterImage.h \
|
||||
Image/IntelliShapedImage.h \
|
||||
IntelliHelper/IntelliColorPicker.h \
|
||||
IntelliHelper/IntelliDatamanager.h \
|
||||
IntelliHelper/IntelliRenderSettings.h \
|
||||
IntelliHelper/IntelliToolsettings.h \
|
||||
IntelliHelper/IntelliTriangulation.h \
|
||||
|
||||
@@ -17,10 +17,27 @@
|
||||
#include "Tool/IntelliToolRectangle.h"
|
||||
#include "Tool/IntelliToolFloodFill.h"
|
||||
#include "Tool/IntelliToolPolygon.h"
|
||||
#include "GUI/IntelliPhotoGui.h"
|
||||
|
||||
LayerObject::LayerObject(){
|
||||
|
||||
}
|
||||
|
||||
LayerObject::LayerObject(const LayerObject& layer){
|
||||
if(layer.image->getTypeOfImage()==ImageType::RASTERIMAGE){
|
||||
this->image = new IntelliRasterImage(*dynamic_cast<IntelliRasterImage*>(layer.image));
|
||||
}else if(layer.image->getTypeOfImage()==ImageType::SHAPEDIMAGE){
|
||||
this->image = new IntelliShapedImage(*dynamic_cast<IntelliShapedImage*>(layer.image));
|
||||
}
|
||||
this->width = layer.width;
|
||||
this->height = layer.height;
|
||||
this->widthOffset = layer.widthOffset;
|
||||
this->heightOffset = layer.heightOffset;
|
||||
this->alpha = layer.alpha;
|
||||
}
|
||||
|
||||
PaintingArea::PaintingArea(int maxWidth, int maxHeight, QWidget*parent)
|
||||
: QWidget(parent){
|
||||
: QLabel(parent){
|
||||
this->Tool = nullptr;
|
||||
this->setLayerDimensions(maxWidth, maxHeight);
|
||||
|
||||
@@ -48,32 +65,48 @@ void PaintingArea::setRenderSettings(bool isFastRenderingOn){
|
||||
}
|
||||
}
|
||||
|
||||
bool PaintingArea::getRenderSettings(){
|
||||
return this->renderSettings.isFastRenderering();
|
||||
}
|
||||
|
||||
void PaintingArea::setLayerDimensions(int maxWidth, int maxHeight){
|
||||
//set standart parameter
|
||||
this->maxWidth = maxWidth;
|
||||
this->maxHeight = maxHeight;
|
||||
Canvas = new QImage(maxWidth,maxHeight, QImage::Format_ARGB32);
|
||||
|
||||
this->offsetXDimension = maxWidth/2;
|
||||
this->offsetYDimension = maxHeight/2;
|
||||
|
||||
// Roots the widget to the top left even if resized
|
||||
setAttribute(Qt::WA_StaticContents);
|
||||
|
||||
}
|
||||
|
||||
int PaintingArea::addLayer(int width, int height, int widthOffset, int heightOffset, IntelliImage::ImageType type){
|
||||
void PaintingArea::setPixelToActive(QColor color, QPoint point){
|
||||
layerBundle[static_cast<size_t>(activeLayer)].image->drawPixel(point, color);
|
||||
}
|
||||
|
||||
void PaintingArea::setPolygonDataToActive(std::vector<QPoint> points){
|
||||
layerBundle[static_cast<size_t>(activeLayer)].image->setPolygon(points);
|
||||
}
|
||||
|
||||
int PaintingArea::addLayer(int width, int height, int widthOffset, int heightOffset,int alpha, ImageType type){
|
||||
LayerObject newLayer;
|
||||
updateTools();
|
||||
newLayer.width = width;
|
||||
newLayer.height = height;
|
||||
newLayer.widthOffset = widthOffset;
|
||||
newLayer.heightOffset = heightOffset;
|
||||
if(type==IntelliImage::ImageType::RASTERIMAGE) {
|
||||
newLayer.alpha = alpha;
|
||||
if(type==ImageType::RASTERIMAGE) {
|
||||
newLayer.image = new IntelliRasterImage(width,height,renderSettings.isFastRenderering());
|
||||
}else if(type==IntelliImage::ImageType::SHAPEDIMAGE) {
|
||||
}else if(type==ImageType::SHAPEDIMAGE) {
|
||||
newLayer.image = new IntelliShapedImage(width, height, renderSettings.isFastRenderering());
|
||||
}
|
||||
newLayer.alpha = 255;
|
||||
this->layerBundle.push_back(newLayer);
|
||||
activeLayer = static_cast<int>(layerBundle.size()) - 1;
|
||||
historyadd();
|
||||
return activeLayer;
|
||||
}
|
||||
|
||||
@@ -98,6 +131,7 @@ void PaintingArea::slotDeleteActiveLayer(){
|
||||
this->layerBundle.erase(layerBundle.begin() + activeLayer);
|
||||
activeLayer--;
|
||||
}
|
||||
historyadd();
|
||||
}
|
||||
|
||||
void PaintingArea::setLayerActive(int idx){
|
||||
@@ -116,11 +150,11 @@ void PaintingArea::setLayerAlpha(int idx, int alpha){
|
||||
}
|
||||
void PaintingArea::setPolygon(int idx){
|
||||
if(idx>=0&&idx<static_cast<int>(layerBundle.size())) {
|
||||
if(layerBundle[static_cast<size_t>(idx)].image->getTypeOfImage()==IntelliImage::ImageType::SHAPEDIMAGE) {
|
||||
if(layerBundle[static_cast<size_t>(idx)].image->getTypeOfImage()==ImageType::SHAPEDIMAGE) {
|
||||
delete this->Tool;
|
||||
this->Tool = new IntelliToolPolygon(this,&colorPicker,&Toolsettings, true);
|
||||
isSettingPolygon = true;
|
||||
this->DummyGui->setToolWidth(5);
|
||||
this->guiReference->setToolWidth(5);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -137,6 +171,13 @@ bool PaintingArea::open(const QString &filePath){
|
||||
return open;
|
||||
}
|
||||
|
||||
void PaintingArea::deleteAllLayers(){
|
||||
for(auto layer: layerBundle){
|
||||
delete layer.image;
|
||||
}
|
||||
layerBundle.clear();
|
||||
}
|
||||
|
||||
// Save the current image
|
||||
bool PaintingArea::save(const QString &filePath, const char*fileFormat){
|
||||
if(layerBundle.size()==0) {
|
||||
@@ -165,6 +206,7 @@ void PaintingArea::movePositionActive(int x, int y){
|
||||
updateTools();
|
||||
layerBundle[static_cast<size_t>(activeLayer)].widthOffset += x;
|
||||
layerBundle[static_cast<size_t>(activeLayer)].heightOffset += y;
|
||||
historyadd();
|
||||
}
|
||||
|
||||
void PaintingArea::moveActiveLayer(int idx){
|
||||
@@ -174,7 +216,8 @@ void PaintingArea::moveActiveLayer(int idx){
|
||||
}else if(idx==-1) {
|
||||
this->selectLayerDown();
|
||||
}
|
||||
DummyGui->UpdateGui();
|
||||
guiReference->UpdateGui();
|
||||
historyadd();
|
||||
}
|
||||
|
||||
void PaintingArea::slotActivateLayer(int a){
|
||||
@@ -248,7 +291,7 @@ int PaintingArea::getMaxHeight(){
|
||||
return this->maxHeight;
|
||||
}
|
||||
|
||||
IntelliImage::ImageType PaintingArea::getTypeOfImageRealLayer(){
|
||||
ImageType PaintingArea::getTypeOfImageRealLayer(){
|
||||
return this->layerBundle[static_cast<size_t>(activeLayer)].image->getTypeOfImage();
|
||||
}
|
||||
|
||||
@@ -265,12 +308,12 @@ void PaintingArea::mousePressEvent(QMouseEvent*event){
|
||||
}
|
||||
if(Tool == nullptr)
|
||||
return;
|
||||
int x = event->x() - layerBundle[static_cast<size_t>(activeLayer)].widthOffset;
|
||||
int y = event->y() - layerBundle[static_cast<size_t>(activeLayer)].heightOffset;
|
||||
int x = event->x() - layerBundle[static_cast<size_t>(activeLayer)].widthOffset-offsetXDimension;
|
||||
int y = event->y() - layerBundle[static_cast<size_t>(activeLayer)].heightOffset-offsetYDimension;
|
||||
if(event->button() == Qt::LeftButton) {
|
||||
Tool->onMouseLeftPressed(x, y);
|
||||
Tool->onMouseLeftPressed(x, y);
|
||||
}else if(event->button() == Qt::RightButton) {
|
||||
Tool->onMouseRightPressed(x, y);
|
||||
Tool->onMouseRightPressed(x, y);
|
||||
}
|
||||
update();
|
||||
}
|
||||
@@ -284,8 +327,8 @@ void PaintingArea::mouseMoveEvent(QMouseEvent*event){
|
||||
}
|
||||
if(Tool == nullptr)
|
||||
return;
|
||||
int x = event->x() - layerBundle[static_cast<size_t>(activeLayer)].widthOffset;
|
||||
int y = event->y() - layerBundle[static_cast<size_t>(activeLayer)].heightOffset;
|
||||
int x = event->x() - layerBundle[static_cast<size_t>(activeLayer)].widthOffset-offsetXDimension;
|
||||
int y = event->y() - layerBundle[static_cast<size_t>(activeLayer)].heightOffset-offsetYDimension;
|
||||
Tool->onMouseMoved(x, y);
|
||||
update();
|
||||
}
|
||||
@@ -296,8 +339,8 @@ void PaintingArea::mouseReleaseEvent(QMouseEvent*event){
|
||||
return;
|
||||
if(Tool == nullptr)
|
||||
return;
|
||||
int x = event->x() - layerBundle[static_cast<size_t>(activeLayer)].widthOffset;
|
||||
int y = event->y() - layerBundle[static_cast<size_t>(activeLayer)].heightOffset;
|
||||
int x = event->x() - layerBundle[static_cast<size_t>(activeLayer)].widthOffset-offsetXDimension;
|
||||
int y = event->y() - layerBundle[static_cast<size_t>(activeLayer)].heightOffset-offsetYDimension;
|
||||
if(event->button() == Qt::LeftButton) {
|
||||
Tool->onMouseLeftReleased(x, y);
|
||||
}else if(event->button() == Qt::RightButton) {
|
||||
@@ -322,11 +365,17 @@ void PaintingArea::wheelEvent(QWheelEvent*event){
|
||||
// The QPaintEvent is sent to widgets that need to
|
||||
// update themselves
|
||||
void PaintingArea::paintEvent(QPaintEvent*event){
|
||||
this->setFixedSize(QSize(maxWidth*2,maxHeight*2));
|
||||
this->drawLayers();
|
||||
|
||||
QPainter painter(this);
|
||||
QRect dirtyRec = event->rect();
|
||||
painter.drawImage(dirtyRec, *Canvas, dirtyRec);
|
||||
QPainter painter(this);
|
||||
|
||||
//insert zoom factor here
|
||||
painter.scale(1,1);
|
||||
|
||||
//calulate image here for scroll
|
||||
//Todo set offset in first to parameters and calulate them into mouse position
|
||||
painter.drawImage(0, 0, *Canvas, -offsetXDimension, -offsetYDimension);
|
||||
update();
|
||||
}
|
||||
|
||||
@@ -435,6 +484,10 @@ QImage PaintingArea::getImageDataOfActiveLayer(){
|
||||
return returnImage;
|
||||
}
|
||||
|
||||
std::vector<LayerObject>* PaintingArea::getLayerBundle(){
|
||||
return &layerBundle;
|
||||
}
|
||||
|
||||
void PaintingArea::updateTools(){
|
||||
if(Tool!=nullptr) {
|
||||
if(Tool->getIsDrawing()) {
|
||||
@@ -449,3 +502,33 @@ void PaintingArea::updateTools(){
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void PaintingArea::historyadd(){
|
||||
|
||||
if (++historyPresent == 100){
|
||||
historyPresent = 0;
|
||||
}
|
||||
historyMaxFuture = historyPresent;
|
||||
if (historyPresent == historyMaxPast)
|
||||
if (++historyMaxPast == 100)
|
||||
historyMaxPast = 0;
|
||||
history[static_cast<size_t>(historyPresent)] = layerBundle;
|
||||
}
|
||||
|
||||
void PaintingArea::historyGoBack(){
|
||||
if (historyPresent != historyMaxPast){
|
||||
if (--historyPresent == -1)
|
||||
historyPresent = 99;
|
||||
layerBundle = history[static_cast<size_t>(historyPresent)];
|
||||
}
|
||||
this->guiReference->UpdateGui();
|
||||
}
|
||||
|
||||
void PaintingArea::historyGoForward(){
|
||||
if (historyPresent != historyMaxFuture){
|
||||
if (++historyPresent == 100)
|
||||
historyPresent = 0;
|
||||
layerBundle = history[static_cast<size_t>(historyPresent)];
|
||||
}
|
||||
this->guiReference->UpdateGui();
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include <QPoint>
|
||||
#include <QWidget>
|
||||
#include <QList>
|
||||
#include "GUI/IntelliPhotoGui.h"
|
||||
#include <QLabel>
|
||||
#include "Image/IntelliImage.h"
|
||||
#include "Image/IntelliRasterImage.h"
|
||||
#include "Image/IntelliShapedImage.h"
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
//for unit testing
|
||||
class UnitTest;
|
||||
|
||||
class IntelliPhotoGui;
|
||||
/*!
|
||||
* \brief The LayerObject struct holds all the information needed to construct a layer
|
||||
*/
|
||||
@@ -45,12 +45,16 @@ struct LayerObject {
|
||||
* \brief alpha - Stores the alpha value of the layer (default=255).
|
||||
*/
|
||||
int alpha = 255;
|
||||
|
||||
LayerObject();
|
||||
|
||||
LayerObject(const LayerObject& layer);
|
||||
};
|
||||
|
||||
/*!
|
||||
* \brief The PaintingArea class manages the methods and stores information about the current painting area, which is the currently opened project
|
||||
*/
|
||||
class PaintingArea : public QWidget
|
||||
class PaintingArea : public QLabel
|
||||
{
|
||||
friend UnitTest;
|
||||
// Declares our class as a QObject which is the base class
|
||||
@@ -79,6 +83,12 @@ PaintingArea(int maxWidth = 600, int maxHeight = 600, QWidget*parent = nullptr);
|
||||
*/
|
||||
void setRenderSettings(bool isFastRenderingOn);
|
||||
|
||||
/*!
|
||||
* \brief getRenderSettings updates all Images to the new Rendersetting.
|
||||
* \param isFastRenderingOn is the new given flag for the FastRenderer.
|
||||
*/
|
||||
bool getRenderSettings();
|
||||
|
||||
/*!
|
||||
* \brief The open method is used for loading a picture into the current layer.
|
||||
* \param filePath - Path and Name which are used to determine where the to-be-opened file is stored.
|
||||
@@ -93,16 +103,21 @@ bool open(const QString &filePath);
|
||||
*/
|
||||
bool save(const QString &filePath, const char*fileFormat);
|
||||
|
||||
/*!
|
||||
* \brief deleteAllLayers deletes all layers
|
||||
*/
|
||||
void deleteAllLayers();
|
||||
/*!
|
||||
* \brief The addLayer adds a layer to the current project/ painting area
|
||||
* \param width - Width of the layer in pixles
|
||||
* \param height - Height of the layer in pixles
|
||||
* \param widthOffset - Offset of the layer measured to the left border of the painting area in pixles
|
||||
* \param heightOffset - Offset of the layer measured to the top border of the painting area in pixles
|
||||
* \param alpha - Transparence of the layer
|
||||
* \param type - Defining the ImageType of the new layer
|
||||
* \return Returns the number of layers in the project
|
||||
*/
|
||||
int addLayer(int width, int height, int widthOffset = 0, int heightOffset = 0, IntelliImage::ImageType type = IntelliImage::ImageType::RASTERIMAGE);
|
||||
int addLayer(int width, int height, int widthOffset = 0, int heightOffset = 0, int alpha=255, ImageType type = ImageType::RASTERIMAGE);
|
||||
/*!
|
||||
* \brief The addLayerAt adds a layer to the current project/ painting area at a specific position in the layer stack
|
||||
* \param idx - Index of the position the new layer should be added
|
||||
@@ -113,7 +128,7 @@ int addLayer(int width, int height, int widthOffset = 0, int heightOffset = 0, I
|
||||
* \param type - Defining the ImageType of the new layer
|
||||
* \return Returns the id of the layer position
|
||||
*/
|
||||
int addLayerAt(int idx, int width, int height, int widthOffset = 0, int heightOffset = 0, IntelliImage::ImageType type = IntelliImage::ImageType::RASTERIMAGE);
|
||||
int addLayerAt(int idx, int width, int height, int widthOffset = 0, int heightOffset = 0, ImageType type = ImageType::RASTERIMAGE);
|
||||
/*!
|
||||
* \brief The deleteLayer method removes a layer at a given idx
|
||||
* \param idx - The index of the layer to be removed
|
||||
@@ -184,7 +199,7 @@ int getMaxWidth();
|
||||
|
||||
int getMaxHeight();
|
||||
|
||||
IntelliImage::ImageType getTypeOfImageRealLayer();
|
||||
ImageType getTypeOfImageRealLayer();
|
||||
|
||||
std::vector<QPoint> getPolygonDataOfRealLayer();
|
||||
|
||||
@@ -198,9 +213,23 @@ IntelliImage* getImageOfActiveLayer();
|
||||
*/
|
||||
QImage getImageDataOfActiveLayer();
|
||||
|
||||
/*!
|
||||
* \brief getLayerBundle returns the real active layerbundle (care!)
|
||||
* \return the reference of the currentLayerBundle
|
||||
*/
|
||||
std::vector<LayerObject>* getLayerBundle();
|
||||
|
||||
IntelliToolsettings Toolsettings;
|
||||
IntelliColorPicker colorPicker;
|
||||
|
||||
void historyGoBack();
|
||||
void historyGoForward();
|
||||
|
||||
void setLayerDimensions(int maxWidth, int maxHeight);
|
||||
|
||||
void setPixelToActive(QColor color, QPoint point);
|
||||
|
||||
void setPolygonDataToActive(std::vector<QPoint> points);
|
||||
public slots:
|
||||
/*!
|
||||
* \brief The slotActivateLayer method handles the event of selecting one layer as active
|
||||
@@ -222,12 +251,16 @@ void wheelEvent(QWheelEvent*event) override;
|
||||
void paintEvent(QPaintEvent*event) override;
|
||||
|
||||
private:
|
||||
void setLayerDimensions(int maxWidth, int maxHeight);
|
||||
//offset for the displayable
|
||||
int offsetXDimension;
|
||||
int offsetYDimension;
|
||||
|
||||
void selectLayerUp();
|
||||
void selectLayerDown();
|
||||
IntelliTool* copyActiveTool();
|
||||
|
||||
QImage* Canvas;
|
||||
QImage ScaledCanvas;
|
||||
int maxWidth;
|
||||
int maxHeight;
|
||||
|
||||
@@ -235,7 +268,7 @@ bool isSettingPolygon = false;
|
||||
|
||||
IntelliRenderSettings renderSettings;
|
||||
IntelliTool* Tool;
|
||||
IntelliPhotoGui* DummyGui;
|
||||
IntelliPhotoGui* guiReference;
|
||||
|
||||
std::vector<LayerObject> layerBundle;
|
||||
int activeLayer = -1;
|
||||
@@ -245,6 +278,14 @@ void drawLayers(bool forSaving = false);
|
||||
bool createTempTopLayer(int idx);
|
||||
|
||||
void updateTools();
|
||||
|
||||
std::vector<LayerObject> history[100] = {layerBundle};
|
||||
int historyMaxPast = 0;
|
||||
int historyMaxFuture = 0;
|
||||
int historyPresent = 0;
|
||||
|
||||
void historyadd();
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "IntelliTool.h"
|
||||
#include "Layer/PaintingArea.h"
|
||||
#include "GUI/IntelliPhotoGui.h"
|
||||
|
||||
IntelliTool::IntelliTool(PaintingArea* Area, IntelliColorPicker* colorPicker, IntelliToolsettings* Toolsettings){
|
||||
this->Area = Area;
|
||||
@@ -50,7 +51,7 @@ void IntelliTool::onMouseMoved(int x, int y){
|
||||
|
||||
void IntelliTool::onWheelScrolled(int value){
|
||||
//if needed for future general tasks implement in here
|
||||
Area->DummyGui->setToolWidth(value + Toolsettings->getLineWidth());
|
||||
Area->guiReference->setToolWidth(value + Toolsettings->getLineWidth());
|
||||
}
|
||||
|
||||
bool IntelliTool::createToolLayer(){
|
||||
@@ -88,7 +89,8 @@ void IntelliTool::mergeToolLayer(){
|
||||
if(Canvas->image->getPolygonData().size() > 0) {
|
||||
activeLayer->image->setPolygon(Canvas->image->getPolygonData());
|
||||
}
|
||||
Area->DummyGui->UpdateGui();
|
||||
Area->guiReference->UpdateGui();
|
||||
Area->historyadd();
|
||||
}
|
||||
|
||||
void IntelliTool::deleteToolLayer(){
|
||||
|
||||
@@ -24,7 +24,7 @@ IntelliToolPolygon::~IntelliToolPolygon(){
|
||||
}
|
||||
|
||||
void IntelliToolPolygon::onMouseLeftPressed(int x, int y){
|
||||
if(!drawingOfPolygon && Area->getTypeOfImageRealLayer() == IntelliImage::ImageType::SHAPEDIMAGE && x > 0 && y > 0 && x<Area->getWidthOfActive() && y<Area->getHeightOfActive()) {
|
||||
if(!drawingOfPolygon && Area->getTypeOfImageRealLayer() == ImageType::SHAPEDIMAGE && x > 0 && y > 0 && x<Area->getWidthOfActive() && y<Area->getHeightOfActive()) {
|
||||
if(Area->getPolygonDataOfRealLayer().size()>2) {
|
||||
std::vector<Triangle> Triangles = IntelliTriangulation::calculateTriangles(Area->getPolygonDataOfRealLayer());
|
||||
QPoint Point(x,y);
|
||||
@@ -37,7 +37,7 @@ void IntelliToolPolygon::onMouseLeftPressed(int x, int y){
|
||||
isInside = true;
|
||||
}
|
||||
}
|
||||
else if(!drawingOfPolygon && Area->getTypeOfImageRealLayer() == IntelliImage::ImageType::RASTERIMAGE && x >= 0 && y >= 0 && x<Area->getWidthOfActive() && y<Area->getHeightOfActive()) {
|
||||
else if(!drawingOfPolygon && Area->getTypeOfImageRealLayer() == ImageType::RASTERIMAGE && x >= 0 && y >= 0 && x<Area->getWidthOfActive() && y<Area->getHeightOfActive()) {
|
||||
isInside = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
#include <QApplication>
|
||||
#include <QDebug>
|
||||
#include <vector>
|
||||
#include <fstream>
|
||||
|
||||
int main(int argc, char*argv[]){
|
||||
// The main application
|
||||
QApplication app(argc, argv);
|
||||
|
||||
// Create and open the main window
|
||||
IntelliPhotoGui window;
|
||||
window.show();
|
||||
|
||||
Reference in New Issue
Block a user