50 lines
1.1 KiB
C++
50 lines
1.1 KiB
C++
//-----------------------------------------------------------------------------+
|
|
// Copyright (C), 1998-2007, Beijing Tangent Software Co. Ltd.
|
|
// = FileName : TTempZoomWindow.h
|
|
// = Version : ver2.0
|
|
// = Author : xlc
|
|
// = CreateDate : 2002-09-09
|
|
// = Description: 类的声明
|
|
// = Maintainers:
|
|
//
|
|
//-----------------------------------------------------------------------------+
|
|
#ifndef _TTEMPZOOMWINDOW_H_
|
|
#define _TTEMPZOOMWINDOW_H_
|
|
|
|
#ifndef _TADSGEPOINT3D_H_
|
|
#include "TADSGePoint3d.h"
|
|
#endif
|
|
|
|
// 根据需要临时执行ZOOM, 并在析构时恢复视图
|
|
class GEOAPI TTempZoomWindow
|
|
{
|
|
public:
|
|
|
|
TTempZoomWindow(const TADSGePoint3d &ptMin, const TADSGePoint3d &ptMax);
|
|
|
|
~TTempZoomWindow();
|
|
|
|
protected:
|
|
|
|
TADSGePoint3d m_ptLowViewCorner, m_ptUpViewCorner;
|
|
|
|
BOOL m_bRestoreView;
|
|
|
|
};
|
|
|
|
|
|
inline TTempZoomWindow::TTempZoomWindow(const TADSGePoint3d &ptMin, const TADSGePoint3d &ptMax)
|
|
{
|
|
GetScreenCorner(m_ptLowViewCorner, m_ptUpViewCorner);
|
|
m_bRestoreView = (AssureInCurrentView(ptMin, ptMax) == Acad::eOk);
|
|
}
|
|
|
|
inline TTempZoomWindow::~TTempZoomWindow()
|
|
{
|
|
if (m_bRestoreView)
|
|
{
|
|
ArxZoom(m_ptLowViewCorner, m_ptUpViewCorner); //恢复视口
|
|
}
|
|
}
|
|
|
|
#endif |