Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change clipping space and add to config.ini #17

Merged
merged 1 commit into from
Jul 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --select=E9,F63,F7,F82 --ignore=C901 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics

Expand Down
4 changes: 3 additions & 1 deletion config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,6 @@ show_orientation = True
background_color = 100, 100, 100
; number of decimal places shown for the parameters of the active bounding box
viewing_precision = 2

; near and far clipping plane for OpenGL (where objects are visible, in meter)
near_plane=0.1
far_plane=300
4 changes: 3 additions & 1 deletion docs/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,11 @@ The following parameters can be changed:
| `STD_ROTATION` | Standard step for rotating the bounding box (with key press). | *0.5* |
| `STD_SCALING` | Standard step for scaling the bounding box (with button press). | *0.03* |
| `MIN_BOUNDINGBOX_DIMENSION` | Minimum value for the length, width and height of a bounding box. | *0.01* |
| **[SETTINGS]** |
| **[USER_INTERFACE]** |
| `Z_ROTATION_ONLY` | Only allow z-rotation of bounding box; deactivate to also label x- & y-rotation. | *True* |
| `SHOW_FLOOR` | Visualizes the floor (x-y-plane) as a grid. | *True* |
| `SHOW_ORIENTATION` | Visualizes the object's orientation as an arrow. | *True* |
| `BACKGROUND_COLOR` | Background color of the point cloud viewer (rgb). | *100, 100, 100* |
| `VIEWING_PRECISION` | Number of decimal places shown on the right side for the parameters of the active bounding box. | *3* |
| `near_plane` | Min. distance of objects to be displayed by OpenGL | *0.1* |
| `far_plane` | Max. distance of objects to be displayed by OpenGL | *300* |
4 changes: 3 additions & 1 deletion labelCloud/ressources/default_config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,6 @@ show_orientation = True
background_color = 100, 100, 100
; number of decimal places shown for the parameters of the active bounding box
viewing_precision = 2

; near and far clipping plane for OpenGL (where objects are visible, in meter)
near_plane=0.1
far_plane=300
5 changes: 4 additions & 1 deletion labelCloud/view/viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@

# Main widget for presenting the point cloud
class GLWidget(QtOpenGL.QGLWidget):
NEAR_PLANE = config.getfloat("USER_INTERFACE", "near_plane")
FAR_PLANE = config.getfloat("USER_INTERFACE", "far_plane")

def __init__(self, parent=None):
self.parent = parent
QtOpenGL.QGLWidget.__init__(self, parent)
Expand Down Expand Up @@ -70,7 +73,7 @@ def resizeGL(self, width, height):
GL.glLoadIdentity()
aspect = width / float(height)

GLU.gluPerspective(45.0, aspect, 0.5, 30.0)
GLU.gluPerspective(45.0, aspect, GLWidget.NEAR_PLANE, GLWidget.FAR_PLANE)
GL.glMatrixMode(GL.GL_MODELVIEW)

def paintGL(self):
Expand Down
5 changes: 3 additions & 2 deletions tests/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ def pytest_configure(config):
print(f"Set working directory to {os.getcwd()}.")

sys.path.insert(0, "labelCloud")
print(f"Added labelCloud to Python path.")
print("Added labelCloud to Python path.")

import app # preventing circular import
# preventing circular import
import app # noqa: E401


@pytest.fixture
Expand Down
5 changes: 3 additions & 2 deletions tests/unit/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ def pytest_configure(config):
print(f"Set working directory to {os.getcwd()}.")

sys.path.insert(0, "labelCloud")
print(f"Added labelCloud to Python path.")
print("Added labelCloud to Python path.")

import app # preventing circular import
# preventing circular import
import app # noqa: E401