diff --git a/docs/source/client_handles.md b/docs/source/client_handles.md new file mode 100644 index 000000000..e249d817b --- /dev/null +++ b/docs/source/client_handles.md @@ -0,0 +1,19 @@ +# Client Handles + +A handle is created for each client that connects to a server. Handles can be +used to communicate with just one client, as well as for reading and writing of +camera state. + + + +.. autoapiclass:: viser.ClientHandle + :members: + :undoc-members: + :inherited-members: + +.. autoapiclass:: viser.CameraHandle + :members: + :undoc-members: + :inherited-members: + + diff --git a/docs/source/conventions.md b/docs/source/conventions.md index f8a5cb1a8..29ea4b2e5 100644 --- a/docs/source/conventions.md +++ b/docs/source/conventions.md @@ -5,12 +5,12 @@ In this note, we describe the coordinate frame conventions used in `viser`. ## Scene tree naming Each object that we add to the scene in viser is instantiated as a node in a -scene tree. The hierarchical relationships in this tree are determined entirely -by the names used in this tree. +scene tree. The structure of this tree is determined by the names assigned to +the nodes. If we add a coordinate frame called `/base_link/shoulder/wrist`, it signifies -that are three nodes: the `wrist` is a child of the `shoulder` which is a child -of the `base_link`. +three nodes: the `wrist` is a child of the `shoulder` which is a child of the +`base_link`. If we set the transformation of a given node like `/shoulder`, both it and all of its children will move. Its parent, `/base_link`, will be unaffected. diff --git a/docs/source/gui_handles.md b/docs/source/gui_handles.md new file mode 100644 index 000000000..188193221 --- /dev/null +++ b/docs/source/gui_handles.md @@ -0,0 +1,33 @@ +# GUI Handles + +A handle is created for each GUI element that is added. Handles can be used to +read and write state. + +When a GUI element is added to a server (for example, via +:func:`ViserServer.add_gui_text()`), state is synchronized between all connected +clients. When a GUI element is added to a client (for example, via +:func:`ClientHandle.add_gui_text()`), state is local to a specific client. + + + +.. autoapiclass:: viser.GuiHandle + :members: + :undoc-members: + :inherited-members: + +.. autoapiclass:: viser.GuiButtonHandle + :members: + :undoc-members: + :inherited-members: + +.. autoapiclass:: viser.GuiButtonGroupHandle + :members: + :undoc-members: + :inherited-members: + +.. autoapiclass:: viser.GuiDropdownHandle + :members: + :undoc-members: + :inherited-members: + + diff --git a/docs/source/scene_handles.md b/docs/source/scene_handles.md new file mode 100644 index 000000000..e974659b1 --- /dev/null +++ b/docs/source/scene_handles.md @@ -0,0 +1,53 @@ +# Scene Handles + +A handle is created for each object that is added to the scene. These can be +used to read and set state, as well as detect clicks. + +When a scene node is added to a server (for example, via +:func:`ViserServer.add_frame()`), state is synchronized between all connected +clients. When a scene node is added to a client (for example, via +:func:`ClientHandle.add_frame()`), state is local to a specific client. + + + +.. autoapiclass:: viser.SceneNodeHandle + :members: + :undoc-members: + :inherited-members: + +.. autoapiclass:: viser.CameraFrustumHandle + :members: + :undoc-members: + :inherited-members: + +.. autoapiclass:: viser.FrameHandle + :members: + :undoc-members: + :inherited-members: + +.. autoapiclass:: viser.ImageHandle + :members: + :undoc-members: + :inherited-members: + +.. autoapiclass:: viser.LabelHandle + :members: + :undoc-members: + :inherited-members: + +.. autoapiclass:: viser.MeshHandle + :members: + :undoc-members: + :inherited-members: + +.. autoapiclass:: viser.PointCloudHandle + :members: + :undoc-members: + :inherited-members: + +.. autoapiclass:: viser.TransformControlsHandle + :members: + :undoc-members: + :inherited-members: + + diff --git a/docs/source/server.md b/docs/source/server.md new file mode 100644 index 000000000..1cba479bb --- /dev/null +++ b/docs/source/server.md @@ -0,0 +1,14 @@ +# Viser Server + +The core `viser` API is designed around :class:`viser.ViserServer`, which (a) +launches a thread with a visualization server and (b) provides a high-level API +for communicating with clients. + + + +.. autoapiclass:: viser.ViserServer + :members: + :undoc-members: + :inherited-members: + + diff --git a/viser/client/build/asset-manifest.json b/viser/client/build/asset-manifest.json index 536bf2394..3562ee7b9 100644 --- a/viser/client/build/asset-manifest.json +++ b/viser/client/build/asset-manifest.json @@ -1,13 +1,13 @@ { "files": { "main.css": "/static/css/main.82973013.css", - "main.js": "/static/js/main.cf7baeba.js", + "main.js": "/static/js/main.78d359b6.js", "index.html": "/index.html", "main.82973013.css.map": "/static/css/main.82973013.css.map", - "main.cf7baeba.js.map": "/static/js/main.cf7baeba.js.map" + "main.78d359b6.js.map": "/static/js/main.78d359b6.js.map" }, "entrypoints": [ "static/css/main.82973013.css", - "static/js/main.cf7baeba.js" + "static/js/main.78d359b6.js" ] } \ No newline at end of file diff --git a/viser/client/build/index.html b/viser/client/build/index.html index 9918fb9c5..8400d20a9 100644 --- a/viser/client/build/index.html +++ b/viser/client/build/index.html @@ -1 +1 @@ -Viser
\ No newline at end of file +Viser
\ No newline at end of file diff --git a/viser/client/build/static/js/main.78d359b6.js b/viser/client/build/static/js/main.78d359b6.js new file mode 100644 index 000000000..47bfa85e6 --- /dev/null +++ b/viser/client/build/static/js/main.78d359b6.js @@ -0,0 +1,3 @@ +/*! For license information please see main.78d359b6.js.LICENSE.txt */ +!function(){var e={7823:function(e){"use strict";e.exports=function(e,t){if(null===e||"undefined"===typeof e)throw new TypeError("expected first argument to be an object.");if("undefined"===typeof t||"undefined"===typeof Symbol)return e;if("function"!==typeof Object.getOwnPropertySymbols)return e;for(var n=Object.prototype.propertyIsEnumerable,r=Object(e),i=arguments.length,a=0;++a0&&void 0!==arguments[0]?arguments[0]:{}).timeout;return l(this,r,"f")?null==a?new Promise((function(e){l(n,i,"f").add(e)})):Promise.race([new Promise((function(r){e=function(){clearTimeout(t),r()},l(n,i,"f").add(e)})),new Promise((function(r,o){t=setTimeout((function(){l(n,i,"f").delete(e),o(new Error("Timed out waiting for lock"))}),a)}))]):(u(this,r,!0,"f"),Promise.resolve())}},{key:"tryAcquire",value:function(){return!l(this,r,"f")&&(u(this,r,!0,"f"),!0)}},{key:"release",value:function(){if(!l(this,r,"f"))throw new Error("Cannot release an unacquired lock");if(l(this,i,"f").size>0){var e=l(this,i,"f"),t=a(e,1)[0];l(this,i,"f").delete(t),t()}else u(this,r,!1,"f")}}]),e}();t.default=c,r=new WeakMap,i=new WeakMap},7494:function(e){function t(e,t,n){var r,i,a,o,s;function l(){var u=Date.now()-o;u=0?r=setTimeout(l,t-u):(r=null,n||(s=e.apply(a,i),a=i=null))}null==t&&(t=100);var u=function(){a=this,i=arguments,o=Date.now();var u=n&&!r;return r||(r=setTimeout(l,t)),u&&(s=e.apply(a,i),a=i=null),s};return u.clear=function(){r&&(clearTimeout(r),r=null)},u.flush=function(){r&&(s=e.apply(a,i),a=i=null,clearTimeout(r),r=null)},u}t.debounce=t,e.exports=t},5456:function(e,t,n){"use strict";var r=n(9583);function i(e,t){for(var n in t)a(t,n)&&(e[n]=t[n])}function a(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e){r(e)||(e={});for(var t=arguments.length,n=1;n=t?e:t)),e}(c(e),t,n)}},8089:function(e,t,n){"use strict";var r=n(9105),i=n(7046),a=n(9944),o=n(7809);e.exports=function(e,t,n){if(!r(e))throw new TypeError("expected an object");if("string"!==typeof t||null==n)return i.apply(null,arguments);if("string"===typeof n)return o(e,t,n),e;var s=a(e,t);return r(n)&&r(s)&&(n=i({},s,n)),o(e,t,n),e}},7046:function(e,t,n){"use strict";var r=n(9105),i=n(8845);function a(e,t){for(var n=arguments.length,r=0;++r