//////////////////////////////////////////////////////////////////////////////
//
//  Copyright 2025 Autodesk, Inc.  All rights reserved.
//
//  Use of this software is subject to the terms of the Autodesk license 
//  agreement provided at the time of installation or download, or which 
//  otherwise accompanies this software in either electronic or hard copy form.   
//
//////////////////////////////////////////////////////////////////////////////

#ifndef AMI2DSDESC_H
#define AMI2DSDESC_H

#include "mibase.h"
#include "AdAChar.h"

typedef struct tagBOUNDS {
   long left;
   long top;
   long right;
   long bottom;
} BOUNDS;

class AmiCompKey;
class AmiCompDefKey;

namespace Ami
{

    ///<summary>Power object folder enumeration. This Enumerated Type is
    ///used to get folder descriptors for specifies power objects bit fields.</summary>
    enum PowerObjectType
    {
      ///<summary>No object</summary>
      kNoObj            = 0x00000000,
      ///<summary>Shaft calculation</summary>
      kShaftCalcObj     = 0x00000001,
      ///<summary>Cam calculation.</summary>
      kCamCalcObj       = 0x00000002,
      ///<summary>Finite element analysis</summary>
      kFEAObj           = 0x00000004,
      ///<summary>Moment of inertia</summary>
      kMomOfInertiaObj  = 0x00000008,
      ///<summary>Deflection line</summary>
      kDeflLineObj      = 0x00000010,
      ///<summary>Screw connection</summary>
      kScrewConObj      = 0x00000020,
      ///<summary>Part feature power object</summary>
      kPartFeatObj      = 0x00000040,
      ///<summary>Shaft power object</summary>
      kShaftObj         = 0x00000080,

      kAllFolderPowerObj = kShaftCalcObj | kCamCalcObj | kFEAObj | kMomOfInertiaObj | kDeflLineObj,
    };
};

///<summary><para>Base class descriptor for 2d structure descriptors.</para><para>The
///descriptor holds a void-pointer to internal implementation of descriptor classes.</para><para>Objects 
///of this class are not persistent.</para></summary>
class AMIAPI Ami2DSDescrip : public AmiDescrip
{
  public:
    MCADAPI_DECLARE_MEMBERS(Ami2DSDescrip);
};

///<summary><para>Folder descriptor class definition.</para>
///<para>The descriptor holds a void-pointer to internal implementation of descriptor classes.</para>
///`<para>Objects of this class are not persistent.</para></summary>
class AMIAPI AmiFolderDescrip : public Ami2DSDescrip
{
  public:
    MCADAPI_DECLARE_MEMBERS(AmiFolderDescrip);
};

///<summary><para>Component view descriptor class definition.</para>
///<para>The descriptor holds a void-pointer to internal implementation of descriptor classes.</para>
///<para>Objects of this class are not persistent.</para></summary>
class AMIAPI AmiCompViewDescrip : public AmiFolderDescrip
{
  public:
    MCADAPI_DECLARE_MEMBERS(AmiCompViewDescrip);
};

///<summary><para>Standard part component view descriptor class definition.</para><para>
///The descriptor holds a void-pointer to internal implementation of descriptor classes.</para><para>
///Objects of this class are not persistent.</para></summary>
class AMIAPI AmiStdCompViewDescrip : public AmiCompViewDescrip
{
  public:
    MCADAPI_DECLARE_MEMBERS(AmiStdCompViewDescrip);
};

///<summary><para>2d component descriptor class definition.</para><para>
///The descriptor holds a void-pointer to internal implementation of descriptor classes.</para><para>
///Objects of this class are not persistent.</para></summary>
class AMIAPI Ami2dCompDescrip : public Ami2DSDescrip
{
  public:
    MCADAPI_DECLARE_MEMBERS(Ami2dCompDescrip);
};

///<summary><para>2d standard part component descriptor class definition.</para><para>
///The descriptor holds a void-pointer to internal implementation of descriptor classes.</para><para>
///Objects of this class are not persistent.</para></summary>
class AMIAPI Ami2dStdCompDescrip : public Ami2dCompDescrip
{
  public:
    MCADAPI_DECLARE_MEMBERS(Ami2dStdCompDescrip);
};

