|
Group: Forum Members
Posts: 35,
Visits: 32
|
Needless to say your requirement is complex in nature. The multiple views feature of the document is designed to help you split the working area – shape positions in scene coordinates will be the same in all cases. To implement more complex document – views scenario I would suggest that you have a different approach that involves document synchronization. So instead of having just one document you must have say three documents the content of which is synchronized to some extend.
There are two approaches to your requirement: 1. Pull approach – perform complete synchronization at regular intervals of time. 2. Push approach – perform partial synchronization in the other views when something in one of the views changes.
I would recommend you to get started with the push approach by subscribing to all events in the document Event Sink service. To preserve at least the connected structure of the shapes I would also recommend to have something like a global map of say abstract shape to shape instances – e.g. keep track of an abstract shape, which is represented by a particular shape in each document instance.
When you add a shape -> you create a new abstract shape and create instances for the added shape in all other documents. Shape deep cloning can be useful here. However since you have actually three shapes they all can have different positions and geometry.
When you delete a shape -> you can find the abstract shape and find the related instances in the other views to delete.
When you connect two shapes -> again you can query the global map and find the instances of the shapes in the other documents that need to be connected.
So in general your requirement can be achieved, because the document event sink service will raise all the mutation events that you need to implement the push approach, but it is not something that we provide support for “out of the box”
|