//
//  (C) Copyright 2003-2008 by Autodesk, Inc.  All rights reserved.
//
// Permission to use, copy, modify, and distribute this software in
// object code form for any purpose and without fee is hereby granted, 
// provided that the above copyright notice appears in all copies and 
// that both that copyright notice and the limited warranty and
// restricted rights notice below appear in all supporting 
// documentation.
//
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS. 
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE.  AUTODESK, INC. 
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
// UNINTERRUPTED OR ERROR FREE.
//
// Use, duplication, or disclosure by the U.S. Government is subject to 
// restrictions set forth in FAR 52.227-19 (Commercial Computer
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
// (Rights in Technical Data and Computer Software), as applicable.
//
#ifndef AMI2DSDESC_H
#define AMI2DSDESC_H

// Includes
//
#include "mibase.h"
#include "AdAChar.h"

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

class AmiCompKey;
class AmiCompDefKey;

// Open Ami namespace to include 2d structure API enumerations.
//
namespace Ami
{

    // Power object folder enumeration. This enum is used to get
    // folder descriptors for specied power objects bit fields.
    //
    // The meanings of the different values are as follows:
    // kShaftCalcObj    - Shaft calculation
    // kCamCalcObj      - Cam calculation
    // kFEAObj          - Finite element analysis
    // kMomOfInertiaObj - Moment of inertia
    // kDeflLineObj     - Deflection line
    // kScrewConObj     - Screw connection
    // kPartFeatObj     - Part feature power object
    // kShaftObj        - Shaft power object
    //
    enum PowerObjectType
    {
      kNoObj            = 0x00000000,
      kShaftCalcObj     = 0x00000001,
      kCamCalcObj       = 0x00000002,
      kFEAObj           = 0x00000004,
      kMomOfInertiaObj  = 0x00000008,
      kDeflLineObj      = 0x00000010,
      kScrewConObj      = 0x00000020,
      kPartFeatObj      = 0x00000040,
      kShaftObj         = 0x00000080,
      kAllFolderPowerObj = kShaftCalcObj | kCamCalcObj | kFEAObj | kMomOfInertiaObj | kDeflLineObj,
    };
};

// Base class descriptor for 2d structure descriptors.
//
// The descriptor holds a void-ptr to internal implementation of
// descriptor classes.
//
// Objects of this class are NOT persistent.
//
class AMIAPI Ami2DSDescrip : public AmiDescrip
{
  public:

    MCADAPI_DECLARE_MEMBERS(Ami2DSDescrip);
};

// Folder descriptor class definition.
//
// The descriptor holds a void-ptr to internal implementation of
// descriptor classes.
//
// Objects of this class are NOT persistent.
//
class AMIAPI AmiFolderDescrip : public Ami2DSDescrip
{
  public:

    MCADAPI_DECLARE_MEMBERS(AmiFolderDescrip);
};

// Component view descriptor class definition.
//
// The descriptor holds a void-ptr to internal implementation of
// descriptor classes.
//
// Objects of this class are NOT persistent.
//
class AMIAPI AmiCompViewDescrip : public AmiFolderDescrip
{
  public:

    MCADAPI_DECLARE_MEMBERS(AmiCompViewDescrip);
};

// Standard part component view descriptor class definition.
//
// The descriptor holds a void-ptr to internal implementation of
// descriptor classes.
//
// Objects of this class are NOT persistent.
//
class AMIAPI AmiStdCompViewDescrip : public AmiCompViewDescrip
{
  public:

    MCADAPI_DECLARE_MEMBERS(AmiStdCompViewDescrip);
};

// 2d component descriptor class definition.
//
// The descriptor holds a void-ptr to internal implementation of
// descriptor classes.
//
// Objects of this class are NOT persistent.
//
class AMIAPI Ami2dCompDescrip : public Ami2DSDescrip
{
  public:

    MCADAPI_DECLARE_MEMBERS(Ami2dCompDescrip);
};

