Skip to content

ROrthoGrid

Class in Grid Module
Header: #include <src/grid/ROrthoGrid.h>
Inherits: RGrid

Grid representation.

This class is responsible for updating the grid and snapping to the grid.

Scriptable: This class is available in script environments.

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 QList< RVector > getIdealGridSpacing(RGraphicsView &view, int minPixelSpacing, const RVector &minSpacing, const RVector &minMetaSpacing)
static bool isFractionalFormat(RS::LinearFormat linearFormat)
static double inchAutoscale(double value, double idealSpacing, RS::Unit unit)
RVector autoMetaSpacing
RVector autoSpacing
RBox gridBox
QString infoText
int isometric
RBox metaGridBox
RVector metaSpacing
RVector minMetaSpacing
int minPixelSpacing
RVector minSpacing
int projection
RVector spacing
RBox viewBox

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.

virtual ROrthoGrid::~ROrthoGrid()

virtual

virtual void ROrthoGrid::clearCache()

virtual

Reimplemented from clearCache.

QList< RVector > ROrthoGrid::getIdealSpacing(int minPixelSpacing, const RVector &minSpacing, const RVector &minMetaSpacing)

virtual QString ROrthoGrid::getInfoText()

virtual

Reimplemented from getInfoText.

RVector ROrthoGrid::getMetaSpacing() const

const

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.

virtual RS::IsoProjectionType ROrthoGrid::getProjection() const

virtual const

Reimplemented from getProjection.

int ROrthoGrid::getSettingsViewportNumber() const

const

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).

RVector ROrthoGrid::getSpacing() const

const

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.

virtual bool ROrthoGrid::isIsometric() const

virtual 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.

virtual void ROrthoGrid::paintCursor(const RVector &pos)

virtual

Reimplemented from paintCursor.

virtual void ROrthoGrid::paintGridLines(const RVector &space, const RBox &box, bool meta)

virtual

virtual void ROrthoGrid::paintGridPoints(const RVector &space, const RBox &box)

virtual

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.

virtual void ROrthoGrid::paintRuler(RRuler &ruler, qreal devicePixelRatio=1.0)

virtual

Reimplemented from paintRuler.

void ROrthoGrid::setIsometric(bool on)

void ROrthoGrid::setProjection(RS::IsoProjectionType p)

virtual RVector ROrthoGrid::snapToGrid(const RVector &positionUcs)

virtual

Maps the given model position to the grid.

Reimplemented from snapToGrid.

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.

static QList< RVector > ROrthoGrid::getIdealGridSpacing(RGraphicsView &view, int minPixelSpacing, const RVector &minSpacing, const RVector &minMetaSpacing)

static

static bool ROrthoGrid::isFractionalFormat(RS::LinearFormat linearFormat)

static

static double ROrthoGrid::inchAutoscale(double value, double idealSpacing, RS::Unit unit)

static private

RVector ROrthoGrid::autoMetaSpacing

private

RVector ROrthoGrid::autoSpacing

private

RBox ROrthoGrid::gridBox

private

QString ROrthoGrid::infoText

private

int ROrthoGrid::isometric

private

RBox ROrthoGrid::metaGridBox

private

RVector ROrthoGrid::metaSpacing

private

RVector ROrthoGrid::minMetaSpacing

private

int ROrthoGrid::minPixelSpacing

private

RVector ROrthoGrid::minSpacing

private

int ROrthoGrid::projection

private

RVector ROrthoGrid::spacing

private

RBox ROrthoGrid::viewBox

private