ScrewBody.h
Upload User: kairuinn
Upload Date: 2009-02-07
Package Size: 2922k
Code Size: 2k
Category:

Graph program

Development Platform:

Visual C++

  1. #ifndef __ScrewCommand__
  2. #define __ScrewCommand__
  3. #include <list>
  4. #include <vector>
  5. class ScrewCommand : public ICommander, public IContextMenuInterface
  6. {
  7. IApplicationInterface* m_app;
  8. private:
  9. IGetObjectsPanel*      m_get_main_object_panel;
  10. IGetObjectsPanel*      m_get_sub_objects_panel;
  11. IGetPointPanel*        m_get_f_p_panel;
  12. IGetPointPanel*        m_get_s_p_panel;
  13. IGetNumberPanel*        m_get_step_panel;
  14. IGetNumberPanel*        m_get_len_panel;
  15. sgCObject*             m_first_obj;
  16. std::vector<sgCObject*>  m_otv;
  17. int                    m_step;
  18. CString                m_message;
  19. SG_POINT               m_obj_gab_center;
  20. SG_POINT               m_project_on_axe_obj_gab_center;
  21. SG_VECTOR              m_plane_Normal;
  22. double                 m_plane_D;
  23. SG_POINT               m_axe_p1;
  24. SG_POINT               m_axe_p2;
  25. SG_VECTOR              m_axe_dir_no_Normal;
  26. bool                   m_good_step_of_screw;
  27. double                 m_cur_step_of_screw;
  28. bool                   m_good_len_of_screw;
  29. double                 m_cur_len_of_screw;
  30. bool                   m_invert_length;
  31. bool                   m_need_third_pnt_for_plane;
  32. bool                   m_need_fourth_pnt_for_plane;
  33. bool                   m_bad_point_on_plane;
  34. bool                   m_inQuestionRegime;
  35. SG_POINT               m_cur_pnt;
  36. std::list<SG_LINE>     m_object_lines;
  37. void                   FillObjectLinesList(sgCObject*);
  38. HO_CORRECT_PATHS_RES   GoodObjectForHole(const sgC2DObject* try_hole);
  39. public:
  40. ScrewCommand(IApplicationInterface* appI);
  41. virtual ~ScrewCommand();
  42. virtual void            Start() ;
  43. virtual bool            PreTranslateMessage(MSG* pMsg);
  44. virtual void            Draw();
  45. IContextMenuInterface*    GetContextMenuInterface() {return this;};
  46. virtual void            SendCommanderMessage(COMMANDER_MESSAGE, void*);
  47. private:
  48. virtual unsigned int    GetItemsCount();
  49. virtual void            GetItem(unsigned int, CString&);
  50. virtual void            GetItemState(unsigned int, bool&, bool&);
  51. virtual HBITMAP  GetItemBitmap(unsigned int);
  52. virtual void            Run(unsigned int);
  53. void            MouseMove(unsigned int,int,int);
  54. void            LeftClick(unsigned int,int,int);
  55. void            OnEnter();
  56. };
  57. #endif