For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings

 

Need to speed up your development?
Have a look at our:

Samples & Tools

 

Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

Related pages

HasDetected never returning anything

Mimosa Olive's picture
Forums: 

Hi, I have OC 7.2 and a little app drawing the MakeBottle example and few extra primitive for testing. Now I'd like to detect a shape when the mouse moves around. Under my MouseMove function, I try this method but it's never true.

void wxViewOC::mouseMoved(wxMouseEvent& event)

{

if (mContext->HasDetected()){
     wxMessageBox("HasDetected");//the code never reach this part
 }

}

Am I missing a setting or something?

Robert W.'s picture

Do you call the MoveTo method on your context? You need it to sync the mouse position with the position in your 3d view.

https://www.opencascade.com/doc/occt-6.9.0/refman/html/class_a_i_s___int...

Mimosa Olive's picture

Yes I discover I needed to do that. Thanks a lot!