# MoveTo Class

> An operator that creates a path by moving to a new current position.

- Product: Adobe PDF Library 21
- Language: Modern C++
- Version: 21.4.0
- HTML page: https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/MoveTo
- Version index: https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/llms.txt

```cpp
class MoveTo : Segment
```

**Namespace:** `datalogics_interface`

**Inherits from:** [`Segment`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/Segment.md)

## Description

An operator that creates a path by moving to a new current position.

A LineTo operator creates an addition to a path element by moving to the (x,y) coordinates specified in the MoveTo statement. The MoveTo coordinates serve as the new current position, and from here a new path element can start.

For example, the MoveTo coordinates can define the starting position for a LineTo operator. The LineTo operator draws a straight line from the current position (MoveTo) to a new position, the set of (x,y) coordinates defined with the LineTo operator: MoveTo{x:0 y:50} LineTo{x:100 y:100}

**Uses types:** [`Point`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/struct/Point.md)

## Constructors

### MoveTo

```cpp
datalogics_interface::MoveTo::MoveTo(const Point &pt)
```

*constructor*

**Parameters**

- `pt` ([`const Point &`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/struct/Point.md)): The new current point to move to.

Move to a new current point.

Begin a new subpath by moving the current point to a new point, omitting any connecting line segment. If the previous path segment in the current path was also a MoveTo, the new m overrides it; no vestige of the previous MoveTo operation remains in the path.

### MoveTo

```cpp
datalogics_interface::MoveTo::MoveTo(double x, double y)
```

*constructor*

**Parameters**

- `x` (`double`): The new current point to move to.
- `y` (`double`)

Move to a new current point.

Begin a new subpath by moving the current point to a new point, omitting any connecting line segment. If the previous path segment in the current path was also a MoveTo, the new m overrides it; no vestige of the previous MoveTo operation remains in the path.

### ~MoveTo

```cpp
datalogics_interface::MoveTo::~MoveTo() override
```

*destructor*

## Methods

### point

```cpp
Point datalogics_interface::MoveTo::point() const
```

**Returns:** [`Point`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/struct/Point.md)

The destination of the move-to.

### to_string

```cpp
std::string datalogics_interface::MoveTo::to_string() const override
```

**Returns:** `std::string`

Represents a segment, or a single line, within a path.
