当前位置: 首页>>代码示例>>C++>>正文


C++ ArRef类代码示例

本文整理汇总了C++中ArRef的典型用法代码示例。如果您正苦于以下问题:C++ ArRef类的具体用法?C++ ArRef怎么用?C++ ArRef使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ArRef类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: while

  void AReViVocalPlayerWidget::initializeMap()
    {
        ArRef<XmlParser> parser = XmlParser::NEW();
        parser->parseFile("vocalAssistances.xml");

	ArRef<AReVi::XmlNode> root_node = parser->getRoot();
	ArRef<AReVi::XmlNode> node_Action=root_node->getChild("Action");
	while(node_Action!= NULL)
	  { 		  
		string name =  node_Action->getProperty("name"); 
		string soundFile =  node_Action->getProperty("soundFile");
		_soundMap[name]=soundFile;
		_accessAssistancesMap[name]=0;
		node_Action=node_Action->getNext();
	  }

        ArRef<XmlParser> parser2 = XmlParser::NEW();
        parser2->parseFile("iconeAssistances.xml");

	ArRef<AReVi::XmlNode> root2_node = parser2->getRoot();
	ArRef<AReVi::XmlNode> node2_Action=root2_node->getChild("Action");
	while(node2_Action!= NULL)
	  { 		  
		string name2 =  node2_Action->getProperty("name"); 
		string iconFile =  node2_Action->getProperty("iconFile");
		_iconMap[name2]=iconFile;
		node2_Action=node2_Action->getNext();
	  }

    }
开发者ID:DelamarreAlban,项目名称:Mascaret,代码行数:30,代码来源:AReViVocalPlayerWidget.cpp

示例2: qx

void
EditorIkSolver::_checkPivotXZ(ArRef<Joint> joint, Vector3d /* requestedTranslation */, Quaterniond requestedRotation) {
  double prx, pry, prz;
  joint->getDeltaRotation().getEulerAngles(prx, pry, prz);

  requestedRotation = joint->getDeltaRotation() * requestedRotation;

  double rx, ry, rz;
  requestedRotation.getEulerAngles(rx, ry, rz);

  double* max[2];
  double* min[2];

  ar_down_cast<JointConstraint2DOF>(joint->getConstraint())->getLimitValues(min, max);

  double xmin = *min[0], xmax = *max[0], zmin = *min[1], zmax = *max[1];

  rx = _clampWithPreviousValue(xmin, xmax, prx, rx);
  rz = _clampWithPreviousValue(zmin, zmax, prz, rz);

  Quaterniond qx(Vector3d(1.0, 0.0, 0.0), rx);
  Quaterniond qz(Vector3d(0.0, 0.0, 1.0), rz);

  joint->setDeltaRotation(qx * qz);
}
开发者ID:rducom,项目名称:Heditor,代码行数:25,代码来源:editorIkSolver.cpp

示例3: setErrorMessage

void
UDPKinectSkeleton::initEmitKinect(unsigned int port, int deviceNumber )
{
_kinect = KinectOpenNI2::NEW(deviceNumber);
_skeleton = _kinect->createPlayerSkeleton();
_kinect->setMirror(false);
_kinect->setDebug(false);
_kinect->update();
/*
_kinect->addNewUserCB(thisRef(),&UDPKinectSkeleton::_newUserCB);
_kinect->addLostUserCB(thisRef(),&UDPKinectSkeleton::_lostUserCB);
_kinect->addCalibrationStartedCB(thisRef(),&UDPKinectSkeleton::_calibrationStartedCB);
_kinect->addCalibrationEndedCB(thisRef(),&UDPKinectSkeleton::_calibrationEndedCB);
*/

ArRef<Activity> act = Activity::NEW(1.0/30.0); //30Hz, Kinect 
act->setBehavior(thisRef(), &UDPKinectSkeleton::_action);

_udp = UDPTransmitter::NEW(port);
if (_udp->fail())
  {
  const StlString message = _udp->getErrorMessage();
  cerr<<"Error on upd transmitter creation :"<<message<<endl;
  _udp = UDPTransmitter::nullRef();
  setErrorMessage(message);
  }
}
开发者ID:ClementRivaille,项目名称:Avant_la_tempete,代码行数:27,代码来源:udpKinectSkeleton.cpp

示例4: q

// Save/Load to XML
void
ArTrackOrientation::_writeXML(ArRef<XmlNode> node) const
{
node->setName("TrackOrientation");

node->setPropertyReal("duration",_track->getDuration());
node->setPropertyInteger("degree",_track->getDegree());
node->setPropertyInteger("dimension",4);

ArTrackOrientationInterpolator *track=(ArTrackOrientationInterpolator *)_track;
StlVector<unsigned> keysPositions;
track->getKeysPositions(keysPositions);
VectorN<double,4> key;

for (unsigned i=0;i<keysPositions.size();i++)
  {
  track->getKeyFrame(keysPositions[i],key );
  
  ArRef<XmlNode> keyFrame=node->addChild("KeyFrameOrientation");
  keyFrame->setPropertyInteger("frame",keysPositions[i]);
  
  Quaterniond q(key[0],key[1],key[2],key[3]);
  Vector3d axis;
  double angle;
  q.getAxisAngle(axis,angle);
  keyFrame->setPropertyReal("vx",axis.x());
  keyFrame->setPropertyReal("vy",axis.y());
  keyFrame->setPropertyReal("vz",axis.z());
  keyFrame->setPropertyReal("angle",angle);
  
  }
}
开发者ID:DelamarreAlban,项目名称:Mascaret,代码行数:33,代码来源:arTrackOrientation.cpp

