예제 #1
0
void InnerModelManager::setScale(std::string item, float scaleX,float scaleY, float scaleZ)
{
  //QMutexLocker locker (mutex);
  QString qItem = QString::fromStdString(item);
  QString m="RoboCompInnerModelManager::setScale()"; 
  
  InnerModelMesh *aux = dynamic_cast<InnerModelMesh*>(getNode(QString::fromStdString(item),m));
  checkOperationInvalidNode(aux,m + qItem +"can't be use as base because it's not a InnerModelMesh node.");
  
  aux->setScale(scaleX, scaleY, scaleZ);
  imv->update();  
  
// #ifdef INNERMODELMANAGERDEBUG 
//   try 
//   {
//     checkPoseCollision(qItem,m);
//   }
//   catch (RoboCompInnerModelManager::InnerModelManagerError err)
//   {
//     std::cout<<err.what()<<" "<<err.text<< "\n";
//     std::cout<< "\n";
//     ///come back to t= (t+1) -t
// 
//   //to check => maybe using a tag in the xml (collide="true"  ) to decide if allow collitions or not
//   //  innerModel->updateTransformValues(qItem,p.x, p.y, p.z, p.rx , p.ry, p.rz);
//   //  innerModel->update();
//     throw err;
//   }
// #endif
}
void InnerModelManager::setScale(std::string item, float scaleX,float scaleY, float scaleZ)
{
    //QMutexLocker locker (mutex);
    QString qItem = QString::fromStdString(item);
    QString m="RoboCompInnerModelManager::setScale()";

    InnerModelMesh *aux = dynamic_cast<InnerModelMesh*>(getNode(QString::fromStdString(item),m));
    checkOperationInvalidNode(aux,m + qItem +"can't be use as base because it's not a InnerModelMesh node.");

    aux->setScale(scaleX, scaleY, scaleZ);
    imv->update();
}
void InnerModelManager::setPose(std::string item,  QVec t,  QVec r,  QVec s)
{
    QString qItem = QString::fromStdString(item);
    QString m="RoboCompInnerModelManager::setPoseFromParent()";

    InnerModelTransform *aux = dynamic_cast<InnerModelTransform*>(getNode(QString::fromStdString(item),m));
    checkOperationInvalidNode(aux,m + qItem +"can't be use as base because it's not a InnerModelTransform node.");

    innerModel->updateTransformValues(qItem, t(0), t(1), t(2), r(0), r(1) , r(2));

    imv->update();
}