Code Monkey home page Code Monkey logo

hsf / qt3dexaminerviewer Goto Github PK

View Code? Open in Web Editor NEW
6.0 13.0 1.0 2.21 MB

A viewer module which offers manipulation and visualization functionalities and tools similar to the OpenInventor/Coin Examiner viewer. The work is part of the CERN/HSF GSoC 2020

Home Page: https://hepsoftwarefoundation.org/gsoc/2020/proposal_ATLAS-Visualization.html

License: Apache License 2.0

QMake 0.91% C++ 99.09%
visualization geometry detector description qt5 qt3d open-inventor coin

qt3dexaminerviewer's Introduction

Qt3DExaminerViewer

GSoC participant: Huajian Qiu (EPFL, Lausanne, Switzerland)

CERN-HSF mentor: Dr. Riccardo Maria Bianchi (ATLAS, CERN & University of Pittsburgh)

This repository is reserved for Google Summer of Code 2020 project, hosted by CERN-HSF. Thanks for giving the chance for me. For more thorough documentation, please refer to my final GSoC report, CERN-HSF workshop presentation slides, CERN-HSF final meeting slides, application proposal.

Introduction

GeoExaminerViewer is a general viewer GUI module that offers manipulation and visualization functionalities similar to the Open Inventor / Coin Examiner viewer.

  • It reads geometry data and its associated information from local SQL databases and builds the basic geometry component shapes (like boxes, toruses, cones, and so forth) according to geometry parameters.
  • It offers a flexible way to inspect huge amounts of geometry components and the parent-children hierarchy between them.
  • It lets users select geometry components and see the pieces of data associated with them.

This viewer is particularly useful for inspecting the geometry structure of large, complex, scientific apparatuses, such as the high energy physics detector ATLAS running at CERN.

Motivation

The ATLAS community already built some Athena visualization tools (VP1/VP1Light/GMEX), which use a stack of different software libraries:

Qt → GUI
Coin/OpenInventor → 3D graphics engine
SoQt → Glue package between Coin and the Qt GUI

The above show several drawbacks:

  • Coin/OpenInventor, even if recently revamped by a small but quite active open source community (mainly from the robotics R&D field), is old-ish technology and lacks modern graphics features
  • SoQt is the weakest link: it handles the low-level graphics calls to the native windowing system, which easily breaks when new OS or compiler versions are out.

In this GSoC project, my work is to replace the usage of Coin/OpenInventor and SoQt by Qt3D, which is a newly released, well-supported 3D engine. Being Qt3D part of the Qt framework–which is used for the GUI anyway–, the use of that instead of Coin+SoQt would help to simplify the software stack too, by eliminating a layer of complexity.

However many high-level functionalities are missed in Qt3D, compared to Coin3D. Therefore, before using Qt3D to effectively render geometry data and interact with that, many software tools had to be designed and implemented. Thus, I had to reimplement many of the most used inspection tools based on the Qt3D API and classes; I also designed some new features after discussions between my mentor and me.

How to build

You need to firstly install qt5.15, GeoModelIO, GeoModelCore as dependencies of this project.

From IDE QtCreator:

open Qt3DExaminerViewer.pro file with QtCreator, click run button on the left bottom corner then it will compile automatically cross platform.

From terminal:

git clone https://github.com/HSF/Qt3DExaminerViewer.git
cd Qt3DExaminerViewer
qmake -o build/Makefile Qt3DExaminerViewer.pro
cd build
make -j4 
open Qt3DExaminerViewer.app

Then select one of the example database file from resourse/db folder.

current functionalities

1. about volume inspection:

  • info window to show information of volumes and tips
  • change visibility of detector volume.
  • switch between select and view mode for mouse: disable moving camera by mouse after opening "select" mode, disable selecting volume by mouse after opening "view" mode
  • accurate picking/selection support: left click volume to select, the selected volume change its color to dard red and info window will display the information of this volume.
  • cancel selection: click empty space or press "X" key
  • open volume : Cmd/Ctrl + left click to hide clicked volume and display its child/children.
  • close volume : Option/Alt + left click to hide clicked volume and display its parent.

2. about viewport:

  • switch between perspective and orthographic projection.
  • three predefined view and "ViewAll" button: top, left, front view
  • bookmark user selected view to a list, quickly return to where user bookmarked before.
  • two automated tours

3. about input-action mapping

  • control camera postion in terms of zoom in/out, tranlsation, rotation
input action
Left mouse button
Arrow keys
translate the camera position and camera view center,
the view direction keeps same.
Right mouse button
Control(on Mac) key + left mouse button
Alt/Option key + up/down keys
rotate the camera position around the camera view center,
the view center keeps same.
scroll wheel
Page up/Page down keys
Fn + up/down keys
Move the camera forwards and backwards.
clicking Both left and right mouse button and move mouse zooms the camera in and out without changing the view center.

current UI

spinbox

qt3dexaminerviewer's People

Contributors

huajian1069 avatar ric-bianchi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

kunvinn

qt3dexaminerviewer's Issues

Volume selection is not accurate enough.

Users should be able to select a volume by left-clicking on the surface of the volume.

However, the volume gets selected even when left-clicking on the "void space" around the volume.

The selection mechanism should be improved. Users should be able to accurately select a single volume in a busy environment.

Could you check and fix this, @huajian1069 ?
Thanks a lot!

Best, -- Riccardo.

Rotation around a point on the surface

Shift+left-click lets users choose a point on the surface of a volume and set the rotation point to it. Rotation (Ctrl+click&drag) should then be performed around the selected point as the new rotation center. However, it seems that the center of rotation is not exactly the point selected by the user but a point nearby and not always on the surface of the given volume.

The rotation point should be set at exactly the point selected on the surface of the volume.

Could you check and fix this, @huajian1069 ?
Thanks a lot!

Best, -- Riccardo.

When selecting an open volume from the geo browser, it gets closed

If I open a volume, let's say one of the the Passive volumes in the Step6 example file, I can see its InnerPassive child volume.

That reflects in the geo browser, where I can click on the InnerPassive label to jump to that volume.

But if I then click on the Passive label in the geo browser, the Passive is closed hiding the child volume and the Passive is shown in the view.

Opened/Closed state should be preserved, because that is set by the user to inspect the geometry; so, clicking on the labels in the geo browser should only affect the camera position/movement, but not the opened/closed state of the volume.


P.S.

Or, we could add a switch to enable that on user's request; something like a lock: when "locked" then the opened/closed state is preserved while navigating through the geo browser; if "unlocked", then clicking on the labels in the geo browser opens/closes the related volumes in the view.
That could be a new feature for one of the future releases.

Questions about GSoC.

Dear seniors, I am a junior student majoring in communication engineering in UESTC. After getting a preliminary understanding of the materials, I found your project on the project list. I hope to participate in GSoC this year (2021). May I ask what relevant preparations need to be made? Is it difficult for non-computer majors?
学长好,我是一名通信工程专业的大三学生,在初步了解资料后,希望参加今年(2021)的GSoC。
请问需要做什么相关的准备呢?对于非计算机专业学生的是不是较为困难?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.