///<summary><para>Power object view group descriptor class definition.</para><para>
///It represents group of views that are in the same power object.</para><para>
///The descriptor holds a void-pointer to internal implementation of descriptor classes.</para><para>
///Objects of this class are not persistent.</para></summary>
class AMIAPI AmiPowObjViewGroupDescrip : public Ami2DSDescrip
{
  public:
    MCADAPI_DECLARE_MEMBERS(AmiPowObjViewGroupDescrip);
};

///<summary><para>2d complex standard part component group descriptor class definition.</para><para>
///It represents group of standard part components that are in the same screw connection or part feature power object.</para><para>
///The descriptor holds a void-pointer to internal implementation of descriptor classes.</para><para>
///Objects of this class are not persistent.</para></summary>
class AMIAPI Ami2dComplexStdPartCompGroupDescrip : public Ami2DSDescrip
{
  public:
    MCADAPI_DECLARE_MEMBERS(Ami2dComplexStdPartCompGroupDescrip);
};

///<summary><para>2d shaft component group descriptor class definition.</para><para>
///It represents group of shaft and standard part components that are in the same shaft power object.</para><para>
///The descriptor holds a void-pointer to internal implementation of descriptor classes.</para><para>
///Objects of this class are not persistent.</para></summary>
class AMIAPI Ami2dShaftCompGroupDescrip : public Ami2DSDescrip
{
  public:
    MCADAPI_DECLARE_MEMBERS(Ami2dShaftCompGroupDescrip);
};



typedef AmiArray<AmiFolderDescrip> AmiFolderDescripArray;
typedef AmiArray<AmiCompViewDescrip> AmiCompViewDescripArray;
typedef AmiArray<Ami2dCompDescrip> Ami2dCompDescripArray;
typedef AmiArray<AmiPowObjViewGroupDescrip> AmiPowObjViewGroupDescripArray;
typedef AmiArray<Ami2dComplexStdPartCompGroupDescrip> Ami2dComplexStdPartCompGroupDescripArray;
typedef AmiArray<Ami2dShaftCompGroupDescrip> Ami2dShaftCompGroupDescripArray;
typedef AcArray<AcDbObjectIdArray, AcArrayObjectCopyReallocator<AcDbObjectIdArray> > Ami2DSObjectIdArrays;



///<summary>Sets the name for the input descriptor.</summary>
///<param name="pDescrip">Input only. Specifies the input descriptor.</param>
///<param name="name">Input only. Specifies the name for the input descriptor.</param>
AMIAPI AmiStatus ami2DSSetDescName(Ami2DSDescrip* pDescrip, const ACHAR* name);

///<summary>Gets the name for the input descriptor.</summary>
///<param name="pDescrip">Input only. Specifies the input descriptor.</param>
///<param name="name">Input only. Specifies the name for the input descriptor.</param>
AMIAPI AmiStatus ami2DSGetDescName(Ami2DSDescrip* pDescrip, TSTDSTRING& name);


///<summary>Creates a new empty folder descriptor.</summary>
///<param name="appName">Application name for delegation</param>
///<param name="pFoldDescrip">Pointer to new folder descriptor object.</param>
AMIAPI AmiStatus ami2DSCreateFolderDescrip(AmiFolderDescrip*& pFoldDescrip, const ACHAR* appName = NULL);

///<summary>Sets view name on the given view descriptor.</summary>
///<param name="pViewDescrip">nput view descriptor</param>
///<param name="name">name to set</param>
AMIAPI AmiStatus ami2DSSetViewDescName(AmiFolderDescrip* pViewDescrip, const ACHAR* name);

///<summary>Gets view name from the given view descriptor.</summary>
///<param name="pViewDescrip">input view descriptor</param>
///<param name="name">view name</param>
AMIAPI AmiStatus ami2DSGetViewDescName(AmiFolderDescrip* pViewDescrip,
                   TSTDSTRING& name);

