MeVisLab Resolution Independence API
FieldSync.h
Go to the documentation of this file.
1 /*************************************************************************************
2 **
3 ** Copyright 2007, MeVis Medical Solutions AG
4 **
5 ** The user may use this file in accordance with the license agreement provided with
6 ** the Software or, alternatively, in accordance with the terms contained in a
7 ** written agreement between the user and MeVis Medical Solutions AG.
8 **
9 ** For further information use the contact form at https://www.mevislab.de/contact
10 **
11 **************************************************************************************/
12 
13 #ifndef FIELD_SYNC_H
14 #define FIELD_SYNC_H
15 
18 
19 #include <Inventor/SbPList.h>
20 
21 class SoField;
22 class SoFieldSensor;
23 class SoSensor;
24 class SoFieldContainer;
25 
26 //=============================================================
29 
30 //=============================================================
32 {
33 public:
35  FieldSyncEntry(SoField* f1, SoField* f2);
36 
39 
41  void fieldSensor(SoFieldSensor* s);
42 
44  static void fieldSensorCB(void* data, SoSensor* s);
45 
46 private:
48  void copyFieldValue(SoField* src, SoField* dst, SoFieldSensor* dstSensor);
49 
51  SoFieldSensor* _sensor1;
53  SoFieldSensor* _sensor2;
54 };
55 
56 //=============================================================
58 
59 //=============================================================
60 class FieldSync
61 {
62 public:
64  FieldSync(SoFieldContainer* src, SoFieldContainer* dst, const SbStringList& fields);
65 
67 
68 private:
70  SbPList _entries;
71 };
72 
73 #endif
a class that synchronizes two Inventor Fields with each other without using SoField::connectFrom.
Definition: FieldSync.h:32
FieldSyncEntry(SoField *f1, SoField *f2)
create field sync for fields f1 and f2
~FieldSyncEntry()
destructor
void fieldSensor(SoFieldSensor *s)
called by sensors when f1 or f2 change
static void fieldSensorCB(void *data, SoSensor *s)
forward callback to fieldSensor()
A class that synchronizes a list of fields of two SoFieldContainer instances.
Definition: FieldSync.h:61
FieldSync(SoFieldContainer *src, SoFieldContainer *dst, const SbStringList &fields)
create a two way synchronization between src and dst for all fields given in fields