ROrthoGrid
Class in Grid Module
Header: #include <src/grid/ROrthoGrid.h>
Inherits: RGrid
Description
Section titled “Description”Grid representation.
This class is responsible for updating the grid and snapping to the grid.
Scriptable: This class is available in script environments.
Public Functions
Section titled “Public Functions”ROrthoGrid(RGraphicsView &view) |
|
| virtual | ~ROrthoGrid() |
| virtual void | clearCache() |
| QList< RVector > | getIdealSpacing(int minPixelSpacing, const RVector &minSpacing, const RVector &minMetaSpacing) |
| virtual QString | getInfoText() |
| RVector | getMetaSpacing() const |
| virtual RS::IsoProjectionType | getProjection() const |
| int | getSettingsViewportNumber() const |
| RVector | getSpacing() const |
| virtual bool | isIsometric() const |
| virtual void | paint()This is called by the graphics view this grid is attached to whenever the grid should be painted. |
| virtual void | paintCursor(const RVector &pos) |
| virtual void | paintGridLines(const RVector &space, const RBox &box, bool meta) |
| virtual void | paintGridPoints(const RVector &space, const RBox &box) |
| virtual void | paintMetaGrid()This is called by the graphics view this grid is attached to whenever the meta grid should be painted. |
| virtual void | paintRuler(RRuler &ruler, qreal devicePixelRatio=1.0) |
| void | setIsometric(bool on) |
| void | setProjection(RS::IsoProjectionType p) |
| virtual RVector | snapToGrid(const RVector &positionUcs)Maps the given model position to the grid. |
| virtual void | update(bool force=false)Updates the grid information, in particular the grid spacing and grid region to the current view port. |
Static Public Functions
Section titled “Static Public Functions”| static QList< RVector > | getIdealGridSpacing(RGraphicsView &view, int minPixelSpacing, const RVector &minSpacing, const RVector &minMetaSpacing) |
| static bool | isFractionalFormat(RS::LinearFormat linearFormat) |
Static Private Functions
Section titled “Static Private Functions”| static double | inchAutoscale(double value, double idealSpacing, RS::Unit unit) |
Private Attributes
Section titled “Private Attributes”Member Documentation
Section titled “Member Documentation”ROrthoGrid
Section titled “ROrthoGrid”ROrthoGrid::ROrthoGrid(RGraphicsView &view)All rights reserved.
This file is part of the QCAD project.
QCAD is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
QCAD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with QCAD.
~ROrthoGrid
Section titled “~ROrthoGrid”virtual ROrthoGrid::~ROrthoGrid()virtual
clearCache
Section titled “clearCache”virtual void ROrthoGrid::clearCache()virtual
Reimplemented from clearCache.
getIdealSpacing
Section titled “getIdealSpacing”QList< RVector > ROrthoGrid::getIdealSpacing(int minPixelSpacing, const RVector &minSpacing, const RVector &minMetaSpacing)getInfoText
Section titled “getInfoText”virtual QString ROrthoGrid::getInfoText()virtual
Reimplemented from getInfoText.
getMetaSpacing
Section titled “getMetaSpacing”RVector ROrthoGrid::getMetaSpacing() constconst
Returns: The effective meta grid spacing as computed by the last call to update: the fixed or automatic meta grid spacing, or the automatic meta grid spacing if the meta grid is currently switched off because the spacing would be below the minimum pixel spacing. Invalid if unknown.
getProjection
Section titled “getProjection”virtual RS::IsoProjectionType ROrthoGrid::getProjection() constvirtual const
Reimplemented from getProjection.
getSettingsViewportNumber
Section titled “getSettingsViewportNumber”int ROrthoGrid::getSettingsViewportNumber() constconst
Returns: The viewport number whose grid settings (spacing, isometric grid, projection) apply to this grid: the viewport number of the view, or 0 for views without a viewport number (e.g. the 3D view which shows the grid with the settings of the first 2D viewport).
getSpacing
Section titled “getSpacing”RVector ROrthoGrid::getSpacing() constconst
Returns: The effective grid spacing as computed by the last call to update: the fixed or automatic grid spacing, or the automatic grid spacing if the grid is currently switched off because the spacing would be below the minimum pixel spacing (e.g. for rulers which show ticks at grid points, see paintRuler). Invalid if unknown.
isIsometric
Section titled “isIsometric”virtual bool ROrthoGrid::isIsometric() constvirtual const
Reimplemented from isIsometric.
virtual void ROrthoGrid::paint()virtual
This is called by the graphics view this grid is attached to whenever the grid should be painted.
Reimplemented from paint.
paintCursor
Section titled “paintCursor”virtual void ROrthoGrid::paintCursor(const RVector &pos)virtual
Reimplemented from paintCursor.
paintGridLines
Section titled “paintGridLines”virtual void ROrthoGrid::paintGridLines(const RVector &space, const RBox &box, bool meta)virtual
paintGridPoints
Section titled “paintGridPoints”virtual void ROrthoGrid::paintGridPoints(const RVector &space, const RBox &box)virtual
paintMetaGrid
Section titled “paintMetaGrid”virtual void ROrthoGrid::paintMetaGrid()virtual
This is called by the graphics view this grid is attached to whenever the meta grid should be painted.
Reimplemented from paintMetaGrid.
paintRuler
Section titled “paintRuler”virtual void ROrthoGrid::paintRuler(RRuler &ruler, qreal devicePixelRatio=1.0)virtual
Reimplemented from paintRuler.
setIsometric
Section titled “setIsometric”void ROrthoGrid::setIsometric(bool on)setProjection
Section titled “setProjection”void ROrthoGrid::setProjection(RS::IsoProjectionType p)snapToGrid
Section titled “snapToGrid”virtual RVector ROrthoGrid::snapToGrid(const RVector &positionUcs)virtual
Maps the given model position to the grid.
Reimplemented from snapToGrid.
update
Section titled “update”virtual void ROrthoGrid::update(bool force=false)virtual
Updates the grid information, in particular the grid spacing and grid region to the current view port.
Reimplemented from update.
getIdealGridSpacing
Section titled “getIdealGridSpacing”static QList< RVector > ROrthoGrid::getIdealGridSpacing(RGraphicsView &view, int minPixelSpacing, const RVector &minSpacing, const RVector &minMetaSpacing)static
isFractionalFormat
Section titled “isFractionalFormat”static bool ROrthoGrid::isFractionalFormat(RS::LinearFormat linearFormat)static
inchAutoscale
Section titled “inchAutoscale”static double ROrthoGrid::inchAutoscale(double value, double idealSpacing, RS::Unit unit)static private
autoMetaSpacing
Section titled “autoMetaSpacing”RVector ROrthoGrid::autoMetaSpacingprivate
autoSpacing
Section titled “autoSpacing”RVector ROrthoGrid::autoSpacingprivate
gridBox
Section titled “gridBox”RBox ROrthoGrid::gridBoxprivate
infoText
Section titled “infoText”QString ROrthoGrid::infoTextprivate
isometric
Section titled “isometric”int ROrthoGrid::isometricprivate
metaGridBox
Section titled “metaGridBox”RBox ROrthoGrid::metaGridBoxprivate
metaSpacing
Section titled “metaSpacing”RVector ROrthoGrid::metaSpacingprivate
minMetaSpacing
Section titled “minMetaSpacing”RVector ROrthoGrid::minMetaSpacingprivate
minPixelSpacing
Section titled “minPixelSpacing”int ROrthoGrid::minPixelSpacingprivate
minSpacing
Section titled “minSpacing”RVector ROrthoGrid::minSpacingprivate
projection
Section titled “projection”int ROrthoGrid::projectionprivate
spacing
Section titled “spacing”RVector ROrthoGrid::spacingprivate
viewBox
Section titled “viewBox”RBox ROrthoGrid::viewBoxprivate