///<summary>Sets position on the given view descriptor.</summary>
///<param name="pViewDescrip">input view descriptor</param>
///<param name="position">position to set</param>
AMIAPI AmiStatus ami2DSSetViewDescPosition(AmiFolderDescrip* pViewDescrip,
                   const AcGeMatrix3d& position);

///<summary>Gets position from the given view descriptor.</summary>
///<param name="pViewDescrip">input view descriptor</param>
///<param name="position">view position</param>
AMIAPI AmiStatus ami2DSGetViewDescPosition(AmiFolderDescrip* pViewDescrip,
                   AcGeMatrix3d& position);

///<summary>Sets entities on the given view descriptor.</summary>
///<param name="pViewDescrip">input view descriptor</param>
///<param name="ents">entities to set</param>
AMIAPI AmiStatus ami2DSSetViewDescEntities(AmiFolderDescrip* pViewDescrip,
                   const AcDbObjectIdArray& ents);

///<summary>Gets entities from the given view descriptor.</summary>
///<param name="pViewDescrip">input view descriptor</param>
///<param name="ents">view entities</param>
AMIAPI AmiStatus ami2DSGetViewDescEntities(AmiFolderDescrip* pViewDescrip,
                   AcDbObjectIdArray& ents);

///<summary>Sets views on the input view descriptor. Views specified in viewKeyArr are
///              added to created view when creating new view from view descriptor.</summary>
///<param name="pViewDescrip">input view descriptor</param>
///<param name="viewKeyArr">views to add to view desriptor, valid are AmiCompViewKey or
///                           AmiFolderKey key types</param>
AMIAPI AmiStatus ami2DSSetViewDescViews(AmiFolderDescrip* pViewDescrip, const AmiObjectKeyArray& viewKeyArr);

///<summary>Gets views from the input view descriptor. Views specified in viewKeyArr are
///              added to created view when creating new view from view descriptor.</summary>
///<param name="pViewDescrip">input view descriptor</param>
///<param name="viewKeyArr">views from the view desriptor, returned are AmiCompViewKey or
///                          AmiFolderKey key types</param>
AMIAPI AmiStatus ami2DSGetViewDescViews(AmiFolderDescrip* pViewDescrip, AmiObjectKeyArray& viewKeyArr);

///<summary>Sets target view on the given view descriptor.</summary>
///<param name="pViewDescrip">input view descriptor</param>
///<param name="pViewKey">AmiFolderKey or AmiCompViewKey for the target view to set</param>
AMIAPI AmiStatus ami2DSSetViewDescTargetView(AmiFolderDescrip* pViewDescrip,
                   AmiObjectKey* pViewKey);

///<summary>Gets target view from the given view descriptor.</summary>
///<param name="pViewDescrip">input view descriptor</param>
///<param name="pViewKey">AmiFolderKey or AmiCompViewKey for the target view of input view</param>
AMIAPI AmiStatus ami2DSGetViewDescTargetView(AmiFolderDescrip* pViewDescrip,
                   AmiObjectKey*& pViewKey);

///<summary>Gets target view from the given view descriptor.</summary>
///<param name="pViewDescrip">input view descriptor</param>
///<param name="pViewKey">AmiFolderKey or AmiCompViewKey for the target view of input view</param>
AMIAPI AmiStatus ami2DSSetViewDescDefinition(AmiFolderDescrip* pViewDescrip, AmiObjectKey* pViewDefKey);

///<summary>Gets view defintion from the given view descriptor.</summary>
///<param name="pViewDescrip">input view descriptor</param>
///<param name="pViewDefKey">AmiFolderDefKey or AmiCompViewDefKey for the view definition of input view</param>
AMIAPI AmiStatus ami2DSGetViewDescDefinition(AmiFolderDescrip* pViewDescrip, AmiObjectKey*& pViewDefKey);

///<summary>Gets view key from the given view descriptor.</summary>
///<param name="pViewDescrip">input view descriptor</param>
///<param name="pViewKey">AmiFolderKey or AmiCompViewKey for the view key of input view descriptor</param>
AMIAPI AmiStatus ami2DSGetViewDescViewKey(AmiFolderDescrip* pViewDescrip, AmiObjectKey*& pViewKey);

