# Geometry: Highlight Clicked Parts

A highlighted part is shown with a white halo. This is useful for indicating for instance selection. The highlighting mechanism applies to all types of parts:

- Data parts
- Isosurfaces
- Isovolumes
- Cutting planes
- Geometry parts (using halo effect)

This example shows how highlight parts as a response to a mouse press event.

Pick event

Send a notification when a pick has occurred.

Attach to the mouse pressed event in the viewer. Create a `cee::Ray` object from the mouse event coordinates and emit a picked signal using this ray.

    void TutorialRunnerViewer::mousePressEvent(QMouseEvent* event)
    {
        cee::vis::View* theView = view();
        if (!theView) return;

        // Picking!
        cee::Ray ray = theView->camera().rayFromWindowCoordinates(event->pos().x(), height() - event->pos().y());
        m_mainWindow->pick(ray);

        cee::vis::CameraInputHandler* inputHandler = theView->camera().inputHandler();
        if (inputHandler)
        {
            cee::vis::MouseEvent me = cee::qt::UtilsGui::toMouseEvent(*this, *event);
            cee::vis::MouseButton buttonPressed = cee::qt::UtilsGui::toMouseButton(event->button());

            inputHandler->mousePressEvent(buttonPressed, me);
            update();
        }
    }

Create the model and connection

Create a geometry model with four boxes.

Respond to a picking event sent from the viewer

Highlight the last hit box

Conversation saved
HOOPSY BETA

### Hello! I'm HOOPSY

Your multilingual generative AI assistant for documentation. Ask me anything about HOOPS Envision for Desktop in your own language, or choose a sample question below to start a conversation:

What is HOOPS Envision for Desktop?
What are the latest release notes for HOOPS Envision for Desktop?
How do I start evaluating HOOPS Envision for Desktop?
How do I write my first sample application?
How can I get assistance?

HOOPSY may store conversations according to OpenAI's policy. Responses may not always be accurate.

HOOPSY is thinking...