//
#ifndef __WELDSYM_H
#define __WELDSYM_H
//
//  (C) Copyright 1993-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 __ACMDEF_H
	#error include 'acmdef.h' before including this file
#endif
#ifndef __CAUXENT_H
	#error include 'cauxent.h' before including this file
#endif

#include "AdAChar.h"

class AcmCWeld;
class AcmCSubWelding;
class AcmCSubWeldingList;
class AcmCWeldServiceImp;
class AcmWeldingStd;
class AcmCWeldServiceImp;
class AcmWeldingStdImp;

class DllImpExp AcmCWeldService
{
  friend class AcmSymbbInternals;
public:
  virtual ~AcmCWeldService();
  
  LPCTSTR            serviceName() const;
  Acm::SubSymbolType serviceType() const;
  Acm::WeldGroup     group() const;

  Acm::WeldLocation  allowedLocation() const;
  Acm::StaggerType   allowedStaggerType() const;
  Adesk::Boolean     enableSpacer() const;

  Acm::AlignmentType alignment() const;
  virtual double alignSize() const;

  Adesk::Boolean hidden() const;
  void setHidden(Adesk::Boolean hide);
  
  double leftTxtStartPosition() const;  
  void setLeftTxtStartPosition(double pos);  
  
  double rightTxtStartPosition() const;  
  void setRightTxtStartPosition(double pos);  

  virtual HBITMAP loadBitmap(Adesk::Boolean flip = Adesk::kFalse) const;

  virtual Acm::ErrorStatus setSuggested(AcmCWeld* pWeld) const;
  virtual Acm::ErrorStatus checkVisibility(AcmCWeld* pWeld) const;
  virtual Acm::ErrorStatus initFields(AcmCWeld* pWeld) const;

  virtual Acm::ErrorStatus getBreakExtents(AcDbExtents& ext,
                                  const AcmCWeld* pWeld) const;
  
  virtual Acm::ErrorStatus linkDef(const AcmCWeld* pWeld,
                                   AcGeMatrix3d& trans) const;
  
  virtual Acm::ErrorStatus secondaryFillet(const AcmCWeld* pWeld,
                                           AcGePoint3d& pt) const;

  virtual void getSubEnts(AcmCWeld* pWeld, AcmCAuxEntArray& entArray);
  
  virtual Acm::ErrorStatus getTransform(const AcmCWeld *pWeld,
                                        AcGeMatrix3d& trans) const;

  virtual AcDbMText::AttachmentPoint attachContourText(const AcmCWeld* pWeld) const;  

protected:
  AcmCWeldService();

  AcmWeldingStd* ownerWeldStd() const;

  void setServiceName(LPCTSTR srvName);
  void setServiceNameRcId(UINT rcSrvNameId);
  void setGroup(Acm::WeldGroup grp);
  void setServiceType(Acm::SubSymbolType srvType);
  void setAllowedStaggerType(Acm::StaggerType aType);
  void setEnableSpacer(Adesk::Boolean enable);
  void setAllowedLocation(Acm::WeldLocation loc);
  void setAlignment(Acm::AlignmentType aType);

  virtual void initTexts(AcmCWeld* pWeld);
  virtual Acm::ErrorStatus initPost(AcmCWeld* pWeld) const;

  virtual HINSTANCE serviceResourceHandle() const;
  
  UINT bitmapRcId() const;
  void setBitmapRcId(UINT bmpRcId);

  UINT bitmapFilpRcId() const;
  void setBitmapFlipRcId(UINT bmpRcId);

  virtual void getBasicSymbol(AcmCWeld* pWeld,
                              double txtHeight,
                              double gap,
                              const AcCmColor & symColor,
                              AcmCAuxEntArray& entArray);
  
  virtual void getBasicSymbol(AcmCWeld* pWeld,
                              double txtHeight,
                              double gap,
                              Adesk::UInt16 symColor,
                              AcmCAuxEntArray& entArray);
private:
  AcmCWeldServiceImp *mpImp;
};


class DllImpExp AcmCWeldBaseService : public AcmCWeldService
{
public:
  virtual Acm::ErrorStatus initFields(AcmCWeld* pWeld) const;
  virtual Acm::ErrorStatus checkVisibility(AcmCWeld* pWeld) const;
  virtual Acm::ErrorStatus setSuggested(AcmCWeld* pWeld) const;
  virtual void getSubEnts(AcmCWeld* pWeld, AcmCAuxEntArray& entArray);
  virtual Acm::ErrorStatus drawBrazing(const AcmCWeld* pWeld,
                                       AcmCAuxEntArray& entArray);

protected:
  virtual void initTexts(AcmCWeld* pWeld);
  virtual Acm::ErrorStatus initPost(AcmCWeld* pWeld) const;

