View Issue Details

IDProjectCategoryView StatusLast Update
0032532CommunityOCCT:Visualizationpublic2021-09-03 13:38
Reporterocc_siddhesh_nikam Assigned Tobugmaster  
PrioritynormalSeverityjust a question 
Status closedResolutionno change required 
PlatformWindowsOSWindows 
Product Version7.2.0 
Target Version7.4.0 
Summary0032532: Multiple Views using "WNT_Window" in MFC Dialog
DescriptionHello,

I have created three "3d_views" in a MFC dialog using following code:

  Viewer_1 = new V3d_Viewer(GraphicDriver);
  Viewer_2 = new V3d_Viewer(GraphicDriver);
  Viewer_3 = new V3d_Viewer(GraphicDriver);

  Window_1 = new WNT_Window(GetSafeHwnd());
  Window_2 = new WNT_Window(GetSafeHwnd());
  Window_3 = new WNT_Window(GetSafeHwnd());

  View_1 = Viewer_1->CreateView();
  View_2 = Viewer_2->CreateView();
  View_3 = Viewer_3->CreateView();

  View_1->SetWindow(Window_1);
  if (!Window_1->IsMapped())
     Window_1->Map();

  View_2->SetWindow(Window_2);
  if (!Window_2->IsMapped())
     Window_2->Map();

  View_3->SetWindow(Window_3);
  if (!Window_3->IsMapped())
     Window_3->Map();


It is working; but while opening a dialog, all three views are not building at a same time. Instead, Window_1 is first created, then Window_2 and then Window_3.
It is giving weird behavior of a dialog. They should build simultaneously.

Also, above code works in "OnPaint()", not in "OnInDialog()."

Is it a flickering issue or anything else?

TagsNo tags attached.
Test case number

Relationships

related to 0032537 feedbackocc_siddhesh_nikam Exception occurs after updating OCCT_7.2.0 to OCCT_7.5.0 

Activities

kgv

2021-08-12 16:05

developer   ~0103156

If you would like 3 windows to appear at once, then you should probably setup 3 views (until V3d_View::SetWindow()) and show these windows on the screen afterwards (via WNT_Window::Map() or it's analog in MFC).

occ_siddhesh_nikam

2021-08-12 16:43

reporter   ~0103157

Hello kgv,

Thanks for the reply.

I have done the same here. Is anything missing in the code?

  Viewer_1 = new V3d_Viewer(GraphicDriver);
  Viewer_2 = new V3d_Viewer(GraphicDriver);
  Viewer_3 = new V3d_Viewer(GraphicDriver);

  Window_1 = new WNT_Window(GetSafeHwnd());
  Window_2 = new WNT_Window(GetSafeHwnd());
  Window_3 = new WNT_Window(GetSafeHwnd());

  View_1 = Viewer_1->CreateView();
  View_2 = Viewer_2->CreateView();
  View_3 = Viewer_3->CreateView();

  View_1->SetWindow(Window_1);
  if (!Window_1->IsMapped())
     Window_1->Map();

  View_2->SetWindow(Window_2);
  if (!Window_2->IsMapped())
     Window_2->Map();

  View_3->SetWindow(Window_3);
  if (!Window_3->IsMapped())
     Window_3->Map();

kgv

2021-08-12 16:50

developer   ~0103158

You call Map() after SetWindow() individually per view.
What I suggest is calling Map() for 3 windows after all Views have been defined via SetWindow().

occ_siddhesh_nikam

2021-08-12 17:07

reporter   ~0103159

Dear kgv,

I am little bit confused.
could you please show a snippet here?

Because if I remove "Map()" function from the code,
still all three windows are displaying.

kgv

2021-08-12 17:17

developer   ~0103160

This means that windows have been already displayed by MFC logic - you may try adjusting visibility of these 3 windows somewhere there.

Note that V3d_View performs implicit window redraws in many places like V3d_View::SetWindow() or V3d_View::MustBeResized().
This behavior could be disabled by V3d_View::SetImmediateUpdate() flag (normally set right after V3d_View construction).

occ_siddhesh_nikam

2021-08-12 17:57

reporter   ~0103165

Thanks kgv. I got your point.
In V3d_View.cxx/SetWindow(), Redraw() has been called.

"SetImmediateUpdate(FALSE)" doesn't work.

Any other idea??

kgv

2021-08-12 20:31

developer   ~0103166

> "SetImmediateUpdate(FALSE)" doesn't work.
If you are indeed using OCCT 7.2.0, then you need updating OCCT to a newer version (7.4.0+), where this particular bug in V3d_View::SetWindow() has been fixed.

occ_siddhesh_nikam

2021-08-12 21:30

reporter   ~0103168

Thanks... I will do it.

occ_siddhesh_nikam

2021-08-14 13:19

reporter   ~0103195

Thanks kgv for help.
Issue is resolved by updating OCCT version.

Issue History

Date Modified Username Field Change
2021-08-12 14:17 occ_siddhesh_nikam New Issue
2021-08-12 14:17 occ_siddhesh_nikam Assigned To => kgv
2021-08-12 16:05 kgv Note Added: 0103156
2021-08-12 16:06 kgv Severity minor => just a question
2021-08-12 16:43 occ_siddhesh_nikam Note Added: 0103157
2021-08-12 16:50 kgv Note Added: 0103158
2021-08-12 17:07 occ_siddhesh_nikam Note Added: 0103159
2021-08-12 17:17 kgv Note Added: 0103160
2021-08-12 17:57 occ_siddhesh_nikam Note Added: 0103165
2021-08-12 20:31 kgv Note Added: 0103166
2021-08-12 21:30 occ_siddhesh_nikam Note Added: 0103168
2021-08-14 13:19 occ_siddhesh_nikam Note Added: 0103195
2021-08-14 13:54 kgv Assigned To kgv => bugmaster
2021-08-14 13:54 kgv Status new => feedback
2021-08-14 13:54 kgv Resolution open => no change required
2021-08-14 13:54 kgv Target Version => 7.4.0
2021-08-16 21:53 kgv Relationship added related to 0032537
2021-09-03 13:38 bugmaster Status feedback => closed