Click here to Skip to main content
15,886,137 members
Articles / Desktop Programming / MFC

CCurveDlg - Curve Interpolation

Rate me:
Please Sign up or sign in to vote.
2.75/5 (4 votes)
15 Sep 20012 min read 113.5K   5.3K   42  
A Photoshop-like curve dialog.
// CKnot : header file
//
// CKnot Class, object helper class, data representation of knots  
// Functionality :
//      1. Set and retrieving data
//		2. Serialsation
//      3. Operator overloading
//      
// Copyright Johan Janssens, 2001 (jjanssens@mail.com)
// Feel free to use and distribute. May not be sold for profit. 

#ifndef _JANSSENS_JOHAN_KNOT_H_
#define _JANSSENS_JOHAN_KNOT_H_

//Knot Class
class CKnot : public CObject
{
public :

	UINT  x;
	UINT  y;
	DWORD dwData;

public :

	CKnot() : x(0), y(0), dwData(true) {}	//Constructors	
	CKnot(int ptX, int ptY) : 
			x(ptX), y(ptY), dwData(0)  {}

	void SetPoint(CPoint pt)  {	x = pt.x; y = pt.y;}	//Setting
	void SetData(DWORD data)  { dwData = data;}

	void GetPoint(LPPOINT pt) { pt->x = x; pt->y = y;}	//Extraction

	//Operator overloading
	void operator = (CKnot knot)   {x = knot.x; y = knot.y; dwData  = knot.dwData; }
	void operator = (CPoint point) {x = point.x; y = point.y;}

	bool operator != (CPoint point)
	{
		bool b;
		((x != point.x) && (y != point.y)) ? b = true : b = false;
		return b;
	}

	void Serialize(CArchive& ar)
	{
		if(ar.IsStoring())
			ar << x << y << dwData;
		else
			ar >> x >> y >> dwData;
	}
};

/////////////////////////////////////////////////////////////////////////////
#endif // _JANSSENS_JOHAN_KNOT_H_

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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
Russian Federation Russian Federation
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions