Example #1
0
void ProgressBar::percent(float p)
{
	if (p < 0.0f) percent_ = 0.0f;
	else if (p > 1.0f) percent_ = 1.0f;
	else percent_ = p;

	notifyRedraw();
}
Example #2
0
void Button::updateButtonState()
{
	if (isDisable_) currState_ = ST_DISABLE;
	else if (mouseDown_) currState_ = ST_DOWN;
	else if (mouseOver_) currState_ = ST_OVER;
	else currState_ = ST_NORMAL;
	notifyRedraw();
}
//--------------------------------------------------------------------------------------------------
/// 
//--------------------------------------------------------------------------------------------------
bool RicBoxManipulatorEventHandler::eventFilter(QObject *obj, QEvent* inputEvent)
{
    if (inputEvent->type() == QEvent::MouseButtonPress)
    {
        QMouseEvent* mouseEvent = static_cast<QMouseEvent*>(inputEvent);

        if (mouseEvent->button() == Qt::LeftButton)
        {
            cvf::HitItemCollection hitItems;
            if (m_viewer->rayPick(mouseEvent->x(), mouseEvent->y(), &hitItems))
            {
                m_partManager->tryToActivateManipulator(hitItems.firstItem());

                if(m_partManager->isManipulatorActive())
                {
                    emit notifyRedraw();

                    return true;
                }
            }
        }
    }
    else if (inputEvent->type() == QEvent::MouseMove)
    {
        if (m_partManager->isManipulatorActive())
        {
            QMouseEvent* mouseEvent = static_cast<QMouseEvent*>(inputEvent);

            //qDebug() << "Inside mouse move";
            //qDebug() << mouseEvent->pos();

            int translatedMousePosX = mouseEvent->pos().x();
            int translatedMousePosY = m_viewer->height() - mouseEvent->pos().y();

            cvf::ref<cvf::Ray> ray = m_viewer->mainCamera()->rayFromWindowCoordinates(translatedMousePosX, translatedMousePosY);
            {
                m_partManager->updateManipulatorFromRay(ray.p());

                cvf::Vec3d origin;
                cvf::Vec3d size;
                m_partManager->originAndSize(&origin, &size);

                emit notifyUpdate(origin, size);

                emit notifyRedraw();

                return true;
            }
        }
    }
    else if (inputEvent->type() == QEvent::MouseButtonRelease)
    {
        if (m_partManager->isManipulatorActive())
        {
            m_partManager->endManipulator();

            cvf::Vec3d origin;
            cvf::Vec3d size;
            m_partManager->originAndSize(&origin, &size);

            emit notifyUpdate(origin, size);

            return true;
        }
    }

    return false;
}
//--------------------------------------------------------------------------------------------------
/// 
//--------------------------------------------------------------------------------------------------
void RicBoxManipulatorEventHandler::setSize(const cvf::Vec3d& size)
{
    m_partManager->setSize(size);
    
    emit notifyRedraw();
}
//--------------------------------------------------------------------------------------------------
/// 
//--------------------------------------------------------------------------------------------------
void RicBoxManipulatorEventHandler::setOrigin(const cvf::Vec3d& origin)
{
    m_partManager->setOrigin(origin);

    emit notifyRedraw();
}
Example #6
0
void Label::fontColor(const Gdiplus::Color& c)
{
	fontColor_ = c;
	notifyRedraw();
}
Example #7
0
void Label::fontFamily(const std::wstring& f)
{
	fontFamily_ = f;
	notifyRedraw();
}
Example #8
0
void Label::fontSize(float sz)
{
	fontSize_ = sz;
	notifyRedraw();
}
Example #9
0
void Label::text(const std::wstring& t)
{
	text_ = t;
	notifyRedraw();
}