RImageData
Class in Entity Module
Header: #include <src/entity/RImageData.h>
Inherits: REntityData
Description
Section titled “Description”Stores and manages all data that defines the geometry and appearance of a raster image entity.
Scriptable: This class is available in script environments.
Copyable: Objects are cleaned up automatically by the garbage collector of the script engine.
Public Functions
Section titled “Public Functions”RImageData() |
|
RImageData(const QString &fileName, const RVector &insertionPoint, const RVector &uVector, const RVector &vVector, int brightness, int contrast, int fade) |
|
RImageData(const RImageData &other) |
|
| virtual | ~RImageData() |
| virtual RShape * | castToShape() |
| double | getAngle() const |
| virtual RBox | getBoundingBox(bool ignoreEmpty=false) const |
| int | getBrightness() const |
| int | getContrast() const |
| QList< RVector > | getCorners() const |
| QList< RVector > | getCornersPx() const |
| virtual double | getDistanceTo(const RVector &point, bool limited=true, double range=0.0, bool draft=false, double strictRange=RMAXDOUBLE) const |
| QList< RLine > | getEdges() const |
| int | getFade() const |
| QString | getFileName() const |
| QString | getFullFilePath() const |
| double | getHeight() const |
| QImage | getImage() const |
| RVector | getInsertionPoint() const |
| int | getPixelHeight() const |
| int | getPixelWidth() const |
| virtual RVector | getPointOnEntity() const |
| virtual QList< RRefPoint > | getReferencePoints(RS::ProjectionRenderingHint hint=RS::RenderTop) const |
| RVector | getScaleVector() const |
| virtual QList< QSharedPointer< RShape > > | getShapes(const RBox &queryBox=RDEFAULT_RBOX, bool ignoreComplex=false, bool segment=false, QList< RObject::Id > *entityIds=NULL) const |
| virtual RS::EntityType | getType() const |
| RVector | getUVector() const |
| RVector | getVVector() const |
| double | getWidth() const |
| virtual bool | intersectsWith(const RShape &shape) const |
| void | load() const |
| RVector | mapFromImage(const RVector &v) constMaps the given coordinate from image pixels to drawing coordinates. |
| RVector | mapToImage(const RVector &v) constMaps the given drawing coordinates to image pixel coordinates. |
| virtual bool | mirror(const RLine &axis) |
| virtual bool | move(const RVector &offset)Moves this entity by the given offset. |
| virtual bool | moveReferencePoint(const RVector &referencePoint, const RVector &targetPoint, Qt::KeyboardModifiers modifiers=Qt::NoModifier)Moves the given reference point to the given target point or does nothing if this entity has no reference point as the given location. |
| RImageData & | operator=(const RImageData &other) |
| void | reload() |
| virtual bool | rotate(double rotation, const RVector ¢er=RDEFAULT_RVECTOR) |
| virtual bool | scale(const RVector &scaleFactors, const RVector ¢er=RDEFAULT_RVECTOR) |
| void | setAngle(double a) |
| void | setBrightness(int v) |
| void | setContrast(int v) |
| void | setFade(int v) |
| void | setFileName(const QString &fn) |
| void | setHeight(double h, bool keepRatio=false) |
| void | setInsertionPoint(const RVector &ip) |
| void | setUVector(const RVector &v) |
| void | setVVector(const RVector &v) |
| void | setWidth(double w, bool keepRatio=false) |
Protected Functions
Section titled “Protected Functions”RImageData(RDocument *document, const RImageData &data) |
Private Attributes
Section titled “Private Attributes”| int | brightness |
| int | contrast |
| int | fade |
| QString | fileName |
| QImage | image |
| RVector | insertionPoint |
| RVector | uVector |
| RVector | vVector |
Friends
Section titled “Friends”| class | RImageEntity |
Member Documentation
Section titled “Member Documentation”RImageData
Section titled “RImageData”RImageData::RImageData()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.
RImageData
Section titled “RImageData”RImageData::RImageData(const QString &fileName, const RVector &insertionPoint, const RVector &uVector, const RVector &vVector, int brightness, int contrast, int fade)RImageData
Section titled “RImageData”RImageData::RImageData(const RImageData &other)~RImageData
Section titled “~RImageData”virtual RImageData::~RImageData()virtual
castToShape
Section titled “castToShape”virtual RShape * RImageData::castToShape()virtual inline
Reimplemented from castToShape.
getAngle
Section titled “getAngle”double RImageData::getAngle() constinline const
getBoundingBox
Section titled “getBoundingBox”virtual RBox RImageData::getBoundingBox(bool ignoreEmpty=false) constvirtual const
Returns: The bounding box that contains this entity.
Reimplemented from getBoundingBox.
getBrightness
Section titled “getBrightness”int RImageData::getBrightness() constinline const
getContrast
Section titled “getContrast”int RImageData::getContrast() constinline const
getCorners
Section titled “getCorners”QList< RVector > RImageData::getCorners() constconst
getCornersPx
Section titled “getCornersPx”QList< RVector > RImageData::getCornersPx() constconst
getDistanceTo
Section titled “getDistanceTo”virtual double RImageData::getDistanceTo(const RVector &point, bool limited=true, double range=0.0, bool draft=false, double strictRange=RMAXDOUBLE) constvirtual const
Returns: The shortest distance from this entity to the given point.
Parameters:
limited: Limit lines, arcs at end points, otherwise the orthogonal distance to the unlimited line / circle is returned.range: This is returned for solid filled entities (solid filled or dense hatches, text entities) if the point is on the entity and the distance would be zero.draft: Calculate based on draft mode representation of the entity.strictRange: If limited, this is the maximum range from either end point of the entity. Zero to only return distances that are strictly orthogonal to the entity.
Reimplemented from getDistanceTo.
getEdges
Section titled “getEdges”QList< RLine > RImageData::getEdges() constconst
getFade
Section titled “getFade”int RImageData::getFade() constinline const
getFileName
Section titled “getFileName”QString RImageData::getFileName() constinline const
getFullFilePath
Section titled “getFullFilePath”QString RImageData::getFullFilePath() constconst
getHeight
Section titled “getHeight”double RImageData::getHeight() constconst
getImage
Section titled “getImage”QImage RImageData::getImage() constconst
getInsertionPoint
Section titled “getInsertionPoint”RVector RImageData::getInsertionPoint() constinline const
getPixelHeight
Section titled “getPixelHeight”int RImageData::getPixelHeight() constconst
getPixelWidth
Section titled “getPixelWidth”int RImageData::getPixelWidth() constconst
getPointOnEntity
Section titled “getPointOnEntity”virtual RVector RImageData::getPointOnEntity() constvirtual const
Returns: A point that is on the entity. Used to check if an entity is inside a polygon.
Reimplemented from getPointOnEntity.
getReferencePoints
Section titled “getReferencePoints”virtual QList< RRefPoint > RImageData::getReferencePoints(RS::ProjectionRenderingHint hint=RS::RenderTop) constvirtual const
Returns: Vector of reference points of this entity. Reference points can usually be moved around by the user to change the geometry of the entity.
Reimplemented from getReferencePoints.
getScaleVector
Section titled “getScaleVector”RVector RImageData::getScaleVector() constconst
getShapes
Section titled “getShapes”virtual QList< QSharedPointer< RShape > > RImageData::getShapes(const RBox &queryBox=RDEFAULT_RBOX, bool ignoreComplex=false, bool segment=false, QList< RObject::Id > *entityIds=NULL) constvirtual const
Returns: Shapes that represent the geometry of this entity.
Parameters:
queryBox: Limit returned shapes to query boxignoreComplex: Ignore complex shapes and explode those into simple shapessegment: Split up splines into spline segments
Reimplemented from getShapes.
getType
Section titled “getType”virtual RS::EntityType RImageData::getType() constvirtual inline const
Reimplemented from getType.
getUVector
Section titled “getUVector”RVector RImageData::getUVector() constinline const
getVVector
Section titled “getVVector”RVector RImageData::getVVector() constinline const
getWidth
Section titled “getWidth”double RImageData::getWidth() constconst
intersectsWith
Section titled “intersectsWith”virtual bool RImageData::intersectsWith(const RShape &shape) constvirtual const
Returns: True if this entity intersects with the given shape, false otherwise.
Reimplemented from intersectsWith.
void RImageData::load() constconst
mapFromImage
Section titled “mapFromImage”RVector RImageData::mapFromImage(const RVector &v) constconst
Maps the given coordinate from image pixels to drawing coordinates.
mapToImage
Section titled “mapToImage”RVector RImageData::mapToImage(const RVector &v) constconst
Maps the given drawing coordinates to image pixel coordinates.
mirror
Section titled “mirror”virtual bool RImageData::mirror(const RLine &axis)virtual
Reimplemented from mirror.
virtual bool RImageData::move(const RVector &offset)virtual
Moves this entity by the given offset.
Reimplemented from move.
moveReferencePoint
Section titled “moveReferencePoint”virtual bool RImageData::moveReferencePoint(const RVector &referencePoint, const RVector &targetPoint, Qt::KeyboardModifiers modifiers=Qt::NoModifier)virtual
Moves the given reference point to the given target point or does nothing if this entity has no reference point as the given location.
Returns: True if a reference point has been moved successfully, false otherwise.
Reimplemented from moveReferencePoint.
operator=
Section titled “operator=”RImageData & RImageData::operator=(const RImageData &other)reload
Section titled “reload”void RImageData::reload()rotate
Section titled “rotate”virtual bool RImageData::rotate(double rotation, const RVector ¢er=RDEFAULT_RVECTOR)virtual
Reimplemented from rotate.
virtual bool RImageData::scale(const RVector &scaleFactors, const RVector ¢er=RDEFAULT_RVECTOR)virtual
Reimplemented from scale.
setAngle
Section titled “setAngle”void RImageData::setAngle(double a)inline
setBrightness
Section titled “setBrightness”void RImageData::setBrightness(int v)inline
setContrast
Section titled “setContrast”void RImageData::setContrast(int v)inline
setFade
Section titled “setFade”void RImageData::setFade(int v)inline
setFileName
Section titled “setFileName”void RImageData::setFileName(const QString &fn)inline
setHeight
Section titled “setHeight”void RImageData::setHeight(double h, bool keepRatio=false)setInsertionPoint
Section titled “setInsertionPoint”void RImageData::setInsertionPoint(const RVector &ip)inline
setUVector
Section titled “setUVector”void RImageData::setUVector(const RVector &v)inline
setVVector
Section titled “setVVector”void RImageData::setVVector(const RVector &v)inline
setWidth
Section titled “setWidth”void RImageData::setWidth(double w, bool keepRatio=false)RImageData
Section titled “RImageData”RImageData::RImageData(RDocument *document, const RImageData &data)protected
brightness
Section titled “brightness”int RImageData::brightnessprivate
contrast
Section titled “contrast”int RImageData::contrastprivate
int RImageData::fadeprivate
fileName
Section titled “fileName”QString RImageData::fileNameprivate
QImage RImageData::imageprivate
insertionPoint
Section titled “insertionPoint”RVector RImageData::insertionPointprivate
uVector
Section titled “uVector”RVector RImageData::uVectorprivate
vVector
Section titled “vVector”RVector RImageData::vVectorprivate
RImageEntity
Section titled “RImageEntity”friend class RImageEntityprivate