///<summary>Gets power object type from the given folder descriptor.</summary>
///<param name="pViewDescrip">input folder descriptor</param>
///<param name="objType">power object type of folder descriptor or Ami::kNoObj
///                        if no power object owns this descriptor</param>
AMIAPI AmiStatus ami2DSGetViewDescPowObjType(AmiFolderDescrip* pViewDescrip, Ami::PowerObjectType& objType);

///<summary>Creates new folder from the given view descriptor.</summary>
///<param name="pFolderDesc">input folder descriptor</param>
AMIAPI AmiStatus ami2DSCreateFolderFromDesc(AmiFolderDescrip* pFolderDesc );


///<summary>Creates a new empty component view descriptor.</summary>
///<param name="appName">Application name for delegation</param>
///<param name="pCompViewDescrip">Pointer to new component view descriptor object.</param>
AMIAPI AmiStatus ami2DSCreateCompViewDescrip(AmiCompViewDescrip*& pCompViewDescrip, const ACHAR* appName = NULL);

///<summary>Sets component on the given component view descriptor.</summary>
///<param name="pCompViewDescrip">input view descriptor</param>
///<param name="pCompKey">component to set</param>
AMIAPI AmiStatus ami2DSSetCompViewDescComp(AmiCompViewDescrip* pCompViewDescrip,
                   AmiCompKey* pCompKey);

///<summary>Gets component folder from the given component view descriptor.</summary>
///<param name="pCompViewDescrip">input view descriptor</param>
///<param name="pViewKey">component of input view descriptor</param>
AMIAPI AmiStatus ami2DSGetCompViewDescComp(AmiCompViewDescrip* pCompViewDescrip,
                   AmiCompKey*& pViewKey);



///<param name="pViewDescrip">input view</param>
///<param name="name">view name</param>
AMIAPI AmiStatus ami2DSGetFullCompViewDescName(AmiCompViewDescrip* pViewDescrip, TSTDSTRING& name);

///<summary>Creates component view from the given component view descriptor.</summary>
///<param name="pCompViewDescrip">input component view descriptor</param>
AMIAPI AmiStatus ami2DSCreateCompViewFromDesc(AmiCompViewDescrip* pCompViewDescrip);


///<summary>Creates a new empty 2d component descriptor.</summary>
///<param name="appName">Application name for delegation</param>
///<param name="p2dCompDescrip">Pointer to new 2d component descriptor object.</param>
AMIAPI AmiStatus ami2DSCreate2dCompDescrip(Ami2dCompDescrip*& p2dCompDescrip, const ACHAR* appName = NULL);

///<summary>Gets component from the given component descriptor.</summary>
///<param name="pCompDescrip">input component descriptor</param>
///<param name="pCompKey">component of input component descritor</param>
AMIAPI AmiStatus ami2DSGetCompDescComponent(Ami2dCompDescrip* pCompDescrip,
                   AmiCompKey*& pCompKey);

///<summary>Sets component definition on the given component descriptor.</summary>
///<param name="pCompDescrip">input component descriptor</param>
///<param name="pCompDefKey">component definition key to set</param>
AMIAPI AmiStatus ami2DSSetCompDescCompDef(Ami2dCompDescrip* pCompDescrip,
                   AmiCompDefKey* pCompDefKey);

///<summary>Gets component definition from the given component descriptor.</summary>
///<param name="pCompDescrip">input component descriptor</param>
///<param name="pCompDefKey">component definition of input component descriptor</param>
AMIAPI AmiStatus ami2DSGetCompDescCompDef(Ami2dCompDescrip* pCompDescrip,
                   AmiCompDefKey*& pCompDefKey);

///<summary>Sets owninig component definition on the given component descriptor.</summary>
///<param name="pCompDescrip">input component descriptor</param>
///<param name="pCompDefKey">owninig component definition key to set</param>
AMIAPI AmiStatus ami2DSSetCompDescOwningCompDef(Ami2dCompDescrip* pCompDescrip,
                   AmiCompDefKey* pCompDefKey);

