//////////////////////////////////////////////////////////////////////////////
//
//  Copyright 2025 by Autodesk, Inc.  All rights reserved.
//
// This computer source code and related instructions and comments 
// are the unpublished confidential and proprietary information of 
// Autodesk, Inc. and are protected under applicable copyright and 
// trade secret law.  They may not be disclosed to, copied or used 
// by any third party without the prior written consent of Autodesk, Inc.
//
//////////////////////////////////////////////////////////////////////////////
#pragma once

///<summary>This derived class implements standard-specific versions of functions available in the AmdtEdgeStd
///class. Refer to the AmdtEdgeStd class for further information.</summary>
class STDIMP_DLLSHARE AmdtEdgeStdISO : public AmdtEdgeStd
{
public:
  ACRX_DECLARE_MEMBERS(AmdtEdgeStdISO);
  ///<summary>The construct function.</summary>
  AmdtEdgeStdISO();
  ///<summary>The destruct function.</summary>
  virtual ~AmdtEdgeStdISO();
  ///<summary>Gets the information about the standard name and revision.</summary>
  Acm::ErrorStatus getRevision(CString& rev, Adesk::UInt16& year) const override;
  ///<summary>Provides the basic interface for the AcmStandardManager and hence determines whether AcmSymbolSTD 
  ///can be used for a particular standard.</summary>
  Adesk::Boolean   isCompatibleTo(const AcmStandard* pStd) const override;
  void initToEdit() const override;
  void initToEditOriginal() const override;
  ///<summary>Sets the factory default values.</summary>
  Adesk::Boolean setFactoryDefaults() override;
  void setDefaultSubSymbol(AmdtCEdge* pData) const override;
  Acm::ErrorStatus checkVisibility(AmdtCEdge* pData) const override;
  Acm::ErrorStatus initFields(AmdtCEdge* pSubSym) const override;
  Acm::ErrorStatus validityFields(AmdtCEdge *pData,
    bool setBoundary = false,
    int dlgIndex = -1) override;
  void getSubEnts(const AmdtCEdge* pSubSym,
                          AcmCAuxEntArray& subents,
                          bool corrSymbOnRightSide = false) const override;
  Acm::ErrorStatus setSuggested(AmdtCEdge* pData) const override;

  ///<summary>Get the suggested values list for edge.</summary>
  ///<param name="strList">suggest values string list.</param>
  ///<returns>Returns Acm::eOK.</returns>
  Acm::ErrorStatus getSuggestedList(CStringList& strList)const override;

  ///<summary>Get the list avalable type for undefined direction </summary>
  ///<param name="List">vector of the value represented by EdgeUndefinedDirection enum.</param>
  ///<returns>Returns Acm::eOK for success </returns>
  Acm::ErrorStatus getUndefinedSizePosList(std::vector<Adesk::UInt16>& list) const override;

protected:
  void getHeights(const AmdtCEdge*, AcGeDoubleArray&) const override;

  ///<summary>It sets the origin point for the text of edge symbol.</summary>
  ///<param name="pText">input pointer</param>
  ///<param name="subEntsText">the symbol's sub-entities array</param>
  ///<param name="basePoint">origin point for text</param>
  ///<param name="str">content</param>
  ///<param name="dir">Attach point for text</param>
  virtual void setTextOrigin(AcmCAuxText* pText,
                     AcmCAuxEntArray& subEntsText,
                     const AcGePoint3d& basePoint,
                     const CString& str, Acm::Direction dir= Acm::kToBottom) const;
};

///<summary>The AmdtEdgeStdISO13715 class is a derived class of the AmdtEdgeStdISO class. The usage of 
///AmdtEdgeStdISO13715 class is the same as that of AmdtEdgeStdISO class.</summary>
class STDIMP_DLLSHARE AmdtEdgeStdISO13715 : public AmdtEdgeStdISO
{
public:
  ACRX_DECLARE_MEMBERS(AmdtEdgeStdISO13715);
  ///<summary>The construct function.</summary>
  AmdtEdgeStdISO13715();
  ///<summary>The destruct function.</summary>
  virtual ~AmdtEdgeStdISO13715();
  ///<summary>Gets the information about the standard name and revision.</summary>
  Acm::ErrorStatus getRevision(CString& rev, Adesk::UInt16& year) const override;
  ///<summary>Sets the factory default values.</summary>
  Adesk::Boolean setFactoryDefaults() override;
  void getSubEnts(const AmdtCEdge* pSymb, 
                          AcmCAuxEntArray& subents,
                          bool corrSymbOnRightSide = false) const override;

  Acad::ErrorStatus dwgInFields(AcDbDwgFiler* filer) override;

  ///<summary>Get the symbol's standard number string.</summary>
  ///<param name="rev">standard number.</param>
  virtual void getStandardNum(CString& rev) const;

  ///<summary>It is used to draw standard number for a edge symbol. Add the standard number sub-entities to
  ///edge's sub-entities.</summary>
  ///<param name="pSymb">The edge symbol</param>
  ///<param name="subents">Symbol's sub-entities</param>
  ///<param name="cnvMat">Symbol's transform matrix</param>
  ///<param name="corrSymbOnRightSide">Symbol is on right side of its leader.</param>
  virtual void drawStandardNum(const AmdtCEdge* pSymb, 
                               AcmCAuxEntArray& subents,
                               const AcGeMatrix3d& cnvMat,
                               bool corrSymbOnRightSide) const;
};


