//////////////////////////////////////////////////////////////////////////////
//
//  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 AMI2DSHIDE_H
#define AMI2DSHIDE_H

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

namespace Ami
{

  enum HideSituationSubentType
  {
    mc2DSNoEnt      = 0,
  ///<summary>Foreground entity</summary>
    mc2DSFGEnt      = 1,       // foreground entity
  ///<summary>Background entity</summary>
    mc2DSBGEnt      = 2,       // background entity
  ///<summary>Foreground exclude entity</summary>
    mc2DSFGExclEnt  = 4,       // foreground exclude entity
  ///<summary>Background exclude entity</summary>
    mc2DSBGExclEnt  = 8,       // background exclude entity
  ///<summary>Foreground entity excluded from background of levels above</summary>
    mc2DSUpperBGExclEnt  = 16, // foreground entity excluded from background of levels above
  };
  enum HideSituationRefType
  {
    ///<summary>Leaf or view instance is directly refered by hide situation.</summary>
    mc2DSDirectRef  = 0x0001,  // leaf or view instance is directly refered by hide situation
    ///<summary>Leaf or view instance is subentity of view that is refered by hide situation.</summary>
    mc2DSSubEntRef  = 0x0002,  // leaf or view instance is subentity of view that is
    ///<summary>View instance is partially or fully refered by hide situation.</summary>
    mc2DSPartialRef = 0x0004,  // view instance is partially or fully refered by hide situation
    mc2DSAllRef     = mc2DSDirectRef | mc2DSSubEntRef,
  };
};
typedef Ami::HideSituationSubentType     AmiHideSituationSubentType;
typedef Ami::HideSituationRefType        AmiHideSituationRefType;

class AmiFolderDefKey;
class AmiFolderKey;
///<summary>This is class AmiHideSituationKey.</summary>
class AMIAPI AmiHideSituationKey : public AmiObjectKey
{
public:
  MCADAPI_DECLARE_MEMBERS(AmiHideSituationKey);
};

///<summary>This is class AmiComplexHideSituationKey.</summary>
class AMIAPI AmiComplexHideSituationKey : public AmiObjectKey
{
public:
  MCADAPI_DECLARE_MEMBERS(AmiComplexHideSituationKey);
};

//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////

AMIAPI AmiStatus ami2DSSetHideName(AmiHideSituationKey* pHideSituationKey,
								   const ACHAR* name);

AMIAPI AmiStatus ami2DSGetHideName(AmiHideSituationKey* pHideSituationKey, 
								   ACHAR*& name);

AMIAPI AmiStatus ami2DSSetHideSysName(AmiHideSituationKey* pHideSituationKey, 
                   const ACHAR* sysName);
				   
AMIAPI AmiStatus ami2DSGetHideSysName(AmiHideSituationKey* pHideSituationKey, 
                   ACHAR*& sysName);

AMIAPI AmiStatus ami2DSSetHideDefinition(AmiHideSituationKey* pHideSituationKey, 
                   const AmiFolderDefKey* pViewDefKey);
				   
AMIAPI AmiStatus ami2DSGetHideDefinition(AmiHideSituationKey* pHideSituationKey, 
                   AmiFolderDefKey*& pViewDefKey);

AMIAPI AmiStatus ami2DSIsHideSuppressed(AmiHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean& suppressed);
				   
AMIAPI AmiStatus ami2DSSetHideSuppressed(AmiHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean suppressed);

AMIAPI AmiStatus ami2DSIsHideConcealed(AmiHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean& concealed);
				   
AMIAPI AmiStatus ami2DSSetHideConcealed(AmiHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean concealed);

AMIAPI AmiStatus ami2DSIsStdPartHide(AmiHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean& isStandardPartHide);

AMIAPI AmiStatus ami2DSIsModifiedStdPartHide(AmiHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean& isModifiedStandardPartHide);

AMIAPI AmiStatus ami2DSIsHideMigrated(AmiHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean& isIsMigrated);

AMIAPI AmiStatus ami2DSIsHideComplexHideLevel(AmiHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean& isComplexHideLevel);

AMIAPI AmiStatus ami2DSGetHideSubents(AmiHideSituationKey* pHideSituationKey, 
                   AmiHideSituationSubentType subentType,
                   AmiArray<AmiFolderKey>& viewKeys);

AMIAPI AmiStatus ami2DSAddHideSubent(AmiHideSituationKey* pHideSituationKey, 
                   AmiHideSituationSubentType subentType,
                   const AmiFolderKey* pViewKey);

