Netless whiteboard supports multiple scenes. Based on multiple scenarios, we can design multi-page whiteboard functions and PPT presentation functions.
The single scene is a vast space that extends infinitely around. Users can write in this space, insert pictures, or insert a certain page of the PPT. We can construct multiple scenes in a room and switch between different scenes. This kind of switching is visually like "cutting pages". Therefore, in business, we can regard "scene" as "page".
If we want to show a 20-page PPT, we can construct 20 scenes in a whiteboard room, and place a page of PPT content in each scene for display. By switching scenes, we have achieved a page cut effect similar to PPT.
There can be one or more scenes in the room of the whiteboard. At each moment, only one of these scenes can be shown. You can add, delete, modify, and check scenes through the SDK API. But please note that you cannot delete all the scenes-you must at least leave the last scene for the room.
In the room, in addition to the "scene", there is also a "scene group" structure. Scene groups can contain other scenes or scene groups. The room itself is also a special scene group, the root scene group. We cannot show a certain scene group, but we can show a certain scene. In addition, the scene itself no longer contains a more microscopic structure.
This organizational structure makes the scenes and scene groups in the room present tree structure. You can cleverly design a tree structure to meet your business scenarios.
The organizational structure designed as shown above can meet the following business requirements.
Each scene and scene group has an address (identified by a character string), which can uniquely identify a scene or scene group. The address rules are as follows.
/
./${scene-name}
. Where ${scene-name}
is the name of the scene or scene group.The above rule may be very abstract, we can look at an example.
For the scene group /math
, the scenes /math/class-A
and /math/class-B
belong to it, and /physical/class-C
does not belong to it .
In addition, any newly created room contains only one scene by default, and the address of this scene is /init
.
If you find the scene identification rules a bit obscure, you can think of scenes as files, scene groups as folders, and their addresses as the addresses of the file system in Unix/Linux.
You can directly add or delete scenes, and the associated scene groups will be automatically added or deleted. In other words, you don't need to manage scene groups specifically.
For example, suppose the current room only has /
scene group and /init
scene.
First, you add a scene with the address /math/class-A
. The scene belongs to the /math
scene group, but the scene group does not exist. Therefore, the /math
scene group will be added automatically.
Later, you added another scene with the address /math/class-B
. Since the /math
scene group exists, the new scene is directly added to the /math
scene group.
After that, you deleted the scene with the address /math/class-A
, so it was deleted.
Finally, you delete the scene whose address is /math/class-B
. At this time, all the elements in the /math
scene group are deleted, so the /math
scene group is Automatically delete.
The management of scenes and scene groups follows the following three rules.
/init
will be created automatically.When adding a new scene, a series of related scene group parent nodes may be automatically created. Failure to create any of the parent nodes will result in the failure of the "Add Scene" behavior. This failure is often because a scene group with the same name exists in an automatically created parent node scene group. Based on the principle of prohibiting the existence of elements with the same name in the same scene group, the automatic creation behavior fails.
The scene group contains multiple elements, and the elements can be either scenes or scene groups. The scenes in the scene group are ordered. Each element has its own name, and elements within the same scene group are not allowed to have the same name. In this way, from the point of view of data structure, a scene group is an ordered dictionary.
You can manually adjust the order of the scenes in the scene group (but there is no order in the scene group).