1.0.0
This is the core class to represent the geometry.
(any)
Returns the bounding box of the model.
获取模型的包围盒。
Returns up vector as an array of 3 以长度为3的数组形式返回世界向上的向量
Returns object properties. 返回模型的属性信息。
Returns object categories. 返回模型的分类
Returns object levels. 返回模型的层级
Returns object elements. 返回模型子元素
(Object)
filter,
filter can be a number,
an object e.g. {categoryId: -200183},
or {categoryId: {gt: -20000}}
an object string like "{'categoryId': -200183}" start with '{'',
an array containing element ids like:
[
30, 317
]
(function)
this method that is called when request for property db succeeds. - 成功的回调函数
(function)
this method that is called when request for property db fails. - 失败的回调函数
Returns object tree. 返回模型树
Searches the object property database. 根据属性关键词查找模型
This is the base class for all viewer implementations. It contains everything that is needed to connect to the viewing service and display 3D models. It also includes basic navgiation support, and context menu and extension APIs.
(HTMLElement)
The viewer container. - viewer容器,一般是div盒
(Navigation)
: The Navigation api object.
(ToolController)
: The ToolController object.
(ViewingUtilities)
: The ViewingUtilities object.
Unloads any loaded extensions and then uninitializes the viewer. 卸载所有已加载的扩展并且卸载对viewer的设置
Load the file from the cloud or locally.
Asynchronously loads the document given its svfURN.
异步加载给定svfURN的文件,可以是本地或者网上的。
On success: Calls onDocumentLoadedCallback.
On error: Displays an error AlertBox.
成功:回调onDocumentLoadedCallback
失败:显示一个错误弹出框
(object?)
Optiones
(function?)
method gets called when initial loading is done and streaming starts 成功加载的回调函数
(function (int, string)?)
method gets called when initial loading is done and streaming starts 失败的回调函数
(string?)
for internal use
(any)
RenderModel
:
loadedModel - 已加载的模型
Unload model from viewer and memory
从viewer中卸载模型
(RenderModel)
instanceOf RenderModel, can get using getModelById
需要被卸载的模型,可以用getModelById函数获得
(any)
Gets the camera so it can be modified by the client. 获得相机
THREE.camera
:
The active camera. 相机对象
Restores the viewer state from a given object. 以一个给出的数据对象,恢复viewer的状态
(Object)
(Object?)
Similar in structure to viewerState used to filter out values
that should not be restored.
- 用来过滤掉不需要被恢复的状态
(boolean?)
Whether the new view is applied with (true) or without transition (false)
- 新的viewer是否申请这种恢复(true 或者 false)
boolean
:
true if restore operation was successful.
Searches the elements for the given text. When the search is complete, the callback onResultsReturned(idArray) is invoked. 输入关键词查找模型构成元素。查找完成后,回调函数onResultsReturned将被调用。
(string)
the search term. -查询关键词
(function (idArray))
the callback to invoke when search is complete. - 成功查询的回调函数
(function (errorCode, errorMsg))
the callback to invoke when search is complete. - 失败查询的回调函数
Returns an Array of the IDs of the currently hidden nodes. When isolation is in place, there are no hidden nodes returned because all nodes that are not isolated are considered hidden. 返回当前隐藏节点的id数组。有隔离操作时,将不会返回隐藏节点数组,因为没有被隔离的节点 才会考虑是否被隐藏。
Array
:
of nodes that are currently hidden, when no isolation is in place.
当前隐藏节点的id数组
Isolates one of many sub-elements. You can pass in a node or an array of nodes to isolate. Pass in null to reset isolation. 隔离模型的子元素。可以传入一个子元素的id也可以传入id数组,如果不传入的话,将重置隔离。 Not yet implemented for 2D.
((Array<int> | int))
A node ID or array of node IDs from the model tree
BaseViewer#getObjectTree
一个子元素的ID或者一个ID数组
(any)
(any)
(any)
Isolates one of many sub-elements. You can pass in a node or an array of nodes to isolate. Pass in null to reset isolation. 隔离模型的子元素。可以传入一个子元素的id也可以传入id数组,如果不传入的话,将重置隔离。 Not yet implemented for 2D.
((Array<int> | int))
A node ID or array of node IDs from the model tree
BaseViewer#getObjectTree
一个子元素的ID或者一个ID数组
(any)
(any)
(RenderModel)
(boolean)
,针对这个模型进行隔离,不影响其他模型。设置为false的时候,其他模型也被隔离。
Isolates one of many sub-elements. You can pass in a node or an array of nodes to isolate. Pass in null to reset isolation. 隔离模型的子元素。可以传入一个子元素的id也可以传入id数组,如果不传入的话,将重置隔离。
Not yet implemented for 2D.
((Array<int> | int))
A node ID or array of node IDs from the model tree
BaseViewer#getObjectTree
一个子元素的ID或者一个ID数组
(any)
(any)
Selects the array of ids. You can also just pass in a single id instead of an array. 选中给定数组中所有id的模型。当然你也可以只传入一个id用来只选中一个模型。
Clears the selection. 清空选中
Sets selection granularity mode. Supported values are: SelectionMode.LEAF_OBJECT -- always select the leaf objects in the hierarchy SelectionMode.FIRST_OBJECT -- for a given node, selects the first non-composite (layer, collection, model) on the path from the root to the given node, and all children SelectionMode.LAST_OBJECT -- for a given node, selects the nearest ancestor composite node and all children. Selects the input node itself in case there is no composite node in the path to the root node. 设置选择模式。支持的参数值包括: SelectionMode.LEAF_OBJECT -- 只选择叶子节点 SelectionMode.FIRST_OBJECT -- 对于一个给定的节点,选择从根节点到当前节点路径中的第一个非复合的节点和他所有的孩子节点。 SelectionMode.LAST_OBJECT -- 对于一个给定的节点,
(any)
Returns the selected items from all loaded models. 返回所有已加载的模型中被选择的部分模型
(Function)
-- optional callback to receive enumerated pairs of model and dbId for each selected object.
If no callback is given, an array of objects is returned.
-- 可缺省。接受每个被选择的模型可枚举的model和dbId,如果缺省,则直接返回一个对象数组。
Array<Object>
:
An array of objects with a model and selectionSet properties
for each model that has selected items in the scene
所有场景中已选择的模型的model和selection属性的对象所构成的数组
Ensures everything is visible. Clears all node isolation (3D) and turns on all layers (2D). 显示全部的模型,取消所有的隔离设置。
Ensures everything is not visible. Clears all node isolation (3D) and turns on all layers (2D). 隐藏全部的模型,取消所有的隔离设置。
Check if all model loaded 检查一组模型是否全部加载完毕
(Array)
Array of RenderModels that need to check, will check all model if no arr is given 需要检查的模型数组,如果缺省,则默认是全部的模型
Boolean
:
False if at least one model hasn't be loaded. True if all models have been loaded. 如果有一个模型未被加载则返回false,全部加载完毕返回true