AMIAPI AmiStatus ami2DSAddHideSubents(AmiHideSituationKey* pHideSituationKey, 
                   AmiHideSituationSubentType subentType,
                   const AmiArray<AmiFolderKey>& viewKeys);

AMIAPI AmiStatus ami2DSRemoveHideSubent(AmiHideSituationKey* pHideSituationKey, 
                   AmiHideSituationSubentType subentType,
                   const AmiFolderKey* pViewKey);

AMIAPI AmiStatus ami2DSRemoveHideSubentByIdx(AmiHideSituationKey* pHideSituationKey,
                   long subentIdx,
                   AmiHideSituationSubentType subentType);

AMIAPI AmiStatus ami2DSClearHideSubents(AmiHideSituationKey* pHideSituationKey,
                   AmiHideSituationSubentType subentType);

AMIAPI AmiStatus ami2DSAddHideMSSubent(AmiHideSituationKey* pHideSituationKey,
                   const AcDbObjectId& ent,
                   AmiHideSituationSubentType subentType);

AMIAPI AmiStatus ami2DSAddHideMSSubents(AmiHideSituationKey* pHideSituationKey,
                   AcDbObjectIdArray entityIds,
                   AmiHideSituationSubentType subentType);

AMIAPI AmiStatus ami2DSSetHideIgnoreFgExclude(AmiHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean ignore);
				   
AMIAPI AmiStatus ami2DSGetHideIgnoreFgExclude(AmiHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean& ignore);

AMIAPI AmiStatus ami2DSSetHideIgnoreBgExclude(AmiHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean ignore);
				   
AMIAPI AmiStatus ami2DSGetHideIgnoreBgExclude(AmiHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean& ignore);

AMIAPI AmiStatus ami2DSSetHideIgnoreUpperBgExclude(AmiHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean ignore);
				   
AMIAPI AmiStatus ami2DSGetHideIgnoreUpperBgExclude(AmiHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean& ignore);

AMIAPI AmiStatus ami2DSSetHideFgSelectionName(AmiHideSituationKey* pHideSituationKey, 
                   const ACHAR* name);
				   
AMIAPI AmiStatus ami2DSGetHideFgSelectionName(AmiHideSituationKey* pHideSituationKey, 
                   ACHAR*& name);

AMIAPI AmiStatus ami2DSSetHideBgSelectionName(AmiHideSituationKey* pHideSituationKey, 
                   const ACHAR* name);
				   
AMIAPI AmiStatus ami2DSGetHideBgSelectionName(AmiHideSituationKey* pHideSituationKey, 
                   ACHAR*& name);

AMIAPI AmiStatus ami2DSSetHideHiddenLinesInvisible(AmiHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean val);
				   
AMIAPI AmiStatus ami2DSGetHideHiddenLinesInvisible(AmiHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean& val);

AMIAPI AmiStatus ami2DSSetHideAppropriateObjectsOnly(AmiHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean val);
				   
AMIAPI AmiStatus ami2DSGetHideAppropriateObjectsOnly(AmiHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean& val);

AMIAPI AmiStatus ami2DSSetHideOuterContourOnly(AmiHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean val);
				   
AMIAPI AmiStatus ami2DSGetHideOuterContourOnly(AmiHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean& val);

AMIAPI AmiStatus ami2DSSetHideSaveSimplifiedOuterContour(AmiHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean val);
				   
AMIAPI AmiStatus ami2DSGetHideSaveSimplifiedOuterContour(AmiHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean& val);

AMIAPI AmiStatus ami2DSSetHideInverseForeground(AmiHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean val);
				   
AMIAPI AmiStatus ami2DSGetHideInverseForeground(AmiHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean& val);

AMIAPI AmiStatus ami2DSSetHideContoursOnlyInForeground(AmiHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean val);
				   
AMIAPI AmiStatus ami2DSGetHideContoursOnlyInForeground(AmiHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean& val);

AMIAPI AmiStatus ami2DSHideAutoSelectBackground(AmiHideSituationKey* pHideSituationKey, 
                              Adesk::Boolean occurrencesOnly = Adesk::kFalse,
                              Adesk::Boolean createNewLevel = Adesk::kFalse);

AMIAPI AmiStatus ami2DSHideSwapFgAndBg(AmiHideSituationKey* pHideSituationKey);

AMIAPI AmiStatus ami2DSGetHideParentHide(AmiHideSituationKey* pHideSituationKey,
                   AmiComplexHideSituationKey*& pParentHide);

AMIAPI AmiStatus ami2DSGetHideLevelIndex(AmiHideSituationKey* pHideSituationKey,
                   long& index);

