X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0fc1a7137cccc829a34b3527c768db7d7ac83437..31811e1acaf3dd16403b94f5ff93c41e4e4ca9bb:/utils/ogl/src/ogldiag.h diff --git a/utils/ogl/src/ogldiag.h b/utils/ogl/src/ogldiag.h index 4f45eb0d42..e06e1248f4 100644 --- a/utils/ogl/src/ogldiag.h +++ b/utils/ogl/src/ogldiag.h @@ -33,7 +33,7 @@ public: virtual void Redraw(wxDC& dc); virtual void Clear(wxDC& dc); - virtual void DrawOutline(wxDC& dc, float x1, float y1, float x2, float y2); + virtual void DrawOutline(wxDC& dc, double x1, double y1, double x2, double y2); // Add object to end of object list (if addAfter is NULL) // or just after addAfter. @@ -43,10 +43,10 @@ public: virtual void InsertShape(wxShape *object); void SetSnapToGrid(bool snap); - void SetGridSpacing(float spacing); - inline float GetGridSpacing() { return m_gridSpacing; } + void SetGridSpacing(double spacing); + inline double GetGridSpacing() const { return m_gridSpacing; } inline bool GetSnapToGrid() const { return m_snapToGrid; } - void Snap(float *x, float *y); + void Snap(double *x, double *y); inline void SetQuickEditMode(bool qem) { m_quickEditMode = qem; } inline bool GetQuickEditMode() const { return m_quickEditMode; } @@ -56,15 +56,18 @@ public: virtual void DeleteAllShapes(); virtual void ShowAll(bool show); + // Find a shape by its id + wxShape* FindShape(long id) const; + inline void SetMouseTolerance(int tol) { m_mouseTolerance = tol; } inline int GetMouseTolerance() const { return m_mouseTolerance; } inline wxList *GetShapeList() const { return m_shapeList; } + inline int GetCount() const { return m_shapeList->Number(); } // Make sure all text that should be centred, is centred. void RecentreAll(wxDC& dc); #ifdef PROLOGIO - // Prolog database stuff virtual bool SaveFile(const wxString& filename); virtual bool LoadFile(const wxString& filename); @@ -85,10 +88,37 @@ protected: wxShapeCanvas* m_diagramCanvas; bool m_quickEditMode; bool m_snapToGrid; - float m_gridSpacing; + double m_gridSpacing; int m_mouseTolerance; wxList* m_shapeList; }; +class wxLineCrossing: public wxObject +{ +public: + wxLineCrossing() { m_lineShape1 = NULL; m_lineShape2 = NULL; } + wxRealPoint m_pt1; // First line + wxRealPoint m_pt2; + wxRealPoint m_pt3; // Second line + wxRealPoint m_pt4; + wxRealPoint m_intersect; + wxLineShape* m_lineShape1; + wxLineShape* m_lineShape2; +}; + +class wxLineCrossings: public wxObject +{ +public: + wxLineCrossings(); + ~wxLineCrossings(); + + void FindCrossings(wxDiagram& diagram); + void DrawCrossings(wxDiagram& diagram, wxDC& dc); + void ClearCrossings(); + +public: + wxList m_crossings; +}; + #endif // _OGL_OGLDIAG_H_