///<summary>Gets owning component definition from the given component descriptor.</summary>
///<param name="pCompDescrip">input component descriptor</param>
///<param name="pCompDefKey">owninig component definition of input component descriptor</param>
AMIAPI AmiStatus ami2DSGetCompDescOwningCompDef(Ami2dCompDescrip* pCompDescrip,
                   AmiCompDefKey*& pCompDefKey);

///<summary>Adds component view descriptor to the given component descriptor.</summary>
///<param name="pCompDescrip">input component descriptor</param>
///<param name="pCompViewDescrip">component view descriptor to add</param>
AMIAPI AmiStatus ami2DSAddCompDescCompView(Ami2dCompDescrip* pCompDescrip,
                   AmiCompViewDescrip* pCompViewDescrip);

///<summary>Removes component view descriptor from the given component descriptor.</summary>
///<param name="pCompDescrip">input component descriptor</param>
///<param name="pCompViewDescrip">component view descriptor to remove</param>
AMIAPI AmiStatus ami2DSRemoveCompDescCompView(Ami2dCompDescrip* pCompDescrip,
                   AmiCompViewDescrip* pCompViewDescrip);

///<summary>Returns view descriptors from the given component descriptor.</summary>
///<param name="pCompDescrip">input component descriptor</param>
///<param name="views">view descriptors of input component descriptor</param>
AMIAPI AmiStatus ami2DSGetCompDescCompViews(Ami2dCompDescrip* pCompDescrip,
                   AmiCompViewDescripArray& views);

///<summary>Returns true if given componentdescriptor has equal type with given
///              component view descriptor.</summary>
///<param name="pCompDescrip">input component descriptor</param>
///<param name="pCompViewDescrip">input component view descriptor</param>
///<param name="bEqualType">true if given descriptors have equal type</param>
AMIAPI AmiStatus ami2DSHasCompDescEqualTypeWithCompView(Ami2dCompDescrip* pCompDescrip,
                   AmiCompViewDescrip* pCompViewDescrip,
                   bool& bEqualType);

///<summary>Creates a new 2D component from the given descriptor.</summary>
///<param name="pCompDescrip">input component descriptor</param>
AMIAPI AmiStatus ami2DSCreate2dCompFromDesc(Ami2dCompDescrip* pCompDescrip);


///<summary>Creates a new empty 2d standard part component descriptor.</summary>
///<param name="appName">Application name for delegation</param>
///<param name="p2dCompDescrip">Pointer to new 2d standard part component descriptor object.</param>
AMIAPI AmiStatus ami2DSCreate2dStdCompDescrip(Ami2dStdCompDescrip*& p2dCompDescrip, const ACHAR* appName = NULL);




///<summary>Gets entities from the given view group descriptor.</summary>
///<param name="pViewDescrip">input view group descriptor</param>
///<param name="ents">entities of input view group descriptor</param>
AMIAPI AmiStatus ami2DSGetViewGroupDescEntities(AmiPowObjViewGroupDescrip* pViewDescrip, AcDbObjectIdArray& ents);

///<summary>Sets target view on the given view group descriptor.</summary>
///<param name="pViewDescrip">input view group descriptor</param>
///<param name="pViewKey">AmiFolderKey or AmiCompViewKey for the target view to set</param>
AMIAPI AmiStatus ami2DSSetViewGroupDescTargetView(AmiPowObjViewGroupDescrip* pViewDescrip, AmiObjectKey* pViewKey);

///<summary>Gets target view from the given view group descriptor.</summary>
///<param name="pViewDescrip">input view group descriptor</param>
///<param name="pViewKey">AmiFolderKey or AmiCompViewKey for the target view of input view descriptor</param>
AMIAPI AmiStatus ami2DSGetViewGroupDescTargetView(AmiPowObjViewGroupDescrip* pViewDescrip, AmiObjectKey*& pViewKey);