///<summary>The AmdtEdgeStdISO13715_2017 class is a derived class of the AmdtEdgeStdISO class. The usage of 
///AmdtEdgeStdISO13715_2017 class is the same as that of AmdtEdgeStdISO class.</summary>
class STDIMP_DLLSHARE AmdtEdgeStdISO13715_2017 : public AmdtEdgeStdISO13715
{
public:
    ACRX_DECLARE_MEMBERS(AmdtEdgeStdISO13715_2017);
    ///<summary>The construct function.</summary>
    AmdtEdgeStdISO13715_2017();
    ///<summary>The destruct function.</summary>
    virtual ~AmdtEdgeStdISO13715_2017();
    ///<summary>Gets the information about the standard name and revision.</summary>
    Acm::ErrorStatus getRevision(CString& rev, Adesk::UInt16& year) const override;
    ///<summary>Sets the factory default values.</summary>
    Adesk::Boolean setFactoryDefaults() override;

    ///<summary>Get the symbol's standard number string.</summary>
    ///<param name="rev">standard number.</param>
    void getStandardNum(CString& rev) const override;


    void setDefaultSubSymbol(AmdtCEdge* pData) const override;

    Acm::ErrorStatus checkVisibility(AmdtCEdge* pData) const override;
    Acm::ErrorStatus initFields(AmdtCEdge* pSubSym) const override;

    Acm::ErrorStatus validityFields(AmdtCEdge* pData,
                                    bool setBoundary = false,
                                    int dlgIndex = -1) override;

    Acm::ErrorStatus validityEdgeLimits(AmdtCEdge* pSubSym,
                                        Acm::Variable currVar,
                                        AcmStringValue& currLimit) override;

    Acm::ErrorStatus getUndefinedSizePosList(std::vector<Adesk::UInt16>& list) const override;
    Acm::ErrorStatus getEdgeSignTypeList(std::vector<Adesk::UInt16>& list) const override;
    Acm::ErrorStatus getOptionsList(std::vector<Adesk::UInt16>& list) const override;
    Acm::ErrorStatus getDirectionList(std::vector<Adesk::UInt16>& list) const override;
    Acm::ErrorStatus initPost(AmdtCEdge* pSubSym) const override;
    Acm::ErrorStatus setSuggested(AmdtCEdge* pData) const override;
    Acm::ErrorStatus getTooltip(const AmdtCEdge* pSubSym, CString& resStr) const override;

    void getSubEnts(const AmdtCEdge* pSymb,
                    AcmCAuxEntArray& subents,
                    bool corrSymbOnRightSide = false) const override;

    void getLibSubEnts(const AmdtEdge* pEdge,
                       const AmdtCEdge* pSubSymb,
                       AcmCAuxEntArray& subents) const override;

    void getSideEdgeSubEnts(const AmdtCEdge* pSymb,
                            AcmCAuxEntArray& subents,
                            const AcGePoint3d leaderStartPt) const;

    void drawStandardNum(const AmdtCEdge* pSubSym,
                        AcmCAuxEntArray& subents,
                        const AcGeMatrix3d& cnvMat,
                        bool corrSymbOnRightSide) const override;

protected:
    void getHeights(const AmdtCEdge*, AcGeDoubleArray&) const override;

private:
    void getSubEntOfLandingLineAndQuantity(const AmdtCEdge* pSubSym,
                                const AcmStandard* pStd,
                                AcmCAuxEntArray& subents,
                                AcmCAuxEntArray& subEntsText,
                                AcmCAuxEntArray& subEntsLimArea,
                                AcGeMatrix3d& cnvMat,
                                Acm::Direction lDir,
                                const AcGeDoubleArray& H) const;

    void getSubEntOfBoundaryText(const AmdtCEdge* pSubSym,
                                 const AcmStandard* pStd,
                                 AcmCAuxEntArray& subents,
                                 AcmCAuxEntArray& subEntsText,
                                 Acm::Variable max,
                                 Acm::Variable min,
                                 const AcGeDoubleArray& H,
                                 Acm::Direction lDir,
                                 bool bAsymmetric = false,
                                 const AcDbExtents* pAsTextExtens = nullptr) const;

    void getSubEntOfBaseSymbol(const AmdtCEdge* pSubSym,
                               const AcmStandard* pStd,
                               AcmCAuxEntArray& subents,
                               const AcGeDoubleArray& H) const;

    void getSubEntOfLimitedArea(const AmdtCEdge* pSubSym,
                               const AcmStandard* pStd,
                               AcmCAuxEntArray&  subEntsLimArea,
                               double midXPos,
                               double minYPos,
                               const AcGeDoubleArray& H) const;

    void getSubEntOfAppModifier(const AmdtCEdge* pSubSym,
                                const AcmStandard* pStd,
                                AcmCAuxEntArray& subents,
                                const AcGeDoubleArray& H) const;

    void getBracketSubEnts(const AmdtCEdge* pSubSym,
                           const AcmStandard* pStd,
                           AcmCAuxEntArray& subents,
                           double bulge,
                           double& bracketWidth,
                           const AcDbExtents* pAditionalExtend = nullptr) const;

};