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_src.zip
- pgllib_demo.zip
- PGL.dll
- testpgl.exe
- 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
|
// CPGLView.cpp: implementation of the CPGLView class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "PGL/PGLView.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
IMPLEMENT_SERIAL(CPGLView, CObject, 1);
void CPGLView::Serialize(CArchive &archive)
{
// call base class function first
// base class is CObject in this case
CObject::Serialize( archive );
// now do the stuff for our specific class
if( archive.IsStoring() )
{
archive<<m_iTx<<m_iTy<<m_iWidth<<m_iHeight;
}
else
{
archive>>m_iTx>>m_iTy>>m_iWidth>>m_iHeight;
}
}
#ifdef _DEBUG
void CPGLView::Dump( CDumpContext& dc ) const
{
// call base class function first
CObject::Dump( dc );
// now do the stuff for our specific class
// now dumping
dc <<_T("--- CPGLView ---") << endl;
}
void CPGLView::AssertValid() const
{
// call inherited AssertValid first
CObject::AssertValid();
// check CPGLView members...
ASSERT(m_iTx>=0);
ASSERT(m_iTy>=0);
ASSERT(m_iWidth>=0);
ASSERT(m_iHeight>=0);
}
#endif
CPGLView::CPGLView(int _iTx,int _iTy,int _iWidth,int _iHeight)
{
m_iTx=_iTx;
m_iTy=_iTy;
m_iWidth=_iWidth;
m_iHeight=_iHeight;
};
CPGLView::CPGLView(const CPGLView& v)
{
m_iTx=v.m_iTx;
m_iTy=v.m_iTy;
m_iWidth=v.m_iWidth;
m_iHeight=v.m_iHeight;
}
CPGLView& CPGLView::operator= (const CPGLView& v)
{
if (this!=&v)
{
m_iTx=v.m_iTx;
m_iTy=v.m_iTy;
m_iWidth=v.m_iWidth;
m_iHeight=v.m_iHeight;
}
return *this;
}
void CPGLView::PlotGfx(gfxinterface::CGfxInterface& gfx)
{
gfx.SetBoundingBox(m_iTx, m_iTy,m_iTx+m_iWidth,m_iTy+m_iHeight);
}
|
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).