100 lines
2.2 KiB
C++
100 lines
2.2 KiB
C++
#pragma once
|
|
|
|
#include "AecDbObjXDataMap.h"
|
|
#include <map>
|
|
|
|
class KTInputContext : public AcEdInputContextReactor
|
|
{
|
|
public:
|
|
virtual void endSSGet(Acad::PromptStatus returnStatus,
|
|
const AcArray<AcDbObjectId>& ss);
|
|
};
|
|
|
|
class KTDocReactor : public AcApDocManagerReactor
|
|
{
|
|
public:
|
|
typedef std::map<AcApDocument*, KTInputContext*> PtrMap;
|
|
|
|
public:
|
|
virtual void documentCreated(AcApDocument* pDocCreating);
|
|
virtual void documentToBeDestroyed(AcApDocument* pDocToDestroy);
|
|
void init();
|
|
|
|
private:
|
|
void addReactor(AcApDocument *pDoc);
|
|
void delReactor(AcApDocument *pDoc);
|
|
private:
|
|
PtrMap m_adrMap;
|
|
};
|
|
|
|
class KTInputMonitor : public AcEdInputPointMonitor
|
|
{
|
|
public:
|
|
KTInputMonitor();
|
|
virtual ~KTInputMonitor();
|
|
|
|
BOOL Start(AcApDocument* pDoc);
|
|
BOOL Stop();
|
|
BOOL Stop(AcApDocument* pDoc);
|
|
|
|
BOOL IsEnabled() const;
|
|
void SetEnabled(BOOL bEnable);
|
|
|
|
protected:
|
|
BOOL OnExtractAecDbInfo(AcDbObjectId& idEnt);
|
|
BOOL OnExtractEw(const AcGePoint3d &pt, AcDbObjectId& idEnt);
|
|
BOOL OnHighlightEntity(AcDbObjectId idEnt, BOOL bHighlight);
|
|
|
|
BOOL m_bEnabled;
|
|
CString m_sInfoTip;
|
|
AcDbObjectId m_idCurrent;
|
|
|
|
public:
|
|
|
|
AcApDocument* m_pDocMonitor;
|
|
AcApDocManagerReactor* m_pDocReactor;
|
|
|
|
protected:
|
|
|
|
virtual Acad::ErrorStatus monitorInputPoint(const AcEdInputPoint& input, AcEdInputPointMonitorResult& output);
|
|
};
|
|
|
|
class KTInputFilter : public AcEdInputPointFilter
|
|
{
|
|
public:
|
|
KTInputFilter();
|
|
virtual ~KTInputFilter();
|
|
|
|
BOOL Stop();
|
|
BOOL Stop(AcApDocument* pDoc);
|
|
|
|
protected:
|
|
|
|
BOOL OnExtractAecDbInfo(AcDbObjectId& idEnt);
|
|
BOOL OnExtractEw(const AcGePoint3d &pt, AcDbObjectId& idEnt);
|
|
BOOL OnHighlightEntity(AcDbObjectId idEnt, BOOL bHighlight);
|
|
|
|
virtual Acad::ErrorStatus processInputPoint(const AcEdInputPoint& input, AcEdInputPointFilterResult& output);
|
|
|
|
CString m_sInfoTip;
|
|
};
|
|
|
|
class KTInfoMonitor : public AcApDocManagerReactor
|
|
{
|
|
public:
|
|
KTInfoMonitor();
|
|
virtual ~KTInfoMonitor();
|
|
|
|
BOOL StartMonitor();
|
|
BOOL StopMonitor();
|
|
|
|
KTInputMonitor m_cInputMonitor;
|
|
KTInputFilter m_cInputFilter;
|
|
|
|
protected:
|
|
virtual void documentCreated(AcApDocument* pDocCreating);
|
|
virtual void documentToBeActivated(AcApDocument* pActivatingDoc);
|
|
virtual void documentToBeDeactivated(AcApDocument* pDeActivatedDoc);
|
|
virtual void documentToBeDestroyed(AcApDocument* pDocToDestroy);
|
|
};
|