---++!! !InventorAppDev __description__: Inventor %TOC{title="Contents:"}% %STARTINCLUDE% ---++ 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); %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/app_main.lua"); </verbatim> ---+++ 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 Map3DSystem.App.ConnectMode. __syntax__ <verbatim>function MyCompany.Apps.Inventor.OnConnection(app, connectMode)</verbatim> __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__ <verbatim>function MyCompany.Apps.Inventor.OnDisconnection(app, disconnectMode)</verbatim> __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 Map3DSystem.App.CommandStatusWanted * _return_ ____ : returns according to statusWanted. it may return an integer by adding values in Map3DSystem.App.CommandStatus. __syntax__ <verbatim>function MyCompany.Apps.Inventor.OnQueryStatus(app, commandName, statusWanted)</verbatim> __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 Map3DSystem.App.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__ <verbatim>function MyCompany.Apps.Inventor.OnExec(app, commandName, params)</verbatim> __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__ <verbatim>function MyCompany.Apps.Inventor.OnRenderBox(mcmlData)</verbatim> __parameters__ | *mcmlData* | | ---++++ !MyCompany.Apps.Inventor.Navigate called when the user wants to nagivate to the 3D world location relavent to this application __syntax__ <verbatim>function MyCompany.Apps.Inventor.Navigate()</verbatim> ---++++ !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__ <verbatim>function MyCompany.Apps.Inventor.GotoHomepage()</verbatim> ---++++ !MyCompany.Apps.Inventor.DoQuickAction called when user clicks the quick action for this application. __syntax__ <verbatim>function MyCompany.Apps.Inventor.DoQuickAction()</verbatim> ---++++ !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__ <verbatim>function MyCompany.Apps.Inventor.MSGProc(window, msg)</verbatim> __parameters__ | *window* | | | *msg* | | ---++ CommandAdd | *Title* | CommandAdd | | *Author(s)* | Leio | | *Date* | 2008/11/24 | | *File* | script/kids/3DMapSystemUI/Inventor/Command/CommandAdd.lua | ---+++ Description %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Command/CommandAdd.lua"); </verbatim> ---++ CommandChangeState | *Title* | CommandChangeState | | *Author(s)* | Leio | | *Date* | 2008/11/24 | | *File* | script/kids/3DMapSystemUI/Inventor/Command/CommandChangeState.lua | ---+++ Description %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Command/CommandChangeState.lua"); </verbatim> ---++ CommandCopy | *Title* | CommandCopy | | *Author(s)* | Leio | | *Date* | 2008/11/24 | | *File* | script/kids/3DMapSystemUI/Inventor/Command/CommandCopy.lua | ---+++ Description %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Command/CommandCopy.lua"); </verbatim> ---++ CommandCut | *Title* | CommandCut | | *Author(s)* | Leio | | *Date* | 2008/11/24 | | *File* | script/kids/3DMapSystemUI/Inventor/Command/CommandCut.lua | ---+++ Description %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Command/CommandCut.lua"); </verbatim> ---++ CommandDelete | *Title* | CommandDelete | | *Author(s)* | Leio | | *Date* | 2008/11/24 | | *File* | script/kids/3DMapSystemUI/Inventor/Command/CommandDelete.lua | ---+++ Description %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Command/CommandDelete.lua"); </verbatim> ---++ CommandDeleteAll | *Title* | CommandDeleteAll | | *Author(s)* | Leio | | *Date* | 2008/11/24 | | *File* | script/kids/3DMapSystemUI/Inventor/Command/CommandDeleteAll.lua | ---+++ Description %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Command/CommandDeleteAll.lua"); </verbatim> ---++ CommandGroup | *Title* | CommandGroup | | *Author(s)* | Leio | | *Date* | 2008/11/27 | | *File* | script/kids/3DMapSystemUI/Inventor/Command/CommandGroup.lua | ---+++ Description %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Command/CommandGroup.lua"); </verbatim> ---++ CommandPaste | *Title* | CommandPaste | | *Author(s)* | Leio | | *Date* | 2008/11/24 | | *File* | script/kids/3DMapSystemUI/Inventor/Command/CommandPaste.lua | ---+++ Description %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Command/CommandPaste.lua"); </verbatim> ---++ CommandUnGroup | *Title* | CommandUnGroup | | *Author(s)* | Leio | | *Date* | 2008/11/27 | | *File* | script/kids/3DMapSystemUI/Inventor/Command/CommandUnGroup.lua | ---+++ Description %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Command/CommandUnGroup.lua"); </verbatim> ---++ ICommand | *Title* | ICommand | | *Author(s)* | Leio | | *Date* | 2008/11/24 | | *File* | script/kids/3DMapSystemUI/Inventor/Command/ICommand.lua | ---+++ Description %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Command/ICommand.lua"); </verbatim> ---++ UndoManager | *Title* | UndoManager | | *Author(s)* | Leio | | *Date* | 2008/11/24 | | *File* | script/kids/3DMapSystemUI/Inventor/Command/UndoManager.lua | ---+++ Description %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Command/UndoManager.lua"); </verbatim> ---++ Lite3DCanvas | *Title* | Lite3DCanvas | | *Author(s)* | Leio | | *Date* | 2008/11/24 | | *File* | script/kids/3DMapSystemUI/Inventor/Container/Lite3DCanvas.lua | ---+++ Description %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Container/Lite3DCanvas.lua"); </verbatim> ---++ Lite3DCanvasView | *Title* | Lite3DCanvasView | | *Author(s)* | Leio | | *Date* | 2008/11/27 | | *File* | script/kids/3DMapSystemUI/Inventor/Container/Lite3DCanvasView.lua | ---+++ Description %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Container/Lite3DCanvasView.lua"); </verbatim> ---++ LiteCanvas | *Title* | LiteCanvas | | *Author(s)* | Leio | | *Date* | 2009/1/15 | | *File* | script/kids/3DMapSystemUI/Inventor/Container/LiteCanvas.lua | ---+++ Description %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Container/LiteCanvas.lua"); local canvas = Map3DSystem.App.Inventor.LiteCanvas:new{ type = "MiniScene", -- "MiniScene" or "Scene" autoPick = false, } </verbatim> ---++ LiteCanvasView | *Title* | LiteCanvasView | | *Author(s)* | Leio | | *Date* | 2008/11/27 | | *File* | script/kids/3DMapSystemUI/Inventor/Container/LiteCanvasView.lua | ---+++ Description %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Container/LiteCanvasView.lua"); </verbatim> ---++ BaseObject | *Title* | BaseObject | | *Author(s)* | Leio | | *Date* | 2008/11/24 | | *File* | script/kids/3DMapSystemUI/Inventor/Entity/BaseObject.lua | ---+++ Description %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Entity/BaseObject.lua"); </verbatim> ---+++ Member Functions ---++++ !BaseObject:SetPicking --------------------------------------------------- __syntax__ <verbatim>function BaseObject:SetPicking(v)</verbatim> __parameters__ | *v* | | ---++ Group | *Title* | Group | | *Author(s)* | Leio | | *Date* | 2008/11/26 | | *File* | script/kids/3DMapSystemUI/Inventor/Entity/Group.lua | ---+++ Description %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Entity/Group.lua"); </verbatim> ---+++ 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__ <verbatim>function Group:MoveDelta(point3D)</verbatim> __parameters__ | *point3D* | | ---++++ !Group:SetPosition it is a absolute value __syntax__ <verbatim>function Group:SetPosition(x,y,z)</verbatim> __parameters__ | *x* | | | *y* | | | *z* | | ---++ ObjectPropertyPanel | *Title* | ObjectPropertyPanel | | *Author(s)* | Leio | | *Date* | 2008/12/20 | | *File* | script/kids/3DMapSystemUI/Inventor/Gears/ObjectPropertyPanel.lua | ---+++ Description %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Gears/ObjectPropertyPanel.lua"); </verbatim> ---++ ToolBar | *Title* | ToolBar | | *Author(s)* | Leio | | *Date* | 2008/11/25 | | *File* | script/kids/3DMapSystemUI/Inventor/Gears/ToolBar.lua | ---+++ Description %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Gears/ToolBar.lua"); </verbatim> ---++ ToolBar3 | *Title* | ToolBar3 | | *Author(s)* | Leio | | *Date* | 2009/1/15 | | *File* | script/kids/3DMapSystemUI/Inventor/Gears/ToolBar3.lua | ---+++ Description %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Gears/ToolBar3.lua"); </verbatim> ---++ TransformPanel | *Title* | TransformPanel | | *Author(s)* | Leio | | *Date* | 2008/12/20 | | *File* | script/kids/3DMapSystemUI/Inventor/Gears/TransformPanel.lua | ---+++ Description %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Gears/TransformPanel.lua"); </verbatim> ---++ EntityTool | *Title* | EntityTool | | *Author(s)* | Leio | | *Date* | 2008/11/24 | | *File* | script/kids/3DMapSystemUI/Inventor/Tools/EntityTool.lua | ---+++ Description %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Tools/EntityTool.lua"); </verbatim> ---++ IEntityTool | *Title* | IEntityTool | | *Author(s)* | Leio | | *Date* | 2008/11/24 | | *File* | script/kids/3DMapSystemUI/Inventor/Tools/IEntityTool.lua | ---+++ Description %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Tools/IEntityTool.lua"); </verbatim> ---++ ITool | *Title* | ITool | | *Author(s)* | Leio | | *Date* | 2008/11/24 | | *File* | script/kids/3DMapSystemUI/Inventor/Tools/ITool.lua | ---+++ Description %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Tools/ITool.lua"); </verbatim> ---++ PointerTool | *Title* | PointerTool | | *Author(s)* | Leio | | *Date* | 2008/11/24 | | *File* | script/kids/3DMapSystemUI/Inventor/Tools/PointerTool.lua | ---+++ Description %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Tools/PointerTool.lua"); </verbatim> ---++ RotationTool | *Title* | RotationTool | | *Author(s)* | Leio | | *Date* | 2008/12/1 | | *File* | script/kids/3DMapSystemUI/Inventor/Tools/RotationTool.lua | ---+++ Description %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Tools/RotationTool.lua"); </verbatim> ---++ ScaleTool | *Title* | ScaleTool | | *Author(s)* | Leio | | *Date* | 2008/12/1 | | *File* | script/kids/3DMapSystemUI/Inventor/Tools/ScaleTool.lua | ---+++ Description %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Tools/ScaleTool.lua"); </verbatim> ---++ SelectorTool | *Title* | SelectorTool | | *Author(s)* | Leio | | *Date* | 2008/12/19 | | *File* | script/kids/3DMapSystemUI/Inventor/Tools/SelectorTool.lua | ---+++ Description %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Tools/SelectorTool.lua"); </verbatim> ---++ SelectTool | *Title* | SelectTool | | *Author(s)* | Leio | | *Date* | 2008/12/19 | | *File* | script/kids/3DMapSystemUI/Inventor/Tools/SelectTool.lua | ---+++ Description %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Tools/SelectTool.lua"); </verbatim> ---++ TransformationBox | *Title* | TransformationBox | | *Author(s)* | Leio | | *Date* | 2008/12/8 | | *File* | script/kids/3DMapSystemUI/Inventor/Tools/TransformationBox.lua | ---+++ Description %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemUI/Inventor/Tools/TransformationBox.lua"); local box = Map3DSystem.App.Inventor.TransformationBox:new(); box:Show(); </verbatim> ---++ GlobalInventor | *Title* | GlobalInventor | | *Author(s)* | Leio | | *Date* | 2008/11/24 | | *File* | script/kids/3DMapSystemUI/Inventor/Util/GlobalInventor.lua | ---+++ Description %T% __Sample Code__ <verbatim> 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); </verbatim> %STOPINCLUDE%
E
dit
|
A
ttach
|
P
rint version
|
H
istory
: r1
|
B
acklinks
|
V
iew topic
|
Ra
w
edit
|
M
ore topic actions
Topic revision: r1 - 2008-02-29
-
LiXizhi
Home
Site map
CCWeb web
HaqiTeen web
Main web
ParaEngine web
TWiki web
Main Web
Users
Groups
Index
Search
Changes
Notifications
RSS Feed
Statistics
导航页WebTopMenu
Preferences
开发指南
Getting Started
ParacraftSDK
NPL
MCML
NPL Reference Manual
美术Mod
Account
Log In
English
简体中文
簡體中文
E
dit
A
ttach
Copyright © 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