# Signals between Axl objects¶

Signals are exchanged between the objects of the following types:

• Data: geometric objects, such as points, lines, planes, …
• Inspector: tools, which display the information on the geometric objects and allow to edit them;
• Actor: tools, which allow to modify graphically the objects;

The signals are exchanged between data and inspectors and bewteen data and actors, to update the information attached to these classes.

## Data¶

Each Axl data which inherits from `axlAbstractData` has signals attached to it:

```signals:
void modifiedGeometry(void);
void modifiedStructure(void);
void modifiedField(void);
```
• `modifiedGeometry` indicates that the data of the object have changed. It can be emitted by using:

```this->touchGeometry();
```
• `modifiedStructure` indicates that the structure (e.g., the connection of the control points) has changed. It can be emitted by using:

```this->touchStructure();
```
• `modifiedField` indicates that the field attached to the object has changed. It can be emitted by using:

```this->touchField();
```

## Inspector¶

Two types of messages need to be considered.

• First, when values such as the coordinates of a point are modified from the inspector, the corresponding data are modified. This is done with the connection:

```connect(d->coordinate_x, SIGNAL(valueChanged(double)), this, SLOT(onCoordDataChanged_x(double)));
```

via the method `onCoordDataChanged_x`:

```void axlInspectorObjectPoint::onCoordDataChanged_x(double x)
{
d->point->x() = x;
d->point->touchGeometry();
emit update();
}
```
• Secondly, when the object is modified, the data inspector should update its displayed values. This is done in the method `setData` of the data inspector. A connection between the signal `modifiedGeometry` and the slot `updateValues` allows to update the values displayed by the data inspector when the data is modified:

```{
return QSize(300, 300);
}

void axlInspectorObjectPoint::setData(axlPoint *point)
{
```

Here is the method `updateValues`, which updates the values displayed by the inspector:

```void axlInspectorObjectPoint::onChangedBoxValue_y(void)
{
double y = d->point->y();
d->coordinate_y->setValue(y);
}

```

When the signal `modifiedGeometry` is sent, the slot `updateValues` is evaluated and the displayed values of the coordinates in the inspector are updated according to the coordinates of the point.

## Actor¶

Here also, two types of messages need to be considered.

• When the widget in the actor Data Observer modifies the data, a signal `modifiedGeometry` is emitted. Here is the method `Execute` in the class `axlActorPointObserver`, which send this signal:

```    virtual void Execute(vtkObject *caller, unsigned long event, void *)
{
vtkRenderWindowInteractor *interactor = observerDataAssembly->getInteractor();            //interactor->Render();

if(event == vtkCommand::InteractionEvent) {
observerData_sphereSource->Update();
observerData_sphereSource->Modified();
interactor->Render();

if (!pointWidget)
return;

if(caller == pointWidget) {
observerData_point->setCoordinates(pointWidget->GetPosition(), pointWidget->GetPosition(), pointWidget->GetPosition());
observerData_point->touchGeometry();
```
• When the data is modified, the actor should be updated. In the method `setData` of the corresponding actor, the signal `modifiedGeometry` is connected with the slot `onUpdateGeometry`, which updates the actor data:

```connect(d->point, SIGNAL(modifiedGeometry()),this, SLOT(onUpdateGeometry()));
```

Here is the method `onUpdateGeometry`, which update the source and widget of the actor:

```    }

//remove actor specificity
this->RemoveAllObservers();
this->RemovePart(this->getActor());
this->getActor()->RemoveAllObservers();

if(axlActorComposite *actorComposite = dynamic_cast<axlActorComposite *>(this->parent()) )
actorComposite->removeActorReference(this);
}

void axlActorPoint::onUpdateGeometry(void)
{
d->sphereSource->SetCenter(d->point->coordinates());
```
{"ft_lang_label":"__label__en","ft_lang_prob":0.64613473,"math_prob":0.83493567,"size":3814,"snap":"2021-21-2021-25","text_gpt3_token_len":833,"char_repetition_ratio":0.13910761,"word_repetition_ratio":0.04118993,"special_character_ratio":0.20372313,"punctuation_ratio":0.17200674,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9596422,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-05-16T08:03:02Z\",\"WARC-Record-ID\":\"<urn:uuid:b3d71244-1a3f-4544-ac4a-69548f48dfb8>\",\"Content-Length\":\"31869\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:d6946b29-8d8c-4a28-af5c-6bd489dcfc89>\",\"WARC-Concurrent-To\":\"<urn:uuid:7672477e-d32a-4cc7-8d6d-180a405e9e43>\",\"WARC-IP-Address\":\"138.96.19.17\",\"WARC-Target-URI\":\"http://axel.inria.fr/structure/signals.html\",\"WARC-Payload-Digest\":\"sha1:BWTWLPW53PLHT5T4IEYAU3KRX6YP4UY6\",\"WARC-Block-Digest\":\"sha1:L5RWUHNXYINX5JQFJ643GHXUJXENGMZH\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-21/CC-MAIN-2021-21_segments_1620243992516.56_warc_CC-MAIN-20210516075201-20210516105201-00357.warc.gz\"}"}