Lesson 4: how to enable shaded view

devdscm

New member
Hi, I have successfully compiled Lesson04_HelloOpenCascade OCC project.I have loaded ANC101.brep shape.
I am not able to visualize a shaded shape like your video does.
I get only the attached shape
How activate shaded visualization?
Regards
 

Attachments

  • Img1.png
    Img1.png
    22.4 KB · Views: 0

Quaoar

Administrator
Staff member
Hey @devdscm ! Btw, in the newer versions of OpenCascade it's now the weird Ctrl+S combination for switching to a shaded mode. Somehow they wanted to reserve "WASD" for moving around I guess, although I hardly understand why that should be relevant to a CAD kernel :)
 

Quaoar

Administrator
Staff member
In the example, try adding SetDisplayMode() invocation like this (the last line):

C++:
//! Starts message loop.
void Viewer::StartMessageLoop()
{
  for ( auto sh : m_shapes )
  {
    Handle(AIS_Shape) shape = new AIS_Shape(sh);
    m_context->Display(shape, true);
    m_context->SetDisplayMode(shape, AIS_Shaded, true);
 
Top