diff --git a/Abgabe/presentation.md b/Abgabe/presentation.md deleted file mode 100644 index 4649bb3..0000000 --- a/Abgabe/presentation.md +++ /dev/null @@ -1,3 +0,0 @@ -# Presentation Links - -- 0.3 https://prezi.com/view/M593VBJhmfwQzuqt3t6f/ diff --git a/README.md b/README.md index 57db251..69598fe 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,22 @@ # IntelliPhoto -For the user manual see docs/manual.pdf \ No newline at end of file +For the user manual see `docs/manual.pdf` + +## Content + +- `src` - Source Code +- `docs` - Documentation of the source code and user manual +- `Examples` - Temporary folder for example pictures +- `Abgabe` - Files that were submitted + +## Pesentations + +- 0.3 https://prezi.com/view/M593VBJhmfwQzuqt3t6f/ + +## Branching + +- `master` branch: current state of the program, pull requests only by maintainers or developers +- `dev` branch: state of development for next week, will be merged every Thursday, pushable for maintainers, pull requests for everyone +- `dev-X` branches: feature development branches which will be merged into dev, when tested + +Every Thursday dev and master will be merged and tagged with the current version. diff --git a/src/GUI/IntelliPhotoGui.cpp b/src/GUI/IntelliPhotoGui.cpp index 119bbfd..a25999b 100644 --- a/src/GUI/IntelliPhotoGui.cpp +++ b/src/GUI/IntelliPhotoGui.cpp @@ -7,8 +7,7 @@ #include "Layer/PaintingArea.h" // IntelliPhotoGui constructor -IntelliPhotoGui::IntelliPhotoGui() -{ +IntelliPhotoGui::IntelliPhotoGui(){ //create Gui elements and lay them out createGui(); // Create actions @@ -22,10 +21,8 @@ IntelliPhotoGui::IntelliPhotoGui() showMaximized(); } - // User tried to close the app -void IntelliPhotoGui::closeEvent(QCloseEvent *event) -{ +void IntelliPhotoGui::closeEvent(QCloseEvent *event){ // If they try to close maybeSave() returns true // if no changes have been made and the app closes if (maybeSave()) { @@ -39,8 +36,7 @@ void IntelliPhotoGui::closeEvent(QCloseEvent *event) // Check if the current image has been changed and then // open a dialog to open a file -void IntelliPhotoGui::slotOpen() -{ +void IntelliPhotoGui::slotOpen(){ // Check if changes have been made since last save // maybeSave() returns true if no changes have been made if (maybeSave()) { @@ -59,8 +55,7 @@ void IntelliPhotoGui::slotOpen() } // Called when the user clicks Save As in the menu -void IntelliPhotoGui::slotSave() -{ +void IntelliPhotoGui::slotSave(){ // A QAction represents the action of the user clicking QAction *action = qobject_cast(sender()); @@ -72,8 +67,7 @@ void IntelliPhotoGui::slotSave() } // Opens a dialog that allows the user to create a New Layer -void IntelliPhotoGui::slotCreateNewLayer() -{ +void IntelliPhotoGui::slotCreateNewLayer(){ // Stores button value bool ok1, ok2; @@ -95,8 +89,7 @@ void IntelliPhotoGui::slotCreateNewLayer() } // Opens a dialog that allows the user to delete a Layer -void IntelliPhotoGui::slotDeleteLayer() -{ +void IntelliPhotoGui::slotDeleteLayer(){ // Stores button value bool ok; @@ -119,7 +112,6 @@ void slotCreateFloodFillTool(){ } - void IntelliPhotoGui::slotSetActiveAlpha(){ // Stores button value bool ok1, ok2; @@ -239,18 +231,14 @@ void IntelliPhotoGui::slotCreateLineTool(){ } // Open an about dialog -void IntelliPhotoGui::slotAboutDialog() -{ +void IntelliPhotoGui::slotAboutDialog(){ // Window title and text to display QMessageBox::about(this, tr("About Painting"), tr("

IntelliPhoto Some nice ass looking software

