Skip to content
Snippets Groups Projects
Commit d0dca829 authored by Pospelov, Gennady's avatar Pospelov, Gennady
Browse files

Function to access bounding rectangle of transformation

parent 8a4b06dc
No related branches found
No related tags found
No related merge requests found
......@@ -163,7 +163,7 @@ QRectF DesignerHelper::getDefaultBoundingRect(const QString& name)
} else if (name == Constants::ParticleLayoutType) {
return getParticleLayoutBoundingRect();
} else if (name == Constants::RotationType) {
return QRectF(0, 0, getDefaultTransformationWidth(), getDefaultTransformationHeight());
return getTransformationBoundingRect();
} else if (name.startsWith(Constants::FormFactorType) || name == Constants::ParticleType
|| name == Constants::ParticleCoreShellType
|| name == Constants::ParticleDistributionType) {
......@@ -263,19 +263,14 @@ QRectF DesignerHelper::getParticleBoundingRect()
return QRectF(0, 0, layerHeight() * 3.5, layerHeight() * 4);
}
int DesignerHelper::getDefaultTransformationWidth()
{
return layerHeight() * 4;
}
int DesignerHelper::getDefaultTransformationHeight()
QColor DesignerHelper::getDefaultTransformationColor()
{
return layerHeight() * 2;
return QColor(145, 50, 220);
}
QColor DesignerHelper::getDefaultTransformationColor()
QRectF DesignerHelper::getTransformationBoundingRect()
{
return QColor(145, 50, 220);
return QRectF(0, 0, layerHeight() * 4, layerHeight() * 2);
}
QColor DesignerHelper::getDefaultMaterialColor()
......
......@@ -38,9 +38,8 @@ public:
static QColor getDefaultParticleColor();
static QRectF getParticleBoundingRect();
static int getDefaultTransformationWidth();
static int getDefaultTransformationHeight();
static QColor getDefaultTransformationColor();
static QRectF getTransformationBoundingRect();
static QColor getDefaultMaterialColor();
......
......@@ -20,8 +20,8 @@ TransformationView::TransformationView(QGraphicsItem* parent) : ConnectableView(
{
setName(Constants::RotationType);
setColor(DesignerHelper::getDefaultTransformationColor());
setRectangle(DesignerHelper::getDefaultBoundingRect(getName()));
setRectangle(DesignerHelper::getTransformationBoundingRect());
addPort("out", NodeEditorPort::OUTPUT, NodeEditorPort::TRANSFORMATION)
->setToolTip(QStringLiteral("Connect this port to the particle to define its rotation"));
->setToolTip("Connect this port to the particle to define its rotation");
m_roundpar = 3;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment