InventorAppDev

description: Inventor

Inventor app for Paraworld

Title Inventor app for Paraworld
Author(s) Date: 2008/11/24
Date 2008/11/24
File script/kids/3DMapSystemUI/Inventor/app_main.lua

Description

db registration insert script INSERT INTO apps VALUES (NULL, 'Sample_GUID', 'Inventor', '1.0.0', 'http://www.paraengine.com/apps/Sample_v1.zip', 'YourCompany', 'enUS', 'script/kids/3DMapSystemUI/Inventor/IP.xml', '', 'script/kids/3DMapSystemUI/Inventor/app_main.lua', 'MyCompany.Apps.Inventor.MSGProc', 1);

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/app_main.lua");

Member Functions

MyCompany.Apps.Inventor.OnConnection

requires

create class commonlib.setfield("MyCompany.Apps.Inventor", {}); NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Util/GlobalInventor.lua");


event handlers

OnConnection method is the obvious point to place your UI (menus, mainbars, tool buttons) through which the user will communicate to the app. This method is also the place to put your validation code if you are licensing the add-in. You would normally do this before putting up the UI. If the user is not a valid user, you would not want to put the UI into the IDE.

  • param app : the object representing the current application in the IDE.
  • param connectMode : type of ConnectMode.

syntax

function MyCompany.Apps.Inventor.OnConnection(app, connectMode)

parameters

app the object representing the current application in the IDE.
connectMode  

MyCompany.Apps.Inventor.OnDisconnection

Receives notification that the Add-in is being unloaded.

syntax

function MyCompany.Apps.Inventor.OnDisconnection(app, disconnectMode)

parameters

app  
disconnectMode  

MyCompany.Apps.Inventor.OnQueryStatus

This is called when the command's availability is updated When the user clicks a command (menu or mainbar button), the QueryStatus event is fired. The QueryStatus event returns the current status of the specified named command, whether it is enabled, disabled, or hidden in the CommandStatus parameter, which is passed to the msg by reference (or returned in the event handler).

  • param commandName : The name of the command to determine state for. Usually in the string format "Category.SubCate.Name".
  • param statusWanted : what status of the command is queried. it is of type CommandStatusWanted
  • return __ : returns according to statusWanted. it may return an integer by adding values in CommandStatus.

syntax

function MyCompany.Apps.Inventor.OnQueryStatus(app, commandName, statusWanted)

parameters

app  
commandName The name of the command to determine state for. Usually in the string format "Category.SubCate.Name".
statusWanted  
return returns according to statusWanted. it may return an integer by adding values in CommandStatus.

MyCompany.Apps.Inventor.OnExec

This is called when the command is invoked.The Exec is fired after the QueryStatus event is fired, assuming that the return to the statusOption parameter of QueryStatus is supported and enabled. This is the event where you place the actual code for handling the response to the user click on the command.

  • param commandName : The name of the command to determine state for. Usually in the string format "Category.SubCate.Name".

syntax

function MyCompany.Apps.Inventor.OnExec(app, commandName, params)

parameters

app  
commandName The name of the command to determine state for. Usually in the string format "Category.SubCate.Name".
params  

MyCompany.Apps.Inventor.OnRenderBox

Change and render the 3D world with mcml data that is usually retrieved from the current user's profile page for this application.

syntax

function MyCompany.Apps.Inventor.OnRenderBox(mcmlData)

parameters

mcmlData  

MyCompany.Apps.Inventor.Navigate

called when the user wants to nagivate to the 3D world location relavent to this application

syntax

function MyCompany.Apps.Inventor.Navigate()

MyCompany.Apps.Inventor.GotoHomepage

called when user clicks to check out the homepage of this application. Homepage usually includes: developer info, support, developer worlds information, app global news, app updates, all community user rating, active users, trade, currency transfer, etc.

syntax

function MyCompany.Apps.Inventor.GotoHomepage()

MyCompany.Apps.Inventor.DoQuickAction

called when user clicks the quick action for this application.

syntax

function MyCompany.Apps.Inventor.DoQuickAction()

MyCompany.Apps.Inventor.MSGProc


client world database function helpers.


all related messages

APPS can be invoked in many ways: Through app Manager mainbar or menu command or buttons Command Line 3D World installed apps

syntax

function MyCompany.Apps.Inventor.MSGProc(window, msg)

parameters

window  
msg  

CommandAdd

Title CommandAdd
Author(s) Leio
Date 2008/11/24
File script/kids/3DMapSystemUI/Inventor/Command/CommandAdd.lua

Description

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Command/CommandAdd.lua");

CommandChangeState

