本文整理汇总了C++中GeometryUnrecPtr::getTexCoords1方法的典型用法代码示例。如果您正苦于以下问题:C++ GeometryUnrecPtr::getTexCoords1方法的具体用法?C++ GeometryUnrecPtr::getTexCoords1怎么用?C++ GeometryUnrecPtr::getTexCoords1使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GeometryUnrecPtr
的用法示例。
在下文中一共展示了GeometryUnrecPtr::getTexCoords1方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: processTransformations
void MergeGraphOp::processTransformations(Node * const node)
{
MFUnrecChildNodePtr::const_iterator mfit = node->getMFChildren()->begin();
MFUnrecChildNodePtr::const_iterator mfen = node->getMFChildren()->end ();
std::vector<Node *> toAdd;
std::vector<Node *> toSub;
for ( ; mfit != mfen; ++mfit )
{
bool special=isInExcludeList(*mfit);
bool leaf=isLeaf(*mfit);
bool empty=true;
//if a transformation:
if ((*mfit)->getCore()->getType().isDerivedFrom(
Transform::getClassType()))
{
if (!leaf && !special)
{
//try to apply it to children geometries
//move all "moveable" children one level up
//if empty after that, delete it
MFUnrecChildNodePtr::const_iterator it2 =
(*mfit)->getMFChildren()->begin();
MFUnrecChildNodePtr::const_iterator en2 =
(*mfit)->getMFChildren()->end ();
for ( ; it2 != en2; ++it2 )
{
if (!isInExcludeList(*it2))
{
//check if geometry
if ((*it2)->getCore()->getType().isDerivedFrom(
Geometry::getClassType()))
{
if(!isLeaf(*it2))
{
//hmm...bad tree...
empty=false;
}
else
{
//it is a leaf geometry, so apply the transformation
Geometry *geo_old =
dynamic_cast<Geometry *>(
(*it2)->getCore());
//GeometryPtr geo = geo_old->clone();
GeometryUnrecPtr geo =
dynamic_pointer_cast<Geometry>(
OSG::deepClone(geo_old, "Material"));
Transform *t =
dynamic_cast<Transform *>(
(*mfit)->getCore());
GeoPnt3fProperty *pos = dynamic_cast<GeoPnt3fProperty *>(geo->getPositions());
GeoVec3fProperty *norm = dynamic_cast<GeoVec3fProperty *>(geo->getNormals());
GeoColor3fProperty *color = dynamic_cast<GeoColor3fProperty *>(geo->getColors());
GeoColor3fProperty *scolor = dynamic_cast<GeoColor3fProperty *>(geo->getSecondaryColors());
GeoVec3fProperty *texcoord0 = dynamic_cast<GeoVec3fProperty *>(geo->getTexCoords());
GeoVec3fProperty *texcoord1 = dynamic_cast<GeoVec3fProperty *>(geo->getTexCoords1());
GeoVec3fProperty *texcoord2 = dynamic_cast<GeoVec3fProperty *>(geo->getTexCoords2());
GeoVec3fProperty * texcoord3 = dynamic_cast<GeoVec3fProperty *>(geo->getTexCoords3());
Matrix m=t->getMatrix();
if(pos!=NULL)
{
for(UInt32 i = 0; i < pos->size(); ++i)
{
Pnt3f p=pos->getValue(i);
m.multFull(p, p);
pos->setValue(p,i);
}
}
if(norm!=NULL)
{
for(UInt32 i = 0; i < norm->size(); ++i)
{
Vec3f n=norm->getValue(i);
m.mult(n, n);
n.normalize();
norm->setValue(n,i);
}
}
if(color != NULL && _color_is_vector)
{
for(UInt32 i = 0; i < color->size(); ++i)
{
Color3f c = color->getValue(i);
Vec3f v;
v.setValue(c.getValuesRGB());
m.mult(v, v);
v.normalize();
c.setValuesRGB(v[0], v[1], v[2]);
color->setValue(c,i);
}
}
//.........这里部分代码省略.........