sview.html5.js
The application-layer main class, used to obtain underlying interfaces and listen for underlying methods.
Initialize SView
initSView(labelId) {
this.sviewFrame = SView.createSViewObject(SView, "FrameMain", labelId);
if (renderType !== RenderType.Server) {
this.sviewFrame.createCanvas(labelId);
this.sviewFrame.getViewer().initEventListener();
}
// Add a message subscription to the Frame layer
M3D.Utility.M3DMessageCenter.getCenter().subscribe(this, this.sviewFrame);
return this.sviewFrame;
}
For message listening and handling, refer to the SView message mechanism in the API documentation and the original file.
update(msg) {
// console.error(`I am [sview], and I received a new message with content: ${msg.state}`);
switch (msg.type) {
// Whether to enable the right-click menu (msg.state = "true")
case "ChangeRightMenuClick":
break;
case "MoveTypeCommand":
break;
case "PlayAnimationCommand":
break;
case "CreateClipPlaneCommandView":
break;
case "ShapeSetCommandView":
break;
case "PropertyCommandView":
break;
case "CollisionCommand":
break;
case "ChangeFaceColor":
break;
case "VolumeWeightCommand":
break;
case "CollisionCommandView":
break;
case "DrawMode":
break;
case "ClipPlaneCommand":
break;
case SView.Commands.CommandNames.CHANGEVIEWCOMMAND:
break;
case M3D.Utility.MessageType.Read:
{
break;
}
case M3D.Utility.MessageType.Scene:
break;
case M3D.Utility.MessageType.Loader:
{
break;
}
case M3D.Utility.MessageType.Shapes:
{
break;
}
case M3D.Utility.MessageType.Licence:
{
break;
}
case M3D.Utility.MessageType.Selector:
{
break;
}
}
}
Some External Message Events
class FunctionListener {
static configLoaded(configType) {
}
static showHideAssemblyDilaog(isShow) {
}
static buttonClickFunction(id, enterMenu, returnMenu = MainBottomMenu) {
}
static changeBottomMenuState(event) {
}
static createSubMenu(id, enterMenu) {
}
static executeCommand(btnId) {
}
static showViewMenu(elementId) {
}
static selectWalkingMode() {
}
static showTopViewBar(isShow) {
}
}