// 2d standard part component descriptor class definition.
//
// The descriptor holds a void-ptr to internal implementation of
// descriptor classes.
//
// Objects of this class are NOT persistent.
//
class AMIAPI Ami2dStdCompDescrip : public Ami2dCompDescrip
{
  public:

    MCADAPI_DECLARE_MEMBERS(Ami2dStdCompDescrip);
};

// Power object view group descriptor class definition.
// It represents group of views that are in the same power object.
//
// The descriptor holds a void-ptr to internal implementation of
// descriptor classes.
//
// Objects of this class are NOT persistent.
//
class AMIAPI AmiPowObjViewGroupDescrip : public Ami2DSDescrip
{
  public:

    MCADAPI_DECLARE_MEMBERS(AmiPowObjViewGroupDescrip);
};

// 2d complex standard part component group descriptor class definition.
// It represents group of standard part components that are in the same
// screw connection or part feature power object.
//
// The descriptor holds a void-ptr to internal implementation of
// descriptor classes.
//
// Objects of this class are NOT persistent.
//
class AMIAPI Ami2dComplexStdPartCompGroupDescrip : public Ami2DSDescrip
{
  public:

    MCADAPI_DECLARE_MEMBERS(Ami2dComplexStdPartCompGroupDescrip);
};

// 2d shaft component group descriptor class definition.
// It represents group of shaft and standard part components that are in the same
// shaft power object.
//
// The descriptor holds a void-ptr to internal implementation of
// descriptor classes.
//
// Objects of this class are NOT persistent.
//
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;

// Registration section for MCAD FILE API functions.
//

//==============================================================================
// 2d structure descriptor

// Description: Sets name to the input descriptor.
//              Applicable for AmiFolderDescrip, AmiCompViewDescrip,
//              AmiPowObjViewGroupDescrip, Ami2dComplexStdPartCompGroupDescrip and
//              Ami2dShaftCompGroupDescrip.
// Input      : pDescrip - input descriptor
//            : name - name to set
AMIAPI AmiStatus ami2DSSetDescName(Ami2DSDescrip* pDescrip, const ACHAR* name);

// Description: Gets name from the input descriptor.
//              Applicable for AmiFolderDescrip, AmiCompViewDescrip,
//              AmiPowObjViewGroupDescrip, Ami2dComplexStdPartCompGroupDescrip and
//              Ami2dShaftCompGroupDescrip.
// Input      : pDescrip - input descriptor
// Output     : name - name from descriptor
AMIAPI AmiStatus ami2DSGetDescName(Ami2DSDescrip* pDescrip, TSTDSTRING& name);

//------------------------------------------------------------------------------
// Folder descriptor

// Description: Creates a new empty folder descriptor.
// Input      : appName - Application name for delegation
// Output     : pFoldDescrip - Pointer to new folder descriptor object.
AMIAPI AmiStatus ami2DSCreateFolderDescrip(AmiFolderDescrip*& pFoldDescrip, const ACHAR* appName = NULL);

// Description: Sets view name on the given view descriptor.
// Input      : pViewDescrip - input view descriptor
//            : name - name to set
AMIAPI AmiStatus ami2DSSetViewDescName(AmiFolderDescrip* pViewDescrip, const ACHAR* name);

// Description: Gets view name from the given view descriptor.
// Input      : pViewDescrip - input view descriptor
// Output     : name - view name
AMIAPI AmiStatus ami2DSGetViewDescName(AmiFolderDescrip* pViewDescrip,
                   TSTDSTRING& name);

// Description: Sets position on the given view descriptor.
// Input      : pViewDescrip - input view descriptor
//            : position - position to set
AMIAPI AmiStatus ami2DSSetViewDescPosition(AmiFolderDescrip* pViewDescrip,
                   const AcGeMatrix3d& position);

// Description: Gets position from the given view descriptor.
// Input      : pViewDescrip - input view descriptor
// Output     : position - view position
AMIAPI AmiStatus ami2DSGetViewDescPosition(AmiFolderDescrip* pViewDescrip,
                   AcGeMatrix3d& position);

