本文整理汇总了C++中ci::app::MouseEvent::getWheelIncrement方法的典型用法代码示例。如果您正苦于以下问题:C++ MouseEvent::getWheelIncrement方法的具体用法?C++ MouseEvent::getWheelIncrement怎么用?C++ MouseEvent::getWheelIncrement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ci::app::MouseEvent
的用法示例。
在下文中一共展示了MouseEvent::getWheelIncrement方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mouseWheel
void ColorPicker::mouseWheel( ci::app::MouseEvent &event )
{
if( isHit( event.getPos() ) && !mHit ) {
mColor.a -= event.getWheelIncrement() * mFormat.mSensitivity;
mColor.a = std::max( std::min( mColor.a, mFormat.mAlphaLimits.y ), mFormat.mAlphaLimits.x );
updateColorRef();
updateLabel();
setNeedsDisplay();
if( (int)mTrigger & (int)Trigger::CHANGE ) {
trigger();
}
}
else if( mHit ) {
vec3 color = mColor.get( mFormat.mColorModel );
color.z -= event.getWheelIncrement() * mFormat.mSensitivity;
color.z = std::max( std::min( color.z, 1.0f ), 0.0f );
mColor.set( mFormat.mColorModel, vec4( color.x, color.y, color.z, mColor.a ) );
updateColorRef();
updateLabel();
setNeedsDisplay();
if( (int)mTrigger & (int)Trigger::CHANGE ) {
trigger();
}
}
}
示例2: mouseWheel
void GesturesDemo::mouseWheel(ci::app::MouseEvent event) {
double angle = (event.getWheelIncrement() > 0) ? 2 : -2;
ci::Vec2f temp(getMousePos());
temp[0] /= getWindowWidth();
temp[1] /= getWindowHeight();
field.Rotate(0, temp, 0.5, angle);
}
示例3: signbit
void DialerT<T>::mouseWheel( ci::app::MouseEvent &event )
{
if( isHit( event.getPos() ) )
{
T value = *mValueRef + mZoneMultiplier*( signbit( event.getWheelIncrement() ) > 0 ? 1.0 : -1.0 );
setValue( max( min( value, mMax ), mMin ) );
if( (int)mTrigger & (int)Trigger::CHANGE )
{
trigger();
}
}
}
示例4: onMouseWheel
void PretzelRoot::onMouseWheel(ci::app::MouseEvent &event)
{
mGuiList[0]->mouseWheel( event.getWheelIncrement() );
// for( auto it = mGuiList.begin(); it!=mGuiList.end(); ++it){
// PretzelGui *pg = *it;
//
// if( pg->getGlobalBounds().contains( event.getPos() ) ){
// (*it)->mouseWheel( event.getWheelIncrement() );
// break;
// }
// }
}
示例5: onMouseWheel
void PretzelRoot::onMouseWheel(ci::app::MouseEvent &event)
{
// TODO: this should only happen on the front gui. Make sure to hit test it though.
// mGuiList[0]->mouseWheel( event.getWheelIncrement() );
for( auto it = mGuiList.begin(); it!=mGuiList.end(); ++it){
PretzelGui *pg = *it;
if( pg->getGlobalBounds().contains( event.getPos() ) ){
(*it)->mouseWheel( event.getWheelIncrement() );
break;
}
}
}
示例6: mouseWheel
// Zoom code taken from Cinder::MayaCamUI
bool Camera::mouseWheel(ci::app::MouseEvent m_event) {
if (draw_interface_)
return false;
float mouse_delta = m_event.getWheelIncrement() * zoom_speed_;
//float direction = mouse_delta > 0.0f ? 1.0 : -1.0;
float newCOI = powf( 2.71828183f, -mouse_delta / 500.0f ) * cam_->getCamera().getCenterOfInterest();
ci::Vec3f oldTarget = cam_->getCamera().getCenterOfInterestPoint();
ci::Vec3f newEye = oldTarget - cam_->getCamera().getViewDirection() * newCOI;
ci::CameraPersp new_cam = cam_->getCamera();
new_cam.setEyePoint( newEye );
new_cam.setCenterOfInterest( newCOI );
cam_->setCurrentCam(new_cam);
return false;
}
示例7: mouseWheel
void App::mouseWheel(const ci::app::MouseEvent Event)
{
for (auto&& listener : m_InputListeners) {
listener->OnMouseWheel(Event.getWheelIncrement(), Event);
}
}
示例8: mouseDrag
void TouchDebug::mouseDrag(const ci::app::MouseEvent& e) {
if(mReplicating){
replicate(e, ds::ui::TouchInfo::Moved);
} else if(mTwoTouching){
mEngine.mouseTouchMoved(e, mTouchId);
int deltaX = e.getPos().x - mTwoTouchDown.x;
int deltaY = e.getPos().y - mTwoTouchDown.y;
ci::app::MouseEvent mouseTwo = ci::app::MouseEvent(e.getWindow(), 0, mTwoTouchDown.x - deltaX, mTwoTouchDown.y - deltaY, e.getNativeModifiers(), e.getWheelIncrement(), e.getNativeModifiers());
mEngine.mouseTouchMoved(mouseTwo, mTouchId + 1);
} else {
mEngine.mouseTouchMoved(e, mTouchId);
}
}
示例9: mouseDown
void TouchDebug::mouseDown(const ci::app::MouseEvent& e) {
mReplicating = false;
if(e.isAltDown()) {
if(!mDropTouched){
mEngine.mouseTouchBegin(e, mTouchId + 2);
mDropTouched = true;
} else {
mEngine.mouseTouchEnded(e, mTouchId + 2);
mDropTouched = false;
}
} else if(e.isShiftDown()) {
mReplicating = true;
replicate(e, ds::ui::TouchInfo::Added);
} else if(e.isControlDown()){
if(mTwoTouching){
mTwoTouching = false;
} else {
mTwoTouching = true;
mTwoTouchDown = e.getPos();
}
} else if(mTwoTouching){
mEngine.mouseTouchBegin(e, mTouchId);
int deltaX = e.getPos().x - mTwoTouchDown.x;
int deltaY = e.getPos().y - mTwoTouchDown.y;
ci::app::MouseEvent mouseTwo = ci::app::MouseEvent(e.getWindow(), 0, mTwoTouchDown.x - deltaX, mTwoTouchDown.y - deltaY, e.getNativeModifiers(), e.getWheelIncrement(), e.getNativeModifiers());
mEngine.mouseTouchBegin(mouseTwo, mTouchId + 1);
} else {
mEngine.mouseTouchBegin(e, mTouchId);
}
}
示例10: ImGui_ImplCinder_ScrollCallback
void ImGui_ImplCinder_ScrollCallback(ci::app::MouseEvent e)
{
g_MouseWheel += e.getWheelIncrement();
}