---
metadata:
  - name: generator
    content: Diplodoc Platform v5.39.1
alternate:
  - https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/geometryEditor.model.RootPolygon.md
  - https://yandex.ru/dev/jsapi-v2-1/doc/ru/v2-1/ref/reference/geometryEditor.model.RootPolygon.md
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.ru/dev/jsapi-v2-1/doc/en/llms.txt

# geometryEditor.model.RootPolygon

{% note info %}

The constructor of the geometryEditor.model.RootPolygon class is hidden, as this class is not intended for autonomous initialization.

{% endnote %}

Extends [IGeometryEditorRootModel](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IGeometryEditorRootModel.md).

Model for the root polygon. The constructor is not available in the package.full (a standard set of modules). This module is loaded on demand.

[Fields](#properties-summary) | [Methods](#methods-summary)

## Fields {#properties-summary}

#|
|| **Name** | **Type** | **Description** ||
|| [events](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IEventEmitter.md#events) | [IEventManager](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IEventManager.md)| Event manager.

Inherited from [IEventEmitter](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IEventEmitter.md#events). ||
|#

## Methods {#methods-summary}

#|
|| **Name** | **Returns** | **Description** ||
|| [destroy](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IGeometryEditorModel.md#destroy)() | | Destructor.

Inherited from [IGeometryEditorModel](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IGeometryEditorModel.md#destroy). ||
|| [getAllVerticesNumber](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/geometryEditor.model.RootPolygon.md#getAllVerticesNumber)() | Integer
| Returns the total number of vertexes in the geometry being edited. ||
|| [getPathModels](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/geometryEditor.model.RootPolygon.md#getPathModels)() | [geometryEditor.model.ChildLinearRing](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/geometryEditor.model.ChildLinearRing.md)[]
| Returns an array of models for child contours. ||
|| [getPixels](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IGeometryEditorModel.md#getPixels)() | Number[]
| Returns the model's pixel data.

Inherited from [IGeometryEditorModel](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IGeometryEditorModel.md#getPixels). ||
|| [splicePaths](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/geometryEditor.model.RootPolygon.md#splicePaths)([start](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/geometryEditor.model.RootPolygon.md#splicePaths-param-start), [deleteCount](https://yandex.ru/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/geometryEditor.model.RootPolygon.md#splicePaths-param-deleteCount)) | Number[][]
| Deletes a defined number of polygon contours, starting from the specified index. New contours can be added in place of the deleted ones. Global pixel coordinates of the new contours can be passed as additional arguments after the "deleteCount" parameter. ||
|#

## Methods details {#method_detail}

### getAllVerticesNumber {#getAllVerticesNumber}

```javascript
{Integer} getAllVerticesNumber()
```

**Returns** the total number of vertexes in the geometry being edited.

### getPathModels {#getPathModels}

```javascript
{geometryEditor.model.ChildLinearRing[]} getPathModels()
```

**Returns** an array of models for child contours.

### splicePaths {#splicePaths}

```javascript
{Number[][]} splicePaths(start, deleteCount)
```

Deletes a defined number of polygon contours, starting from the specified index. New contours can be added in place of the deleted ones. Global pixel coordinates of the new contours can be passed as additional arguments after the "deleteCount" parameter.

**Returns** an array of coordinates of deleted contours.

**Parameters:**

#|
|| **Parameter** | **Default value** | **Description**  ||
|| [`start`](#splicePaths-param-start)[*](*star) | — | Type: Integer

The index to start from for removing and adding contours. ||
|| [`deleteCount`](#splicePaths-param-deleteCount)[*](*star) | — | Type: Integer

The number of contours to be deleted. ||
|#

\* Mandatory parameter/option.

[*star]: Mandatory parameter/option.