23 QString QgsOrientedMinimumBoundingBoxAlgorithm::name()
const
25 return QStringLiteral(
"orientedminimumboundingbox" );
28 QString QgsOrientedMinimumBoundingBoxAlgorithm::displayName()
const
30 return QObject::tr(
"Oriented minimum bounding box" );
33 QStringList QgsOrientedMinimumBoundingBoxAlgorithm::tags()
const
35 return QObject::tr(
"bounding,boxes,envelope,rectangle,extent,oriented,angle" ).split(
',' );
38 QString QgsOrientedMinimumBoundingBoxAlgorithm::group()
const
40 return QObject::tr(
"Vector geometry" );
43 QString QgsOrientedMinimumBoundingBoxAlgorithm::groupId()
const
45 return QStringLiteral(
"vectorgeometry" );
48 QString QgsOrientedMinimumBoundingBoxAlgorithm::outputName()
const
50 return QObject::tr(
"Bounding boxes" );
58 QString QgsOrientedMinimumBoundingBoxAlgorithm::shortHelpString()
const
60 return QObject::tr(
"This algorithm calculates the minimum area rotated rectangle which covers each feature in an input layer." ) +
61 QStringLiteral(
"\n\n" ) +
62 QObject::tr(
"See the 'Minimum bounding geometry' algorithm for a oriented bounding box calculation which covers the whole layer or grouped subsets of features." );
65 QgsOrientedMinimumBoundingBoxAlgorithm *QgsOrientedMinimumBoundingBoxAlgorithm::createInstance()
const
67 return new QgsOrientedMinimumBoundingBoxAlgorithm();
70 bool QgsOrientedMinimumBoundingBoxAlgorithm::supportInPlaceEdit(
const QgsMapLayer *l )
const
72 const QgsVectorLayer *layer = qobject_cast< const QgsVectorLayer * >( l );
79 return layer->
wkbType() == QgsWkbTypes::Type::Polygon || layer->
wkbType() == QgsWkbTypes::Type::MultiPolygon;
82 QgsFields QgsOrientedMinimumBoundingBoxAlgorithm::outputFields(
const QgsFields &inputFields )
const
85 fields.
append(
QgsField( QStringLiteral(
"width" ), QVariant::Double, QString(), 20, 6 ) );
86 fields.
append(
QgsField( QStringLiteral(
"height" ), QVariant::Double, QString(), 20, 6 ) );
87 fields.
append(
QgsField( QStringLiteral(
"angle" ), QVariant::Double, QString(), 20, 6 ) );
88 fields.
append(
QgsField( QStringLiteral(
"area" ), QVariant::Double, QString(), 20, 6 ) );
89 fields.
append(
QgsField( QStringLiteral(
"perimeter" ), QVariant::Double, QString(), 20, 6 ) );
109 << 2 * width + 2 * height;