// Description: Sets entities on the given view descriptor.
// Input      : pViewDescrip - input view descriptor
//            : ents - entities to set
AMIAPI AmiStatus ami2DSSetViewDescEntities(AmiFolderDescrip* pViewDescrip,
                   const AcDbObjectIdArray& ents);

// Description: Gets entities from the given view descriptor.
// Input      : pViewDescrip - input view descriptor
// Output     : ents - view entities
AMIAPI AmiStatus ami2DSGetViewDescEntities(AmiFolderDescrip* pViewDescrip,
                   AcDbObjectIdArray& ents);

// Description: Sets views on the input view descriptor. Views specified in viewKeyArr are
//              added to created view when creating new view from view descriptor.
// Input      : pViewDescrip - input view descriptor
//            : viewKeyArr - views to add to view desriptor, valid are AmiCompViewKey or
//                           AmiFolderKey key types
AMIAPI AmiStatus ami2DSSetViewDescViews(AmiFolderDescrip* pViewDescrip, const AmiObjectKeyArray& viewKeyArr);

// Description: Gets views from the input view descriptor. Views specified in viewKeyArr are
//              added to created view when creating new view from view descriptor.
// Input      : pViewDescrip - input view descriptor
// Output     : viewKeyArr - views from the view desriptor, returned are AmiCompViewKey or
//                           AmiFolderKey key types
AMIAPI AmiStatus ami2DSGetViewDescViews(AmiFolderDescrip* pViewDescrip, AmiObjectKeyArray& viewKeyArr);

// Description: Sets target view on the given view descriptor.
// Input      : pViewDescrip - input view descriptor
//            : pViewKey - AmiFolderKey or AmiCompViewKey for the target view to set
AMIAPI AmiStatus ami2DSSetViewDescTargetView(AmiFolderDescrip* pViewDescrip,
                   AmiObjectKey* pViewKey);

// Description: Gets target view from the given view descriptor.
// Input      : pViewDescrip - input view descriptor
// Output     : pViewKey - AmiFolderKey or AmiCompViewKey for the target view of input view
AMIAPI AmiStatus ami2DSGetViewDescTargetView(AmiFolderDescrip* pViewDescrip,
                   AmiObjectKey*& pViewKey);

// Description: Gets target view from the given view descriptor.
// Input      : pViewDescrip - input view descriptor
// Output     : pViewKey - AmiFolderKey or AmiCompViewKey for the target view of input view
AMIAPI AmiStatus ami2DSSetViewDescDefinition(AmiFolderDescrip* pViewDescrip, AmiObjectKey* pViewDefKey);

// Description: Gets view defintion from the given view descriptor.
// Input      : pViewDescrip - input view descriptor
// Output     : pViewDefKey - AmiFolderDefKey or AmiCompViewDefKey for the view definition of input view
AMIAPI AmiStatus ami2DSGetViewDescDefinition(AmiFolderDescrip* pViewDescrip, AmiObjectKey*& pViewDefKey);

// Description: Gets view key from the given view descriptor.
// Input      : pViewDescrip - input view descriptor
// Output     : pViewKey - AmiFolderKey or AmiCompViewKey for the view key of input view descriptor
AMIAPI AmiStatus ami2DSGetViewDescViewKey(AmiFolderDescrip* pViewDescrip, AmiObjectKey*& pViewKey);

// Description: Gets power object type from the given folder descriptor.
// Input      : pViewDescrip - input folder descriptor
// Output     : objType - power object type of folder descriptor or Ami::kNoObj
//                        if no power object owns this descriptor
AMIAPI AmiStatus ami2DSGetViewDescPowObjType(AmiFolderDescrip* pViewDescrip, Ami::PowerObjectType& objType);

// Description: Creates new folder from the given view descriptor.
// Input      : pFolderDesc - input folder descriptor
AMIAPI AmiStatus ami2DSCreateFolderFromDesc(AmiFolderDescrip* pFolderDesc );

