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


C++ GEO_Point::setString方法代码示例

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


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

示例1: setFileAttributes

/* ******************************************************************************
*  Function Name : setFileAttributes()
*
*  Description :
*
*  Input Arguments : GEO_Point *ppt, GU_Detail *inst_gdp
*
*  Return Value : int
*
***************************************************************************** */
inline int VRAY_clusterThis::setFileAttributes(GU_Detail * file_gdp)
{

#ifdef DEBUG
   cout << "VRAY_clusterThis::setFileAttributes() " << endl;
#endif

   GEO_Point * ppt;

#ifdef DEBUG
   long int num_points = (long int) file_gdp->points().entries();
   cout << "VRAY_clusterThis::setFileAttributes() - num points :" << num_points << endl;
#endif

// NOTE: File instanced geo should have normals already, do not set the normals to the source point normals

   GA_FOR_ALL_GPOINTS(file_gdp, ppt) {

      ppt->setValue<UT_Vector3>(myFileAttrOffsets.Cd, (const UT_Vector3)myPointAttributes.Cd);
      ppt->setValue<float>(myFileAttrOffsets.Alpha, (const float)myPointAttributes.Alpha);
      ppt->setValue<UT_Vector3>(myFileAttrOffsets.pointV, (const UT_Vector3)myPointAttributes.v);
      ppt->setValue<int>(myFileAttrOffsets.pointId, (const int)myPointAttributes.id);
      ppt->setString(myFileAttrOffsets.material, myPointAttributes.material);
   }
开发者ID:bxyldy,项目名称:clusterThis,代码行数:34,代码来源:VRAY_clusterThisAttributeUtils.C

示例2: setInstanceAttributes

/* ******************************************************************************
*  Function Name : setInstanceAttributes()
*
*  Description : Set the attributes of the instanced primitive
*
*  Input Arguments : GEO_Primitive *myGeoPrim
*
*  Return Value : void
*
***************************************************************************** */
inline void VRAY_clusterThis::setInstanceAttributes(GEO_Primitive * myGeoPrim)
{

#ifdef DEBUG
   cout << "VRAY_clusterThis::setInstanceAttributes() " << endl;
#endif
   GEO_Point * ppt;

   myGeoPrim->setValue<UT_Vector3>(myInstAttrRefs.Cd, (const UT_Vector3)myPointAttributes.Cd);
   myGeoPrim->setValue<fpreal>(myInstAttrRefs.Alpha, (const fpreal)myPointAttributes.Alpha);
   myGeoPrim->setValue<UT_Vector3>(myInstAttrRefs.v, (const UT_Vector3)myPointAttributes.v);
   myGeoPrim->setValue<UT_Vector3>(myInstAttrRefs.N, (const UT_Vector3)myPointAttributes.N);
//    myGeoPrim->setValue<UT_Vector4>(myInstAttrRefs.orient (const UT_Vector4)myPointAttributes.orient);
   myGeoPrim->setValue<fpreal>(myInstAttrRefs.pscale, (const fpreal)myPointAttributes.pscale);
   myGeoPrim->setValue<int>(myInstAttrRefs.id, (const int)myPointAttributes.id);
   myGeoPrim->setValue<int>(myInstAttrRefs.inst_id, (const int)myInstanceNum);
   myGeoPrim->setValue<fpreal>(myInstAttrRefs.weight, (const fpreal)myPointAttributes.weight);
   myGeoPrim->setValue<fpreal>(myInstAttrRefs.width, (const fpreal)myPointAttributes.width);
   myGeoPrim->setString(myInstAttrRefs.material, myPointAttributes.material);


   // apply attribues to each vertex
   for (int i=0; i < myGeoPrim->getVertexCount(); i++) {
      ppt = myGeoPrim->getVertexElement(i).getPt();
      ppt->setValue<UT_Vector3>(myInstAttrRefs.pointCd, (const UT_Vector3)myPointAttributes.Cd);
      ppt->setValue<float>(myInstAttrRefs.pointAlpha, (const float)myPointAttributes.Alpha);
      ppt->setValue<UT_Vector3>(myInstAttrRefs.pointV, (const UT_Vector3)myPointAttributes.v);
      ppt->setValue<UT_Vector3>(myInstAttrRefs.pointN, (const UT_Vector3)myPointAttributes.N);
      ppt->setValue<float>(myInstAttrRefs.pointPscale, (const float)myPointAttributes.pscale);
      ppt->setValue<int>(myInstAttrRefs.pointId, (const int)myPointAttributes.id);
      ppt->setValue<int>(myInstAttrRefs.pointInstId, (const int)myInstanceNum);
      ppt->setString(myInstAttrRefs.pointMaterial, myPointAttributes.material);

   }

}
开发者ID:bxyldy,项目名称:clusterThis,代码行数:46,代码来源:VRAY_clusterThisAttributeUtils.C

示例3: instanceCurve

/* ******************************************************************************
*  Function Name : instanceCurve()
*
*  Description : Instance a curve
*
*  Input Arguments : GU_Detail *inst_gdp, GU_Detail *mb_gdp
*
*  Return Value : int
*
***************************************************************************** */
int VRAY_clusterThis::instanceCurve(GU_Detail * inst_gdp, GU_Detail * mb_gdp, fpreal theta, long int point_num)
{
#ifdef DEBUG
   std::cout << "VRAY_clusterThis::instanceCurve()" << std::endl;
#endif

   GEO_Point * ppt;
   GU_PrimNURBCurve * myCurve, * myMBCurve;
   uint32 num_vtx;
   int myCurvePointNum = 0;
   UT_Vector4 pt_pos;
   GU_Detail * curve_gdp, * curve_mb_gdp;

   curve_gdp = allocateGeometry();

   GA_RWAttributeRef prim_Cd = curve_gdp->addDiffuseAttribute(GEO_PRIMITIVE_DICT);
   GA_RWAttributeRef prim_Alpha = curve_gdp->addAlphaAttribute(GEO_PRIMITIVE_DICT);
   GA_RWAttributeRef prim_v = curve_gdp->addVelocityAttribute(GEO_PRIMITIVE_DICT);
   GA_RWAttributeRef prim_N = curve_gdp->addNormalAttribute(GEO_PRIMITIVE_DICT);
   GA_RWAttributeRef prim_material = curve_gdp->addStringTuple(GEO_PRIMITIVE_DICT, "shop_materialpath", 1);

   GA_RWAttributeRef pt_Cd = curve_gdp->addDiffuseAttribute(GEO_POINT_DICT);
   GA_RWAttributeRef pt_Alpha = curve_gdp->addAlphaAttribute(GEO_POINT_DICT);
   GA_RWAttributeRef pt_v = curve_gdp->addVelocityAttribute(GEO_POINT_DICT);
   GA_RWAttributeRef pt_N = curve_gdp->addNormalAttribute(GEO_POINT_DICT);
   GA_RWAttributeRef pt_pscale = curve_gdp->addFloatTuple(GA_ATTRIB_POINT, "pscale", 1);
   GA_RWAttributeRef pt_width = curve_gdp->addFloatTuple(GA_ATTRIB_POINT, "width", 1);
   GA_RWAttributeRef pt_id = curve_gdp->addIntTuple(GA_ATTRIB_POINT, "id", 1);
   GA_RWAttributeRef pt_instId = curve_gdp->addIntTuple(GA_ATTRIB_POINT, "inst_id", 1);
   GA_RWAttributeRef pt_material = curve_gdp->addStringTuple(GA_ATTRIB_POINT, "shop_materialpath", 1);

   GA_RWAttributeRef pt_mb_Cd;
   GA_RWAttributeRef pt_mb_Alpha;
   GA_RWAttributeRef pt_mb_v;
   GA_RWAttributeRef pt_mb_N;
   GA_RWAttributeRef pt_mb_pscale;
   GA_RWAttributeRef pt_mb_width;
   GA_RWAttributeRef pt_mb_id;
   GA_RWAttributeRef pt_mb_instId;
   GA_RWAttributeRef pt_mb_material;

   num_vtx = ((myNumCopies * myRecursion) > 4) ? (myNumCopies * myRecursion) : 4;
   myCurve = (GU_PrimNURBCurve *)GU_PrimNURBCurve::build((GU_Detail *)curve_gdp, num_vtx, 4, 0, 1, 1);

   myCurve->setValue<UT_Vector3>(prim_Cd, (const UT_Vector3)myPointAttributes.Cd);
   myCurve->setValue<fpreal>(prim_Alpha, (const fpreal)myPointAttributes.Alpha);
   myCurve->setString(prim_material, myPointAttributes.material);

//   cout << "VRAY_clusterThis::instanceCurve() - num vertices: " << myCurve->getVertexCount() << endl;;
//   cout << "id: "  << myCurve->getPrimitiveId() << endl;
//   cout << "breakCount: "  << myCurve->breakCount() << endl;

   if(myDoMotionBlur == CLUSTER_MB_DEFORMATION) {
         curve_mb_gdp = allocateGeometry();
         myMBCurve = (GU_PrimNURBCurve *)GU_PrimNURBCurve::build((GU_Detail *)curve_mb_gdp, num_vtx, 4, 0, 1, 1);
         pt_mb_Cd = curve_gdp->addDiffuseAttribute(GEO_POINT_DICT);
         pt_mb_Alpha = curve_gdp->addAlphaAttribute(GEO_POINT_DICT);
         pt_mb_v = curve_gdp->addVelocityAttribute(GEO_POINT_DICT);
         pt_mb_N = curve_gdp->addNormalAttribute(GEO_POINT_DICT);
         pt_mb_pscale = curve_gdp->addFloatTuple(GA_ATTRIB_POINT, "pscale", 1);
         pt_mb_width = curve_gdp->addFloatTuple(GA_ATTRIB_POINT, "width", 1);
         pt_mb_id = curve_gdp->addIntTuple(GA_ATTRIB_POINT, "id", 1);
         pt_mb_instId = curve_gdp->addIntTuple(GA_ATTRIB_POINT, "inst_id", 1);
         pt_mb_material = curve_gdp->addStringTuple(GA_ATTRIB_POINT, "shop_materialpath", 1);
      }


   for(int copyNum = 0; copyNum < myNumCopies; copyNum++)
      for(int recursionNum = 0; recursionNum < myRecursion; recursionNum++) {

            VRAY_clusterThis::calculateNewPosition(theta, copyNum, recursionNum);
            ppt = myCurve->getVertexElement(myCurvePointNum).getPt();
            ppt->setPos((float)myPointAttributes.myNewPos[0],
                        (float)myPointAttributes.myNewPos[1],
                        (float)myPointAttributes.myNewPos[2], 1.0);

            // Assign attributes to each point
            ppt->setValue<UT_Vector3>(pt_Cd, (const UT_Vector3)myPointAttributes.Cd);
            ppt->setValue<fpreal>(pt_Alpha, (const fpreal)myPointAttributes.Alpha);
            ppt->setValue<UT_Vector3>(pt_v, (const UT_Vector3)myPointAttributes.v);
            ppt->setValue<UT_Vector3>(pt_N, (const UT_Vector3)myPointAttributes.N);
            ppt->setValue<fpreal>(pt_pscale, (const fpreal)myPointAttributes.pscale);
            ppt->setValue<fpreal>(pt_width, (const fpreal)myPointAttributes.width);
            ppt->setValue<int>(pt_id, (const int)myPointAttributes.id);
            ppt->setValue<int>(pt_instId, (const int)myCurvePointNum);
            ppt->setString(pt_material, myPointAttributes.material);

            if(myDoMotionBlur == CLUSTER_MB_DEFORMATION) {
                  ppt = myMBCurve->getVertexElement(myCurvePointNum).getPt();
                  ppt->setPos((float)myPointAttributes.myNewPos[0],
//.........这里部分代码省略.........
开发者ID:dperi,项目名称:clusterThis,代码行数:101,代码来源:VRAY_clusterThisInstance.cpp


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