///<summary>Gets power object type from the given view group descriptor.</summary>
///<param name="pViewDescrip">input folder descriptor</param>
///<param name="objType">power object type of view group descriptor</param>
AMIAPI AmiStatus ami2DSGetViewGroupDescPowObjType(AmiPowObjViewGroupDescrip* pViewDescrip,
                   Ami::PowerObjectType& objType);


///<summary>Creates a new empty 2d complex standard part descriptor.</summary>
///<param name="appName">Application name for delegation</param>
///<param name="p2dCompDescrip">Pointer to new 2d complex standard part descriptor object.</param>
AMIAPI AmiStatus ami2DSCreate2dComplexStdPartGroupDescrip(Ami2dComplexStdPartCompGroupDescrip*& p2dCompDescrip, 
                                                                                    const ACHAR* appName = NULL);

///<summary>Adds view group descriptor to the given complex standard part descriptor.</summary>
///<param name="pCompDescrip">input complex standard part descriptor</param>
///<param name="pViewGroupDescrip">view group descriptor to add</param>
AMIAPI AmiStatus ami2DSAddComplexStdPartGroupDescView(Ami2dComplexStdPartCompGroupDescrip* pCompDescrip,
                   AmiPowObjViewGroupDescrip* pViewGroupDescrip);

///<summary>Removes view group descriptor from the given complex standard part descriptor.</summary>
///<param name="pCompDescrip">input complex standard part descriptor</param>
///<param name="pViewGroupDescrip">view group descriptor to remove</param>
AMIAPI AmiStatus ami2DSRemoveComplexStdPartGroupDescView(Ami2dComplexStdPartCompGroupDescrip* pCompDescrip,
                   AmiPowObjViewGroupDescrip* pViewGroupDescrip);

///<summary>Returns view group descriptors from the given complex standard part descriptor.</summary>
///<param name="pCompDescrip">input complex standard part descriptor</param>
///<param name="viewGroups">returned view group descriptors</param>
AMIAPI AmiStatus ami2DSGetComplexStdPartGroupDescViews(Ami2dComplexStdPartCompGroupDescrip* pCompDescrip,
                   AmiPowObjViewGroupDescripArray& viewGroups);

///<summary>Returns true if given complex standard part descriptor has equal type with given
///              component view descriptor.</summary>
///<param name="pCompDescrip">input complex standard part descriptor</param>
///<param name="pViewGroupDescrip">input view group descriptor</param>
///<param name="bEqualType">true if given descriptors have equal type</param>
AMIAPI AmiStatus ami2DSHasComplexStdPartDescEqualTypeWithViewGroup(Ami2dComplexStdPartCompGroupDescrip* pCompDescrip,
                   AmiPowObjViewGroupDescrip* pViewGroupDescrip,
                   bool& bEqualType);

///<summary>Migrates 2d complex standard part to 2d structure.
///              New 2d standard part components with standard part views are created.</summary>
AMIAPI AmiStatus ami2DSMigrate2dComplexStdPart(Ami2dComplexStdPartCompGroupDescrip* pCompDesc);


///<summary>Returns view group descriptors from the given shaft group descriptor.</summary>
///<param name="pCompDescrip">input shaft group descriptor</param>
///<param name="viewGroups">returned view group descriptors</param>
AMIAPI AmiStatus ami2DSGetShaftGroupDescViews(Ami2dShaftCompGroupDescrip* pCompDescrip,
                   AmiPowObjViewGroupDescripArray& viewGroups);

///<summary>Migrates 2d shaft to 2d structure.
///              New 2d shaft component with standard parts is created.</summary>
AMIAPI AmiStatus ami2DSMigrate2dShaft(Ami2dShaftCompGroupDescrip* pCompDesc);



///<summary>Gets array of power object folder descriptors that needs to be
///              migrated to 2d structure.</summary>
///<param name="objType">power object types to search for</param>
///<param name="objFolderDescArr">arrary of power object folders descriptors
///                                 that need migration.</param>
AMIAPI AmiStatus ami2DSGetFolderPowObjectsForMigr(AmiFolderDescripArray& objFolderDescArr,
                                                                            Adesk::UInt32 objType = Ami::kAllFolderPowerObj);