//------------------------------------------------------------------------------
// Component view descriptor

// Description: Creates a new empty component view descriptor.
// Input      : appName - Application name for delegation
// Output     : pCompViewDescrip - Pointer to new component view descriptor object.
AMIAPI AmiStatus ami2DSCreateCompViewDescrip(AmiCompViewDescrip*& pCompViewDescrip, const ACHAR* appName = NULL);

// Description: Sets component on the given component view descriptor.
// Input      : pCompViewDescrip - input view descriptor
//            : pCompKey - component to set
AMIAPI AmiStatus ami2DSSetCompViewDescComp(AmiCompViewDescrip* pCompViewDescrip,
                   AmiCompKey* pCompKey);

// Description: Gets component folder from the given component view descriptor.
// Input      : pCompViewDescrip - input view descriptor
// Output     : pViewKey - component of input view descriptor
AMIAPI AmiStatus ami2DSGetCompViewDescComp(AmiCompViewDescrip* pCompViewDescrip,
                   AmiCompKey*& pViewKey);

// Description: Gets full component view name from input view descriptor.
//              If component is set for input view descriptor then returned name is in
//              format "<component name>(<view name>)" otherwise format is "<view name>".
//              For standard part views it returns full name "<component name>(<view name>)"
//              although component is not set, in this case <component name> is
//              type of standard part.
// Input      : pViewDescrip - input view
// Output     : name - view name
AMIAPI AmiStatus ami2DSGetFullCompViewDescName(AmiCompViewDescrip* pViewDescrip, TSTDSTRING& name);

// Description: Creates component view from the given component view descriptor.
// Input      : pCompViewDescrip - input component view descriptor
AMIAPI AmiStatus ami2DSCreateCompViewFromDesc(AmiCompViewDescrip* pCompViewDescrip);

//------------------------------------------------------------------------------
// Component descriptor

// Description: Creates a new empty 2d component descriptor.
// Input      : appName - Application name for delegation
// Output     : p2dCompDescrip - Pointer to new 2d component descriptor object.
AMIAPI AmiStatus ami2DSCreate2dCompDescrip(Ami2dCompDescrip*& p2dCompDescrip, const ACHAR* appName = NULL);

// Description: Gets component from the given component descriptor.
// Input      : pCompDescrip - input component descriptor
// Output     : pCompKey - component of input component descritor
AMIAPI AmiStatus ami2DSGetCompDescComponent(Ami2dCompDescrip* pCompDescrip,
                   AmiCompKey*& pCompKey);

// Description: Sets component definition on the given component descriptor.
// Input      : pCompDescrip - input component descriptor
//            : pCompDefKey - component definition key to set
AMIAPI AmiStatus ami2DSSetCompDescCompDef(Ami2dCompDescrip* pCompDescrip,
                   AmiCompDefKey* pCompDefKey);

// Description: Gets component definition from the given component descriptor.
// Input      : pCompDescrip - input component descriptor
// Output     : pCompDefKey - component definition of input component descriptor
AMIAPI AmiStatus ami2DSGetCompDescCompDef(Ami2dCompDescrip* pCompDescrip,
                   AmiCompDefKey*& pCompDefKey);

// Description: Sets owninig component definition on the given component descriptor.
// Input      : pCompDescrip - input component descriptor
//            : pCompDefKey - owninig component definition key to set
AMIAPI AmiStatus ami2DSSetCompDescOwningCompDef(Ami2dCompDescrip* pCompDescrip,
                   AmiCompDefKey* pCompDefKey);

// Description: Gets owning component definition from the given component descriptor.
// Input      : pCompDescrip - input component descriptor
// Output     : pCompDefKey - owninig component definition of input component descriptor
AMIAPI AmiStatus ami2DSGetCompDescOwningCompDef(Ami2dCompDescrip* pCompDescrip,
                   AmiCompDefKey*& pCompDefKey);

