//////////////////////////////////////////////////////////////////////////////
//
//  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.   
//
//////////////////////////////////////////////////////////////////////////////

#pragma once

#include "AmgScaleArea.h"

///<summary>This class provides the functions to create and find a scale area in modelspace.</summary>
class AMGUTIL_CRX_DLLSHARE AcMgScaleAreaMgr
{
  friend class AcMgUtilCrxApp;

public: 
  ///<summary>Create a new scale area and append it to the current layout.</summary>
  ///<param name="borderId">Object id of the closed curve for the border  </param>
  AcMgScaleArea* createScaleArea(const AcDbObjectId &);

  ///<summary>Search the scale area attached to the given object.</summary>
  ///<param name="searchAllLayouts ">true = search in all layouts.false (DEFAULT) = search in current layout only </param>
  ///<param name="borderId">Object id of the closed curve for the border.</param>
  AcMgScaleArea* findScaleArea(const AcDbObjectId &, bool searchAllLayouts = false);

  ///<summary>Delete scale area.</summary>
  ///<param name="pScaleArea">Scale area to delete. </param>
  bool deleteScaleArea(AcMgScaleArea* pScaleArea);

public:
  ///<summary>Get the static instance of this class.</summary>
  static AcMgScaleAreaMgr* getAcMgScaleAreaMgr();

private:
  AcMgScaleAreaMgr();
  ~AcMgScaleAreaMgr();

private:
  static AcMgScaleAreaMgr* m_pScaleAreaMgr;
};