")); } // Define menu actions that call functions -void IntelliPhotoGui::createActions() -{ - - +void IntelliPhotoGui::createActions(){ // Get a list of the supported file formats // QImageWriter is used to write images to files foreach (QByteArray format, QImageWriter::supportedImageFormats()) { @@ -277,8 +265,6 @@ void IntelliPhotoGui::createActions() // Attach each PNG in save Menu actionSaveAs.append(pngSaveAction); - - // Create exit action and tie to IntelliPhotoGui::close() actionExit = new QAction(tr("&Exit"), this); actionExit->setShortcuts(QKeySequence::Quit); @@ -357,8 +343,7 @@ void IntelliPhotoGui::createActions() } // Create the menubar -void IntelliPhotoGui::createMenus() -{ +void IntelliPhotoGui::createMenus(){ // Create Save As option and the list of file types saveAsMenu = new QMenu(tr("&Save As"), this); foreach (QAction *action, actionSaveAs) @@ -440,8 +425,7 @@ void IntelliPhotoGui::setIntelliStyle(){ this->menuBar()->setStyleSheet("color:rgb(255,255,255)"); } -bool IntelliPhotoGui::maybeSave() -{ +bool IntelliPhotoGui::maybeSave(){ // Check for changes since last save //TODO insert variable for modified status here to make an save exit message @@ -468,8 +452,7 @@ bool IntelliPhotoGui::maybeSave() return true; } -bool IntelliPhotoGui::saveFile(const QByteArray &fileFormat) -{ +bool IntelliPhotoGui::saveFile(const QByteArray &fileFormat){ // Define path, name and default file type QString initialPath = QDir::currentPath() + "/untitled." + fileFormat; @@ -485,9 +468,7 @@ bool IntelliPhotoGui::saveFile(const QByteArray &fileFormat) if (fileName.isEmpty()) { return false; } else { - // Call for the file to be saved return paintingArea->save(fileName, fileFormat.constData()); } } - diff --git a/src/GUI/IntelliPhotoGui.h b/src/GUI/IntelliPhotoGui.h index c204cce..3865c1f 100644 --- a/src/GUI/IntelliPhotoGui.h +++ b/src/GUI/IntelliPhotoGui.h @@ -16,8 +16,7 @@ class IntelliTool; class IntelliColorPicker; -class IntelliPhotoGui : public QMainWindow -{ +class IntelliPhotoGui : public QMainWindow{ // Declares our class as a QObject which is the base class // for all Qt objects // QObjects handle events diff --git a/src/IntelliHelper/IntelliHelper.cpp b/src/IntelliHelper/IntelliHelper.cpp index 0cd9460..cb5d6a8 100644 --- a/src/IntelliHelper/IntelliHelper.cpp +++ b/src/IntelliHelper/IntelliHelper.cpp @@ -1,4 +1,2 @@ #include"IntelliHelper.h" #include - - diff --git a/src/IntelliHelper/IntelliHelper.h b/src/IntelliHelper/IntelliHelper.h index ef6b32a..1bad2b9 100644 --- a/src/IntelliHelper/IntelliHelper.h +++ b/src/IntelliHelper/IntelliHelper.h @@ -12,7 +12,6 @@ public: return (p1.x()-p3.x())*(p2.y()-p3.y())-(p2.x()-p3.x())*(p1.y()-p3.y()); } - static inline bool isInTriangle(QPoint& A, QPoint& B, QPoint& C, QPoint& P){ float val1, val2, val3; bool neg, pos; diff --git a/src/Layer/PaintingArea.cpp b/src/Layer/PaintingArea.cpp index 7fff2a9..9099489 100644 --- a/src/Layer/PaintingArea.cpp +++ b/src/Layer/PaintingArea.cpp @@ -14,7 +14,6 @@ #include "Tool/IntelliToolPlain.h" #include "Tool/IntelliToolLine.h" - PaintingArea::PaintingArea(int maxWidth, int maxHeight, QWidget *parent) :QWidget(parent){ this->Tool = nullptr; @@ -40,7 +39,6 @@ PaintingArea::~PaintingArea(){ delete Tool; } - void PaintingArea::setUp(int maxWidth, int maxHeight){ //set standart parameter this->maxWidth = maxWidth; @@ -85,7 +83,7 @@ void PaintingArea::slotDeleteActiveLayer(){ } } -void PaintingArea::setLayerToActive(int index) { +void PaintingArea::setLayerToActive(int index){ if(index>=0&&index(layerBundle.size())){ this->activeLayer=index; } @@ -97,10 +95,8 @@ void PaintingArea::setAlphaOfLayer(int index, int alpha){ } } - // Used to load the image and place it in the widget -bool PaintingArea::open(const QString &fileName) -{ +bool PaintingArea::open(const QString &fileName){ if(this->activeLayer==-1){ return false; } @@ -112,8 +108,7 @@ bool PaintingArea::open(const QString &fileName) } // Save the current image -bool PaintingArea::save(const QString &fileName, const char *fileFormat) -{ +bool PaintingArea::save(const QString &fileName, const char *fileFormat){ if(layerBundle.size()==0){ return false; } @@ -136,7 +131,6 @@ bool PaintingArea::save(const QString &fileName, const char *fileFormat) } } - // Color the image area with white void PaintingArea::floodFill(int r, int g, int b, int a){ if(this->activeLayer==-1){ @@ -198,8 +192,7 @@ void PaintingArea::createLineTool(){ // If a mouse button is pressed check if it was the // left button and if so store the current position // Set that we are currently drawing -void PaintingArea::mousePressEvent(QMouseEvent *event) -{ +void PaintingArea::mousePressEvent(QMouseEvent *event){ if(Tool == nullptr) return; int x = event->x()-layerBundle[activeLayer].widthOffset; @@ -212,12 +205,10 @@ void PaintingArea::mousePressEvent(QMouseEvent *event) update(); } - // When the mouse moves if the left button is clicked // we call the drawline function which draws a line // from the last position to the current -void PaintingArea::mouseMoveEvent(QMouseEvent *event) -{ +void PaintingArea::mouseMoveEvent(QMouseEvent *event){ if(Tool == nullptr) return; int x = event->x()-layerBundle[activeLayer].widthOffset; @@ -227,8 +218,7 @@ void PaintingArea::mouseMoveEvent(QMouseEvent *event) } // If the button is released we set variables to stop drawing -void PaintingArea::mouseReleaseEvent(QMouseEvent *event) -{ +void PaintingArea::mouseReleaseEvent(QMouseEvent *event){ if(Tool == nullptr) return; int x = event->x()-layerBundle[activeLayer].widthOffset; @@ -244,8 +234,7 @@ void PaintingArea::mouseReleaseEvent(QMouseEvent *event) // QPainter provides functions to draw on the widget // The QPaintEvent is sent to widgets that need to // update themselves -void PaintingArea::paintEvent(QPaintEvent *event) -{ +void PaintingArea::paintEvent(QPaintEvent *event){ this->assembleLayers(); QPainter painter(this); @@ -256,13 +245,11 @@ void PaintingArea::paintEvent(QPaintEvent *event) // Resize the image to slightly larger then the main window // to cut down on the need to resize the image -void PaintingArea::resizeEvent(QResizeEvent *event) -{ +void PaintingArea::resizeEvent(QResizeEvent *event){ //TODO wait till tool works update(); } - void PaintingArea::resizeImage(QImage *image_res, const QSize &newSize){ //TODO implement } @@ -281,7 +268,6 @@ void PaintingArea::activateLowerLayer(){ } } - void PaintingArea::assembleLayers(bool forSaving){ if(forSaving){ Canvas->fill(Qt::GlobalColor::transparent); diff --git a/src/Tool/IntelliToolLine.h b/src/Tool/IntelliToolLine.h index 637eb73..ffde866 100644 --- a/src/Tool/IntelliToolLine.h +++ b/src/Tool/IntelliToolLine.h @@ -10,8 +10,7 @@ enum class LineStyle{ DOTTED_LINE }; -class IntelliToolLine : public IntelliTool -{ +class IntelliToolLine : public IntelliTool{ QPoint start; int lineWidth; LineStyle lineStyle; diff --git a/src/Tool/IntelliToolPlain.h b/src/Tool/IntelliToolPlain.h index 9e468f4..9ff1b7a 100644 --- a/src/Tool/IntelliToolPlain.h +++ b/src/Tool/IntelliToolPlain.h @@ -4,8 +4,7 @@ #include "IntelliTool.h" #include "QColor" -class IntelliToolPlainTool : public IntelliTool -{ +class IntelliToolPlainTool : public IntelliTool{ public: IntelliToolPlainTool(PaintingArea *Area, IntelliColorPicker* colorPicker); diff --git a/src/main.cpp b/src/main.cpp index 6ada0cb..771a872 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2,8 +2,7 @@ #include #include -int main(int argc, char *argv[]) -{ +int main(int argc, char *argv[]){ // The main application QApplication app(argc, argv); @@ -14,7 +13,3 @@ int main(int argc, char *argv[]) return app.exec(); } - - - -