In this article, you will see a library called PGL that encapsulates plot capabilities in a MFC project for VC6 and VC7. It can easily plot data generated in a project without the need of any external software.
- pgllib_demo.zip
- PGL.dll
- testpgl.exe
- pgllib_src.zip
- pgluml_pdf.zip
- pgluml.pdf
- pglmfclib_src.zip
- CVS
- Base
- Debug
- OGLT
- CVS
- Base
- pglmfclib
- AlgoTools
- bin
- CVS
- Base
- Doxygen
- CVS
- Base
- images
- CVS
- Base
- PlotGraphicLibrary
- Doc
- HTML - English
- PlotGraphicLibrary.dow
- IGfx
- IGfxTest
- lib
- licence.txt
- OGLTools
- CVS
- Base
- Debug
- OGLT
- CVS
- Base
- Release
- res
- CVS
- Base
- PGL
- PGL_Install
- PGLPowerAddIn
- CVS
- Base
- Release
- res
- CVS
- Base
- Plot Graphic Library.dsw
- TestPGL
- Release
- res
- CVS
- Base
- pglmfclib_demo.zip
- PGL.dll
- testpgl.exe
|
// PGLLine2DLODPropPage.cpp : implementation file
//
#include "stdafx.h"
#include "PGL/pgl.h"
#include "PGL/PGLLine2DLODPropPage.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CPGLLine2DLODPropPage property page
IMPLEMENT_DYNCREATE(CPGLLine2DLODPropPage, CPropertyPage)
CPGLLine2DLODPropPage::CPGLLine2DLODPropPage(CPGLLine2DLOD* _pLine2DLOD) : CPropertyPage(CPGLLine2DLODPropPage::IDD)
{
//{{AFX_DATA_INIT(CPGLLine2DLODPropPage)
m_iNbPApprox = 0;
m_iNbPOrig = 0;
m_dTol = 0.0;
m_dPreview = FALSE;
//}}AFX_DATA_INIT
m_pLine2DLOD=_pLine2DLOD;
}
CPGLLine2DLODPropPage::~CPGLLine2DLODPropPage()
{
}
void CPGLLine2DLODPropPage::DoDataExchange(CDataExchange* pDX)
{
CPropertyPage::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CPGLLine2DLODPropPage)
DDX_Text(pDX, IDC_PGL_EDIT_NBPAPPROX, m_iNbPApprox);
DDX_Text(pDX, IDC_PGL_EDIT_NBPORIG, m_iNbPOrig);
DDX_Text(pDX, IDC_PGL_EDIT_TOL, m_dTol);
DDX_Check(pDX, IDC_PGL_CHECK_PREVIEW, m_dPreview);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CPGLLine2DLODPropPage, CPropertyPage)
//{{AFX_MSG_MAP(CPGLLine2DLODPropPage)
ON_EN_CHANGE(IDC_PGL_EDIT_TOL, OnChangePglEditTol)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CPGLLine2DLODPropPage message handlers
BOOL CPGLLine2DLODPropPage::OnKillActive()
{
UpdateData(TRUE);
CDPHull* pHull=m_pLine2DLOD->GetHull();
ASSERT(pHull);
// Setting tolerance
pHull->SetTol(m_dTol);
// Simplify
pHull->Simplify();
return CPropertyPage::OnKillActive();
}
void CPGLLine2DLODPropPage::OnChangePglEditTol()
{
UpdateData(TRUE);
if (m_dPreview)
{
CDPHull* pHull=m_pLine2DLOD->GetHull();
ASSERT(pHull);
// Setting tolerance
pHull->SetTol(m_dTol);
pHull->Simplify();
Refresh();
}
UpdateData(FALSE);
}
void CPGLLine2DLODPropPage::Refresh()
{
CDPHull* pHull=m_pLine2DLOD->GetHull();
ASSERT(pHull);
m_iNbPOrig=pHull->GetNPoints();
m_iNbPApprox=pHull->GetDPNPoints();
m_dTol=pHull->GetTol();
}
BOOL CPGLLine2DLODPropPage::OnSetActive()
{
ASSERT(m_pLine2DLOD);
m_dPreview=TRUE;
Refresh();
UpdateData(FALSE);
return CPropertyPage::OnSetActive();
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Jonathan de Halleux is Civil Engineer in Applied Mathematics. He finished his PhD in 2004 in the rainy country of Belgium. After 2 years in the Common Language Runtime (i.e. .net), he is now working at Microsoft Research on Pex (http://research.microsoft.com/pex).