  virtual void getBasicSymbol(AcmCWeld* pWeld,
                              double txtH,
                              double gap, 
                              const AcCmColor & symColor,
                              AcmCAuxEntArray& entArray);
  
  virtual void getBasicSymbol(AcmCWeld* pWeld,
                              double txtH,
                              double gap, 
                              Adesk::UInt16 symColor,
                              AcmCAuxEntArray& entArray);

  virtual void brazing(const AcGePoint3d& p1,
                       const AcGePoint3d& p2,
                       const AcGePoint3d& p3,
                       LPCTSTR value,
                       AcmCAuxEntArray& entArray,
                       double arwSize = - 1.0);
};


class DllImpExp AcmCContourWeldService : public AcmCWeldService
{
public:
  AcmCContourWeldService();
  
  virtual Acm::ErrorStatus getTransform(const AcmCWeld *pWeld,
                                        AcGeMatrix3d& trans) const;
  virtual AcDbMText::AttachmentPoint attachContourText(const AcmCWeld* pWeld) const;
};


class DllImpExp AcmWeldingStd : public AcmSymbolStd
{
  friend class AcmSymbbInternals;
public:
  ACRX_DECLARE_MEMBERS(AcmWeldingStd);

  virtual ~AcmWeldingStd();

  virtual Acm::ErrorStatus cInit();
  virtual Adesk::Boolean setFactoryDefaults();
  virtual void setDefaultSubSymbol(AcmCSubWelding* pData) const;

  virtual Acm::ErrorStatus getDescription(CString& desc,
                                          CBitmap*& pBmpLoaded,
                                          CBitmap*& pBmpReg,
                                          Adesk::Boolean& enablePref) const;

  AcDbObjectId identLtypeId() const;
  Acm::ErrorStatus setIdentLtypeId(const AcDbObjectId& idType);

  Acm::ErrorStatus getIdentLtypeName(ACHAR*& pName) const;
  Acm::ErrorStatus setIdentLtypeName(const ACHAR* pName);

  double identLineGap() const;
  void setIdentLineGap(double value);
  
  double currentIdentLineGap() const;
  void setCurrentIdentLineGap(double value);

  double symbolGap() const;
  void setSymbolGap(double value);

  double currentSymbolGap() const;
  void setCurrentSymbolGap(double value);

  Adesk::Boolean allowedClosedTail() const;
  void setAllowedClosedTail(Adesk::Boolean status);
  
  Adesk::Boolean   allowedISOSymbols(const AcmCSubWelding* pSubWeld = NULL) const;  
  void setAllowedISOSymbols(Adesk::Boolean flag);

  virtual Adesk::Boolean   allowedIdentLine(const AcmCSubWelding* pSubWeld = NULL) const;  
  virtual Acm::StaggerType allowedStaggerType(const AcmCSubWelding* pWelding) const;
  virtual Adesk::Boolean   allowedSpacer(const AcmCSubWelding* pWelding) const;
  
  virtual Adesk::Boolean getWelds(const AcmCSubWelding *pSubWeld,
                                  Acm::WeldLocationFilter filter,
                                  AcmCObjArray<AcmCSymbolDesc>& list,
                                  Adesk::Boolean bISOSymbol = Adesk::kFalse) const;
  
  virtual Adesk::Boolean getWeldDesc(AcmCObjArray<AcmCSymbolDesc>& list,
                                     Acm::WeldGroup wGroup = Acm::kWeld,
                                     Acm::WeldLocationFilter filter = Acm::kForBothSides,
                                     Adesk::Boolean bISOSymbol = Adesk::kFalse) const;
  
  virtual Adesk::Boolean setWeldDesc(const AcmCObjArray<AcmCSymbolDesc>& list, int ISOStartIndex = -1);
  
  AcmCWeldService* getService(Acm::SubSymbolType wType, Adesk::Boolean bISOSymbol = Adesk::kFalse) const;
  Adesk::Boolean isOfferedService(Acm::SubSymbolType wType) const;
    
  AcmCWeldService* serviceAt(Adesk::UInt32 at) const;
  Adesk::UInt32 numOfServices() const;
    
  Adesk::Boolean removeService(Acm::SubSymbolType wType);
  Adesk::Boolean removeServiceAt(Adesk::UInt32 at);