// Description: Adds component view descriptor to the given component descriptor.
// Input      : pCompDescrip - input component descriptor
//            : pCompViewDescrip - component view descriptor to add
AMIAPI AmiStatus ami2DSAddCompDescCompView(Ami2dCompDescrip* pCompDescrip,
                   AmiCompViewDescrip* pCompViewDescrip);

// Description: Removes component view descriptor from the given component descriptor.
// Input      : pCompDescrip - input component descriptor
//            : pCompViewDescrip - component view descriptor to remove
AMIAPI AmiStatus ami2DSRemoveCompDescCompView(Ami2dCompDescrip* pCompDescrip,
                   AmiCompViewDescrip* pCompViewDescrip);

// Description: Returns view descriptors from the given component descriptor.
// Input      : pCompDescrip - input component descriptor
// Output     : views - view descriptors of input component descriptor
AMIAPI AmiStatus ami2DSGetCompDescCompViews(Ami2dCompDescrip* pCompDescrip,
                   AmiCompViewDescripArray& views);

// Description: Returns true if given componentdescriptor has equal type with given
//              component view descriptor.
// Input      : pCompDescrip - input component descriptor
//            : pCompViewDescrip - input component view descriptor
// Output     : bEqualType - true if given descriptors have equal type
AMIAPI AmiStatus ami2DSHasCompDescEqualTypeWithCompView(Ami2dCompDescrip* pCompDescrip,
                   AmiCompViewDescrip* pCompViewDescrip,
                   bool& bEqualType);

// Description: Creates a new 2D component from the given descriptor.
// Input      : pCompDescrip - input component descriptor
AMIAPI AmiStatus ami2DSCreate2dCompFromDesc(Ami2dCompDescrip* pCompDescrip);

//------------------------------------------------------------------------------
// Standard part component descriptor

// Description: Creates a new empty 2d standard part component descriptor.
// Input      : appName - Application name for delegation
// Output     : p2dCompDescrip - Pointer to new 2d standard part component descriptor object.
AMIAPI AmiStatus ami2DSCreate2dStdCompDescrip(Ami2dStdCompDescrip*& p2dCompDescrip, const ACHAR* appName = NULL);



//==============================================================================
// Power object view group descriptor
//------------------------------------------------------------------------------

// Description: Gets entities from the given view group descriptor.
// Input      : pViewDescrip - input view group descriptor
// Output     : ents - entities of input view group descriptor
AMIAPI AmiStatus ami2DSGetViewGroupDescEntities(AmiPowObjViewGroupDescrip* pViewDescrip, AcDbObjectIdArray& ents);

// Description: Sets target view on the given view group descriptor.
// Input      : pViewDescrip - input view group descriptor
//            : pViewKey - AmiFolderKey or AmiCompViewKey for the target view to set
AMIAPI AmiStatus ami2DSSetViewGroupDescTargetView(AmiPowObjViewGroupDescrip* pViewDescrip, AmiObjectKey* pViewKey);

// Description: Gets target view from the given view group descriptor.
// Input      : pViewDescrip - input view group descriptor
// Output     : pViewKey - AmiFolderKey or AmiCompViewKey for the target view of input view descriptor
AMIAPI AmiStatus ami2DSGetViewGroupDescTargetView(AmiPowObjViewGroupDescrip* pViewDescrip, AmiObjectKey*& pViewKey);

// Description: Gets power object type from the given view group descriptor.
// Input      : pViewDescrip - input folder descriptor
// Output     : objType - power object type of view group descriptor
AMIAPI AmiStatus ami2DSGetViewGroupDescPowObjType(AmiPowObjViewGroupDescrip* pViewDescrip,
                   Ami::PowerObjectType& objType);

//------------------------------------------------------------------------------
// Complex standard part group descriptor

// Description: Creates a new empty 2d complex standard part descriptor.
// Input      : appName - Application name for delegation
// Output     : p2dCompDescrip - Pointer to new 2d complex standard part descriptor object.
AMIAPI AmiStatus ami2DSCreate2dComplexStdPartGroupDescrip(Ami2dComplexStdPartCompGroupDescrip*& p2dCompDescrip, 
                                                                                    const ACHAR* appName = NULL);

