/* *interaction sur mouvement de souris -> bouge la KO */ void KeyOrientation::onMotionInteraction(ArRef<AbstractInteractor> source, ArRef<Base3D> newLocation, bool begin, bool end) { _c3dof->globalToLocalLocation(newLocation); double x, y, z; newLocation->getPosition(x, y, z); Vector3d v(x, y, z); v.normalize(); v *= _c3dof->getRadius(); newLocation->setPosition(v.x(),v.y(), v.z()); _c3dof->localToGlobalLocation(newLocation); Object3D::onMotionInteraction(source, ShapePart3D::nullRef(), 0, newLocation, begin, end); }
AReViVocalPlayerWidget::AReViVocalPlayerWidget(ArCW& arCW, AReViWindow3D* window) : ArObject(arCW), _viewer(window->getAReViViewer()), _window3D(window) { _widgetInteractor = WidgetInteractor::NEW(); _parser = XmlParser::NEW(); _parser->parseFile("vocalPlayerWidget.xml"); /** parse & create widgets */ if(!ArWidgetUtils::readWidgets(_parser->getRoot(),_widgets,_viewer)) { cerr << "VocalPlayerWidget -- Error reading widgets description" << endl; exit(1); } /** execute */ if (ArWidgetUtils::findWidget("executeButton2",AwWidget::nullRef(),_executeButton)) _executeButton->addClickCB(thisRef(),&AReViVocalPlayerWidget::_onExecuteButtonClick); ArRef<AwWidget> widgets = _widgets["executeButton2"]; widgets->setPosition(200,960); //crade, recup la taille de la window initializeMap(); }