  virtual void initToEditOriginal();
  virtual void initToEdit();

  virtual Adesk::Boolean initPost(AcmCWeld* pWeld) const;

  virtual Acm::ErrorStatus setSuggested(AcmCSubWelding* pData) const;
  virtual Acm::ErrorStatus getSuggestedFinished(CStringList& list);
  virtual Acm::ErrorStatus checkVisibility(AcmCSubWelding* pData) const;
  virtual Acm::ErrorStatus initFields(AcmCSubWelding* pData) const;

  virtual void getSubEnts(const AcmCSubWelding* pSubSym,
                          AcmCAuxEntArray& subents,
                          AcGePoint3d& ptRefEnd) const;

  virtual Acad::ErrorStatus dwgInFields(AcDbDwgFiler* filer);
  virtual Acad::ErrorStatus dwgOutFields(AcDbDwgFiler* filer) const;
  virtual Acad::ErrorStatus dxfInFields(AcDbDxfFiler* filer);
  virtual Acad::ErrorStatus dxfOutFields(AcDbDxfFiler* filer) const;

  enum Variable {
    kIdentLineType = 0,
    kIdentLineGap,    
    kAllowISOSymbols
  };

  virtual Acm::Visibility variableStatus(AcmWeldingStd::Variable var) const;
  virtual void setVariableStatus(AcmWeldingStd::Variable var, Acm::Visibility status);

  virtual Adesk::Boolean isMultipleSymbolsAllowed() const;  
  
  virtual void setDefaultISOSettings();

  virtual void getWeldProcessPrefix(CString& bufStr) const;

  virtual void getDefaultStandardList(AcArray<CString>& list) const;

protected:
  void setAllowedIdentLine(Adesk::Boolean flag);  
  
  Adesk::Boolean registerService(AcmCWeldService* pNewServ, Adesk::Boolean bISOSymbol = Adesk::kFalse);

  virtual void getSideSubEnts(AcmCWeld* pWeld,
                              AcmCWeld* pWeldS,
                              AcmCAuxEntArray& entitySet,
                              Acm::AlignmentType& align,
                              double& moveX) const;
  
  virtual Acad::ErrorStatus   subGetClassID(CLSID* pClsid) const;

  AcmWeldingStd();

private:
  AcmWeldingStdImp *mpImp;
};
MAKE_ACDBOPENOBJECT_FUNCTION(AcmWeldingStd);
DBREF_DECLARE(AcmWeldingStd)

class ADESK_NO_VTABLE AcmCWeld
{
public:
  virtual ~AcmCWeld() = 0
  {
  };
  
  virtual Acm::SubSymbolType type() const = 0;
  virtual void setType(Acm::SubSymbolType type) = 0;
  
  virtual Acm::SubSymbolType contourType() const = 0;
  virtual void setContourType(Acm::SubSymbolType type) = 0;

  virtual Acm::SubSymbolType sizeType() const = 0;
  virtual void setSizeType(Acm::SubSymbolType type) = 0;

  virtual Acm::SubSymbolType secSymbolType() const = 0;
  virtual void setSecSymbolType(Acm::SubSymbolType type) = 0;

  virtual Adesk::Boolean brazing() const = 0;
  virtual void setBrazing(Adesk::Boolean brazing) = 0;

  virtual Adesk::Boolean asSecondary() const = 0;
  virtual Acm::WeldLocation location() const = 0;
  virtual Acm::StaggerType staggered() const = 0;

  virtual double staggerAuxDist() const = 0;
  virtual void setStaggerAuxDist(double value) = 0;

  virtual Adesk::Boolean isEmpty(Acm::Variable var) const = 0;
  
  virtual Acm::ErrorStatus getPrefixSuffix(Acm::Variable var,
                                           CString& prefix,
                                           CString& suffix) const = 0;
  virtual Acm::ErrorStatus setPrefixSuffix(Acm::Variable var,
                                           LPCTSTR prefix,
                                           LPCTSTR suffix) = 0;

  virtual AcmCSubWelding* subWelding() const = 0;

  virtual LPCTSTR value(Acm::Variable var) const = 0;
  virtual Acm::ErrorStatus getValue(Acm::Variable var, CString& value) const = 0;
  virtual Acm::ErrorStatus setValue(Acm::Variable var, LPCTSTR value) = 0;

  virtual Acm::Visibility  variableStatus(Acm::Variable var) const = 0;
  virtual Acm::ErrorStatus setVariableStatus(Acm::Variable var, Acm::Visibility status) = 0;

