| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| #ifndef LC_ORTHOGONALGRID_H |
| #define LC_ORTHOGONALGRID_H |
|
|
| #include "rs_grid.h" |
| #include "lc_gridsystem.h" |
|
|
| class LC_OrthogonalGrid:public LC_GridSystem{ |
| public: |
|
|
| explicit LC_OrthogonalGrid(LC_GridOptions *options); |
| ~LC_OrthogonalGrid() override; |
| RS_Vector snapGrid(const RS_Vector &coord) const override; |
| protected: |
|
|
| |
| |
| |
| |
| RS_Vector gridMin; |
| |
| |
| |
| RS_Vector gridMax; |
|
|
|
|
| int numPointsXLeft = 0; |
| int numPointsXRight = 0; |
| int numPointsYBottom = 0; |
| int numPointsYTop = 0; |
| int numPointsXTotal = 0; |
| int numPointsYTotal = 0; |
|
|
| |
| |
| |
| |
| |
| RS_Vector gridBasePointIfMetagridNotVisible; |
|
|
| void prepareGridOther(const RS_Vector &viewZero, const RS_Vector &viewSize) override; |
|
|
| void fillMetaGridCoordinates(); |
|
|
| void ensureAllMetaGridLinesInView(const RS_Vector &viewZero, const RS_Vector &viewSize); |
|
|
| void determineMetaGridBoundaries(const RS_Vector &viewZero, const RS_Vector &viewSize) override; |
|
|
| void projectMetaGridLinesAmount(const RS_Vector &metaGridWidth); |
|
|
| void determineGridPointsAmount(const RS_Vector &viewZero) override; |
|
|
| int determineTotalPointsAmount(bool drawGridWithoutGaps) override; |
|
|
| void fillPointsLatticeWithGapsForMetaGrid(); |
|
|
| void determineGridBoundaries(const RS_Vector &viewZero,const RS_Vector &viewSize); |
|
|
| void drawMetaGridLines(RS_Painter *painter, LC_GraphicViewport *view) override; |
|
|
| void createGridPoints(const RS_Vector &min, const RS_Vector &max,const RS_Vector &gridWidth, bool drawGridWithoutGaps, int numPointsTotal) override; |
|
|
| void createGridLines(const RS_Vector& min, const RS_Vector &max, const RS_Vector & gridWidth, bool gaps, const RS_Vector& lineOffset) override; |
|
|
| void createVerticalLines(const double &start, const double &end, const double &baseX, const double &delta, const int &pointsToDraw) const; |
|
|
| void createHorizontalLines(const double &start, const double &end, const double &baseY, const double &delta, const int &pointsToDraw) const; |
|
|
| void createMetaGridLines(const RS_Vector &min, const RS_Vector &max) override; |
|
|
| void doCreateVerticalLines(LC_Lattice *lattice, const double &start, const double &end, const double &baseX, |
| const double &delta, const int &pointsToDraw) const; |
|
|
| void doCreateHorizontalLines(LC_Lattice *lattice, const double &start, const double &end, const double &baseY, |
| const double &delta, const int &pointsToDraw) const; |
|
|
| void createGridLinesWithoutGaps(const RS_Vector &min, const RS_Vector &max); |
|
|
| void createGridLinesWithGaps(const RS_Vector &min, const RS_Vector &max, const RS_Vector &lineOffset); |
|
|
| void createCellVector(const RS_Vector &gridWidth) override; |
|
|
|
|
| }; |
|
|
| #endif |
|
|