20#ifndef RGRAPHICSVIEWIMAGE_H
21#define RGRAPHICSVIEWIMAGE_H
79 void setNumThreads(
int n);
83 virtual void setCursor(Qt::CursorShape cursorShape);
84 virtual void setCursor(
const QCursor& cursor);
259 virtual void updateImage();
275 virtual void resizeImage(
int w,
int h);
281 void setPaintOrigin(
bool val);
283 void setPanOptimization(
bool on);
284 bool getPanOptimization();
286 virtual void paintEntities(QPainter* painter,
const RBox& queryBox);
287 void paintEntitiesMulti(
const RBox& queryBox);
294 virtual void paintOverlay();
296 QImage getBuffer()
const;
297 QTransform getTransform()
const;
299 void clearBackground();
301 void setBackgroundTransform(
double bgFactor,
const RVector& bgOffset);
303 void clearOverlay(
int overlayId);
304 void clearOverlay(
int overlayId,
RObject::Id objectId);
308 colorCorrectionOverride = (int)on;
312 return (colorCorrectionOverride!=0);
316 minimumLineweight = lw;
320 return minimumLineweight;
324 maximumLineweight = lw;
328 return maximumLineweight;
355 return graphicsBufferWithPreview;
363 lastKnownScreenPosition = p;
367 lastKnownModelPosition = p;
383 virtual void emitUpdateTextLabel(
const RTextLabel& textLabel);
391 QList<RPainterPath> getTextLayoutsPainterPaths(
const RTextBasedData& text,
const QList<RTextLayout>& textLayouts);
392 void applyMinimumLineweight(QPen& pen);
393 void applyColorCorrection(QPen& pen);
394 void applyColorCorrection(QBrush& brush);
395 void applyColorMode(QPen& pen);
396 void applyColorMode(QBrush& brush);
397 double getPointSize(
double pSize);
412 virtual void paintDocument(
const QRect& rect = QRect());
415 virtual void endPaint()
const;
416 virtual void setBrush(
const QBrush& brush)
const;
417 virtual void setPen(
const QPen& pen)
const;
418 virtual void drawLine(
const QLineF& line)
const;
423 void initPainter(QPaintDevice& device,
bool erase,
bool screen =
false,
const QRect& rect = QRect());
425 void invalidate(
bool force=
false);
426 virtual void initWorkers();
428 void updateTransformation()
const;
Q_DECLARE_METATYPE(RMath *)
Abstract base class for all action classes.
Definition RAction.h:57
Represents a box e.g.
Definition RBox.h:46
Color.
Definition RColor.h:43
A graphics document contains and owns entities, layers, user coordinate systems, variables,...
Definition RDocument.h:78
Interface for interaction between a graphics document and a user.
Definition RDocumentInterface.h:97
Definition RGraphicsSceneDrawable.h:37
Abstract base class for all graphics scenes.
Definition RGraphicsScene.h:64
Qt based 2d graphics scene.
Definition RGraphicsSceneQt.h:68
Graphics view.
Definition RGraphicsView.h:67
virtual double mapDistanceFromView(double d) const =0
Maps the given view distance in pixels to a model distance.
virtual double getDevicePixelRatio() const
Definition RGraphicsView.h:324
virtual void setScene(RGraphicsScene *scene, bool regen=true)
Definition RGraphicsView.cpp:164
virtual void setCursor(Qt::CursorShape)
Definition RGraphicsView.h:243
RVector offset
Offset of the zero point from the lower left corner of the view in model coordinates.
Definition RGraphicsView.h:381
virtual void paintCursorLine(const RLine &)
Definition RGraphicsView.h:240
void restoreViewport()
Definition RGraphicsView.cpp:155
virtual RVector mapToView(const RVector &v) const =0
Maps the given model coordinate to a view coordinate in pixels.
virtual bool hasFocus()=0
virtual int getHeight() const =0
virtual void repaintView()=0
Repaints the view (widget, etc..).
virtual void removeFocus()=0
virtual double mapDistanceToView(double d) const =0
Maps the given model distance to a screen distance in pixels.
virtual int getWidth() const =0
virtual void paintGridPoint(const RVector &)
Definition RGraphicsView.h:238
virtual RVector mapFromView(const RVector &v, double z=0.0) const =0
Maps the given view coordinate in pixels to a model coordinate.
virtual void regenerate(bool force=false)=0
Regenerates the view to show the visible parts of the underlying scene.
virtual void setBackgroundColor(const QColor &col)
Definition RGraphicsView.cpp:934
RVector lastKnownScreenPosition
Definition RGraphicsView.h:409
virtual QCursor getCursor()
Definition RGraphicsView.h:242
virtual void viewportChangeEvent()
Definition RGraphicsView.cpp:143
void saveViewport()
Definition RGraphicsView.cpp:150
virtual void simulateMouseMoveEvent()
Definition RGraphicsView.cpp:614
void clear()
Definition RGraphicsView.h:84
virtual void paintGridLine(const RLine &)
Definition RGraphicsView.h:239
virtual void giveFocus()=0
QImage based 2d graphics view.
Definition RGraphicsViewImage.h:69
double lastFactor
Definition RGraphicsViewImage.h:454
QImage graphicsBufferWithPreview
Definition RGraphicsViewImage.h:442
RGraphicsViewWorker * decorationWorker
Definition RGraphicsViewImage.h:496
RVector lastOffset
Definition RGraphicsViewImage.h:453
QString lastScaleString
Definition RGraphicsViewImage.h:491
bool panOptimization
Definition RGraphicsViewImage.h:447
bool getColorCorrectionOverride() const
Definition RGraphicsViewImage.h:311
bool colorCorrectionDisableForPrinting
Definition RGraphicsViewImage.h:468
RVector getPaintOffset() const
Definition RGraphicsViewImage.h:335
bool showOnlyPlottable
Definition RGraphicsViewImage.h:493
QTransform previousView
Definition RGraphicsViewImage.h:457
bool doPaintOrigin
Definition RGraphicsViewImage.h:460
void setMaximumLineweight(double lw)
Definition RGraphicsViewImage.h:323
double getMaximumLineweight() const
Definition RGraphicsViewImage.h:327
void setLastKnownScreenPosition(const RVector &p)
Definition RGraphicsViewImage.h:362
int colorThreshold
Definition RGraphicsViewImage.h:469
virtual bool registerForFocus() const
Reimplementations may return true to register this view and allow it to be returned by RDocumentInter...
Definition RGraphicsViewImage.h:376
double maximumLineweight
Definition RGraphicsViewImage.h:472
double minimumLineweight
Definition RGraphicsViewImage.h:471
QList< RGraphicsSceneDrawable > backgroundDecoration
Definition RGraphicsViewImage.h:479
int colorCorrectionOverride
Definition RGraphicsViewImage.h:466
QSet< RObject::Id > selectedIds
Definition RGraphicsViewImage.h:463
int bgColorLightness
Definition RGraphicsViewImage.h:464
QPainter * painter
Definition RGraphicsViewImage.h:459
RVector backgroundOffset
Definition RGraphicsViewImage.h:482
int getNumThreads() const
Definition RGraphicsViewImage.h:76
double backgroundFactor
Definition RGraphicsViewImage.h:481
RVector getLastKnownScreenPosition() const
Definition RGraphicsViewImage.h:358
QTransform transform
Definition RGraphicsViewImage.h:456
void setAlphaEnabled(bool on)
Definition RGraphicsViewImage.h:343
virtual bool isShared() const
Reimplementations may return true to prevent this view from being deleted.
Definition RGraphicsViewImage.h:370
double drawingScale
Definition RGraphicsViewImage.h:477
void updateSnapInfo(RGraphicsViewWorker *worker, RSnap *snap, RSnapRestriction *restriction)
bool alphaEnabled
Definition RGraphicsViewImage.h:489
void setMinimumLineweight(double lw)
Definition RGraphicsViewImage.h:315
QImage graphicsBuffer
Definition RGraphicsViewImage.h:440
bool isAlphaEnabled() const
Definition RGraphicsViewImage.h:339
RBox clipBox
Definition RGraphicsViewImage.h:486
bool isSelected
Definition RGraphicsViewImage.h:462
double currentScale
Definition RGraphicsViewImage.h:451
void setLastKnownModelPosition(const RVector &p)
Definition RGraphicsViewImage.h:366
RVector paintOffset
Definition RGraphicsViewImage.h:488
void updateTextLabel(RGraphicsViewWorker *worker, const RTextLabel &textLabel)
double getDrawingScale() const
Definition RGraphicsViewImage.h:347
bool graphicsBufferNeedsUpdate
Definition RGraphicsViewImage.h:455
QSize lastSize
Definition RGraphicsViewImage.h:452
void setDrawingScale(double s)
Definition RGraphicsViewImage.h:350
int numThreads
Definition RGraphicsViewImage.h:444
void setPaintOffset(const RVector &offset)
Definition RGraphicsViewImage.h:331
QMap< int, QMap< RObject::Id, QList< RGraphicsSceneDrawable > > > overlayDrawables
Definition RGraphicsViewImage.h:484
void setColorCorrectionOverride(bool on)
Definition RGraphicsViewImage.h:307
QImage getGraphicsBufferWithPreview() const
Definition RGraphicsViewImage.h:354
QList< RGraphicsViewWorker * > workers
Definition RGraphicsViewImage.h:495
bool colorCorrection
Definition RGraphicsViewImage.h:467
QMutex mutexSi
Definition RGraphicsViewImage.h:448
RGraphicsSceneQt * sceneQt
Definition RGraphicsViewImage.h:450
double getMinimumLineweight() const
Definition RGraphicsViewImage.h:319
QWidget based 2d graphics view.
Definition RGraphicsViewQt.h:44
Thread worker that draws a part of a document.
Definition RGraphicsViewWorker.h:44
Abstract base class for grid implementations.
Definition RGrid.h:41
Stores and manages all data that defines the geometry and appearance of a raster image entity.
Definition RImageData.h:41
Low-level mathematical representation of a line.
Definition RLine.h:41
A mouse event for a graphics scene.
Definition RMouseEvent.h:42
Abstract base class for all objects.
Definition RObject.h:64
int Id
Definition RObject.h:69
Extended painter path with a z-level and a pen.
Definition RPainterPath.h:48
Represents a reference point of an entity.
Definition RRefPoint.h:18
Interface for geometrical shape classes.
Definition RShape.h:72
Abstract base class for all grid and object snap implementations.
Definition RSnap.h:43
Abstract base class for all snap restriction implementations.
Definition RSnapRestriction.h:37
A tablet event for a graphics scene.
Definition RTabletEvent.h:43
Copyright (c) 2011-2018 by Andrew Mustun.
Definition RTerminateEvent.h:34
Stores and manages all data that defines the geometry and appearance of a text based entity (text,...
Definition RTextBasedData.h:68
Text label.
Definition RTextLabel.h:44
Copyright (c) 2011-2018 by Andrew Mustun.
Definition RTextLayout.h:37
Represents a 3d vector (x/y/z).
Definition RVector.h:47
A mouse wheel event for a graphics scene.
Definition RWheelEvent.h:41
#define QCADGUI_EXPORT
Definition gui_global.h:10
char s
Definition opennurbs_string.cpp:32
#define NULL
Definition opennurbs_system.h:256