///<summary>Gets array of single standard part view descriptors that needs to be
///              migrated to 2d structure.</summary>
///<param name="stdPartDescArr">arrary of standard part view descriptors
///                               that need migration.</param>
AMIAPI AmiStatus ami2DSGetSglStdPartViewsForMigr(AmiCompViewDescripArray& stdPartDescArr);

///<summary>Gets array of single standard part component descriptors that needs to be
///              migrated to 2d structure.</summary>
///<param name="stdPartDescArr">arrary of standard part component descriptors
///                               that need migration.</param>
///<param name="entityGroups">object id arrays defining view groups. Created component
///                             descriptor has only one view from the same entity group.</param>
AMIAPI AmiStatus ami2DSGetSglStdPartCompsForMigr(Ami2dCompDescripArray& stdPartDescArr,
                   const Ami2DSObjectIdArrays& entityGroup);

///<summary>Gets array of complex standard part (screw connection and part feature)
///              power object view group descriptors that needs to be migrated to 2d structure.</summary>
///<param name="viewGrpDescArr">arrary of power object view groups that need migration.</param>
///<param name="objType">power object types to search for (Ami::kScrewConObj or Ami::kPartFeatObj)</param>
AMIAPI AmiStatus ami2DSGetComplexStdPartViewsForMigr(AmiPowObjViewGroupDescripArray& viewGrpDescArr,
                                                                               Adesk::UInt32 objType = Ami::kScrewConObj | Ami::kPartFeatObj);

///<summary>Gets array of standard part component descriptors that needs to be
///              migrated to 2d structure.</summary>
///<param name="groupDescArr">arrary of standard part component descriptors
///                               that need migration.</param>
///<param name="entityGroups">object id arrays defining view groups. Created component group
///                             descriptor has only one view group from the same entity group.</param>
///<param name="objType">power object types to search for (Ami::kScrewConObj or Ami::kPartFeatObj)</param>
AMIAPI AmiStatus ami2DSGetComplexStdPartsForMigr(Ami2dComplexStdPartCompGroupDescripArray& groupDescArr,
                                                                           const Ami2DSObjectIdArrays& entityGroups,
                                                                           Adesk::UInt32 objType = Ami::kScrewConObj | Ami::kPartFeatObj);

///<summary>Gets array of shaft component group descriptors that needs to be
///              migrated to 2d structure.</summary>
///<param name="groupDescArr">arrary of shaft component group descriptors
///                               that need migration.</param>
AMIAPI AmiStatus ami2DSGetShaftsForMigr(Ami2dShaftCompGroupDescripArray& groupDescArr);



///<summary>Generate a preview into a window from a descriptor. The descriptor can be a folder descriptor, 
///              or a component view descriptor, or it could simply contain an entity list, or a single block 
///              table record in its entity list</summary>
AMIAPI AmiStatus ami2DSGeneratePreview(LONG_PTR hWnd, 
                   Ami2DSDescrip* pDescriptor);

///<summary>Generate a preview into a DC from a descriptor. The descriptor can be a folder descriptor, 
///              or a component view descriptor, or it could simply contain an entity list, or a single block 
///              table record in its entity list.</summary>
AMIAPI AmiStatus ami2DSGeneratePreview2DC(void* pDC, 
                   const BOUNDS& bounds,
                   Ami2DSDescrip* pDescriptor);


///<summary>Create corresponding structure given a list of component descriptors and folder
///              descriptors. The component descriptors should contain one or more component view
///              descriptors, and the folder and component view descriptors can reference existing
///              objects of the appropriate type, or their entity list can contain a list of entities
///              or a single block table record.</summary>
AMIAPI AmiStatus ami2DSCreateStructureFromBlocks(const AcArray<Ami2dCompDescrip*>& arCompDescriptors,
                   const AcArray<AmiFolderDescrip*>& arFolderDescriptors);


#endif //AMI2DSDESC_H

