【发布时间】:2020-07-07 07:50:06
【问题描述】:
我在 Autodesk Forge Viewer 中有一个用于 3D 模型的标记扩展。我需要在 Markups Core 中创建一个新的扩展工具以添加到我的模型中,但我阅读了文档以创建一个新的 Markup Tool,但它对我没有帮助,我唯一发现的就是它:
Advance concepts
Create a new drawing tool (a new EditMode)
Developers are encourage to implement drawing tools not included in the Markups extension.
Every drawing tool must have a set of classes to handle them. Let's say for example we are implementing a
Panda tool. For a Panda tool we would need to add the following files/classes:
MarkupPanda.js
EditModePanda.js
CreatePanda.js (Action)
DeletePanda.js (Action)
SetPanda.js (Action)
MarkupPanda.js would contain the class MarkupPanda which extends
Markup and provides the code to render the
markups as an Svg and in a href="http://www.w3.org/TR/2dcontext/">www.w3.org/TR/2dcontext/ canvas 2d context.
EditModePanda.js would contain the class EditModePanda which extends
EditMode and provides the code
to handle user-input for creating a MarkupPanda onscreen.
CreatePanda, DeletePanda and SetPanda are classes that extend
EditAction and provide mechanisms to
author markups of type MarkupPanda.
By encapsulating these operations in actions, the Markups extension is able to make sure
that the undo and redo system handles them gracefully.
但这对我没有帮助,我没有找到任何关于如何创建新的 EditMode 的代码示例,就像上面的文档说的那样。谁能帮帮我?
【问题讨论】:
-
嗨,你有没有让任何东西工作,我们处于相同的位置,创建自定义编辑工具的信息不多