// Description: Adds view group descriptor to the given complex standard part descriptor.
// Input      : pCompDescrip - input complex standard part descriptor
//            : pViewGroupDescrip - view group descriptor to add
AMIAPI AmiStatus ami2DSAddComplexStdPartGroupDescView(Ami2dComplexStdPartCompGroupDescrip* pCompDescrip,
                   AmiPowObjViewGroupDescrip* pViewGroupDescrip);

// Description: Removes view group descriptor from the given complex standard part descriptor.
// Input      : pCompDescrip - input complex standard part descriptor
//            : pViewGroupDescrip - view group descriptor to remove
AMIAPI AmiStatus ami2DSRemoveComplexStdPartGroupDescView(Ami2dComplexStdPartCompGroupDescrip* pCompDescrip,
                   AmiPowObjViewGroupDescrip* pViewGroupDescrip);

// Description: Returns view group descriptors from the given complex standard part descriptor.
// Input      : pCompDescrip - input complex standard part descriptor
//            : viewGroups - returned view group descriptors
AMIAPI AmiStatus ami2DSGetComplexStdPartGroupDescViews(Ami2dComplexStdPartCompGroupDescrip* pCompDescrip,
                   AmiPowObjViewGroupDescripArray& viewGroups);

// Description: Returns true if given complex standard part descriptor has equal type with given
//              component view descriptor.
// Input      : pCompDescrip - input complex standard part descriptor
//            : pViewGroupDescrip - input view group descriptor
// Output     : bEqualType - true if given descriptors have equal type
AMIAPI AmiStatus ami2DSHasComplexStdPartDescEqualTypeWithViewGroup(Ami2dComplexStdPartCompGroupDescrip* pCompDescrip,
                   AmiPowObjViewGroupDescrip* pViewGroupDescrip,
                   bool& bEqualType);

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

//------------------------------------------------------------------------------
// Shaft group descriptor

// Description: Returns view group descriptors from the given shaft group descriptor.
// Input      : pCompDescrip - input shaft group descriptor
//            : viewGroups - returned view group descriptors
AMIAPI AmiStatus ami2DSGetShaftGroupDescViews(Ami2dShaftCompGroupDescrip* pCompDescrip,
                   AmiPowObjViewGroupDescripArray& viewGroups);

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


//------------------------------------------------------------------------------
// Global functions to get objects for migration

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

// Description: Gets array of single standard part view descriptors that needs to be
//              migrated to 2d structure.
// Output     : stdPartDescArr - arrary of standard part view descriptors
//                               that need migration.
AMIAPI AmiStatus ami2DSGetSglStdPartViewsForMigr(AmiCompViewDescripArray& stdPartDescArr);

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

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

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

// Description: Gets array of shaft component group descriptors that needs to be
//              migrated to 2d structure.
// Output     : groupDescArr - arrary of shaft component group descriptors
//                               that need migration.
AMIAPI AmiStatus ami2DSGetShaftsForMigr(Ami2dShaftCompGroupDescripArray& groupDescArr);


//------------------------------------------------------------------------------
// Functions to generate a thumbnail preview from a structure descriptor.

// Description: 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.
// Output     : None.
AMIAPI AmiStatus ami2DSGeneratePreview(LONG_PTR hWnd, 
                   Ami2DSDescrip* pDescriptor);

// Description: 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.
// Output     : None.
AMIAPI AmiStatus ami2DSGeneratePreview2DC(void* pDC, 
                   const BOUNDS& bounds,
                   Ami2DSDescrip* pDescriptor);

//------------------------------------------------------------------------------
// Migrate blocks to structure

// Description: 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.
// Output     : None.
AMIAPI AmiStatus ami2DSCreateStructureFromBlocks(const AcArray<Ami2dCompDescrip*>& arCompDescriptors,
                   const AcArray<AmiFolderDescrip*>& arFolderDescriptors);


#endif //AMI2DSDESC_H

