.. _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 :c:type:`~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:


::

   //markupdata
   
   A3DEEntityTypeeType;
   A3DInt32iRet=A3DEntityGetType(pMarkup,&eType);
   //if(iRet!=A3D_SUCCESS)exit
   if(eType==kA3DTypeMkpMarkup)
   {
   //nodefinitionisset,noinformationtoretrieve
   //terminate...
   }
   
   //markupdefinitiondata
   
   A3DMarkupDefinitionDatasDataDefinition=A3D_MAKE_DATA(A3DMarkupDefinitionData);
   A3DInt32iRet=A3DMarkupDefinitionGet((A3DMarkupDefinition*)pMarkup,&sDataDefinition);//sDataDefinitioncontainsbasicdefinitioninformation
   
   //specificdata
   
   A3DMarkupTextDatasTextData;
   A3DMarkupDimensionDatasDimensionData;
   switch(eType)
   {
   casekA3DTypeMarkupText:
   {
   A3DMarkupTextDatasTextData=A3D_MAKE_DATA(A3DMarkupTextData);
   A3DInt32iRet=A3DMarkupTextGet((A3DMarkupText*)pMarkup,&sTextData);
   break;
   }
   casekA3DTypeMarkupDimension:
   {
   A3DMarkupDimensionDatasDimensionData=A3D_MAKE_DATA(A3DMarkupDimensionData);
   A3DInt32iRet=A3DMarkupTextGet((A3DMarkupDimension*)pMarkup,&sDimensionData);
   break;
   }
   casekA3DTypeMarkupGDT:
   {
   A3DMarkupGDTDatasGDTData=A3D_MAKE_DATA(A3DMarkupGDTData);
   A3DInt32iRet=A3DMarkupGDTGet((A3DMarkupGDT*)pMarkup,&sGDTData);
   break;
   }
   ...samethingforalltypes
   
   default:
   break;
   
   }

**Parameters**


   **pMarkupDefinition**\ : is the markup.

   **pIsScreenLocation**\ : true if the position of the markup is a screen position.

   **pPosition**\ : is the 2D position of the markup.

   **pOffsetAnchorPoint**\ : is the offset of position of the markup.


**Returns**


   ``A3D_SUCCESS``\ on success, or an error code on failure


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

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


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


* :ref:`Position definition <group__a3d__markupposition>`
* :ref:`Notes <group__a3d__markupnote>`
* :ref:`Dimension <group__a3d__markupdimension>`
* :ref:`Tolerance <group__a3d__markuptolerance>`
* :ref:`Symbols <group__a3d__markupsymbol>`
* :ref:`Welding <group__a3d__markupwelding>`

.. rst-class:: kind-group kind-record

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


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


* :c:struct:`~A3DMDTextPropertiesData`
* :c:struct:`~A3DMarkupDefinitionData`

.. rst-class:: kind-group kind-enumeration

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


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


* :c:enum:`~A3DEMDMarkupDisplayType`
* :c:enum:`~A3DEMDTextPropertiesScore`
* :c:enum:`~A3DEMDTextPropertiesFormat`
* :c:enum:`~A3DEMDTextPropertiesJustification`

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

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


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


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

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

   a3d_markupposition
   a3d_markupnote
   a3d_markupdimension
   a3d_markuptolerance
   a3d_markupsymbol
   a3d_markupwelding
   ../structures/A3DMDTextPropertiesData
   ../structures/A3DMarkupDefinitionData
   ../functions/A3DMDTextPropertiesGet
   ../functions/A3DMarkupDefinitionGet
   ../functions/A3DMarkupPositionIsScreenLocation
   ../functions/A3DMDTextPropertiesCreate
   ../functions/A3DMDTextPositionCreate
   ../functions/A3DMDLeaderDefinitionSet
   ../functions/A3DMarkupDefinitionSet
   ../enums/A3DEMDMarkupDisplayType
   ../enums/A3DEMDTextPropertiesScore
   ../enums/A3DEMDTextPropertiesFormat
   ../enums/A3DEMDTextPropertiesJustification


