QCAD Application Framework
CAD Application Development and Automation.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ROrthoGrid.h
Go to the documentation of this file.
1 #ifndef RORTHOGRID_H
2 #define RORTHOGRID_H
3 
4 #include "RGrid.h"
5 
6 class RGraphicsView;
7 class RRuler;
8 
9 
10 
19 class ROrthoGrid : public RGrid {
20 public:
21  ROrthoGrid();
22  virtual ~ROrthoGrid();
23 
24  RVector snapToGrid(RGraphicsView& view, const RVector& positionUcs);
25  virtual void update(RGraphicsView& view, bool force=false);
26  virtual void paint(RGraphicsView& view);
27  virtual void paintMetaGrid(RGraphicsView& view);
28 
29  virtual void paintRuler(RGraphicsView& view, RRuler& ruler);
30 
31  virtual QString getInfoText();
32 
33  static QList<RVector> getIdealSpacing(const RGraphicsView& view, int minPixelSpacing, const RVector& minSpacing);
34 
35  // This is just an idea. This might update the grid for
36  // an entity that is viewed as elevation view. This might be at
37  // any angle.
38  //void updateGrid(REntity& entity);
39 
40  static bool isFractionalFormat(RS::LinearFormat linearFormat);
41 
42 private:
43  static double inchAutoscale(double value, double idealSpacing, RS::Unit unit);
44 
45 private:
54  bool scaleGrid;
56  //RS::Unit unit;
57  QString infoText;
58 };
59 
61 
62 #endif