  virtual Acm::ErrorStatus getVarDlgInfo(Acm::Variable var,CVarDlgInfo& v) const = 0;
  virtual Acm::ErrorStatus setVarDlgInfo(Acm::Variable var,const CVarDlgInfo& v) = 0;

  virtual Acad::ErrorStatus dwgInFields(AcDbDwgFiler* filer, Adesk::UInt16 ver) = 0;
  virtual Acad::ErrorStatus dwgOutFields(AcDbDwgFiler* filer) const = 0;
  virtual Acad::ErrorStatus dxfInFields(AcDbDxfFiler* filer) = 0;
  virtual Acad::ErrorStatus dxfOutFields(AcDbDxfFiler* filer) const = 0;
  
  virtual Adesk::Boolean ISOSymbol() const = 0;
  virtual void setISOSymbol(Adesk::Boolean newVal) = 0;

  virtual Adesk::Boolean isFull() const = 0;
  virtual void setFull(Adesk::Boolean bIsFull) = 0;
};


class AcmCSubWelding : public AcmCSubSymbol
{
public:
  virtual Adesk::Boolean reverseSide() = 0;
  virtual AcmCWeld *newWeld() const = 0;   

  virtual Acm::Orientation orientation() const = 0;

  virtual Acm::AlignmentType textAlign() const = 0;

  virtual Acm::SubSymbolType areaDescType() const = 0;
  virtual void setAreaDescType(Acm::SubSymbolType type) = 0;

  virtual Adesk::Boolean fieldWeld() const = 0;
  virtual void setFieldWeld(Adesk::Boolean field) = 0;

  virtual Acm::IdentLineType identificationLine() const = 0;
  virtual void setIdentificationLine(Acm::IdentLineType type) = 0;

  virtual Adesk::Boolean closedTail() const = 0;
  virtual void setClosedTail(Adesk::Boolean status) = 0;

  virtual Acm::WeldAssociation associationType() const = 0;
  virtual void setAssociationType(Acm::WeldAssociation type) = 0;

  virtual AcmCWeld* weldOnArrowSide(Adesk::Boolean primary = Adesk::kTrue) const = 0;
  virtual Adesk::Boolean setWeldOnArrowSide(AcmCWeld* pNewWeld,
                                    Adesk::Boolean primary = Adesk::kTrue) = 0;

  virtual AcmCWeld* weldOnOtherSide(Adesk::Boolean primary = Adesk::kTrue) const = 0;
  virtual Adesk::Boolean setWeldOnOtherSide(AcmCWeld* pNewWeld,
                                    Adesk::Boolean primary = Adesk::kTrue) = 0;
  
  virtual void setNewSymbolRev(Adesk::Boolean newRev = Adesk::kTrue) = 0;  
  virtual Adesk::Boolean newSymbolRev() const = 0;

  virtual Acm::ErrorStatus getLeaderPoints(Adesk::UInt16 index, AcGePoint3dArray& gripPoints) const = 0;
};


class DllImpExp AcmWelding : public AcmSymbol
{
public:
  ACRX_DECLARE_MEMBERS(AcmWelding);

  AcmWelding();
  virtual ~AcmWelding();

  Acm::SubSymbolType type(Adesk::Boolean arwSide = Adesk::kTrue,
                          Adesk::Boolean primary = Adesk::kTrue,
                          Adesk::UInt16 subWelding = 0) const;
  
  void setType(Acm::SubSymbolType type,
               Adesk::Boolean arwSide = Adesk::kTrue,
               Adesk::Boolean primary = Adesk::kTrue,
               Adesk::UInt16 subWelding = 0);
  
  Acm::SubSymbolType contourType(Adesk::Boolean arwSide = Adesk::kTrue,
                                 Adesk::Boolean primary = Adesk::kTrue,
                                 Adesk::UInt16 subWelding = 0) const;
  
  void setContourType(Acm::SubSymbolType type,
                      Adesk::Boolean arwSide = Adesk::kTrue,
                      Adesk::Boolean primary = Adesk::kTrue,
                      Adesk::UInt16 subWelding = 0);

  Acm::SubSymbolType sizeType(Adesk::Boolean arwSide = Adesk::kTrue,
                              Adesk::Boolean primary = Adesk::kTrue,
                              Adesk::UInt16 subWelding = 0) const;

  void setSizeType(Acm::SubSymbolType type,
                   Adesk::Boolean arwSide = Adesk::kTrue,
                   Adesk::Boolean primary = Adesk::kTrue,
                   Adesk::UInt16 subWelding = 0);

