QCAD
Open Source 2D CAD
ROrthoGrid Class Reference

Grid representation. More...

#include <ROrthoGrid.h>

Inheritance diagram for ROrthoGrid:
RGrid

Public Member Functions

virtual void clearCache ()
 
QList< RVectorgetIdealSpacing (int minPixelSpacing, const RVector &minSpacing, const RVector &minMetaSpacing)
 
virtual QString getInfoText ()
 
virtual RS::IsoProjectionType getProjection () 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. More...
 
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. More...
 
virtual void paintRuler (RRuler &ruler, qreal devicePixelRatio=1.0)
 
 ROrthoGrid (RGraphicsView &view)
 Copyright (c) 2011-2018 by Andrew Mustun. More...
 
void setIsometric (bool on)
 
void setProjection (RS::IsoProjectionType p)
 
RVector snapToGrid (const RVector &positionUcs)
 Maps the given model position to the grid. More...
 
virtual void update (bool force=false)
 Updates the grid information, in particular the grid spacing and grid region to the current view port. More...
 
virtual ~ROrthoGrid ()
 
- Public Member Functions inherited from RGrid
RDocumentgetDocument () const
 
int getViewportNumber () const
 Copyright (c) 2011-2018 by Andrew Mustun. More...
 
bool isVisible () const
 
 RGrid (RGraphicsView &view)
 
void setVisible (bool on)
 
virtual ~RGrid ()
 

Static Public Member Functions

static QList< RVectorgetIdealGridSpacing (RGraphicsView &view, int minPixelSpacing, const RVector &minSpacing, const RVector &minMetaSpacing)
 
static bool isFractionalFormat (RS::LinearFormat linearFormat)
 

Static Private Member Functions

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

Private Attributes

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
 

Additional Inherited Members

- Protected Attributes inherited from RGrid
RGraphicsViewview
 
int visible
 

Detailed Description

Grid representation.

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

Scriptable:\nThis class is available in script environments.\n

Constructor & Destructor Documentation

◆ ROrthoGrid()

ROrthoGrid::ROrthoGrid ( RGraphicsView view)

Copyright (c) 2011-2018 by Andrew Mustun.

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

ROrthoGrid::~ROrthoGrid ( )
virtual

Member Function Documentation

◆ clearCache()

void ROrthoGrid::clearCache ( )
virtual

Reimplemented from RGrid.

◆ getIdealGridSpacing()

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

◆ getIdealSpacing()

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

◆ getInfoText()

QString ROrthoGrid::getInfoText ( )
virtual

Implements RGrid.

◆ getProjection()

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

Reimplemented from RGrid.

◆ inchAutoscale()

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

◆ isFractionalFormat()

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

◆ isIsometric()

bool ROrthoGrid::isIsometric ( ) const
virtual

Reimplemented from RGrid.

◆ paint()

void ROrthoGrid::paint ( )
virtual

This is called by the graphics view this grid is attached to whenever the grid should be painted.

Implements RGrid.

◆ paintCursor()

void ROrthoGrid::paintCursor ( const RVector pos)
virtual

Implements RGrid.

◆ paintGridLines()

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

◆ paintGridPoints()

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

◆ paintMetaGrid()

void ROrthoGrid::paintMetaGrid ( )
virtual

This is called by the graphics view this grid is attached to whenever the meta grid should be painted.

Implements RGrid.

◆ paintRuler()

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

Implements RGrid.

◆ setIsometric()

void ROrthoGrid::setIsometric ( bool  on)

◆ setProjection()

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

◆ snapToGrid()

RVector ROrthoGrid::snapToGrid ( const RVector positionUcs)
virtual

Maps the given model position to the grid.

Implements RGrid.

◆ update()

void ROrthoGrid::update ( bool  force = false)
virtual

Updates the grid information, in particular the grid spacing and grid region to the current view port.

Implements RGrid.

Member Data Documentation

◆ autoMetaSpacing

RVector ROrthoGrid::autoMetaSpacing
private

◆ autoSpacing

RVector ROrthoGrid::autoSpacing
private

◆ gridBox

RBox ROrthoGrid::gridBox
private

◆ infoText

QString ROrthoGrid::infoText
private

◆ isometric

int ROrthoGrid::isometric
mutableprivate

◆ metaGridBox

RBox ROrthoGrid::metaGridBox
private

◆ metaSpacing

RVector ROrthoGrid::metaSpacing
private

◆ minMetaSpacing

RVector ROrthoGrid::minMetaSpacing
private

◆ minPixelSpacing

int ROrthoGrid::minPixelSpacing
private

◆ minSpacing

RVector ROrthoGrid::minSpacing
private

◆ projection

int ROrthoGrid::projection
mutableprivate

◆ spacing

RVector ROrthoGrid::spacing
private

◆ viewBox

RBox ROrthoGrid::viewBox
private

The documentation for this class was generated from the following files: