Add a section for element casting in the function API reference, move these functions to the end.

PiperOrigin-RevId: 677783917
Change-Id: I5042e7df20f2a2e0ecfe01a85a1969ccfc2307cd
This commit is contained in:
Yuval Tassa
2024-09-23 07:24:53 -07:00
committed by Copybara-Service
parent 0ba11b9623
commit 41ea95f077
5 changed files with 704 additions and 696 deletions
+1
View File
@@ -52,5 +52,6 @@ API function can be classified as:
- :ref:`Attribute getters<AttributeGetters>`.
- :ref:`Spec utilities<SpecUtilities>`.
- :ref:`Element initialization<ElementInitialization>`.
- :ref:`Element casting<ElementCasting>`.
.. include:: functions.rst
+220 -216
View File
@@ -4225,222 +4225,6 @@ mjs_nextElement
Return spec's next element; return NULL if element is last.
.. _mjs_asBody:
mjs_asBody
~~~~~~~~~~
.. mujoco-include:: mjs_asBody
Safely cast an element as mjsBody, or return NULL if the element is not an mjsBody.
.. _mjs_asGeom:
mjs_asGeom
~~~~~~~~~~
.. mujoco-include:: mjs_asGeom
Safely cast an element as mjsGeom, or return NULL if the element is not an mjsGeom.
.. _mjs_asJoint:
mjs_asJoint
~~~~~~~~~~~
.. mujoco-include:: mjs_asJoint
Safely cast an element as mjsJoint, or return NULL if the element is not an mjsJoint.
.. _mjs_asSite:
mjs_asSite
~~~~~~~~~~
.. mujoco-include:: mjs_asSite
Safely cast an element as mjsSite, or return NULL if the element is not an mjsSite.
.. _mjs_asCamera:
mjs_asCamera
~~~~~~~~~~~~
.. mujoco-include:: mjs_asCamera
Safely cast an element as mjsCamera, or return NULL if the element is not an mjsCamera.
.. _mjs_asLight:
mjs_asLight
~~~~~~~~~~~
.. mujoco-include:: mjs_asLight
Safely cast an element as mjsLight, or return NULL if the element is not an mjsLight.
.. _mjs_asFrame:
mjs_asFrame
~~~~~~~~~~~
.. mujoco-include:: mjs_asFrame
Safely cast an element as mjsFrame, or return NULL if the element is not an mjsFrame.
.. _mjs_asActuator:
mjs_asActuator
~~~~~~~~~~~~~~
.. mujoco-include:: mjs_asActuator
Safely cast an element as mjsActuator, or return NULL if the element is not an mjsActuator.
.. _mjs_asSensor:
mjs_asSensor
~~~~~~~~~~~~
.. mujoco-include:: mjs_asSensor
Safely cast an element as mjsSensor, or return NULL if the element is not an mjsSensor.
.. _mjs_asFlex:
mjs_asFlex
~~~~~~~~~~
.. mujoco-include:: mjs_asFlex
Safely cast an element as mjsFlex, or return NULL if the element is not an mjsFlex.
.. _mjs_asPair:
mjs_asPair
~~~~~~~~~~
.. mujoco-include:: mjs_asPair
Safely cast an element as mjsPair, or return NULL if the element is not an mjsPair.
.. _mjs_asEquality:
mjs_asEquality
~~~~~~~~~~~~~~
.. mujoco-include:: mjs_asEquality
Safely cast an element as mjsEquality, or return NULL if the element is not an mjsEquality.
.. _mjs_asExclude:
mjs_asExclude
~~~~~~~~~~~~~
.. mujoco-include:: mjs_asExclude
Safely cast an element as mjsExclude, or return NULL if the element is not an mjsExclude.
.. _mjs_asTendon:
mjs_asTendon
~~~~~~~~~~~~
.. mujoco-include:: mjs_asTendon
Safely cast an element as mjsTendon, or return NULL if the element is not an mjsTendon.
.. _mjs_asNumeric:
mjs_asNumeric
~~~~~~~~~~~~~
.. mujoco-include:: mjs_asNumeric
Safely cast an element as mjsNumeric, or return NULL if the element is not an mjsNumeric.
.. _mjs_asText:
mjs_asText
~~~~~~~~~~
.. mujoco-include:: mjs_asText
Safely cast an element as mjsText, or return NULL if the element is not an mjsText.
.. _mjs_asTuple:
mjs_asTuple
~~~~~~~~~~~
.. mujoco-include:: mjs_asTuple
Safely cast an element as mjsTuple, or return NULL if the element is not an mjsTuple.
.. _mjs_asKey:
mjs_asKey
~~~~~~~~~
.. mujoco-include:: mjs_asKey
Safely cast an element as mjsKey, or return NULL if the element is not an mjsKey.
.. _mjs_asMesh:
mjs_asMesh
~~~~~~~~~~
.. mujoco-include:: mjs_asMesh
Safely cast an element as mjsMesh, or return NULL if the element is not an mjsMesh.
.. _mjs_asHField:
mjs_asHField
~~~~~~~~~~~~
.. mujoco-include:: mjs_asHField
Safely cast an element as mjsHField, or return NULL if the element is not an mjsHField.
.. _mjs_asSkin:
mjs_asSkin
~~~~~~~~~~
.. mujoco-include:: mjs_asSkin
Safely cast an element as mjsSkin, or return NULL if the element is not an mjsSkin.
.. _mjs_asTexture:
mjs_asTexture
~~~~~~~~~~~~~
.. mujoco-include:: mjs_asTexture
Safely cast an element as mjsTexture, or return NULL if the element is not an mjsTexture.
.. _mjs_asMaterial:
mjs_asMaterial
~~~~~~~~~~~~~~
.. mujoco-include:: mjs_asMaterial
Safely cast an element as mjsMaterial, or return NULL if the element is not an mjsMaterial.
.. _mjs_asPlugin:
mjs_asPlugin
~~~~~~~~~~~~
.. mujoco-include:: mjs_asPlugin
Safely cast an element as mjsPlugin, or return NULL if the element is not an mjsPlugin.
.. _AttributeSetters:
Attribute setters
@@ -4835,3 +4619,223 @@ mjs_defaultPlugin
Default plugin attributes.
.. _ElementCasting:
Element casting
^^^^^^^^^^^^^^^
.. _mjs_asBody:
mjs_asBody
~~~~~~~~~~
.. mujoco-include:: mjs_asBody
Safely cast an element as mjsBody, or return NULL if the element is not an mjsBody.
.. _mjs_asGeom:
mjs_asGeom
~~~~~~~~~~
.. mujoco-include:: mjs_asGeom
Safely cast an element as mjsGeom, or return NULL if the element is not an mjsGeom.
.. _mjs_asJoint:
mjs_asJoint
~~~~~~~~~~~
.. mujoco-include:: mjs_asJoint
Safely cast an element as mjsJoint, or return NULL if the element is not an mjsJoint.
.. _mjs_asSite:
mjs_asSite
~~~~~~~~~~
.. mujoco-include:: mjs_asSite
Safely cast an element as mjsSite, or return NULL if the element is not an mjsSite.
.. _mjs_asCamera:
mjs_asCamera
~~~~~~~~~~~~
.. mujoco-include:: mjs_asCamera
Safely cast an element as mjsCamera, or return NULL if the element is not an mjsCamera.
.. _mjs_asLight:
mjs_asLight
~~~~~~~~~~~
.. mujoco-include:: mjs_asLight
Safely cast an element as mjsLight, or return NULL if the element is not an mjsLight.
.. _mjs_asFrame:
mjs_asFrame
~~~~~~~~~~~
.. mujoco-include:: mjs_asFrame
Safely cast an element as mjsFrame, or return NULL if the element is not an mjsFrame.
.. _mjs_asActuator:
mjs_asActuator
~~~~~~~~~~~~~~
.. mujoco-include:: mjs_asActuator
Safely cast an element as mjsActuator, or return NULL if the element is not an mjsActuator.
.. _mjs_asSensor:
mjs_asSensor
~~~~~~~~~~~~
.. mujoco-include:: mjs_asSensor
Safely cast an element as mjsSensor, or return NULL if the element is not an mjsSensor.
.. _mjs_asFlex:
mjs_asFlex
~~~~~~~~~~
.. mujoco-include:: mjs_asFlex
Safely cast an element as mjsFlex, or return NULL if the element is not an mjsFlex.
.. _mjs_asPair:
mjs_asPair
~~~~~~~~~~
.. mujoco-include:: mjs_asPair
Safely cast an element as mjsPair, or return NULL if the element is not an mjsPair.
.. _mjs_asEquality:
mjs_asEquality
~~~~~~~~~~~~~~
.. mujoco-include:: mjs_asEquality
Safely cast an element as mjsEquality, or return NULL if the element is not an mjsEquality.
.. _mjs_asExclude:
mjs_asExclude
~~~~~~~~~~~~~
.. mujoco-include:: mjs_asExclude
Safely cast an element as mjsExclude, or return NULL if the element is not an mjsExclude.
.. _mjs_asTendon:
mjs_asTendon
~~~~~~~~~~~~
.. mujoco-include:: mjs_asTendon
Safely cast an element as mjsTendon, or return NULL if the element is not an mjsTendon.
.. _mjs_asNumeric:
mjs_asNumeric
~~~~~~~~~~~~~
.. mujoco-include:: mjs_asNumeric
Safely cast an element as mjsNumeric, or return NULL if the element is not an mjsNumeric.
.. _mjs_asText:
mjs_asText
~~~~~~~~~~
.. mujoco-include:: mjs_asText
Safely cast an element as mjsText, or return NULL if the element is not an mjsText.
.. _mjs_asTuple:
mjs_asTuple
~~~~~~~~~~~
.. mujoco-include:: mjs_asTuple
Safely cast an element as mjsTuple, or return NULL if the element is not an mjsTuple.
.. _mjs_asKey:
mjs_asKey
~~~~~~~~~
.. mujoco-include:: mjs_asKey
Safely cast an element as mjsKey, or return NULL if the element is not an mjsKey.
.. _mjs_asMesh:
mjs_asMesh
~~~~~~~~~~
.. mujoco-include:: mjs_asMesh
Safely cast an element as mjsMesh, or return NULL if the element is not an mjsMesh.
.. _mjs_asHField:
mjs_asHField
~~~~~~~~~~~~
.. mujoco-include:: mjs_asHField
Safely cast an element as mjsHField, or return NULL if the element is not an mjsHField.
.. _mjs_asSkin:
mjs_asSkin
~~~~~~~~~~
.. mujoco-include:: mjs_asSkin
Safely cast an element as mjsSkin, or return NULL if the element is not an mjsSkin.
.. _mjs_asTexture:
mjs_asTexture
~~~~~~~~~~~~~
.. mujoco-include:: mjs_asTexture
Safely cast an element as mjsTexture, or return NULL if the element is not an mjsTexture.
.. _mjs_asMaterial:
mjs_asMaterial
~~~~~~~~~~~~~~
.. mujoco-include:: mjs_asMaterial
Safely cast an element as mjsMaterial, or return NULL if the element is not an mjsMaterial.
.. _mjs_asPlugin:
mjs_asPlugin
~~~~~~~~~~~~
.. mujoco-include:: mjs_asPlugin
Safely cast an element as mjsPlugin, or return NULL if the element is not an mjsPlugin.