Click here to Skip to main content
15,895,557 members
Articles / Desktop Programming / MFC

SolidGraph CAD System

Rate me:
Please Sign up or sign in to vote.
4.97/5 (78 votes)
12 Sep 20062 min read 375.9K   29.8K   209  
A SolidGraph CAD system source code.
#ifndef __Contour__
#define __Contour__

//#include "..//Dialogs//ContScenarDlg.h"

class CContObjDlg;
class CContScenarDlg;

class Contour : public ICommander, public IContextMenuInterface
{
	IApplicationInterface*  m_app;
private:
	sgCObject*          m_start_object;
	int                 m_scenar;
	int                 m_step;
	bool                m_lines;
	IGetObjectsPanel*   m_get_object_panel;

	CContScenarDlg*     m_scenar_panel;
	CContObjDlg*        m_select_obj_type_panel;

	IGetPointPanel*     m_get_first_point;
	IGetPointPanel*     m_get_second_point;
	IGetPointPanel*     m_get_third_point;

	CString m_message;

	SG_POINT            m_cur_point;

	SG_POINT        m_first_point;
	SG_POINT        m_tmp_first_point;
	SG_POINT        m_tmp_second_point;
	bool            m_isFirstPoint;
	bool            m_isSecondPoint;
	bool            m_isLastPointOnArc;
	bool            m_exist_arc_data;
	bool            m_can_close;
	std::vector<sgCObject*>   m_objects;

	SG_ARC          m_arc_geo;


	void    CreateContour(sgCObject*);
	void    CreateContourFromObjects();
public:
	void    SwitchScenario(int newScen);
	void    SwitchObjectType(int newObjType);
public:
	Contour(IApplicationInterface*  appI);
	virtual ~Contour();

	virtual void            Start()	;
	virtual bool            PreTranslateMessage(MSG* pMsg);
	virtual void            Draw();
	IContextMenuInterface*    GetContextMenuInterface() {return this;};

	virtual void            SendCommanderMessage(COMMANDER_MESSAGE, void*);

private:	
	virtual unsigned int    GetItemsCount();
	virtual void            GetItem(unsigned int, CString&);
	virtual void            GetItemState(unsigned int, bool&, bool&);
	virtual HBITMAP  GetItemBitmap(unsigned int);
	virtual void            Run(unsigned int);

	void            MouseMove(unsigned int,int,int);
	void            LeftClick(unsigned int,int,int);
	void            OnEnter();
};

#endif

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
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions