MantisBT - Community
View Issue Details
0031237Community[OCCT] OCCT:Visualizationpublic2019-12-12 09:092019-12-13 19:29
0031237: Visualization - implement simple 2d gui on the AIS layer
create a simple 2d gui on the ais layer, such as sprite. This sprite has position and area properties. When it is implemented, it has a callback function that responds to mouse events. is it possible?
No tags attached.
related to 0030952new kgv Open CASCADE Draw Harness, ViewerTest - add command showing on-screen GUI for configuring material properties 
png scribble.png (138,960) 2019-12-13 17:03
png Screen Shot 2019-12-14 at 00.11.35.png (51,178) 2019-12-13 19:29
Issue History
2019-12-12 09:09mahaidongNew Issue
2019-12-12 09:09mahaidongAssigned To => kgv
2019-12-12 09:10mahaidongAssigned Tokgv =>
2019-12-12 09:15mahaidongNote Added: 0089472
2019-12-12 10:35kgvRelationship addedrelated to 0030952
2019-12-13 13:10kgvNote Added: 0089495
2019-12-13 13:16kgvSummaryproposal: simple 2d gui on the AIS layer. => Visualization - implement simple 2d gui on the AIS layer
2019-12-13 17:03mahaidongFile Added: scribble.png
2019-12-13 17:09mahaidongNote Added: 0089507
2019-12-13 17:09mahaidongNote Edited: 0089507bug_revision_view_page.php?bugnote_id=89507#r22345
2019-12-13 17:12mahaidongAssigned To => mahaidong
2019-12-13 19:29mahaidongFile Added: Screen Shot 2019-12-14 at 00.11.35.png

2019-12-12 09:15   
inspired by SDL2 gui layer.
2019-12-13 13:10   
> cool! can I do something with this?
Draft within 0030952 creates some interactive OSD presentations within ViewerTest, so that it gives the idea of how such kind of things can be technically implemented on top of AIS.

The more comprehensive idea is:
- Define a new basic interface for this kind of 2D OSD objects (aka clickable).
- Provide reusable tools like sensitive entity to be useful for such kind of presentations.
- Implement a couple of presentations ("widgets") that can be used as building blocks for most common operations.
- Optionally introduce simplified signal-slot mechanism instead of callbacks for more flexible connections.
- Extend AIS_InteractiveContext / AIS_ViewController to redirect mouse movement / button press and release events on this kind of objects, so that more sophisticated logic can be implemented by widget.

Designing own widget hierarchy is not a simple but feasible task, and the main problem here is developing a minimal set of standard widgets enough for building simplified GUI. Things like buttons and text labels are trivial enough, flickable and clipped areas require extra efforts and implementing a comprehensive text input and managing input focus between widgets might be quite complicated.

I'm not sure it is worth developing a comprehensive GUI toolkit on top of AIS - there are a lot of GUI frameworks and it is clear that such task require quite an effort. But introducing some minimal blocks might be nice for cases, where complex GUI is not necessary, or portions of GUI are better connected to 3D objects.
2019-12-13 17:09   
some simple gui like [^] , as you said which are better connected to 3d objects.

they implement the slider, text label.

I think we maybe need xyz-point input, slider