home *** CD-ROM | disk | FTP | other *** search
- /******************************************************************/
- /* */
- /* TurboCAD for Windows */
- /* Copyright (c) 1993 - 2001 */
- /* International Microcomputer Software, Inc. */
- /* (IMSI) */
- /* All rights reserved. */
- /* */
- /******************************************************************/
-
- // Merge.h: interface for the CMerge class.
- //
- //////////////////////////////////////////////////////////////////////
-
- #if !defined(AFX_MERGE_H__AB417D73_CF7E_11D1_B818_000021452DB6__INCLUDED_)
- #define AFX_MERGE_H__AB417D73_CF7E_11D1_B818_000021452DB6__INCLUDED_
-
- #if _MSC_VER >= 1000
- #pragma once
- #endif // _MSC_VER >= 1000
-
- class CMapStyles : public CMap<long, long, Style*, Style*>
- {
- public:
- ~CMapStyles() {CleanAll();};
- void CleanAll();
- };
-
- class CMapLineStyles : public CMap<long, long, LineStyle*, LineStyle*>
- {
- public:
- ~CMapLineStyles() {CleanAll();};
- void CleanAll();
- };
- class CMapBrushStyles : public CMap<long, long, BrushStyle*, BrushStyle*>
- {
- public:
- ~CMapBrushStyles() {CleanAll();};
- void CleanAll();
- };
-
- class CMapBlocks : public CMap<long, long, Block*, Block*>
- {
- public:
- ~CMapBlocks() {CleanAll();};
- void CleanAll();
- };
-
- class CMapLayers : public CMap<long, long, Layer*, Layer*>
- {
- public:
- ~CMapLayers() {CleanAll();};
- void CleanAll();
- };
-
- class CArrBlock : public CArray<Block*, Block*>
- {
- public:
- ~CArrBlock() {CleanAll();};
- void CleanAll();
- };
-
- class CArrLayer : public CArray<Layer*, Layer*>
- {
- public:
- ~CArrLayer() {CleanAll();};
- void CleanAll();
- };
-
- class CMergeGraphic;
- class CMerge
- {
- public:
- HRESULT CorrectGraphic(IGraphic *pIGr, BOOL bInsert = TRUE);
-
- void CleanAddedBlocks();
- HRESULT CorrectAddedBlocks();
-
- void CleanAddedLayers();
-
- virtual void CleanAll();
- CMerge();
- virtual ~CMerge();
-
- HRESULT Init(IDrawing *pIDwgSrc, IDrawing *pIDwgTrg, BOOL bSel);
- HRESULT InitA(IDrawing *pIDwgSrc, IDrawing *pIDwgTrg);
-
- HRESULT Run(IGraphic **ppIGrMerge, BOOL bGrsOnly = FALSE);
- HRESULT RunA();
-
- HRESULT StyleMerge(IUnknown *pIUnkStyle);
-
- CMapStyles m_mapStyles;
- CMapLineStyles m_mapLineStyles;
- CMapBrushStyles m_mapBrushStyles;
- CMapBlocks m_mapBlks;
- CMapLayers m_mapLayers;
-
- CArrBlock m_arrBlks;
- CArrLayer m_arrLyrs;
- private:
- BOOL m_bSel;
-
- Selection* m_pSelSrc;
- IGraphic * m_pIGrMerge;
- BOOL m_bInit;
-
- IDrawing *m_pIDwgSrc;
- Styles *m_pStylesSrc;
- LineStyles *m_pLineStylesSrc;
- BrushStyles *m_pBrushStylesSrc;
- Blocks *m_pBlksSrc;
- Layers *m_pLayersSrc;
- Graphics *m_pGrsSrc;
-
- IDrawing *m_pIDwgTrg;
- Styles *m_pStylesTrg;
- LineStyles *m_pLineStylesTrg;
- BrushStyles *m_pBrushStylesTrg;
- Blocks *m_pBlksTrg;
- Layers *m_pLayersTrg;
- Graphics *m_pGrsTrg;
-
- HRESULT MergeStyles();
- HRESULT MergeStyle(Style *pStSrc);
-
- HRESULT MergeLineStyles();
- HRESULT MergeLineStyle(LineStyle *pLineStSrc);
-
- HRESULT MergeBrushStyles();
- HRESULT MergeBrushStyle(BrushStyle *pBrStSrc);
-
- HRESULT MergeBlock(Block *pBlkSrc, Block** ppBlkTrg);
- HRESULT MergeBlocks();
-
- HRESULT MergeLayer(Layer *pLyrSrc, Layer** ppLyrTrg);
- HRESULT MergeLayers();
-
- HRESULT MergeSelGraphics();
- HRESULT MergeGraphics(Graphics *pGrsSrc, Graphics *pGrsTrg);
-
- DRAWINGGETGRAPHIC m_pfnDwgGetGraphic;
- GRAPHICGETDISPATCH m_pfnGrGetDispatch;
-
- friend class CMergeGraphic;
- };
-
- #endif // !defined(AFX_MERGE_H__AB417D73_CF7E_11D1_B818_000021452DB6__INCLUDED_)
-