  Acm::SubSymbolType secSymbolType(Adesk::Boolean arwSide = Adesk::kTrue,
                                   Adesk::Boolean primary = Adesk::kTrue,
                                   Adesk::UInt16 subWelding = 0) const;

  void setSecSymbolType(Acm::SubSymbolType type,
                        Adesk::Boolean arwSide = Adesk::kTrue,
                        Adesk::Boolean primary = Adesk::kTrue,
                        Adesk::UInt16 subWelding = 0);

  Adesk::Boolean brazing(Adesk::Boolean arwSide = Adesk::kTrue,
                         Adesk::Boolean primary = Adesk::kTrue,
                         Adesk::UInt16 subWelding = 0) const;

  void setBrazing(Adesk::Boolean brazing,
                  Adesk::Boolean arwSide = Adesk::kTrue,
                  Adesk::Boolean primary = Adesk::kTrue,
                  Adesk::UInt16 subWelding = 0);

  LPCTSTR value(Acm::Variable var,
                Adesk::Boolean arwSide = Adesk::kTrue,
                Adesk::Boolean primary = Adesk::kTrue,
                Adesk::UInt16 subWelding = 0) const;

  Acm::ErrorStatus getValue(Acm::Variable var,
                            CString& value,
                            Adesk::Boolean arwSide = Adesk::kTrue,
                            Adesk::Boolean primary = Adesk::kTrue,
                            Adesk::UInt16 subWelding = 0) const;

  Acm::ErrorStatus setValue(Acm::Variable var,
                            LPCTSTR value,
                            Adesk::Boolean arwSide = Adesk::kTrue,
                            Adesk::Boolean primary = Adesk::kTrue,
                            Adesk::UInt16 subWelding = 0);

  Acm::Visibility variableStatus(Acm::Variable var,
                                 Adesk::Boolean arwSide = Adesk::kTrue,
                                 Adesk::Boolean primary = Adesk::kTrue,
                                 Adesk::UInt16 subWelding = 0) const;

  Acm::ErrorStatus setVariableStatus(Acm::Variable var,
                                     Acm::Visibility status,
                                     Adesk::Boolean arwSide = Adesk::kTrue,
                                     Adesk::Boolean primary = Adesk::kTrue,
                                     Adesk::UInt16 subWelding = 0);

  Acm::ErrorStatus getVarDlgInfo(Acm::Variable var,
                                 CVarDlgInfo& v,
                                 Adesk::Boolean arwSide = Adesk::kTrue,
                                 Adesk::Boolean primary = Adesk::kTrue,
                                 Adesk::UInt16 subWelding = 0) const;

  Acm::ErrorStatus setVarDlgInfo(Acm::Variable var,
                                 const CVarDlgInfo& v,
                                 Adesk::Boolean arwSide = Adesk::kTrue,
                                 Adesk::Boolean primary = Adesk::kTrue,
                                 Adesk::UInt16 subWelding = 0);

  Acm::SubSymbolType areaDescType(Adesk::UInt16 subWelding = 0) const;
  void setAreaDescType(Acm::SubSymbolType type, Adesk::UInt16 subWelding = 0);

  Adesk::Boolean fieldWeld(Adesk::UInt16 subWelding = 0) const;
  void setFieldWeld(Adesk::Boolean field, Adesk::UInt16 subWelding = 0);

  Acm::IdentLineType identificationLine(Adesk::UInt16 subWelding = 0) const;
  void setIdentificationLine(Acm::IdentLineType type, Adesk::UInt16 subWelding = 0);
  
  Adesk::Boolean closedTail(Adesk::UInt16 subWelding = 0) const;
  Acm::ErrorStatus setClosedTail(Adesk::Boolean status, Adesk::UInt16 subWelding = 0);
  
  Acm::WeldAssociation associationType(Adesk::UInt16 subWelding = 0) const;
  void setAssociationType(Acm::WeldAssociation type, Adesk::UInt16 subWelding = 0);

  virtual Acm::ErrorStatus setSymbolDefaults(AcDbDatabase* pDb = NULL);
  virtual AcmCSubWelding* newSubWelding() const;
  
  Acm::ErrorStatus setOrientation(Acm::Orientation orientation);
  Acm::Orientation orientation() const;

  void setTextAlign(const Acm::AlignmentType align);
  Acm::AlignmentType textAlign() const;

  Acm::ErrorStatus addSubWelding(AcmCSubWelding* pSubWelding);

