Example #1
0
void MemberHandler::startParam(const QXmlAttributes& attrib)
{
  ParamHandler *paramHandler = new ParamHandler(this);
  paramHandler->startParam(attrib);
  if (m_insideTemplateParamList)
  {
    m_templateParams.append(paramHandler);
  }
  else
  {
    m_params.append(paramHandler);
  }
}
Example #2
0
void TemplateParamListHandler::startParam(const QXmlAttributes& attrib)
{
  ParamHandler *ph = new ParamHandler(this);
  ph->startParam(attrib);
  m_templateParams.append(ph);
}
Example #3
0
int main(int argc, char *argv[])
{
  string inputSkeleton;
  string inputMotion;
  SMRMotion motion;

  ParamHandler argh;
  argh.AddLong("motion", 'm').SetString().SetDesc("input motion file" , "<file>");
  argh.AddLong("skeleton", 's').SetString().SetDesc("input skeleton file" , "<file>");
  argh.AddLong("help", 'h').SetBool().SetDesc("Displays quick manual.");

  argh.StartParse(argc, argv);
  for(;;)
  {
    int c = argh.GetParam();
    if(c == -1)break;
    switch(c)
    {
    case 's': inputSkeleton = argh.GetString(); break;//worst = argh.GetBool(); break;
    case 'm': inputMotion = argh.GetString(); break;
    default :
      printf(
        "*** SMR simple viewer demo ***\n"
        "\n Usage: motionPlayer [<option> [<...>]] \n"
        "\n This demo lets you play bvh or asf/amc animations\n");
      argh.ListOptions();
      printf("\nNo warranty whatsoever.\n");
      return 0;
    }
  }

  if (inputMotion.find(".amc",0) !=  string::npos )
  {
    if (inputSkeleton.find(".asf") == string::npos )
    {
      cout << "You shall specify an asf skeleton file with an amc file" << endl;
      return 0;
    }else
    {
      motion = loadMotionFromAcclaim( getFileName(inputSkeleton), getFileName(inputMotion) );
      myMotionPlayer = new SMRMotionPlayer( &motion );
    }
  }else if (inputMotion.find(".bvh",0) !=  string::npos )
  {
    motion = loadMotionFromBVH( getFileName(inputMotion) );
    myMotionPlayer = new SMRMotionPlayer( &motion );
  }else if (inputSkeleton.find(".vsk",0) !=  string::npos )
  {
    motion = loadMotionFromVSK( inputSkeleton, inputMotion);
    myMotionPlayer = new SMRMotionPlayer( &motion );
    //SMRSkeleton mySkeleton = loadSkeletonFromVSK(inputSkeleton);
    //SMRQuaternion identity;
    //identity.identity();
    //for(int i = 0; i< mySkeleton.getNumJoints(); i++)
    //{
    //  mySkeleton.getJoint(i)->setOrientation(identity);
    //}
    //save the file as bvh

    //exportMotionToBVH("shrug.bvh",motion, mySkeleton);
    //
    //exportPoseToBVH("blah.bvh", mySkeleton);
    //mySkeleton.setMode(RELATIVEMODE);
  }
  else
  {
    cout << "unknown file format" << endl;
    return 0;
  }

  // get GLUT to work
  InitializeGlut(&argc, argv);
  // Init the Smr Library
  Smr::initSmr();
  // Init the shaders capability
  InitShaders();
  // Get my scene prepared
  InitScene();
  // Enter the endless loop
  glutMainLoop();
  // Exit properly
  ShutDown();
  //delete(motion);
  return 0;
}