本文整理汇总了C++中ArRef::getPropertyReal方法的典型用法代码示例。如果您正苦于以下问题:C++ ArRef::getPropertyReal方法的具体用法?C++ ArRef::getPropertyReal怎么用?C++ ArRef::getPropertyReal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArRef
的用法示例。
在下文中一共展示了ArRef::getPropertyReal方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: return
bool
ArTrackSpiral::_readXML(ArRef<XmlNode> node)
{
if(!ArKeyFrameTrack::_readXML(node))
return(false);
if (node->getName()=="TrackSpiral")
{
node->getPropertyReal("vx",_axis.accessVector()[0]);
node->getPropertyReal("vy",_axis.accessVector()[1]);
node->getPropertyReal("vz",_axis.accessVector()[2]);
node->getPropertyReal("ox",_offset.accessVector()[0]);
node->getPropertyReal("oy",_offset.accessVector()[1]);
node->getPropertyReal("oz",_offset.accessVector()[2]);
}
else
{
_offset=Vector3d(0,0,0);
_axis=Vector3d(1,0,0);
}
return(true);
}
示例2: axis
bool
ArTrackOrientation::_readXML(ArRef<XmlNode> node)
{
if (node->getName()!="TrackOrientation")
return(ArKeyFrameTrack::_readXML(node));
double duration;
int degree;
node->getPropertyReal("duration",duration);
node->getPropertyInteger("degree",degree);
_track->setDuration(duration);
_track->setDegree(degree);
int dim;
if (!node->getPropertyInteger("dimension",dim))
{
cerr << "Missing dimensions specification" << endl;
return(false);
}
if (dim!=4)
{
cerr << "Bad track dimension " << dim << "!=4" << endl;
return(false);
}
_track->clearKeyFrames();
ArRef<XmlNode> keyFrame=node->getFirstChild();
while(keyFrame)
{
if (keyFrame->getName()=="KeyFrameOrientation")
{
int frame;
if (!keyFrame->getPropertyInteger("frame",frame))
{
cerr << "Invalid keyFrame misssing frame info"<< endl;
return(false);
}
double angle;
double xx,yy,zz;
bool ok=true;
if(!keyFrame->getPropertyReal("vx",xx))
ok = false;
if(!keyFrame->getPropertyReal("vy",yy))
ok = false;
if(!keyFrame->getPropertyReal("vz",zz))
ok = false;
if(!keyFrame->getPropertyReal("angle",angle))
ok = false;
if(!ok)
{
cerr << "Error reading orientation infos (vx,vy,vz,angle)" << endl;
return(false);
}
Vector3d axis(xx,yy,zz);
/* if (!keyFrame->getPropertyReal("vx",axis.accessVector()[0]) ||
!keyFrame->getPropertyReal("vy",axis.accessVector()[1]) ||
!keyFrame->getPropertyReal("vz",axis.accessVector()[2]) ||
!keyFrame->getPropertyReal("angle",angle))
{
cerr << "Error reading orientation infos (vx,vy,vz,angle)" << endl;
return(false);
}*/
setKeyFrame(frame,axis,angle);
//cerr << "kf=" << frame << " axis=" << axis << " angme=" << angle << endl;
}
keyFrame=keyFrame->getNext();
}
return(true);
}