
Tue, 09/24/2019 - 07:59
Forums:
I tried drawexe sample :
vinit
vlayerline 0 300 300 300 10
it is no problem to show the linewidth 10.
But when I code in my code c++ with Viewer or V3d_view.
I can not let line have linewidth.
I don't know which parameter can controll the display in screen to show linewidth.
If anyone know about this , could you help me?
the setting about my viewer and view:
Handle(OpenGl_GraphicDriver) aGraphicDriver = new OpenGl_GraphicDriver (myOcctWindow->GetDisplay(), false);
Handle(V3d_Viewer) aViewer = new V3d_Viewer (aGraphicDriver);
aViewer->SetDefaultLights();
aViewer->SetLightOn();
aViewer->SetDefaultTypeOfView (V3d_PERSPECTIVE);
aViewer->ActivateGrid (Aspect_GT_Rectangular, Aspect_GDM_Lines);
myView = aViewer->CreateView();
myView->SetImmediateUpdate (false);
myView->SetWindow (myOcctWindow, myOcctWindow->NativeGlContext());
myView->ChangeRenderingParams().ToShowStats = true;
myContext = new AIS_InteractiveContext (aViewer);
Attachments:
Tue, 09/24/2019 - 09:53
There is NO global parameter defining line width in the viewer.
This aspect is configured for specific presentation via related Prs3d_LineAspect/Graphic3d_AspectLine3d property.
Within your code sample you are displaying a rectangular grid, so I suppose that your question is related to this object.
In fact, V3d_RectangularGrid presentation simply does not expose line width property, it is hard-coded as 1.0 and cannot be changed without modifying OCCT:
Tue, 09/24/2019 - 19:38
@Kirill Gavrilov , thanks for your fast reply and help.
Firstly, I am sorry for this wrong pic Screen_Shot_2019-09-24_at_23.53.03.png , it mislead you to the question about displaying a rectangular grid.
Now I post the whole codes in attachments which is reusing the code from official MFC sample.
I used it in my GLFW demo.
You can see the linewidth in MFC sample, but you still can not see line width in my GLFW demo.
As you said there is NO global parameter defining linewidth in the viewer, so I don’t know why there is no linewidth in my GLFW demo code.
Tue, 09/24/2019 - 20:15
This is because OpenGL within Core Profile does not support line width other than 1.
Tue, 09/24/2019 - 20:56
Thanks again for your help. It save me a lot of time.