示例5: calculateTransformation

ArRef<Transform3D> calculateTransformation(double p, double r, double y){
    ArRef<Transform3D> tr = Transform3D::NEW();
    tr->prePitch(p);
    tr->preRoll(r);
    tr->preYaw(y);
    return tr;
}
开发者ID:DelamarreAlban,项目名称:Mascaret,代码行数:7,代码来源:AReViBalloon.cpp

示例6: _writeStringOSC

void
UDPKinectSkeleton::_transmitCurrentPoseOSC()
{
if (_udp.valid() && _skeleton.valid())
  {
  ArConstRef<Joint> torso = _skeleton->findJoint("torso");

  ArRef<MemoryBlock> memory = MemoryBlock::NEW();
  ArRef<MemoryOStream> stream = MemoryOStream::NEW(memory,0);
  _writeStringOSC("/skeleton",stream);

  ArRef<MemoryBlock> memory2 = MemoryBlock::NEW();
  ArRef<MemoryOStream> stream2 = MemoryOStream::NEW(memory2,0);
  _writeStringOSC("/skeleton_local",stream2);

  unsigned int nb = _skeleton->getNbJoints();
  StlString typeString = ",";
  for (size_t i(0);i<nb;++i)
    { typeString+="sfff"; }
  _writeStringOSC(typeString,stream);
  _writeStringOSC(typeString,stream2);

  for (unsigned int i(0);i<nb;++i)
    {
    ArConstRef<Joint> joint = _skeleton->getJoint(i);
    const StlString jointName = joint->getName();
    _writeStringOSC(jointName,stream);   
    _writeStringOSC(jointName,stream2);   
    double x,y,z;
    joint->getPosition(x,y,z);
    stream->writeFloat(x);
    stream->writeFloat(y);
    stream->writeFloat(z);

    if ( (torso.valid()) && (joint != torso) )
      { torso->globalToLocalPosition(x,y,z); }
    stream2->writeFloat(x);
    stream2->writeFloat(y);
    stream2->writeFloat(z);
    }

  for (unsigned int i(0);i<_addresses.size();++i)
    {
    if (_addresses[i].OSC)
      {
      _udp->sendBytes(memory,0,memory->getSize(),
                                 _addresses[i].ip,_addresses[i].port);
      if (_addresses[i].port2 != 0)
        {
        _udp->sendBytes(memory2,0,memory2->getSize(),
                                 _addresses[i].ip,_addresses[i].port2);
        }
      }
    }
  }
}
开发者ID:ClementRivaille,项目名称:Avant_la_tempete,代码行数:56,代码来源:udpKinectSkeleton.cpp

示例7: StlVectorFastErase

void
Axis::removeRenderer(ArRef<Renderer3D> renderer) {
  for(size_t i = _renderers.size(); i--;) {
    if(renderer == _renderers[i]) {
      renderer->addOSD(_axis);
      renderer->addOSD(_inOsd);
      renderer->addOSD(_outOsd);
      StlVectorFastErase(_renderers, i);
      return;
    }
  }
}
开发者ID:rducom,项目名称:Heditor,代码行数:12,代码来源:axis.cpp

示例8:

// Save/Load to XML
void
ArTrackSpiral::_writeXML(ArRef<XmlNode> node) const
{
ArKeyFrameTrack::_writeXML(node);
node->setName("TrackSpiral");
node->setPropertyReal("vx",_axis.x());
node->setPropertyReal("vy",_axis.y());
node->setPropertyReal("vz",_axis.z());
node->setPropertyReal("ox",_offset.x());
node->setPropertyReal("oy",_offset.y());
node->setPropertyReal("oz",_offset.z());

}
开发者ID:DelamarreAlban,项目名称:Mascaret,代码行数:14,代码来源:arTrackSpiral.cpp

示例9:

void
Axis::addRenderer(ArRef<Renderer3D> renderer) {
  for(size_t i = _renderers.size(); i--;) {
    if(renderer == _renderers[i]) {
      return;
    }
  }

  _renderers.push_back(renderer);

  renderer->addOSD(_axis);
  renderer->addOSD(_inOsd);
  renderer->addOSD(_outOsd);
}
开发者ID:rducom,项目名称:Heditor,代码行数:14,代码来源:axis.cpp

示例10: v

