# cee::app::Selection

class `Selection` : public RefCountedObject

  Class to manage a list of selected HitItems.

  Selected items are per view.

  Public Types

  enum `ItemType`

    List of selection item types.

    Values:

    enumerator `NONE`

      None.

    enumerator `ELEMENT`

      Element selection.

    enumerator `NODE`

      Node selection.

    enumerator `ELEMENT_NODE`

      Element node selection.

    enumerator `ELEMENT_SURFACE`

      Element surface selection.

    enumerator `COORDINATE`

      Coordinate selection.

  Public Functions

  `Selection`()

    Constructs an empty selection instance.

  size_t `count`()

    Returns number of selections.

  void `set`(size_t index, const cee::ug::HitItem &item)

    Sets the hititem item at the specified index.

  cee::ug::HitItem `get`(size_t index)

    Returns the hititem at index.

  size_t `add`(const cee::ug::HitItem &hitItem)

    Adds the specified hititem and returns its index.

  size_t `addNode`(size_t index)

    Adds a node by index to selection.

  size_t `addElement`(size_t index)

    Adds an element by index to selection.

  size_t `addElementNode`(size_t elementIndex, size_t localNodeIndex)

    Adds an element node by element index and local node index to selection.

  size_t `addElementSurface`(size_t elementIndex, size_t surfaceIndex)

    Adds an element surface by element index and surface index to selection.

  size_t `addCoordinate`(const cee::Vec3d &coordinate)

    Adds a coordinate to selection.

  void `remove`(size_t index)

    Removes the selection at index.

  void `removeAll`()

    Removes all selections.

  void `setItemType`(ItemType selectionType)

    Sets the selection type.

  ItemType `itemType`() const

    Returns the selection type.

  bool `isMultiSelectionEnabled`() const

    Returns true of multi selection is enabled.

  void `enableMultiSelection`(bool enable)

    Enables multi selection.

  const int `initialGeometryId`(size_t index) const

    Returns the initial geometry id for the given index.

Conversation saved
HOOPSY BETA

### Hello! I'm HOOPSY

Your Docs generative AI assistant. Ask me anything about HOOPS Envision for Desktop 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...