Beispiel #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
}
/**
 * @brief Adds a plane to InnerModel
 * 
 * @param item ...
 * @param parentS ...
 * @param path ...
 * @param scale ...
 * @param t ...
 * @param r ...
 * @return void
 */
void SpecificWorker::addPlane(QString item, QString parentS, QString path, QVec scale, QVec t, QVec r)
{
	InnerModelTransform *parent = dynamic_cast<InnerModelTransform *>(innerModel->getNode(parentS));
	if (innerModel->getNode(item) != NULL)
		removeNode(item);
	InnerModelMesh *mesh = innerModel->newMesh(item, parent, path, scale(0), scale(1), scale(2), 0, t(0), t(1), t(2),
	                                           r(0), r(1), r(2));
	mesh->setScale(scale(0), scale(1), scale(2));
	parent->addChild(mesh);
}
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();
}