Handle_AIS_InteractiveContext::Select function is crashed

Hello,

I'm trying upgrade open cascade version which built into my application from V6.9.1 to V7.4.0.

open cascade and my application ware successfully built.

But my application is crashed when use "Handle_AIS_InteractiveContext::Select" function.

 

-------------------[source code]-----------------------------------

// CreateViewer​​
m_viewer = new V3d_Viewer( GraphicDriver );
m_viewer->SetDefaultLights();
m_viewer->SetLightOn();

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

// CreateView
m_viewer = new V3d_Viewer( GraphicDriver );
m_view = m_viewer->CreateView();
m_view->SetWindow( wind );
m_view->SetBackgroundColor( Quantity_TOC_RGB, 0.1 ,0.1, 0.2 );
m_view->MustBeResized();
m_view->TriedronDisplay( Aspect_TOTP_LEFT_LOWERQuantity_NOC_GOLD,  0.08, V3d_ZBUFFER );

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

// Create Context
m_context = new AIS_InteractiveContext( m_viewer );
Prs3d_Drawer drowSelect;
drowSelect.SetColor( Quantity_Color(Quantity_NOC_MAGENTA1) );
m_context->SetSelectionStyle( drowSelect.Link() );
Prs3d_Drawer drowHilight;
drowHilight.SetColor( Quantity_Color(Quantity_NOC_CYAN2) );
m_context->SetSelectionStyle( drowHilight.Link() );
m_context->SetDisplayMode( AIS_Shaded, Standard_True );

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

// Selection Mode Set
m_context->Deactivate();
m_context->Activate( AIS_Shape::SelectionMode(TopAbs_SOLID) );
m_context->Activate( AIS_Shape::SelectionMode(TopAbs_VERTEX) );
m_context->Activate( AIS_Shape::SelectionMode(TopAbs_EDGE) );

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

// Selection
inputEvent( const int x, const int y )
{
    m_context->Select( Standard_False );  <- crash!!
    ~~~~~~~
}

 

Anyone had this problem?

Best regards.

Keito Okajima's picture

I solved my problem.

I repaired my code like below.

// Create Context
m_context = new AIS_InteractiveContext( m_viewer );
Handle(Prs3d_Drawer) drowSelect = new Prs3d_Drawer();
drowSelect->SetColor( Quantity_Color(Quantity_NOC_MAGENTA1) );
m_context->SetSelectionStyle( drowSelect );
Handle(Prs3d_Drawer) drowHilight = new Prs3d_Drawer();
drowHilight->SetColor( Quantity_Color(Quantity_NOC_CYAN2) );
m_context->SetHighlightStyle​( drowHilight );
m_context->SetDisplayMode( AIS_Shaded, Standard_True );