Skip to content

RImageData

Class in Entity Module
Header: #include <src/entity/RImageData.h>
Inherits: REntityData

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.

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) const
Maps the given coordinate from image pixels to drawing coordinates.
RVector mapToImage(const RVector &v) const
Maps 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 &center=RDEFAULT_RVECTOR)
virtual bool scale(const RVector &scaleFactors, const RVector &center=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)
RImageData(RDocument *document, const RImageData &data)
int brightness
int contrast
int fade
QString fileName
QImage image
RVector insertionPoint
RVector uVector
RVector vVector
class RImageEntity

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::RImageData(const QString &fileName, const RVector &insertionPoint, const RVector &uVector, const RVector &vVector, int brightness, int contrast, int fade)

RImageData::RImageData(const RImageData &other)

virtual RImageData::~RImageData()

virtual

virtual RShape * RImageData::castToShape()

virtual inline

Reimplemented from castToShape.

double RImageData::getAngle() const

inline const

virtual RBox RImageData::getBoundingBox(bool ignoreEmpty=false) const

virtual const

Returns: The bounding box that contains this entity.

Reimplemented from getBoundingBox.

int RImageData::getBrightness() const

inline const

int RImageData::getContrast() const

inline const

QList< RVector > RImageData::getCorners() const

const

QList< RVector > RImageData::getCornersPx() const

const

virtual double RImageData::getDistanceTo(const RVector &point, bool limited=true, double range=0.0, bool draft=false, double strictRange=RMAXDOUBLE) const

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

QList< RLine > RImageData::getEdges() const

const

int RImageData::getFade() const

inline const

QString RImageData::getFileName() const

inline const

QString RImageData::getFullFilePath() const

const

double RImageData::getHeight() const

const

QImage RImageData::getImage() const

const

RVector RImageData::getInsertionPoint() const

inline const

int RImageData::getPixelHeight() const

const

int RImageData::getPixelWidth() const

const

virtual RVector RImageData::getPointOnEntity() const

virtual const

Returns: A point that is on the entity. Used to check if an entity is inside a polygon.

Reimplemented from getPointOnEntity.

virtual QList< RRefPoint > RImageData::getReferencePoints(RS::ProjectionRenderingHint hint=RS::RenderTop) const

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

RVector RImageData::getScaleVector() const

const

virtual QList< QSharedPointer< RShape > > RImageData::getShapes(const RBox &queryBox=RDEFAULT_RBOX, bool ignoreComplex=false, bool segment=false, QList< RObject::Id > *entityIds=NULL) const

virtual const

Returns: Shapes that represent the geometry of this entity.

Parameters:

  • queryBox: Limit returned shapes to query box
  • ignoreComplex: Ignore complex shapes and explode those into simple shapes
  • segment: Split up splines into spline segments

Reimplemented from getShapes.

virtual RS::EntityType RImageData::getType() const

virtual inline const

Reimplemented from getType.

RVector RImageData::getUVector() const

inline const

RVector RImageData::getVVector() const

inline const

double RImageData::getWidth() const

const

virtual bool RImageData::intersectsWith(const RShape &shape) const

virtual const

Returns: True if this entity intersects with the given shape, false otherwise.

Reimplemented from intersectsWith.

void RImageData::load() const

const

RVector RImageData::mapFromImage(const RVector &v) const

const

Maps the given coordinate from image pixels to drawing coordinates.

RVector RImageData::mapToImage(const RVector &v) const

const

Maps the given drawing coordinates to image pixel coordinates.

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.

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.

RImageData & RImageData::operator=(const RImageData &other)

void RImageData::reload()

virtual bool RImageData::rotate(double rotation, const RVector &center=RDEFAULT_RVECTOR)

virtual

Reimplemented from rotate.

virtual bool RImageData::scale(const RVector &scaleFactors, const RVector &center=RDEFAULT_RVECTOR)

virtual

Reimplemented from scale.

void RImageData::setAngle(double a)

inline

void RImageData::setBrightness(int v)

inline

void RImageData::setContrast(int v)

inline

void RImageData::setFade(int v)

inline

void RImageData::setFileName(const QString &fn)

inline

void RImageData::setHeight(double h, bool keepRatio=false)

void RImageData::setInsertionPoint(const RVector &ip)

inline

void RImageData::setUVector(const RVector &v)

inline

void RImageData::setVVector(const RVector &v)

inline

void RImageData::setWidth(double w, bool keepRatio=false)

RImageData::RImageData(RDocument *document, const RImageData &data)

protected

int RImageData::brightness

private

int RImageData::contrast

private

int RImageData::fade

private

QString RImageData::fileName

private

QImage RImageData::image

private

RVector RImageData::insertionPoint

private

RVector RImageData::uVector

private

RVector RImageData::vVector

private

friend class RImageEntity

private