2020-06-26 11:15:35 -04:00
# Prepare your environment.
2020-06-26 11:23:41 -04:00
Download the latest version of python and Microsoft c++ redistributable
2020-06-26 11:15:35 -04:00
* [Microsoft C++ redistributable ](https://www.microsoft.com/en-ca/download/details.aspx?id=48145 )
* [Python environment ](https://www.python.org/downloads/ )
2020-06-23 12:09:31 -04:00
# Get the code.
2020-06-23 11:24:19 -04:00
2022-04-11 19:29:29 -04:00
1. First thing you will need is an editor for your source code, that's a personal choice, but we would like to recommend PyCharm community edition, an excellent open-source python editor. [PyCharm Community edition ](https://www.jetbrains.com/pycharm/download/download-thanks.html?platform=windows&code=PCC )
2020-06-23 11:24:19 -04:00
2020-06-26 11:23:41 -04:00
2. Run the installer, and follow the installation instructions for PyCharm, you may change a few options, but the default ones should be fine.
2020-06-23 11:24:19 -04:00
2020-06-26 11:23:41 -04:00
3. Open PyCharm and click on ** "Get from Version Control"**.
2020-06-23 11:24:19 -04:00
2022-04-11 19:29:29 -04:00
![pycharm welcome screen ](./docs/img/img_0.png )
You can find it also at VCS -> Get from Version Control...
![pycharm get from version control ](./docs/img/img_6.png )
2020-06-23 11:24:19 -04:00
2022-04-11 19:29:29 -04:00
2022-04-12 09:42:43 -04:00
4. Select Git as the version control, and set the URL to [libs repository ](https://rs-loy-gitlab.concordia.ca/Guille/libs.git ) as shown in the picture.
At the website, copy the URL from Clone -> Clone with HTTPS.
2020-06-23 11:35:02 -04:00
![pycharm get from version control screen ](./docs/img/img_1.png )
2022-04-12 09:42:43 -04:00
You may need to install Git, by clicking at ** *Download and install***.
If that message does not appear is because you have it already installed in your computer.
2020-06-23 11:35:02 -04:00
2022-04-11 19:29:29 -04:00
5. Click Clone to download CERC libs source code. You will end with a project like this:
2020-06-23 12:09:31 -04:00
![pycharm project screen ](./docs/img/img_2.png )
2022-04-12 10:47:22 -04:00
6. Create your working branch by right clicking on the project folder (libs) -> Git -> Repository -> Branches:
![create new branch 1 ](./docs/img/img_9.png )
And then + New Branch:
![create new branch 2 ](./docs/img/img_10.png )
Give a name to your branch and open the tab Git at the down-left corner. Right click on your branch and push.
![push new branch 1 ](./docs/img/img_11.png )
![push new branch 2 ](./docs/img/img_12.png )
Check that your branch appears in the Remote list:
![check all set ](./docs/img/img_13.png )
If your branch is there, you are done with this part.
2020-06-26 09:22:12 -04:00
# Configure PyCharm.
2020-06-26 11:23:41 -04:00
We use two spaces as a tab instead of standard [pep8 ](https://www.python.org/dev/peps/pep-0008/ ) four spaces indentation.
2022-04-11 19:29:29 -04:00
This option can be configured in PyCharm at the settings screen, as shown in the picture.
2020-06-26 09:22:12 -04:00
![pycharm configuration screen ](./docs/img/img_5.png )
2020-06-26 11:23:41 -04:00
# Start your project.
2020-06-23 12:09:31 -04:00
2022-04-12 10:47:22 -04:00
1. At our Git (https://rs-loy-gitlab.concordia.ca/), click on New project:
![git new project screen ](./docs/img/img_14.png )
The create a black project with the desired name (remember to follow our ![Coding Style ](PYGUIDE.md )).
2020-06-23 12:09:31 -04:00
2022-04-12 10:47:22 -04:00
![git give a name ](./docs/img/img_15.png )
2020-06-23 12:09:31 -04:00
2022-04-12 10:47:22 -04:00
And finally, clone it following the same steps as with ![libs ](WINDOWS_INSTALL.md#get-the-code ) (steps 3 to 5).
2022-04-12 09:42:43 -04:00
2022-04-11 19:29:29 -04:00
2. Go to project settings and add the libs project to your own, by clicking on Add Content Root:
2020-06-23 12:09:31 -04:00
2020-06-23 12:20:42 -04:00
![pycharm new project screen ](./docs/img/img_4.png )
2022-04-11 19:29:29 -04:00
![pycharm add libs ](./docs/img/img_7.png )
2020-06-23 12:20:42 -04:00
2022-04-12 09:42:43 -04:00
3. Add your first file to your project and click on install requirements to automatically download all the dependencies (in blue at top-right corner).
2020-06-23 12:20:42 -04:00
2022-04-11 19:29:29 -04:00
![pycharm add dependencies ](./docs/img/img_8.png )
2020-06-23 12:20:42 -04:00
2022-04-11 19:29:29 -04:00
4. When all the dependencies are satisfied, you are all set to start importing your first city model.
Add the following code to your main.py
```python
from imports.geometry_factory import GeometryFactory
2020-06-23 12:20:42 -04:00
city = GeometryFactory('citygml', 'myfile.gml').city
2022-04-11 19:29:29 -04:00
```
2020-06-23 12:20:42 -04:00
2022-04-12 10:47:22 -04:00
5. Always remember to push your own project changes as the last thing you do before ending your working day!