void ofx2DPro::mouseReleased(ofMouseEventArgs & args){ if(cursorIsOverGUI()) return; lastClick = ofGetElapsedTimef(); selfMouseReleased(args); }
void ofx2DPro::mousePressed(ofMouseEventArgs & args){ if(cursorIsOverGUI()){ return; } if(ofGetElapsedTimef()-lastClick<doublClickThreshold) selfMouseDoublePressed(args); else selfMousePressed(args); }
void ofx2DPro::mouseDragged(ofMouseEventArgs& args){ if(cursorIsOverGUI()) return; selfMouseDragged(args); }
// selfDraw draws in 3D using the default ofEasyCamera // you can change the camera by returning getCameraRef() void CloudsVisualSystem3DModelLoader::selfDraw() { //???: update... for some reason the selfUpdate is being called in stand alone. // bLeftCamIsActive = bFrontCamIsActive = bPlanCamIsActive = bPerspCamIsActive = false; glDisable(GL_CULL_FACE); if( cursorIsOverGUI() ) { leftCam.disableMouseInput(); planCam.disableMouseInput(); frontCam.disableMouseInput(); perspCam.disableMouseInput(); } else { if( bLeftCamIsActive && !leftCam.getMouseInputEnabled()) leftCam.enableMouseInput(); if( bFrontCamIsActive && !frontCam.getMouseInputEnabled()) frontCam.enableMouseInput(); if( bPlanCamIsActive && !planCam.getMouseInputEnabled()) planCam.enableMouseInput(); if( bPerspCamIsActive && !perspCam.getMouseInputEnabled()) perspCam.enableMouseInput(); } updateModelTransform(); aimMultipleViews( modelTransform.getPosition() ); //draw from single view if( bFourView ) { //MA: changed ofGetWidth() to GetCanvasWidth() and ofGetHeight() to GetCanvasHeight() int hw = getCanvasWidth()/2; int hh = getCanvasHeight()/2; drawSceneLeft( ofRectangle(0,0,hw,hh) ); drawSceneFront( ofRectangle(hw,0,hw,hh) ); drawScenePlan( ofRectangle(0,hh,hw,hh) ); drawScenePerspective( ofRectangle(hw,hh,hw,hh) ); } else if(currentSingleCam == &perspCam) { drawScenePerspective( ofGetCurrentViewport() ); } else if(currentSingleCam == &leftCam) { drawSceneLeft(); } else if(currentSingleCam == &frontCam) { drawSceneFront(); } else if(currentSingleCam == &planCam) { drawScenePlan(); } else if(currentSingleCam == &pathCamera) { if(bUseDuration) pathCamera.update(); else pathCamera.update( pathCameraPosition ); drawSceneCamera( &pathCamera ); } }