  Adesk::Boolean insertSubWeldingBefore(Adesk::UInt16 index,
                                        AcmCSubWelding* pSubWelding);

  Adesk::Boolean insertSubWeldingAfter(Adesk::UInt16 index,
                                       AcmCSubWelding* pSubWelding);

  AcmCSubWelding* getPrevSubWelding(AcmCSubWelding* pThisSubWelding) const;
  AcmCSubWelding* getNextSubWelding(AcmCSubWelding* pThisSubWelding) const;

  Adesk::UInt16   findSubWelding(AcmCSubWelding* pSubWelding) const;
  Adesk::Boolean  removeSubWelding(Adesk::UInt16 index);
  void            removeAllSubWeldings();
  Adesk::UInt16   numOfSubWeldings() const;
  AcmCSubWelding* subWelding(Adesk::UInt16 index) const;

  void resetOrigins();
  virtual void leaderTipPointChanged(const AcGeVector3d& offset,
                                     const AcmCLeader* leader);

  void weldHighlight(Adesk::UInt16 num) const;
  void weldUnhighlight(Adesk::UInt16 num) const;

  using AcmSymbol::transformBy;
  virtual Acad::ErrorStatus transformBy(const AcGeMatrix3d& xform, double symbolScale);

  virtual void mirrorCoordSys(const AcGeMatrix3d& xMirrorForm,
                              AcGeVector3d& XAxis,
                              AcGeVector3d& YAxis,
                              AcGeVector3d& normal) const;

  virtual Acad::ErrorStatus dwgInFields(AcDbDwgFiler* pFiler);
  virtual Acad::ErrorStatus dwgOutFields(AcDbDwgFiler* pFiler) const;
  virtual Acad::ErrorStatus dxfInFields(AcDbDxfFiler* pFiler);
  virtual Acad::ErrorStatus dxfOutFields(AcDbDxfFiler* pFiler) const;
  virtual Acm::ErrorStatus removeLeader(Adesk::UInt16 index);
  
  virtual void setNewSymbolRev(Adesk::Boolean newRev = Adesk::kTrue);
  virtual Adesk::Boolean newSymbolRev() const;

protected:
  virtual Adesk::Boolean    subWorldDraw(AcGiWorldDraw* pMode);

  Adesk::Boolean resetOrigins(const AcGePoint3d& tip,const AcGePoint3d& prev);
  Adesk::Boolean getLeaderLastTwoPoints(AcGePoint3d& tip,AcGePoint3d& prev) const;
  
  virtual Acad::ErrorStatus subGetSubentPathsAtGsMarker(AcDb::SubentType     type,
                                                     INT_PTR              gsMark,
                                                     const AcGePoint3d&   pickPoint,
                                                     const AcGeMatrix3d&  viewXform, 
                                                     int&                 numPaths,
                                                     AcDbFullSubentPath*& subentPaths, 
                                                     int                  numInserts = 0,
                                                     AcDbObjectId*        entAndInsertStack = NULL) const;

  virtual Acad::ErrorStatus subGetGsMarkersAtSubentPath(const AcDbFullSubentPath& subPath, 
                                                     AcArray<INT_PTR>& gsMarkers) const;

  virtual AcDbEntity*       subSubentPtr(const AcDbFullSubentPath& id) const;

  virtual Acad::ErrorStatus subExplode(AcDbVoidPtrArray& entitySet) const;
  virtual Acad::ErrorStatus subGetGeomExtents(AcDbExtents& extents) const;             
  virtual Acad::ErrorStatus subTransformBy(const AcGeMatrix3d& xform);
  
  virtual void              subList() const;

  virtual Acad::ErrorStatus subGetGripPoints(AcGePoint3dArray& gripPnts,
				                                  AcDbIntArray& osnapMasks,
				                                  AcDbIntArray& geomIds) const;

  virtual Acad::ErrorStatus subGetGripPoints(AcDbGripDataPtrArray& grips,
                                          const double curViewUnitSize, 
                                          const int gripSize, 
                                          const AcGeVector3d& curViewDir,
                                          const int bitflags) const;

  virtual Acad::ErrorStatus subMoveGripPointsAt(const AcDbIntArray& indices,
					                                   const AcGeVector3d& offset);
  
  virtual Acad::ErrorStatus subGetClassID(CLSID* pClsid) const;

private:
  AcmCSubWeldingList* mpSubWeldings;
};
MAKE_ACDBOPENOBJECT_FUNCTION(AcmWelding);
DBREF_DECLARE(AcmWelding)

#endif // __WELDSYM_H
