Exemplo n.º 1
0
Mesh::Mesh() :
    isVertexColor(false),
    isFlatColor(true),
    isVisible(true),
    name("Default Mesh Name")
{
    resetTransformations();
}
Exemplo n.º 2
0
void MeshWarpWidget::keyPressEvent(QKeyEvent *event)
{
  switch (event->key())
  {
    case Qt::Key_R: resetTransformations(); update(); break;
  }

  return QWidget::keyPressEvent(event);
}
Exemplo n.º 3
0
void MeshWarpWidget::set(QImage & img, Mesh & mesh)
{
  m_active_cp_x = 0;
  m_active_cp_y = 0;
  m_has_active_cp = false;
  m_orig_img = img;
  m_img = img;

  resetTransformations();
  m_panning = false;

  m_mesh = std::move(mesh);
  m_orig_mesh.resize(m_mesh.sizeX(), m_mesh.sizeY(), img.width(), img.height());

  update();
}
Exemplo n.º 4
0
bool MeshWarpWidget::setImage(const QImage & img)
{
  m_active_cp_x = 0;
  m_active_cp_y = 0;
  m_has_active_cp = false;
  m_orig_img = img;
  m_img = img;

  //m_transform = QTransform();
  resetTransformations();
  m_panning = false;

  m_orig_mesh.resize(DEFAULT_DENSITY, DEFAULT_DENSITY, img.width(), img.height());
  m_mesh.resize(DEFAULT_DENSITY, DEFAULT_DENSITY, img.width(), img.height());

  update();

  return true;
}
DefaultToolTransformWidget::DefaultToolTransformWidget( KoInteractionTool* tool,
                                    QWidget* parent )
    : QMenu(parent)
{
    m_tool = tool;

    setupUi( this );

    setUnit( m_tool->canvas()->unit() );

    connect( m_tool->canvas()->resourceManager(), SIGNAL( canvasResourceChanged( int, const QVariant& ) ),
        this, SLOT( resourceChanged( int, const QVariant& ) ) );

    connect( rotateButton, SIGNAL( clicked() ), this, SLOT( rotationChanged() ) );
    connect( shearXButton, SIGNAL( clicked() ), this, SLOT( shearXChanged() ) );
    connect( shearYButton, SIGNAL( clicked() ), this, SLOT( shearYChanged() ) );
    connect( scaleXButton, SIGNAL( clicked() ), this, SLOT( scaleXChanged() ) );
    connect( scaleYButton, SIGNAL( clicked() ), this, SLOT( scaleYChanged() ) );
    connect( scaleAspectCheckBox, SIGNAL( toggled( bool ) ), scaleYSpinBox, SLOT( setDisabled( bool ) ) );
    connect( scaleAspectCheckBox, SIGNAL( toggled( bool ) ), scaleYButton, SLOT( setDisabled( bool ) ) );
    connect( resetButton, SIGNAL( clicked() ), this, SLOT( resetTransformations() ) );
}