AMIAPI AmiStatus ami2DSIsHideLastLevel(AmiHideSituationKey* pHideSituationKey, 
                  Adesk::Boolean& val);

//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////

AMIAPI AmiStatus ami2DSSetCpxHideName(AmiComplexHideSituationKey* pHideSituationKey, 
                   const ACHAR* name);
				   
AMIAPI AmiStatus ami2DSGetCpxHideName(AmiComplexHideSituationKey* pHideSituationKey, 
                   ACHAR*& name);

AMIAPI AmiStatus ami2DSSetCpxHideSysName(AmiComplexHideSituationKey* pHideSituationKey, 
                   const ACHAR* sysName);
				   
AMIAPI AmiStatus ami2DSGetCpxHideSysName(AmiComplexHideSituationKey* pHideSituationKey, 
                   ACHAR*& sysName);

AMIAPI AmiStatus ami2DSSetCpxHideDefinition(AmiComplexHideSituationKey* pHideSituationKey, 
                   const AmiFolderDefKey* pViewDefKey);
				   
AMIAPI AmiStatus ami2DSGetCpxHideDefinition(AmiComplexHideSituationKey* pHideSituationKey, 
                   AmiFolderDefKey*& pViewDefKey);

AMIAPI AmiStatus ami2DSIsCpxHideSuppressed(AmiComplexHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean& suppressed);
				   
AMIAPI AmiStatus ami2DSSetCpxHideSuppressed(AmiComplexHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean suppressed);

AMIAPI AmiStatus ami2DSIsCpxHideConcealed(AmiComplexHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean& concealed);
				   
AMIAPI AmiStatus ami2DSSetCpxHideConcealed(AmiComplexHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean concealed);

AMIAPI AmiStatus ami2DSIsStdPartCpxHide(AmiComplexHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean& isStandardPartHide);

AMIAPI AmiStatus ami2DSIsModifiedStdPartCpxHide(AmiComplexHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean& isModifiedStandardPartHide);

AMIAPI AmiStatus ami2DSSetCpxHideHiddenLinesInvisible(AmiComplexHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean val);
				   
AMIAPI AmiStatus ami2DSGetCpxHideHiddenLinesInvisible(AmiComplexHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean& val);

AMIAPI AmiStatus ami2DSSetCpxHideAppropriateObjectsOnly(AmiComplexHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean val);
				   
AMIAPI AmiStatus ami2DSGetCpxHideAppropriateObjectsOnly(AmiComplexHideSituationKey* pHideSituationKey, 
                   Adesk::Boolean& val);

AMIAPI AmiStatus ami2DSGetCpxHideLevelIndex(AmiComplexHideSituationKey* pHideSituationKey,
                   long& count);

AMIAPI AmiStatus ami2DSGetLevelCpxHideSituations(AmiComplexHideSituationKey* pHideSituationKey,
                   AmiArray<AmiHideSituationKey>& pVal);

AMIAPI AmiStatus ami2DSInitCpxHide(AmiComplexHideSituationKey* pHideSituationKey,
                   AmiHideSituationKey* pHide);

AMIAPI AmiStatus ami2DSCpxHideAddLevel(AmiComplexHideSituationKey* pHideSituationKey,
                   long levelIdx,
                   AmiHideSituationKey*& pNewHide);

AMIAPI AmiStatus ami2DSCpxHideRemoveLevel(AmiComplexHideSituationKey* pHideSituationKey,
                   AmiHideSituationKey* pHide);

AMIAPI AmiStatus ami2DSCpxHideRemoveLevelByIdx(AmiComplexHideSituationKey* pHideSituationKey,
                   long levelIdx);

AMIAPI AmiStatus ami2DSCpxHideMoveLevel(AmiComplexHideSituationKey* pHideSituationKey,
                   long srcIdx,
                   long destIdx);

AMIAPI AmiStatus ami2DSCpxHideReverseLevels(AmiComplexHideSituationKey* pHideSituationKey);

AMIAPI AmiStatus ami2DSCpxHideLookupLevelName(AmiComplexHideSituationKey* pHideSituationKey,
                   const ACHAR* levelName,
                   Adesk::Boolean& found);

AMIAPI AmiStatus ami2DSCpxHideNextLevelName(AmiComplexHideSituationKey* pHideSituationKey,
                   ACHAR*& levelName);

AMIAPI AmiStatus ami2DSCpxHideUpdateBgSelection(AmiComplexHideSituationKey* pHideSituationKey);

AMIAPI AmiStatus ami2DSExplodeCpxHide(AmiComplexHideSituationKey* pHideSituationKey);

#endif  // AMI2DSHIDE_H
