.. _group__a3d__markupdefinition__module:

#################
Markup definition
#################


   4.0


The :c:struct:`~A3DMkpAnnotationItemData` structure references an :c:type:`~A3DMkpMarkup`\ . This markup contains tessellation, leaders, and linked item information that is available by using the function :c:func:`~A3DMkpMarkupGet`\ . In addition this markup can contain also definition and specific data. Those data are stored in common structure :c:struct:`~A3DMarkupDefinitionData` and in a specific structure corresponding to the type return by the function :c:func:`~A3DEntityGetType`\ . For the structures corresponding to markups with definition, only access functions are defined. In other words, the customer can only create A3DMkpMarkup.

The following illustration shows the available methods to retrieve all the data. In yellow, the data stored in the structure; in blue, the access function defined for corresponding structure. 

Here, it samples of the two ways to obtain markup data. In the first case, the markup contains only a tessellation, a type, and a sub type, in the second case, considering a markup text creation, the markup contains specific data (text, text properties (font...), position definition, display options, with a tessellation, a type, and a sub type. 

See the following sample code:

.. code-block:: c

   //markup data
   
   A3DEEntityType eType;
   A3DInt32 iRet = A3DEntityGetType(pMarkup, &eType);
   // if (iRet != A3D_SUCCESS) exit
   if(eType == kA3DTypeMkpMarkup)
   {
       //no definition is set, no information to retrieve
       //terminate...
   }
   
   //markup definition data
   
   A3DMarkupDefinitionData sDataDefinition = A3D_MAKE_DATA(A3DMarkupDefinitionData);
   A3DInt32 iRet = A3DMarkupDefinitionGet((A3DMarkupDefinition*)pMarkup, &sDataDefinition);//sDataDefinition contains basic definition information
   
   //specific data
   
   A3DMarkupTextData sTextData;
   A3DMarkupDimensionData sDimensionData;
       switch(eType)
       {
       case kA3DTypeMarkupText:
       {
           A3DMarkupTextData sTextData = A3D_MAKE_DATA(A3DMarkupTextData);
           A3DInt32 iRet = A3DMarkupTextGet((A3DMarkupText*)pMarkup, &sTextData);
           break;
       }
       case kA3DTypeMarkupDimension:
       {
           A3DMarkupDimensionData sDimensionData = A3D_MAKE_DATA(A3DMarkupDimensionData);
           A3DInt32 iRet = A3DMarkupTextGet((A3DMarkupDimension*)pMarkup, &sDimensionData);
           break;
       }
       case kA3DTypeMarkupGDT:
       {
           A3DMarkupGDTData sGDTData = A3D_MAKE_DATA(A3DMarkupGDTData);
           A3DInt32 iRet = A3DMarkupGDTGet((A3DMarkupGDT*)pMarkup, &sGDTData);
           break;
       }
       ...same thing for all types
   
       default:
           break;
   
   }

.. rst-class:: kind-group kind-topic

.. rubric:: Topics
   :class: kind-group-title


.. rst-class:: api-xref-list


* :ref:`Dimension <group__a3d__markupdimension>`

.. rst-class:: kind-group kind-function

.. rubric:: Functions
   :class: kind-group-title


.. rst-class:: api-xref-list


* :c:func:`~A3DMarkupDefinitionGet`
* :c:func:`~A3DMarkupDefinitionSet`
* :c:func:`~A3DMarkupPositionIsScreenLocation`
* :c:func:`~A3DMDLeaderDefinitionSet`
* :c:func:`~A3DMDTextPositionCreate`
* :c:func:`~A3DMDTextPropertiesCreate`
* :c:func:`~A3DMDTextPropertiesGet`

.. toctree::
   :maxdepth: 1
   :hidden:

   a3d_markupdimension


