Click here to Skip to main content
12,350,831 members (28,792 online)
Click here to Skip to main content

Stats

202.7K views
7.1K downloads
112 bookmarked
Posted

Undo and Redo the "Easy" Way

, 20 Jun 2004 CPOL
This article introduces a simple approach to in-memory transactions that can be used to implement Undo and Redo. The technique uses SEH and Virtual Memory and requires only STL and Win32.
Common
CER
Curve Simplification
Transactions
Utilities
DrawIt
res
DrawIt.ico
DrawItDoc.ico
Toolbar.bmp
vssver.scc
DrawItMDI
res
DrawItMDI.ico
DrawItMDI.manifest
DrawItMDIDoc.ico
mainfram.bmp
Toolbar.bmp
MemTest
Bin
release
DrawFunc.dll
DrawIt.exe
DrawItMDI.exe
XCrashReport.exe
XCrashReport.ini
DrawFunc
Transactions.jpg
Transactions.jpg
DrawIt.ico
DrawItDoc.ico
Toolbar.bmp
vssver.scc
Transactions.jpg
DrawItMDI.ico
DrawItMDI.manifest
DrawItMDIDoc.ico
mainfram.bmp
Toolbar.bmp
Transactions.jpg
Transactions
Transactions.jpg
// DPHullGL.cpp: implementation of the CDPHullGL class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "DPHullGL.h"

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CDPHullGL::CDPHullGL()
{

}

CDPHullGL::~CDPHullGL()
{

}

void CDPHullGL::PlotCurve()
{
	int i;
	glBegin(GL_LINE_STRIP);
	for (i=0;i<m_iN;i++)
	{
		glVertex2f((GLfloat)m_pV[i][DP_XX],(GLfloat)m_pV[i][DP_YY]);
	}
	glEnd();
}

void CDPHullGL::PlotDPCurve()
{
	int i;
	glBegin(GL_LINE_STRIP);
	for (i=0;i<m_iNumResult;i++)
	{
		glVertex2f((GLfloat)(*m_ppR[i])[DP_XX],(GLfloat)(*m_ppR[i])[DP_YY]);
	}
	glEnd();
}

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.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

compiler
United States United States
A compiler warns of bogasity, ignore it at your peril. Unless you've done the compiler's job yourself, don't criticize it.

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160621.1 | Last Updated 21 Jun 2004
Article Copyright 2002 by compiler
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid