Initial commit
This commit is contained in:
commit
7c345469e9
301
.gitignore
vendored
Normal file
301
.gitignore
vendored
Normal file
@ -0,0 +1,301 @@
|
||||
## Core latex/pdflatex auxiliary files:
|
||||
*.aux
|
||||
*.lof
|
||||
*.log
|
||||
*.lot
|
||||
*.fls
|
||||
*.out
|
||||
*.toc
|
||||
*.fmt
|
||||
*.fot
|
||||
*.cb
|
||||
*.cb2
|
||||
.*.lb
|
||||
|
||||
## Intermediate documents:
|
||||
*.dvi
|
||||
*.xdv
|
||||
*-converted-to.*
|
||||
# these rules might exclude image files for figures etc.
|
||||
# *.ps
|
||||
# *.eps
|
||||
# *.pdf
|
||||
|
||||
## Generated if empty string is given at "Please type another file name for output:"
|
||||
.pdf
|
||||
|
||||
## Bibliography auxiliary files (bibtex/biblatex/biber):
|
||||
*.bbl
|
||||
*.bcf
|
||||
*.blg
|
||||
*-blx.aux
|
||||
*-blx.bib
|
||||
*.run.xml
|
||||
|
||||
## Build tool auxiliary files:
|
||||
*.fdb_latexmk
|
||||
*.synctex
|
||||
*.synctex(busy)
|
||||
*.synctex.gz
|
||||
*.synctex.gz(busy)
|
||||
*.pdfsync
|
||||
|
||||
## Build tool directories for auxiliary files
|
||||
# latexrun
|
||||
latex.out/
|
||||
|
||||
## Auxiliary and intermediate files from other packages:
|
||||
# algorithms
|
||||
*.alg
|
||||
*.loa
|
||||
|
||||
# achemso
|
||||
acs-*.bib
|
||||
|
||||
# amsthm
|
||||
*.thm
|
||||
|
||||
# beamer
|
||||
*.nav
|
||||
*.pre
|
||||
*.snm
|
||||
*.vrb
|
||||
|
||||
# changes
|
||||
*.soc
|
||||
|
||||
# comment
|
||||
*.cut
|
||||
|
||||
# cprotect
|
||||
*.cpt
|
||||
|
||||
# elsarticle (documentclass of Elsevier journals)
|
||||
*.spl
|
||||
|
||||
# endnotes
|
||||
*.ent
|
||||
|
||||
# fixme
|
||||
*.lox
|
||||
|
||||
# feynmf/feynmp
|
||||
*.mf
|
||||
*.mp
|
||||
*.t[1-9]
|
||||
*.t[1-9][0-9]
|
||||
*.tfm
|
||||
|
||||
#(r)(e)ledmac/(r)(e)ledpar
|
||||
*.end
|
||||
*.?end
|
||||
*.[1-9]
|
||||
*.[1-9][0-9]
|
||||
*.[1-9][0-9][0-9]
|
||||
*.[1-9]R
|
||||
*.[1-9][0-9]R
|
||||
*.[1-9][0-9][0-9]R
|
||||
*.eledsec[1-9]
|
||||
*.eledsec[1-9]R
|
||||
*.eledsec[1-9][0-9]
|
||||
*.eledsec[1-9][0-9]R
|
||||
*.eledsec[1-9][0-9][0-9]
|
||||
*.eledsec[1-9][0-9][0-9]R
|
||||
|
||||
# glossaries
|
||||
*.acn
|
||||
*.acr
|
||||
*.glg
|
||||
*.glo
|
||||
*.gls
|
||||
*.glsdefs
|
||||
*.lzo
|
||||
*.lzs
|
||||
*.slg
|
||||
*.slo
|
||||
*.sls
|
||||
|
||||
# uncomment this for glossaries-extra (will ignore makeindex's style files!)
|
||||
# *.ist
|
||||
|
||||
# gnuplot
|
||||
*.gnuplot
|
||||
*.table
|
||||
|
||||
# gnuplottex
|
||||
*-gnuplottex-*
|
||||
|
||||
# gregoriotex
|
||||
*.gaux
|
||||
*.glog
|
||||
*.gtex
|
||||
|
||||
# htlatex
|
||||
*.4ct
|
||||
*.4tc
|
||||
*.idv
|
||||
*.lg
|
||||
*.trc
|
||||
*.xref
|
||||
|
||||
# hyperref
|
||||
*.brf
|
||||
|
||||
# knitr
|
||||
*-concordance.tex
|
||||
# TODO Uncomment the next line if you use knitr and want to ignore its generated tikz files
|
||||
# *.tikz
|
||||
*-tikzDictionary
|
||||
|
||||
# listings
|
||||
*.lol
|
||||
|
||||
# luatexja-ruby
|
||||
*.ltjruby
|
||||
|
||||
# makeidx
|
||||
*.idx
|
||||
*.ilg
|
||||
*.ind
|
||||
|
||||
# minitoc
|
||||
*.maf
|
||||
*.mlf
|
||||
*.mlt
|
||||
*.mtc[0-9]*
|
||||
*.slf[0-9]*
|
||||
*.slt[0-9]*
|
||||
*.stc[0-9]*
|
||||
|
||||
# minted
|
||||
_minted*
|
||||
*.pyg
|
||||
|
||||
# morewrites
|
||||
*.mw
|
||||
|
||||
# newpax
|
||||
*.newpax
|
||||
|
||||
# nomencl
|
||||
*.nlg
|
||||
*.nlo
|
||||
*.nls
|
||||
|
||||
# pax
|
||||
*.pax
|
||||
|
||||
# pdfpcnotes
|
||||
*.pdfpc
|
||||
|
||||
# sagetex
|
||||
*.sagetex.sage
|
||||
*.sagetex.py
|
||||
*.sagetex.scmd
|
||||
|
||||
# scrwfile
|
||||
*.wrt
|
||||
|
||||
# svg
|
||||
svg-inkscape/
|
||||
|
||||
# sympy
|
||||
*.sout
|
||||
*.sympy
|
||||
sympy-plots-for-*.tex/
|
||||
|
||||
# pdfcomment
|
||||
*.upa
|
||||
*.upb
|
||||
|
||||
# pythontex
|
||||
*.pytxcode
|
||||
pythontex-files-*/
|
||||
|
||||
# tcolorbox
|
||||
*.listing
|
||||
|
||||
# thmtools
|
||||
*.loe
|
||||
|
||||
# TikZ & PGF
|
||||
*.dpth
|
||||
*.md5
|
||||
*.auxlock
|
||||
|
||||
# titletoc
|
||||
*.ptc
|
||||
|
||||
# todonotes
|
||||
*.tdo
|
||||
|
||||
# vhistory
|
||||
*.hst
|
||||
*.ver
|
||||
|
||||
# easy-todo
|
||||
*.lod
|
||||
|
||||
# xcolor
|
||||
*.xcp
|
||||
|
||||
# xmpincl
|
||||
*.xmpi
|
||||
|
||||
# xindy
|
||||
*.xdy
|
||||
|
||||
# xypic precompiled matrices and outlines
|
||||
*.xyc
|
||||
*.xyd
|
||||
|
||||
# endfloat
|
||||
*.ttt
|
||||
*.fff
|
||||
|
||||
# Latexian
|
||||
TSWLatexianTemp*
|
||||
|
||||
## Editors:
|
||||
# WinEdt
|
||||
*.bak
|
||||
*.sav
|
||||
|
||||
# Texpad
|
||||
.texpadtmp
|
||||
|
||||
# LyX
|
||||
*.lyx~
|
||||
|
||||
# Kile
|
||||
*.backup
|
||||
|
||||
# gummi
|
||||
.*.swp
|
||||
|
||||
# KBibTeX
|
||||
*~[0-9]*
|
||||
|
||||
# TeXnicCenter
|
||||
*.tps
|
||||
|
||||
# auto folder when using emacs and auctex
|
||||
./auto/*
|
||||
*.el
|
||||
|
||||
# expex forward references with \gathertags
|
||||
*-tags.tex
|
||||
|
||||
# standalone packages
|
||||
*.sta
|
||||
|
||||
# Makeindex log files
|
||||
*.lpz
|
||||
|
||||
# xwatermark package
|
||||
*.xwm
|
||||
|
||||
# REVTeX puts footnotes in the bibliography by default, unless the nofootinbib
|
||||
# option is specified. Footnotes are the stored in a file with suffix Notes.bib.
|
||||
# Uncomment the next line to have this generated file ignored.
|
||||
#*Notes.bib
|
BIN
bachelorproject.pdf
Normal file
BIN
bachelorproject.pdf
Normal file
Binary file not shown.
54
bachelorproject.tex
Normal file
54
bachelorproject.tex
Normal file
@ -0,0 +1,54 @@
|
||||
\documentclass{usiinfbachelorproject}
|
||||
|
||||
\captionsetup{labelfont={bf}}
|
||||
|
||||
\author{Arnaud Fauconnet}
|
||||
|
||||
\title{From flying balls to colliding polygons}
|
||||
\subtitle{2D Physics Engine: Rigid Body Simulation}
|
||||
\versiondate{\today}
|
||||
|
||||
\begin{committee}
|
||||
\advisor[Universit\`a della Svizzera Italiana,
|
||||
Switzerland]{Prof.}{Antonio}{Carzaniga}
|
||||
\end{committee}
|
||||
|
||||
\abstract {
|
||||
Physics engines are a fun and interesting way to learn about a lot of
|
||||
different subjects. First the theoretical concepts, such as the equations
|
||||
that dictate the motion of the objects, together with their components, need
|
||||
to be thoroughly understood. Then there is the necessity of finding a way to
|
||||
represent all of those concepts in a given programming language and to
|
||||
make them as efficient as possible so that the simulation runs fluidly.
|
||||
The task to be completed here was to extend an already existing
|
||||
physics engine that only made circles bounce off each other. The extension
|
||||
was focused on having the ability to generate some arbitrary polygons and
|
||||
make them bounce off each other in a physically accurate way. The main
|
||||
issues that rose up during the development of the extension: determining the
|
||||
inertia of a arbitrary polygon, which is important for realistic
|
||||
impacts; having an accurate collision detection system, which allows the
|
||||
engine to know when to make two polygons bounce off each other. Once those
|
||||
aspects were worked on and polished, the rest of the implementation went
|
||||
smoothly.
|
||||
|
||||
}
|
||||
|
||||
|
||||
\usepackage{subfiles} % Best loaded last in the preamble
|
||||
|
||||
\begin{document}
|
||||
\maketitle
|
||||
\tableofcontents
|
||||
|
||||
|
||||
\subfile{./sections/intro.tex}
|
||||
\subfile{./sections/tech_background.tex}
|
||||
\subfile{./sections/theoretical_background.tex}
|
||||
\subfile{./sections/solution.tex}
|
||||
\subfile{./sections/conclusion.tex}
|
||||
|
||||
%%%%%
|
||||
\bibliographystyle{abbrv}
|
||||
\bibliography{references}
|
||||
|
||||
\end{document}
|
BIN
logo-info.pdf
Normal file
BIN
logo-info.pdf
Normal file
Binary file not shown.
22
questions.md
Normal file
22
questions.md
Normal file
@ -0,0 +1,22 @@
|
||||
# Bachelor Project Questions
|
||||
|
||||
|
||||
## Code
|
||||
### Question
|
||||
|
||||
In `main.cc:7`, there is the line
|
||||
```c
|
||||
#include <gdk/gdkkeysyms.h>
|
||||
```
|
||||
|
||||
But I have the compiler error that the `gdk/gdkkeysyms.h` file is not found.
|
||||
|
||||
How do you install the `gdk`? Which version of `gtk` are you using?
|
||||
|
||||
### Answer (provisional)
|
||||
I ran the command
|
||||
```bash
|
||||
bear -- make
|
||||
```
|
||||
It produced a `compile_commands.json` that the LSP uses to know which
|
||||
directories to include.
|
36
references.bib
Normal file
36
references.bib
Normal file
@ -0,0 +1,36 @@
|
||||
@misc{Cairo:Docs,
|
||||
author = {Cairoglyphics},
|
||||
title = {Cairo Documentation},
|
||||
year = 2016,
|
||||
url = {https://www.cairographics.org/documentation/},
|
||||
urldate = {2023-03-10}
|
||||
}
|
||||
@misc{Cairo:Tutorial,
|
||||
author = {Cairoglyphics},
|
||||
title = {Cairo Tutorial},
|
||||
year = 2012,
|
||||
url = {https://www.cairographics.org/tutorial/},
|
||||
urldate = {2023-03-10}
|
||||
}
|
||||
@article{collisions,
|
||||
author = "Jiménez, Juan José and Segura, Rafael J. and Feito, Francisco R.",
|
||||
title = "Efficient collision detection between 2D polygons",
|
||||
journal = "Journal of WSCG",
|
||||
year = 2004,
|
||||
volume = "12",
|
||||
number = "1-3",
|
||||
pages = "191--198"
|
||||
}
|
||||
@article{convexcollisionsSAT,
|
||||
title={Intersection of convex objects: The method of separating axes},
|
||||
author={Eberly, David},
|
||||
journal={WWW page},
|
||||
year={2001}
|
||||
}
|
||||
@article{jovanoski2008gilbert,
|
||||
title={The Gilbert--Johnson--Keerthi (GJK) Algorithm},
|
||||
author={Jovanoski, Davor},
|
||||
journal={Department of Computer Science, University of Salzburg},
|
||||
pages={13},
|
||||
year={2008}
|
||||
}
|
30
report.md
Normal file
30
report.md
Normal file
@ -0,0 +1,30 @@
|
||||
# Bachelor Project Report
|
||||
|
||||
## Week 1
|
||||
|
||||
- Forked and cloned the repo
|
||||
- Got accustomed to the code
|
||||
- Look up cairo tutorials to understand wtf is going on
|
||||
|
||||
## Week 2
|
||||
- Started coding
|
||||
- `polygons.h` and `polygons.cc`
|
||||
- `polygons_generator.h` and `polygons_generator.cc`
|
||||
- `matrix.h`
|
||||
|
||||
### Polygons properties
|
||||
- points (`std::vector<vec2d>`): the points that form the polygon, **in local
|
||||
coordinates**;
|
||||
- center (`vec2d`): where the origin of the local coordinates lies in global
|
||||
coordinates;
|
||||
- angle (`double`): how the points are rotate around the origin (to keep always
|
||||
the same points but rotating them when making computations are drawing)
|
||||
**interesting question for later: does computing the points rotated at each
|
||||
iteration less computationally efficient than just storing them each time
|
||||
the angle changes?**.
|
||||
|
||||
### Polygon Generator
|
||||
To make life easier for testing different cases, I made a generator of polygons
|
||||
that for now is able to generate any triangle and any rectangle. Simple shapes
|
||||
but that are simple enough to understand what happens when they get hit. We'll
|
||||
then see if the calculation for the forces transpose to any arbitrary polygon.
|
BIN
report.pdf
Normal file
BIN
report.pdf
Normal file
Binary file not shown.
1
sections/conclusion.tex
Normal file
1
sections/conclusion.tex
Normal file
@ -0,0 +1 @@
|
||||
\section{Conclusion}
|
25
sections/intro.tex
Normal file
25
sections/intro.tex
Normal file
@ -0,0 +1,25 @@
|
||||
\section{Introduction}
|
||||
\subsection{Goal of the project}
|
||||
The goal of the project was to extend an existing physics engine called
|
||||
"flying-balls"\footnote{The state of the project before the extension can be
|
||||
found at \url{https://github.com/carzaniga/flying-balls/tree/c++-port}} by Prof. Antonio
|
||||
Carzaniga. This physics engine simulated the interactions between circles in a
|
||||
two-dimensional space. These circles appear in the window with a random
|
||||
position, together with a random initial velocity vector. The simulation would
|
||||
then just calculate the position of each circle in the following frame and draw
|
||||
it in its new state. If two circles were to collide with each other, the engine
|
||||
would detect it and make those circles bounce off each other. The resulting
|
||||
position and speed would be decided by the physics equations that govern the
|
||||
motion of such objects.
|
||||
|
||||
The extension this project was asked to bring is the possibility to have more
|
||||
complex shapes interact with each other, such as polygons. The polygons would
|
||||
have to be arbitrary and bounce off other polygons present in the scene.
|
||||
|
||||
\subsection{State of the art}
|
||||
|
||||
There are a lot of 2D physiques engines across the internet. The purpose of this
|
||||
project was not to bring something new to the already existing landscape, but
|
||||
rather learn how to complete every step of the process (polygons generation,
|
||||
collision detection, kinematics resolution) from scratch, simply having a
|
||||
pre-existing way to represent the shapes on the screen.
|
1
sections/solution.tex
Normal file
1
sections/solution.tex
Normal file
@ -0,0 +1 @@
|
||||
\section{Proposed solution}
|
20
sections/tech_background.tex
Normal file
20
sections/tech_background.tex
Normal file
@ -0,0 +1,20 @@
|
||||
\section{Technical Background}
|
||||
|
||||
The technical background is all the research related to the programming part of
|
||||
this bachelor project. The programming language used in this project is a
|
||||
mixture of C and C++, for this part, the course of Systems Programming taught by
|
||||
Prof. Carzaniga during the third semester. Then came the study of the starting
|
||||
point of the project, which was divided in the logic itself and the framework
|
||||
used to display the state of the simulation on the screen.
|
||||
|
||||
\subsection{Original project}
|
||||
|
||||
Before starting to write any code, it was necessary to study carefully the
|
||||
original project. The starting point of chosen for this specific project was the
|
||||
last commit on the \texttt{c++-port} branch. The reason for this choice is that
|
||||
the project originally started fully in C (which is still the case for the
|
||||
\texttt{main} branch) and C++ offers more functionalities that help for a
|
||||
smoother development process.
|
||||
|
||||
|
||||
\subsection{Cairo}
|
1
sections/theoretical_background.tex
Normal file
1
sections/theoretical_background.tex
Normal file
@ -0,0 +1 @@
|
||||
\section{Theoretical Background}
|
265
usiinfbachelorproject.cls
Normal file
265
usiinfbachelorproject.cls
Normal file
@ -0,0 +1,265 @@
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
% LaTeX class for the Bachelor Thesis at the Faculty of Informatics of Universita' della Svizzera Italiana
|
||||
%
|
||||
% Contributors:
|
||||
% Andrea Adamoli, Domenico Bianculli, Michele Lanza (original design), Jochen Wuttke
|
||||
%
|
||||
%
|
||||
% -----------------------------------------------------------------------------
|
||||
%%
|
||||
%% This file is 'usiinfbachelorproject.cls'
|
||||
%%
|
||||
%% It may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3c of this license or (at your option) any later version. The latest version of this license is in http://www.latex-project.org/lppl.txt and version 1.3c or later is part of all distributions of LaTeX version 2005/12/01 or later.
|
||||
|
||||
%%% identification
|
||||
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
|
||||
\ProvidesClass{usiinfbachelorproject}[2009/11/06 v. 1.1%
|
||||
USI Informatics Bachelor Project class]
|
||||
%%% initial code
|
||||
\RequirePackage{xifthen}
|
||||
%%% true to produce a version suitable for printing
|
||||
\newboolean{@printversion}
|
||||
%%% true to enable automatic loading of hyperref package
|
||||
\newboolean{@hypermode}
|
||||
%%% true if a subtitle is provided
|
||||
\newboolean{@subtitle}
|
||||
%%% declaration of options
|
||||
\DeclareOption{print}{\setboolean{@printversion}{true}}
|
||||
{%redefine margins to match oneside layout
|
||||
}
|
||||
%%% enable/disable hyperref
|
||||
\DeclareOption{hyper}{\setboolean{@hypermode}{true}}
|
||||
\DeclareOption{nohyper}{\setboolean{@hypermode}{false}}
|
||||
|
||||
\DeclareOption{a5paper}{\OptionNotUsed}
|
||||
\DeclareOption{letterpaper}{\OptionNotUsed}
|
||||
\DeclareOption{b5paper}{\OptionNotUsed}
|
||||
\DeclareOption{legalpaper}{\OptionNotUsed}
|
||||
\DeclareOption{executivepaper}{\OptionNotUsed}
|
||||
\DeclareOption{landscape}{\OptionNotUsed}
|
||||
\DeclareOption{openany}{\OptionNotUsed}
|
||||
\DeclareOption{twocolumn}{\OptionNotUsed}
|
||||
\DeclareOption{oneside}{\OptionNotUsed}
|
||||
\DeclareOption{twoside}{\OptionNotUsed}
|
||||
|
||||
%%%
|
||||
\DeclareOption*{%
|
||||
\PassOptionsToClass{\CurrentOption}{document}%
|
||||
}
|
||||
%%% execution of options
|
||||
\ExecuteOptions{hyper}
|
||||
\ProcessOptions \relax
|
||||
\typeout{*** Please report bugs, comments, suggestions, and improvements
|
||||
to: }
|
||||
\typeout{*** Domenico Bianculli <domenico.bianculli@usi.ch>}
|
||||
%%% package loading
|
||||
\LoadClass[ a4paper, 10pt, twoside, onecolumn, final, titlepage, ]{article}
|
||||
%%% main code
|
||||
|
||||
%font settings
|
||||
\RequirePackage[T1]{fontenc}
|
||||
\RequirePackage[utf8]{inputenc}
|
||||
\RequirePackage[charter]{mathdesign}
|
||||
\RequirePackage[scaled]{beramono}
|
||||
\renewcommand{\sfdefault}{uop}
|
||||
\renewcommand{\scshape}{%
|
||||
\not@math@alphabet\scshape\relax
|
||||
\ifthenelse{\equal{\f@family}{uop}}%
|
||||
{\fontshape{sc}\selectfont}%
|
||||
{\fontshape{fsc}\selectfont}%
|
||||
}
|
||||
|
||||
|
||||
%sans-serif titles
|
||||
\RequirePackage{sectsty}
|
||||
\allsectionsfont{\normalfont}
|
||||
|
||||
%geometry
|
||||
\RequirePackage[a4paper,total={170mm,257mm}]{geometry}
|
||||
\geometry{hscale=0.67}
|
||||
\ifthenelse{\boolean{@printversion}}{}%
|
||||
{ \geometry{asymmetric}
|
||||
\geometry{bindingoffset=0pt,hmarginratio=1:1}
|
||||
}
|
||||
|
||||
%%% fancy headers
|
||||
\RequirePackage{fancyhdr}
|
||||
\setlength{\headheight}{15pt}
|
||||
\fancypagestyle{cover}{%
|
||||
\fancyhf{}
|
||||
\fancyhead{\mbox{ }}
|
||||
}
|
||||
\fancypagestyle{hrulefpage}{%
|
||||
\fancyhf{}
|
||||
\fancyhead{\mbox{ }}
|
||||
\fancyfoot[C]{\thepage}
|
||||
}
|
||||
%modifying captions
|
||||
\RequirePackage[font=footnotesize,labelsep=period,sc]{caption}
|
||||
\setlength{\captionmargin}{30pt}
|
||||
%datatool
|
||||
\RequirePackage{datatool}
|
||||
\RequirePackage{calc}
|
||||
|
||||
%commands to print empty values in the database
|
||||
\newcommand{\print@blank}[1]{\ifthenelse{\equal{#1}{!blank!}}{}{#1\ }}
|
||||
\newcommand{\print@empty}[1]{\ifthenelse{\equal{#1}{!blank!}}{}{#1}}
|
||||
|
||||
%utilities
|
||||
\newcommand{\TODO}[1]{\noindent{\textbf{TODO: #1}}}
|
||||
\newcommand{\CONTRIBUTION}[1]{
|
||||
\hspace{-0.82cm}
|
||||
\begin{tabular}{p{3.85cm}p{12.7cm}}
|
||||
\textbf{Envisioned contribution:} & {#1}
|
||||
\end{tabular}
|
||||
}
|
||||
\newcommand{\PATI}[1]{\vspace{0.1cm}\textbf{#1}}
|
||||
|
||||
%%% populate the committee database
|
||||
%%% format of the rows (name of the columns in brackets) :
|
||||
%%% Title [title], First and Middle [first], Last [last], Affiliation [aff], Type ([a]dvisor, phd [d]irector, [i]nternal) [type]
|
||||
\newenvironment{committee}{%
|
||||
\DTLnewdb{committee}
|
||||
}%
|
||||
{%
|
||||
\DTLsort{type,last,first,aff}{committee}
|
||||
}
|
||||
|
||||
\newcounter{advisors}
|
||||
\newcommand*{\advisor}[4][Universit\`a della Svizzera Italiana, Switzerland]{%
|
||||
\DTLnewrow{committee}
|
||||
\ifthenelse{\isempty{#2}}{\DTLnewdbentry{committee}{title}{!blank!}}{%
|
||||
\DTLnewdbentry{committee}{title}{#2}}
|
||||
\DTLnewdbentry{committee}{first}{#3}
|
||||
\DTLnewdbentry{committee}{last}{#4}
|
||||
\DTLnewdbentry{committee}{aff}{#1}
|
||||
\DTLnewdbentry{committee}{type}{r}
|
||||
\stepcounter{advisors}
|
||||
}
|
||||
|
||||
\newcounter{assistants}
|
||||
\newcommand*{\assistant}[4][Universit\`a della Svizzera Italiana, Switzerland]{%
|
||||
\DTLnewrow{committee}
|
||||
\ifthenelse{\isempty{#2}}{\DTLnewdbentry{committee}{title}{!blank!}}{%
|
||||
\DTLnewdbentry{committee}{title}{#2}}
|
||||
\DTLnewdbentry{committee}{first}{#3}
|
||||
\DTLnewdbentry{committee}{last}{#4}
|
||||
\DTLnewdbentry{committee}{aff}{#1}
|
||||
\DTLnewdbentry{committee}{type}{a}
|
||||
\stepcounter{assistants}
|
||||
}
|
||||
|
||||
%%% additional titlepage content commands
|
||||
\newcommand{\subtitle}[1]{\gdef\@subtitle{#1}\setboolean{@subtitle}{true}}
|
||||
\renewcommand\abstract[1]{\def\@abstract{\\#1}}
|
||||
%%% submission and acceptance dates
|
||||
%%% true if the dissertation has been accepted
|
||||
\newboolean{@accepted}
|
||||
\newcommand{\versiondate}[1]{\setboolean{@accepted}{true}\gdef\@dateaccepted{#1}}
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%%%%%%%%%%%% TITLE PAGE %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
%%%%%%%%%%%%%%%% PAGE HEADER %%%%%%%%%%%%%%%%
|
||||
|
||||
\renewcommand{\maketitle}{%
|
||||
\pagenumbering{Alph}\begin{titlepage}
|
||||
\thispagestyle{empty}
|
||||
\noindent \includegraphics[width=123mm]{logo-info.pdf}
|
||||
\hspace{-0.8mm}\rule[3.6mm]{\textwidth-123mm}{0.2pt}
|
||||
\vspace{-20mm}
|
||||
\begin{flushright}
|
||||
{\Large \textsf{Bachelor Thesis}}
|
||||
\end{flushright}
|
||||
\vspace{1mm}
|
||||
\hfill {%
|
||||
\ifthenelse{\boolean{@accepted}}{%
|
||||
\textsf{\@dateaccepted}%
|
||||
}{%
|
||||
\textsf{Submitted on \@datesubmitted}%
|
||||
}%
|
||||
}\\
|
||||
\vspace{16mm}
|
||||
|
||||
%%%%%%%%%%%%%%%% TITLE, SUBTITLE, AUTHOR %%%%%%%%%%%%%%%%
|
||||
|
||||
%%% TITLE %%%
|
||||
\noindent {\huge {\textsf{\@title}}}
|
||||
%%% (OPTIONAL SUBTITLE) %%%
|
||||
\ifthenelse{\boolean{@subtitle}}{ \noindent{\large \\[0.5em]\textsf{\textbf{\@subtitle}}}\\[12mm]}{\\[12mm]}
|
||||
%%% AUTHOR %%%
|
||||
\hfill { \Large {\textsf{\textbf{\@author}}}}\\
|
||||
|
||||
%%%%%%%%%%%%%%%% ABSTRACT %%%%%%%%%%%%%%%%
|
||||
|
||||
\hrule height 0.2pt \vspace{4mm}
|
||||
\noindent{{\textit{Abstract}}}\\
|
||||
\@abstract
|
||||
\vfill \hrule height 0.2pt \vspace{2mm}
|
||||
|
||||
%%%%%%%%%%%%%%%% ADVISOR AND ASSISTANT(S) %%%%%%%%%%%%%%%%
|
||||
|
||||
\noindent\textsf{\textbf{Advisor}~} \\
|
||||
\DTLforeach*[\DTLiseq{\type}{r}]{committee}
|
||||
{\actitle=title,\first=first,\last=last,\type=type}{
|
||||
\hspace{-0.1cm}\textsf{\print@blank{\actitle}\first \ \last~}%
|
||||
}
|
||||
\ifthenelse{\value{assistants} > 0}{\hfill \textsf{\textbf{\\Assistant}\ifthenelse{\value{assistants} > 1}{\textsf{\textbf{s}}{}}}}{}\\
|
||||
\DTLforeach*[\DTLiseq{\type}{a}]{committee}%
|
||||
{\actitle=title,\first=first,\last=last,\type=type}{\DTLiffirstrow{}{, }\textsf{\print@blank{\actitle}\first \ \last}%
|
||||
}
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
\vspace{2mm}
|
||||
\hrule height 0.2pt
|
||||
\vspace{5mm}
|
||||
|
||||
\SIGNATURES
|
||||
|
||||
\end{titlepage}
|
||||
\setcounter{footnote}{0}
|
||||
}
|
||||
|
||||
\renewenvironment{titlepage}
|
||||
{%
|
||||
\cleardoublepage
|
||||
\pagenumbering{arabic}
|
||||
\setcounter{page}\z@
|
||||
}%
|
||||
{\newpage }
|
||||
{\textwidth 5cm}
|
||||
|
||||
%%% put ToC, LoF, LoT and Index entries in the ToC use of \phantomsection is required for dealing with the hyperref package and depends on the nohyper option
|
||||
|
||||
%%% other useful packages
|
||||
|
||||
\RequirePackage{booktabs}
|
||||
\RequirePackage{graphicx}
|
||||
\RequirePackage{textcomp}
|
||||
\RequirePackage{url}
|
||||
\RequirePackage{amsmath}
|
||||
%%% switch on hyperref support
|
||||
\ifthenelse{\boolean{@hypermode}}{%
|
||||
\RequirePackage[unicode,plainpages=false,pdfpagelabels,breaklinks]{hyperref}
|
||||
\RequirePackage[all]{hypcap}
|
||||
|
||||
}{}
|
||||
|
||||
%%% other formatting stuff
|
||||
|
||||
\renewcommand{\baselinestretch}{1.05}
|
||||
|
||||
\newcommand{\SIGNATURES}{
|
||||
\begin{tabular}{ll}
|
||||
\hspace{-0.82cm}
|
||||
\textsf{Advisor's approval}{}
|
||||
(\DTLforeach*[\DTLiseq{\type}{r}]{committee}%
|
||||
{\actitle=title,\first=first,\last=last,\type=type}{%
|
||||
\DTLiffirstrow{}{, }\textsf{\print@blank{\actitle}\first \ \last}):%
|
||||
\hspace{4cm}
|
||||
& \textsf{Date: }
|
||||
}
|
||||
\end{tabular}
|
||||
%
|
||||
}
|
Loading…
Reference in New Issue
Block a user