/*
*interaction sur mouvement de souris -> bouge la KO
*/
void
KeyOrientation::onMotionInteraction(ArRef<AbstractInteractor> source, ArRef<Base3D> newLocation, bool begin, bool end) {
  _c3dof->globalToLocalLocation(newLocation);
  
  double x, y, z;
  newLocation->getPosition(x, y, z);
  Vector3d v(x, y, z);
  v.normalize();
  v *= _c3dof->getRadius();
  newLocation->setPosition(v.x(),v.y(), v.z());
  _c3dof->localToGlobalLocation(newLocation);
  
  Object3D::onMotionInteraction(source, ShapePart3D::nullRef(), 0, newLocation, begin, end);
}
开发者ID:rducom,项目名称:Heditor,代码行数:17,代码来源:keyOrientation.cpp

示例11: if

void
Skin0::setVisible( ArRef<Scene3D> scene, bool visible)
{
if (_visible && !visible)
  {
  for (unsigned int i(0);i<_objects.size();++i)
    { scene->removeObject(_objects[i]); }
  _visible = false;
  }
else if (!_visible && visible)
  {
  for (unsigned int i(0);i<_objects.size();++i)
    { scene->addObject(_objects[i]); }
  _visible = true;
  }
}
开发者ID:ClementRivaille,项目名称:Avant_la_tempete,代码行数:16,代码来源:tempestSkins.cpp

示例12:

void
EditorIkSolver::_checkHingeZ(ArRef<Joint> joint, Vector3d /* requestedTranslation */, Quaterniond requestedRotation) {
  double prx, pry, prz;
  joint->getDeltaRotation().getEulerAngles(prx, pry, prz);

  requestedRotation = joint->getDeltaRotation() * requestedRotation;

  double rx, ry, rz;
  requestedRotation.getEulerAngles(rx, ry, rz);

  double min, max;
  ar_down_cast<JointConstraint1DOF>(joint->getConstraint())->getLimitValues(min, max);

  rz = _clampWithPreviousValue(min, max, prz, rz);

  joint->setDeltaRotation(Quaterniond(Vector3d(0.0, 0.0, 1.0), rz));
}
开发者ID:rducom,项目名称:Heditor,代码行数:17,代码来源:editorIkSolver.cpp

示例13: it

void
UDPKinectSkeleton::_transmitCurrentPose()
{
if (_udp.valid() && _skeleton.valid())
  {
  ArRef<MemoryBlock> memory = MemoryBlock::NEW();
  ArRef<MemoryOStream> stream = MemoryOStream::NEW(memory,0);
  unsigned int nb = _skeleton->getNbJoints();
  stream->writeUInt(nb);
  SerializationDependencies dependencies;
  for (unsigned int i(0);i<nb;++i)
    {
    ArConstRef<Joint> joint = _skeleton->getJoint(i);
    joint->serialize(dependencies,stream); 
    }
  stream->writeInt(_confidences.size());
  StlMap<StlString,double>::iterator it(_confidences.begin());
  while (it != _confidences.end())
    {
    stream->writeString(it->first);
    stream->writeDouble(it->second);
    ++it;
    }

  for (unsigned int i(0);i<_addresses.size();++i)
    {
    if (!_addresses[i].OSC)
      {
      _udp->sendBytes(memory,0,memory->getSize(),
                                 _addresses[i].ip,_addresses[i].port);
      }
    }
  }
}
开发者ID:ClementRivaille,项目名称:Avant_la_tempete,代码行数:34,代码来源:udpKinectSkeleton.cpp

示例14: selectItem

void
OSDSelector::addItem(ArRef<OSDSelectorItem> item) {
  for(size_t i = _items.size(); i--;) {
    if(_items[i] == item) {
      return;
    }
  }

  item->resizeWithRenderer(false);
  item->setLocation(OSD::LOC_FREE);
  _items.push_back(item);

  if(_items.size() == 1) {
    selectItem(item);
  }

  _updateItemsSize();
}
开发者ID:rducom,项目名称:Heditor,代码行数:18,代码来源:osdSelector.cpp

示例15: Object3D

KeyOrientation::KeyOrientation(ArCW& arCW, ArRef<C3DOF> c3dof) : Object3D(arCW), _c3dof(c3dof) {
  attachTo(_c3dof);

  //  ArRef<Material3D> mat = new_Material3D();
  ArRef<Material3D> mat = Material3D::NEW();
  mat->setDiffuseColor(0.0, 0.2, 0.8);

  //  _sphere = new_Sphere3D();
  _sphere = Sphere3D::NEW();
  _sphere->setRadius(0.2);
  _sphere->writeMaterial(mat);

  //  ArRef<Shape3D> sh = new_Shape3D();
  ArRef<Shape3D> sh = Shape3D::NEW();
  sh->addRootPart(_sphere);

  setShape(sh);
}
开发者ID:rducom,项目名称:Heditor,代码行数:18,代码来源:keyOrientation.cpp


注:本文中的ArRef类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。