Title CommandChangeState
Author(s) Leio
Date 2008/11/24
File script/kids/3DMapSystemUI/Inventor/Command/CommandChangeState.lua

Description

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Command/CommandChangeState.lua");

CommandCopy

Title CommandCopy
Author(s) Leio
Date 2008/11/24
File script/kids/3DMapSystemUI/Inventor/Command/CommandCopy.lua

Description

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Command/CommandCopy.lua");

CommandCut

Title CommandCut
Author(s) Leio
Date 2008/11/24
File script/kids/3DMapSystemUI/Inventor/Command/CommandCut.lua

Description

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Command/CommandCut.lua");

CommandDelete

Title CommandDelete
Author(s) Leio
Date 2008/11/24
File script/kids/3DMapSystemUI/Inventor/Command/CommandDelete.lua

Description

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Command/CommandDelete.lua");

CommandDeleteAll

Title CommandDeleteAll
Author(s) Leio
Date 2008/11/24
File script/kids/3DMapSystemUI/Inventor/Command/CommandDeleteAll.lua

Description

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Command/CommandDeleteAll.lua");

CommandGroup

Title CommandGroup
Author(s) Leio
Date 2008/11/27
File script/kids/3DMapSystemUI/Inventor/Command/CommandGroup.lua

Description

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Command/CommandGroup.lua");

CommandPaste

Title CommandPaste
Author(s) Leio
Date 2008/11/24
File script/kids/3DMapSystemUI/Inventor/Command/CommandPaste.lua

Description

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Command/CommandPaste.lua");

CommandUnGroup

Title CommandUnGroup
Author(s) Leio
Date 2008/11/27
File script/kids/3DMapSystemUI/Inventor/Command/CommandUnGroup.lua

Description

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Command/CommandUnGroup.lua");

ICommand

Title ICommand
Author(s) Leio
Date 2008/11/24
File script/kids/3DMapSystemUI/Inventor/Command/ICommand.lua

Description

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Command/ICommand.lua");

UndoManager

Title UndoManager
Author(s) Leio
Date 2008/11/24
File script/kids/3DMapSystemUI/Inventor/Command/UndoManager.lua

Description

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Command/UndoManager.lua");

Lite3DCanvas

Title Lite3DCanvas
Author(s) Leio
Date 2008/11/24
File script/kids/3DMapSystemUI/Inventor/Container/Lite3DCanvas.lua

Description

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Container/Lite3DCanvas.lua");

Lite3DCanvasView

Title Lite3DCanvasView
Author(s) Leio
Date 2008/11/27
File script/kids/3DMapSystemUI/Inventor/Container/Lite3DCanvasView.lua

Description

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Container/Lite3DCanvasView.lua");

LiteCanvas

Title LiteCanvas
Author(s) Leio
Date 2009/1/15
File script/kids/3DMapSystemUI/Inventor/Container/LiteCanvas.lua

Description

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Container/LiteCanvas.lua");

local canvas = Map3DSystem.App.Inventor.LiteCanvas:new{
   type = "MiniScene", -- "MiniScene" or "Scene"
   autoPick = false,
}

LiteCanvasView

Title LiteCanvasView
Author(s) Leio
Date 2008/11/27
File script/kids/3DMapSystemUI/Inventor/Container/LiteCanvasView.lua

Description

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Container/LiteCanvasView.lua");

BaseObject

Title BaseObject
Author(s) Leio
Date 2008/11/24
File script/kids/3DMapSystemUI/Inventor/Entity/BaseObject.lua

Description

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Entity/BaseObject.lua");

Member Functions

BaseObject:SetPicking


syntax

function BaseObject:SetPicking(v)

parameters

v  

Group

Title Group
Author(s) Leio
Date 2008/11/26
File script/kids/3DMapSystemUI/Inventor/Entity/Group.lua

Description

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Entity/Group.lua");

Member Functions

Group:MoveDelta

function Group:UpdateEntity(params) --if(not params)then return end --local firstNode; --local firstNodeParams; --local point3D = {}; --local k,node; --for k,node in ipairs(self.Nodes) do --if(k == 1)then --firstNode = node; --firstNodeParams = node:GetParams(); --point3D.x = params.x - firstNodeParams.x; --point3D.y = params.y - firstNodeParams.y; --point3D.z = params.z - firstNodeParams.z; --node:UpdateEntity(params) --else --local new_params = commonlib.deepcopy(node:GetParams()); --new_params.x = new_params.x + point3D.x; --new_params.y = new_params.y + point3D.y; --new_params.z = new_params.z + point3D.z; --node:UpdateEntity(new_params) --end --end end

