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);
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
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
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
Title |
CommandAdd |
Author(s) |
Leio |
Date |
2008/11/24 |
File |
script/kids/3DMapSystemUI/Inventor/Command/CommandAdd.lua |
Description
Sample Code
NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Command/CommandAdd.lua");
Title |
CommandChangeState |
Author(s) |
Leio |
Date |
2008/11/24 |
File |
script/kids/3DMapSystemUI/Inventor/Command/CommandChangeState.lua |
Description
Sample Code
NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Command/CommandChangeState.lua");
Title |
CommandCopy |
Author(s) |
Leio |
Date |
2008/11/24 |
File |
script/kids/3DMapSystemUI/Inventor/Command/CommandCopy.lua |
Description
Sample Code
NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Command/CommandCopy.lua");
Title |
CommandCut |
Author(s) |
Leio |
Date |
2008/11/24 |
File |
script/kids/3DMapSystemUI/Inventor/Command/CommandCut.lua |
Description
Sample Code
NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Command/CommandCut.lua");
Title |
CommandDelete |
Author(s) |
Leio |
Date |
2008/11/24 |
File |
script/kids/3DMapSystemUI/Inventor/Command/CommandDelete.lua |
Description
Sample Code
NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Command/CommandDelete.lua");
Title |
CommandDeleteAll |
Author(s) |
Leio |
Date |
2008/11/24 |
File |
script/kids/3DMapSystemUI/Inventor/Command/CommandDeleteAll.lua |
Description
Sample Code
NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Command/CommandDeleteAll.lua");
Title |
CommandGroup |
Author(s) |
Leio |
Date |
2008/11/27 |
File |
script/kids/3DMapSystemUI/Inventor/Command/CommandGroup.lua |
Description
Sample Code
NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Command/CommandGroup.lua");
Title |
CommandPaste |
Author(s) |
Leio |
Date |
2008/11/24 |
File |
script/kids/3DMapSystemUI/Inventor/Command/CommandPaste.lua |
Description
Sample Code
NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Command/CommandPaste.lua");
Title |
CommandUnGroup |
Author(s) |
Leio |
Date |
2008/11/27 |
File |
script/kids/3DMapSystemUI/Inventor/Command/CommandUnGroup.lua |
Description
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
Sample Code
NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Command/ICommand.lua");
Title |
UndoManager |
Author(s) |
Leio |
Date |
2008/11/24 |
File |
script/kids/3DMapSystemUI/Inventor/Command/UndoManager.lua |
Description
Sample Code
NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Command/UndoManager.lua");
Title |
Lite3DCanvas |
Author(s) |
Leio |
Date |
2008/11/24 |
File |
script/kids/3DMapSystemUI/Inventor/Container/Lite3DCanvas.lua |
Description
Sample Code
NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Container/Lite3DCanvas.lua");
Title |
Lite3DCanvasView |
Author(s) |
Leio |
Date |
2008/11/27 |
File |
script/kids/3DMapSystemUI/Inventor/Container/Lite3DCanvasView.lua |
Description
Sample Code
NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Container/Lite3DCanvasView.lua");
Title |
LiteCanvas |
Author(s) |
Leio |
Date |
2009/1/15 |
File |
script/kids/3DMapSystemUI/Inventor/Container/LiteCanvas.lua |
Description
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,
}
Title |
LiteCanvasView |
Author(s) |
Leio |
Date |
2008/11/27 |
File |
script/kids/3DMapSystemUI/Inventor/Container/LiteCanvasView.lua |
Description
Sample Code
NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Container/LiteCanvasView.lua");
Title |
BaseObject |
Author(s) |
Leio |
Date |
2008/11/24 |
File |
script/kids/3DMapSystemUI/Inventor/Entity/BaseObject.lua |
Description
Sample Code
NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Entity/BaseObject.lua");
Member Functions
BaseObject:SetPicking
syntax
function BaseObject:SetPicking(v)
parameters
Group
Title |
Group |
Author(s) |
Leio |
Date |
2008/11/26 |
File |
script/kids/3DMapSystemUI/Inventor/Entity/Group.lua |
Description
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
Group:SetPosition
it is a absolute value
syntax
function Group:SetPosition(x,y,z)
parameters
Title |
ObjectPropertyPanel |
Author(s) |
Leio |
Date |
2008/12/20 |
File |
script/kids/3DMapSystemUI/Inventor/Gears/ObjectPropertyPanel.lua |
Description
Sample Code
NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Gears/ObjectPropertyPanel.lua");
Title |
ToolBar |
Author(s) |
Leio |
Date |
2008/11/25 |
File |
script/kids/3DMapSystemUI/Inventor/Gears/ToolBar.lua |
Description
Sample Code
NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Gears/ToolBar.lua");
Title |
ToolBar3 |
Author(s) |
Leio |
Date |
2009/1/15 |
File |
script/kids/3DMapSystemUI/Inventor/Gears/ToolBar3.lua |
Description
Sample Code
NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Gears/ToolBar3.lua");
Title |
TransformPanel |
Author(s) |
Leio |
Date |
2008/12/20 |
File |
script/kids/3DMapSystemUI/Inventor/Gears/TransformPanel.lua |
Description
Sample Code
NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Gears/TransformPanel.lua");
Title |
EntityTool |
Author(s) |
Leio |
Date |
2008/11/24 |
File |
script/kids/3DMapSystemUI/Inventor/Tools/EntityTool.lua |
Description
Sample Code
NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Tools/EntityTool.lua");
Title |
IEntityTool |
Author(s) |
Leio |
Date |
2008/11/24 |
File |
script/kids/3DMapSystemUI/Inventor/Tools/IEntityTool.lua |
Description
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
Sample Code
NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Tools/ITool.lua");
Title |
PointerTool |
Author(s) |
Leio |
Date |
2008/11/24 |
File |
script/kids/3DMapSystemUI/Inventor/Tools/PointerTool.lua |
Description
Sample Code
NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Tools/PointerTool.lua");
Title |
RotationTool |
Author(s) |
Leio |
Date |
2008/12/1 |
File |
script/kids/3DMapSystemUI/Inventor/Tools/RotationTool.lua |
Description
Sample Code
NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Tools/RotationTool.lua");
Title |
ScaleTool |
Author(s) |
Leio |
Date |
2008/12/1 |
File |
script/kids/3DMapSystemUI/Inventor/Tools/ScaleTool.lua |
Description
Sample Code
NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Tools/ScaleTool.lua");
Title |
SelectorTool |
Author(s) |
Leio |
Date |
2008/12/19 |
File |
script/kids/3DMapSystemUI/Inventor/Tools/SelectorTool.lua |
Description
Sample Code
NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Tools/SelectorTool.lua");
Title |
SelectTool |
Author(s) |
Leio |
Date |
2008/12/19 |
File |
script/kids/3DMapSystemUI/Inventor/Tools/SelectTool.lua |
Description
Sample Code
NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Tools/SelectTool.lua");
Title |
TransformationBox |
Author(s) |
Leio |
Date |
2008/12/8 |
File |
script/kids/3DMapSystemUI/Inventor/Tools/TransformationBox.lua |
Description
Sample Code
NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Tools/TransformationBox.lua");
local box = Map3DSystem.App.Inventor.TransformationBox:new();
box:Show();
Title |
GlobalInventor |
Author(s) |
Leio |
Date |
2008/11/24 |
File |
script/kids/3DMapSystemUI/Inventor/Util/GlobalInventor.lua |
Description
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);