8 #include "ccMouseCircle.h"
30 ccMouseCircle::m_owner = owner;
31 m_owner->installEventFilter(
this);
38 m_owner->removeEventFilter(
this);
87 int halfW =
static_cast<int>(
context.glW / 2.0f);
88 int halfH =
static_cast<int>(
context.glH / 2.0f);
91 QPoint p = m_owner->mapFromGlobal(QCursor::pos());
93 int my = 2 * halfH - p.y();
97 int cx = dx + mx - halfW;
98 int cy = dy + my - halfH;
113 bool ccMouseCircle::eventFilter(QObject* obj, QEvent*
event) {
117 if (
event->type() == QEvent::MouseMove) {
123 if (
event->type() == QEvent::Wheel) {
124 QWheelEvent* wheelEvent =
static_cast<QWheelEvent*
>(
event);
127 if (wheelEvent->modifiers().testFlag(Qt::ControlModifier)) {
double qtCompatWheelEventDelta(const QWheelEvent *event) noexcept
cmdLineReadable * params[]
ecvViewportParameters m_params
Viewport parameters.
virtual bool isVisible() const
Returns whether entity is visible or not.
virtual void setVisible(bool state)
Sets entity visibility.
void apply(float vec[3]) const
Applies transformation to a 3D vector (in place) - float version.
float UNIT_CIRCLE[RESOLUTION][2]
void draw(CC_DRAW_CONTEXT &context) override
Draws entity and its children.
ccMouseCircle(ecvMainAppInterface *appInterface, QWidget *owner, QString name=QString("MouseCircle"))
static const int RESOLUTION
virtual void setEnabled(bool state)
Sets the "enabled" property.
Standard parameters for GL displays/viewports.
bool perspectiveView
Perspective view state.
const CCVector3d & getPivotPoint() const
Returns the pivot point (for object-centered view mode)
ccGLMatrixd viewMat
Visualization matrix (rotation only)
#define MACRO_Draw2D(context)
#define MACRO_Foreground(context)