syntax

function Group:MoveDelta(point3D)

parameters

point3D  

Group:SetPosition

it is a absolute value

syntax

function Group:SetPosition(x,y,z)

parameters

x  
y  
z  

ObjectPropertyPanel

Title ObjectPropertyPanel
Author(s) Leio
Date 2008/12/20
File script/kids/3DMapSystemUI/Inventor/Gears/ObjectPropertyPanel.lua

Description

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Gears/ObjectPropertyPanel.lua");

ToolBar

Title ToolBar
Author(s) Leio
Date 2008/11/25
File script/kids/3DMapSystemUI/Inventor/Gears/ToolBar.lua

Description

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Gears/ToolBar.lua");

ToolBar3

Title ToolBar3
Author(s) Leio
Date 2009/1/15
File script/kids/3DMapSystemUI/Inventor/Gears/ToolBar3.lua

Description

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Gears/ToolBar3.lua");

TransformPanel

Title TransformPanel
Author(s) Leio
Date 2008/12/20
File script/kids/3DMapSystemUI/Inventor/Gears/TransformPanel.lua

Description

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Gears/TransformPanel.lua");

EntityTool

Title EntityTool
Author(s) Leio
Date 2008/11/24
File script/kids/3DMapSystemUI/Inventor/Tools/EntityTool.lua

Description

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Tools/EntityTool.lua");

IEntityTool

Title IEntityTool
Author(s) Leio
Date 2008/11/24
File script/kids/3DMapSystemUI/Inventor/Tools/IEntityTool.lua

Description

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Tools/IEntityTool.lua");

ITool

Title ITool
Author(s) Leio
Date 2008/11/24
File script/kids/3DMapSystemUI/Inventor/Tools/ITool.lua

Description

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Tools/ITool.lua");

PointerTool

Title PointerTool
Author(s) Leio
Date 2008/11/24
File script/kids/3DMapSystemUI/Inventor/Tools/PointerTool.lua

Description

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Tools/PointerTool.lua");

RotationTool

Title RotationTool
Author(s) Leio
Date 2008/12/1
File script/kids/3DMapSystemUI/Inventor/Tools/RotationTool.lua

Description

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Tools/RotationTool.lua");

ScaleTool

Title ScaleTool
Author(s) Leio
Date 2008/12/1
File script/kids/3DMapSystemUI/Inventor/Tools/ScaleTool.lua

Description

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Tools/ScaleTool.lua");

SelectorTool

Title SelectorTool
Author(s) Leio
Date 2008/12/19
File script/kids/3DMapSystemUI/Inventor/Tools/SelectorTool.lua

Description

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Tools/SelectorTool.lua");

SelectTool

Title SelectTool
Author(s) Leio
Date 2008/12/19
File script/kids/3DMapSystemUI/Inventor/Tools/SelectTool.lua

Description

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Tools/SelectTool.lua");

TransformationBox

Title TransformationBox
Author(s) Leio
Date 2008/12/8
File script/kids/3DMapSystemUI/Inventor/Tools/TransformationBox.lua

Description

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Tools/TransformationBox.lua");
local box = Map3DSystem.App.Inventor.TransformationBox:new();
box:Show();

GlobalInventor

Title GlobalInventor
Author(s) Leio
Date 2008/11/24
File script/kids/3DMapSystemUI/Inventor/Util/GlobalInventor.lua

Description

TIP Sample Code

NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Gears/ToolBar.lua");
Map3DSystem.App.Inventor.Gears.ToolBar.Show();
NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Util/GlobalInventor.lua");
Map3DSystem.App.Commands.Call("Profile.Inventor.Start");
--Map3DSystem.App.Commands.Call("Profile.Inventor.Stop");

local lite3DCanvas = Map3DSystem.App.Creator.PortalSystemPage.Portal3DCanvas;
Map3DSystem.App.Inventor.GlobalInventor.Start(lite3DCanvas)

-- test
NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Util/GlobalInventor.lua");
NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Gears/ToolBar.lua");
Map3DSystem.App.Inventor.Gears.ToolBar.Show();
NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Container/LiteCanvas.lua");
local lite3DCanvas =  Map3DSystem.App.Inventor.LiteCanvas:new{
   sceneType = "Scene", -- "MiniScene" or "Scene"
   autoPick = true,
}
local config = {
   lite3DCanvas = lite3DCanvas,
   canHistory = true,
   canKeyControl = true,
   canContexMenu = true,
}
Map3DSystem.App.Commands.Call("Profile.Inventor.Start",config);
Topic revision: r1 - 2008-02-29 - LiXizhi
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback