View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0030429 | Community | OCCT:Samples | public | 2019-01-02 18:19 | 2021-11-12 10:50 |
Reporter | mahaidong | Assigned To | bugmaster | ||
Priority | normal | Severity | integration request | ||
Status | closed | Resolution | fixed | ||
Platform | win10 mac ubuntu | ||||
Target Version | 7.4.0 | Fixed in Version | 7.4.0 | ||
Summary | 0030429: Samples - add simple glfw 3D Viewer sample | ||||
Description | a sample based on GLFW for demonstrating usage of OCCT 3D Viewer | ||||
Tags | No tags attached. | ||||
Test case number | Not needed | ||||
|
almost finished, try to push codes https://www.opencascade.com/content/it-possible-initialize-v3dview-glfw%EF%BC%88-lightweight-utility-library-use-opengl%EF%BC%89 |
|
Branch CR30429 has been created by mahaidong. SHA-1: 6a25e180ab887766e37e7dc67e917b031ddf64ef Detailed log of new commits: Author: mahaidong Date: Thu Jan 3 20:11:22 2019 +0800 a simple cross-plotform demo for opencascade in glfw |
|
@kgv I had push a branch CRCR30429 with sample codes. |
|
Branch CR30429 has been updated by mahaidong. SHA-1: 9134ffbc5fec28ab49eb3d5bedab0b9a98ae4cac Detailed log of new commits: Author: mahaidong Date: Thu Jan 3 20:47:21 2019 +0800 change readme Author: mahaidong Date: Thu Jan 3 20:11:22 2019 +0800 a simple cross-plotform demo for opencascade in glfw |
|
If you would like to prepare a proper patch, please take a look onto Coding Rules and Bug Advancement Workflow: https://dev.opencascade.org/doc/overview/html/occt_dev_guides__coding_rules.html https://dev.opencascade.org/doc/overview/html/occt_dev_guides__contribution_workflow.html In particular, indentation should be 2 spaces, figure brackets should be on new line, class members starting with "my", etc. (consider using autoformatting to fix indentation/spacing). +++ b/samples/glfw/readme.md @@ -0,0 +1,3 @@ +a simple demo for opencascade in glfw This looks a little incomplete. +static void error_callback(int error, const char* description) +{ + fprintf(stderr, "Error %d: %s\n", error, description); +} The preferred way is redirecting messages to Message::DefaultMessenger()->Send() with proper message gravity. + glewInit(); Could you please comment why GLEW is needed here? + Handle_V3d_Viewer m_viewer; + Handle_V3d_View m_view; + Handle_OpenGl_Context m_GLcontext; + Handle_AIS_InteractiveContext mContext; Handle_ syntax is deprecated, Handle() is preferred. + void Destroy(); + ~OccWindow() + { + Destroy(); + } Destroy() is an obsolete alias of class destructor from WOK (CDL class declaration) times. + /*** todo cleanup imgui ***/ TODOs related to imgui looks unrelated (as long as you are not going to add them). +void GlfwOccView::s_onMouseButton(GLFWwindow* window, int button, int action, int mods) +{ + GlfwOccView* app = reinterpret_cast<GlfwOccView*>(glfwGetWindowUserPointer(window)); + app->OnMouseButton(button, action, mods); +} +void GlfwOccView::s_onMouseMove(GLFWwindow* window, double xpos, double ypos) +{ + GlfwOccView* app = reinterpret_cast<GlfwOccView*>(glfwGetWindowUserPointer(window)); + app->OnMouseMove(xpos, ypos); +} These proxy callbacks are probably will be better inlined within declaration to make code more compact. + mContext->MoveTo((int)xpos,(int)ypos,m_view,Standard_True); ... +void GlfwOccView::redraw() +{ Looks like a misconception or at least confusing to have a special redraw() method and not implementing actual redraw with it... +INCLUDE_DIRECTORIES(/usr/local/include/opencascade/) Doesn't look correct (multi-platform / flexible). |
|
Branch CR30429 has been updated by mahaidong. SHA-1: b0ad08264ca32c8c53a937d6ac0713eb9ba236fd Detailed log of new commits: Author: mahaidong Date: Sat Jan 5 01:34:44 2019 +0800 Follow the Coding Rules |
|
Branch CR30429 has been updated by mahaidong. SHA-1: e4e6e72ed65070afb96d31fe74468eb9345959bd Detailed log of new commits: Author: mahaidong Date: Sun Jan 6 14:18:23 2019 +0800 let codes be more clean |
|
@kgv, thanks your comments, I had modified my codes according to your comments. |
|
@kgv, should I add more function or just keep on making code clean? |
|
Branch CR30429_1 has been created by kgv. SHA-1: 78c96200cc223f460685277a6e4411684883cfaf Detailed log of new commits: Author: kgv Date: Fri Jan 18 11:00:30 2019 +0300 0030429: Samples - add simple glfw 3D Viewer sample |
|
Branch CR30429_1 has been updated forcibly by kgv. SHA-1: 86a908405dfa897c884b1b25761ef0dbb91dd56c |
|
Branch CR30429_2 has been created by kgv. SHA-1: 2b292b6fdcebd9970ca7b7cc8c1d9bd2ac276c79 Detailed log of new commits: Author: mahaidong Date: Fri Jan 18 11:00:30 2019 +0300 0030429: Samples - add simple glfw 3D Viewer sample |
|
Branch CR30429_2 has been updated forcibly by kgv. SHA-1: 0a80014b39a5c14c6adef23f43686abe0bf83c49 |
|
Branch CR30429_2 has been updated forcibly by kgv. SHA-1: fc5dd1d5649cdede893fc92f4b7d25506d8daf84 |
|
Branch CR30429_2 has been updated forcibly by kgv. SHA-1: 2f237962fddee1199043d3fd7babea51ce2aaff9 |
|
Branch CR30429_2 has been updated by kgv. SHA-1: bf3295e64b76aff312ae66df416d0d84d501acf8 Detailed log of new commits: Author: kgv Date: Fri Jan 18 19:03:35 2019 +0300 Aspect_DisplayConnection - provide constructor wrapping existing X Display connection. |
|
Branch CR30429_2 has been updated by kgv. SHA-1: c1bf295e8562164fd3845f976b9d6e654bfc71a9 Detailed log of new commits: Author: kgv Date: Fri Jan 18 21:48:22 2019 +0300 # fix macOS compilation |
|
Branch CR30429_2 has been updated by kgv. SHA-1: e776e7db2d60c10ec3a4e5e7cb7a23b4d7ea932a Detailed log of new commits: Author: kgv Date: Fri Jan 18 22:12:37 2019 +0300 # corrections |
|
Branch CR30429_3 has been created by kgv. SHA-1: 68bec45a543409c4da9d6dc84f37e92b7c150535 Detailed log of new commits: Author: mahaidong Date: Fri Jan 18 11:00:30 2019 +0300 0030429: Samples - add simple glfw 3D Viewer sample Aspect_DisplayConnection now provides constructor wrapping existing X Display connection. |
|
Branch CR30429_3 has been updated forcibly by kgv. SHA-1: e5ac2c75ab1cebfa10eea015ffd4c999998bd1ff |
|
The sample has been updated and pushed to branch CR30429_3: - GLEW dependency has been removed as redundant. - CMakeLists now uses find_package() for searching OCCT instead of CASROOT. - The issue with glXSwapBuffers() has been fixed by adding Aspect_DisplayConnection constructor wrapping existing X Display connection. - Prefer using glfwWaitEvents() instead of glfwPollEvents(). - Code clean up / simplification. X Error of failed request: GLXBadContextTag Major opcode of failed request: 154 (GLX) Minor opcode of failed request: 11 (X_GLXSwapBuffers) Serial number of failed request: 36 Current serial number in output stream: 504 Please comment, if you have some objections / questions to changes. > glfwWindowHint (GLFW_CONTEXT_VERSION_MAJOR, 3); > glfwWindowHint (GLFW_CONTEXT_VERSION_MINOR, 3); > glfwWindowHint (GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); > glfwWindowHint (GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); Requesting a Forward-Compatible OpenGL profile 3.3 looks like a copy-paste from some another GLFW sample, since it might not the best OpenGL configuration. Forward-compatible bit is rarely used, and limiting to 3.3 would disable some OCCT features requiring OpenGL 4.x. |
|
Branch CR30429_3 has been updated forcibly by kgv. SHA-1: 185f0251c529e408b80299c5b8ab67d0e8b380d1 |
|
Branch CR30429_3 has been updated by mahaidong. SHA-1: e2b9a53c0a1c724335bdcec6f7014a9f612bd9f6 Detailed log of new commits: Author: mahaidong Date: Sat Jan 19 19:21:09 2019 +0800 about apple |
|
@kgv , your codes are amazing!!! The only thing I can explain about is "glfwWindowHint (GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);" I add this line because of this reason: https://github.com/glfw/glfw/issues/832 . I had tested on my Apple computer. I am so happy having this chance to work on this small demo project. And I also hope I can have another chance to keep working on Opencascade project. Thanks again. |
|
Please raise the patch. http://jenkins-test-12.nnov.opencascade.com:8080/view/CR30429_3-master-KGV/ |
|
Combination - OCCT branch : CR30429_3 SHA - e5ac2c75ab1cebfa10eea015ffd4c999998bd1ff Products branch : master SHA - 0b9df64a156abd5cbfbfccb15967b46cdabfe1f8 was compiled on Linux, MacOS and Windows platforms and tested in optimize mode. Number of compiler warnings: No new/fixed warnings Regressions/Differences/Improvements: No regressions/differences CPU differences: Debian80-64: OCCT Total CPU difference: 16355.260000000095 / 16360.560000000005 [-0.03%] Products Total CPU difference: 7172.680000000021 / 7164.9300000000385 [+0.11%] Windows-64-VC14: OCCT Total CPU difference: 17885.171875 / 17757.890625 [+0.72%] Products Total CPU difference: 8602.09375 / 8601.296875 [+0.01%] Image differences : No differences that require special attention Memory differences : No differences that require special attention |
|
Branch CR30429_3 has been updated by kgv. SHA-1: a3fe4f1658c9c9fe855736cce05c4c6cf7a7f434 Detailed log of new commits: Author: kgv Date: Tue Jan 22 15:20:50 2019 +0300 # compatibility with old gcc |
|
Branch CR30429_4 has been created by kgv. SHA-1: ab5f73dd33548ee26676dfdebd724d8ff21d5c0c Detailed log of new commits: Author: mahaidong Date: Fri Jan 18 11:00:30 2019 +0300 0030429: Samples - add simple glfw 3D Viewer sample Aspect_DisplayConnection now provides constructor wrapping existing X Display connection. |
|
Branch CR30429 has been deleted by inv. SHA-1: e4e6e72ed65070afb96d31fe74468eb9345959bd |
|
Branch CR30429_1 has been deleted by inv. SHA-1: 86a908405dfa897c884b1b25761ef0dbb91dd56c |
|
Branch CR30429_2 has been deleted by inv. SHA-1: e776e7db2d60c10ec3a4e5e7cb7a23b4d7ea932a |
|
Branch CR30429_3 has been deleted by inv. SHA-1: a3fe4f1658c9c9fe855736cce05c4c6cf7a7f434 |
|
Branch CR30429_4 has been deleted by inv. SHA-1: ab5f73dd33548ee26676dfdebd724d8ff21d5c0c |
|
nice :) |
occt: master 9c0787df 2019-01-18 08:00:30 Committer: bugmaster Details Diff |
0030429: Samples - add simple glfw 3D Viewer sample Aspect_DisplayConnection now provides constructor wrapping existing X Display connection. |
Affected Issues 0030429 |
|
add - samples/glfw/CMakeLists.txt | Diff File | ||
add - samples/glfw/GlfwOcctView.cpp | Diff File | ||
add - samples/glfw/GlfwOcctView.h | Diff File | ||
add - samples/glfw/GlfwOcctWindow.cpp | Diff File | ||
add - samples/glfw/GlfwOcctWindow.h | Diff File | ||
add - samples/glfw/main.cpp | Diff File | ||
add - samples/glfw/readme.md | Diff File | ||
mod - src/Aspect/Aspect_DisplayConnection.cxx | Diff File | ||
mod - src/Aspect/Aspect_DisplayConnection.hxx | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2019-01-02 18:19 | mahaidong | New Issue | |
2019-01-02 18:19 | mahaidong | Assigned To | => kgv |
2019-01-02 18:22 | mahaidong | Note Added: 0081675 | |
2019-01-02 18:24 | kgv | Summary | glfw sample => Samples - glfw sample |
2019-01-02 18:25 | mahaidong | Note Edited: 0081675 | |
2019-01-03 15:22 | git | Note Added: 0081676 | |
2019-01-03 15:31 | mahaidong | Note Added: 0081677 | |
2019-01-03 15:51 | git | Note Added: 0081678 | |
2019-01-04 04:57 | mahaidong | Assigned To | kgv => mahaidong |
2019-01-04 04:57 | mahaidong | Assigned To | mahaidong => kgv |
2019-01-04 13:18 | kgv | Note Added: 0081679 | |
2019-01-04 13:18 | kgv | Severity | feature => integration request |
2019-01-04 13:18 | kgv | Product Version | 7.3.0 => |
2019-01-04 13:18 | kgv | Target Version | => 7.4.0 |
2019-01-04 13:19 | kgv | Note Edited: 0081679 | |
2019-01-04 13:20 | kgv | Note Edited: 0081679 | |
2019-01-04 13:21 | kgv | Note Edited: 0081679 | |
2019-01-04 20:38 | git | Note Added: 0081680 | |
2019-01-06 09:23 | git | Note Added: 0081681 | |
2019-01-06 09:26 | mahaidong | Note Added: 0081682 | |
2019-01-09 13:04 | mahaidong | Note Added: 0081689 | |
2019-01-18 11:03 | kgv | Summary | Samples - glfw sample => Samples - add simple glfw 3D Viewer sample |
2019-01-18 11:04 | git | Note Added: 0081812 | |
2019-01-18 11:06 | git | Note Added: 0081813 | |
2019-01-18 15:40 | git | Note Added: 0081816 | |
2019-01-18 15:57 | git | Note Added: 0081817 | |
2019-01-18 16:57 | git | Note Added: 0081819 | |
2019-01-18 17:17 | git | Note Added: 0081820 | |
2019-01-18 19:07 | git | Note Added: 0081821 | |
2019-01-18 21:52 | git | Note Added: 0081822 | |
2019-01-18 22:16 | git | Note Added: 0081823 | |
2019-01-18 22:18 | git | Note Added: 0081824 | |
2019-01-18 22:19 | kgv | Status | new => resolved |
2019-01-18 22:20 | git | Note Added: 0081825 | |
2019-01-18 22:36 | kgv | Note Added: 0081826 | |
2019-01-18 22:44 | git | Note Added: 0081827 | |
2019-01-18 22:44 | kgv | Assigned To | kgv => mahaidong |
2019-01-18 22:44 | kgv | Status | resolved => feedback |
2019-01-19 15:40 | git | Note Added: 0081829 | |
2019-01-19 15:49 | mahaidong | Note Added: 0081830 | |
2019-01-19 15:51 | mahaidong | Assigned To | mahaidong => kgv |
2019-01-21 10:35 | kgv | Note Added: 0081832 | |
2019-01-21 10:35 | kgv | Assigned To | kgv => bugmaster |
2019-01-21 10:35 | kgv | Status | feedback => reviewed |
2019-01-21 10:35 | kgv | Note Edited: 0081832 | |
2019-01-21 10:38 | kgv | Note Edited: 0081826 | |
2019-01-21 16:39 | bugmaster | Test case number | => Not needed |
2019-01-21 16:39 | bugmaster | Note Added: 0081854 | |
2019-01-21 16:39 | bugmaster | Status | reviewed => tested |
2019-01-22 15:24 | git | Note Added: 0081858 | |
2019-01-22 15:25 | git | Note Added: 0081859 | |
2019-01-27 11:24 | bugmaster | Changeset attached | => occt master 9c0787df |
2019-01-27 11:24 | bugmaster | Status | tested => verified |
2019-01-27 11:24 | bugmaster | Resolution | open => fixed |
2019-01-28 10:54 | git | Note Added: 0081891 | |
2019-01-28 10:54 | git | Note Added: 0081892 | |
2019-01-28 10:54 | git | Note Added: 0081893 | |
2019-01-28 10:54 | git | Note Added: 0081894 | |
2019-01-28 10:54 | git | Note Added: 0081895 | |
2019-02-03 11:51 | mahaidong | Note Added: 0082000 | |
2019-10-10 17:14 | kgv | Relationship added | parent of 0031056 |
2021-11-12 10:50 | kgv | Relationship added | parent of 0032658 |