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


C++ KSpace::signs方法代码示例

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


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

示例1: main


//.........这里部分代码省略.........
  std::vector<RealVector> nii_estimations;
  const double            r = vm["r-radius"].as<double>();
  IINormalEstimator       nii_estimator( K, noisy_object );
  trace.info() << " r=" << r << std::endl;
  nii_estimator.setParams( r );
  nii_estimator.init( h, digSurf.begin(), digSurf.end() );
  nii_estimator.eval( digSurf.begin(), digSurf.end(), std::back_inserter( nii_estimations ) );
  // Fix orientations of ii.
  for ( unsigned int i = 0; i < nii_estimations.size(); ++i )
    {
      if ( nii_estimations[ i ].dot( nt_estimations[ i ] ) < 0.0 )
        nii_estimations[ i ] *= -1.0;
    }
  trace.info() << "- nb estimations  = " << nii_estimations.size() << std::endl;
  trace.endBlock();

  // The chosen estimator is II.
  {
    unsigned int i = 0;
    for ( ConstIterator it = digSurf.begin(), itE = digSurf.end(); it != itE; ++it, ++i )
      {
        RealVector nii = nii_estimations[ i ];
        nii /= nii.norm();
        n_estimations[ *it ] = nii;
      }
  }

  //-----------------------------------------------------------------------------
  //! [3dVolBoundaryViewer-ViewingSurface]
  trace.beginBlock( "Displaying everything. " );
  Viewer3D<Space,KSpace> viewer( K );
  viewer.setWindowTitle("Simple boundary of volume Viewer");
  viewer.show();
  viewer << SetMode3D(K.unsigns( *(digSurf.begin()) ).className(), "Basic");
  unsigned int i = 0;
  for ( ConstIterator it = digSurf.begin(), itE = digSurf.end(); it != itE; ++it, ++i )
    {
      viewer.setFillColor( Color( 200, 200, 250 ) );
      Display3DFactory<Space,KSpace>::drawOrientedSurfelWithNormal( viewer, *it, n_estimations[ *it ], false );
    }
  viewer << Viewer3D<>::updateDisplay;
  trace.endBlock();

  //-----------------------------------------------------------------------------
  // Defining Discrete Calculus.
  typedef CubicalComplex< KSpace >                                 CComplex;
  typedef DiscreteExteriorCalculus<2,3, EigenLinearAlgebraBackend> Calculus;
  typedef Calculus::Index                                          Index;
  typedef Calculus::PrimalForm0                                    PrimalForm0;
  typedef Calculus::PrimalForm1                                    PrimalForm1;
  typedef Calculus::PrimalForm2                                    PrimalForm2;
  typedef Calculus::PrimalIdentity0                                PrimalIdentity0;
  typedef Calculus::PrimalIdentity1                                PrimalIdentity1;
  typedef Calculus::PrimalIdentity2                                PrimalIdentity2;
  trace.beginBlock( "Creating Discrete Exterior Calculus. " );
  Calculus calculus;
  calculus.initKSpace<Domain>( domain );
  const KSpace& Kc = calculus.myKSpace; // should not be used.
  // Use a cubical complex to find all lower incident cells easily.
  CComplex complex( K );
  for ( ConstIterator it = digSurf.begin(), itE = digSurf.end(); it != itE; ++it )
    complex.insertCell( 2, K.unsigns( *it ) );
  complex.close();
  for ( CComplex::CellMapIterator it = complex.begin( 0 ), itE = complex.end( 0 ); it != itE; ++it )
    calculus.insertSCell( K.signs( it->first, K.POS ) );
  
开发者ID:JacquesOlivierLachaud,项目名称:AT,代码行数:66,代码来源:3d-at-normals-u2-v1.cpp


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