
###############################
A3DGlobalInsertGraphLinePattern
###############################

.. c:function:: A3DStatus A3DGlobalInsertGraphLinePattern(const A3DGraphLinePatternData *pData, A3DUns32 *puiIndexLinePattern)

   .. rst-class:: sig-pretty-signature
   
      | :c:enum:`~A3DStatus` A3DGlobalInsertGraphLinePattern(*const* :c:struct:`~A3DGraphLinePatternData`\ \* **pData**\ , :c:type:`~A3DUns32`\ \* **puiIndexLinePattern**\ )
   
   Creates a line pattern, returning its index.
   
   
      2.0
   
   
   When given an ``A3DGraphLinePatternData``\ , the function searches for an already existing descriptor of the same value and returns its index. If the descriptor does not exist, it is created and a new index is returned. In case of failure ``*puiIndexRgbColor`` is unchanged.
   
   .. code-block:: c
   
      A3DDouble[] aLengths = {1.0, 3.0};
      A3DGraphLinePatternData descriptor = A3D_MAKE_DATA(A3DGraphLinePatternData);
      descriptor.m_uiNumberOfLengths = 2;
      descriptor.m_pdLengths         = aLengths;
      descriptor.m_dPhase            = 0.0;
      descriptor.m_bRealLength       = A3D_TRUE;
      
      A3DUns32 idx_0 = A3D_DEFAULT_LINEPATTERN_INDEX;
      
      A3DStatus result = A3DGlobalInsertGraphLinePattern(&descriptor, &idx_0);
      assert(result == A3D_SUCCESS);
      
      Second insertion with the same data, expect index to be the same.
      A3DUns32 idx_1 = A3D_DEFAULT_LINEPATTERN_INDEX;
      result = A3DGlobalInsertGraphLinePattern(&descriptor, &idx_1);
      assert(result == A3D_SUCCESS);
      assert(idx_0 == idx_1);
   
   **Return Values**
   
   
      **A3D_SUCCESS**\ : in case of success.
   
      **A3D_INITIALIZE_NOT_CALLED**\ : if the library is not initialized.
   
      **A3D_INVALID_DATA_STRUCT_SIZE**\ : if ``pData`` is incorrectly initialized
   
      **A3D_INVALID_DATA_STRUCT_NULL**\ : if ``pData`` is null.
   
   
   **Parameters**
   
   
      **pData**\ : The line pattern descriptor to insert.
   
      **puiIndexLinePattern**\ : The resulting index for the line pattern.
   
   
   **Returns**
   
   
      A3D_SUCCESS or an error code.
   
   




