#ifndef AMG_SCALEAREA_H
#define AMG_SCALEAREA_H
//
//  (C) Copyright 2007 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.
//

#ifdef AMGUTILBUILD
#define AMGUTIL_DLLSHARE __declspec(dllexport)
#else
#define AMGUTIL_DLLSHARE __declspec(dllimport)
#endif

class GenPmScaleArea;

class AMGUTIL_DLLSHARE AcMgScaleArea
{
  friend class AcMgScaleAreaMgr;

public:
  // scale type
  enum ScaleType
  {
    kScalePf = 2,                 //scale was defined to be text scaling
    kScaleDf = 4,                 //scale was defined to be length scaling
  };

  virtual ~AcMgScaleArea();

  // gets the object id of the defining object, which is the closed curve for the border
  const AcDbObjectId& getAttachId() const;

  //returns the text scaling factor of the scale area
  double textScalingFactor() const;

  //sets the text scaling factor of the scale area directly
  bool setTextScalingFactor(double pf);

  //returns the length scaling factor of the scale area
  double lengthScalingFactor() const;

  //sets the length scaling factor of the scale area directly
  bool setLengthScalingFactor(double df);     

  //returns the scale type of the scale area
  ScaleType scaleType() const;

  //sets the type of scale (GenPm::kScalePf or GenPm::kScaleDf)
  bool setScaleType(ScaleType type);        
  
  //sets text scaling factor as the model scale. 
  bool setBasicScale();

  //performs rescaling of specified objects
  bool rescaleObjects(AcDbObjectIdArray& objIds);

  //creates viewport on specified layout
  bool createViewPort(const ACHAR* layoutName, AcGePoint3d viewPosition);

  //deletes viewport for the scale area
  bool deleteViewPort();

  //move the border of scale area
  bool moveBorder(AcGePoint3d* pTarget);

  //gets all viewport ids attached to the scale area
  bool getAttachedViewportIds(AcDbObjectIdArray& viewportIds);

private:
  //private constructor,using AmgScaleAreaMgr to create scale area
  AcMgScaleArea();

  //initialize the wrapped object
  void setImp(GenPmScaleArea* pSDF);

private:
  //the wrapped object
  GenPmScaleArea* m_pSDF;
};

#endif // AMG_SCALEAREA_H