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


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

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


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

示例1: main

int main( int argc, char** argv )
{
  // for 3D display with Viewer3D
  QApplication application(argc,argv);
  
  KSpace K;
  Point plow(0,0,0);  
  Point pup(3,3,2);
  Domain domain( plow, pup );
  K.init( plow, pup, true );
  
  Viewer3D viewer;  
  viewer.show();
  viewer << SetMode3D( domain.styleName(), "Paving" );
  
  SCell ptlow = K.sPointel( plow ); // pointel (0*2,0*2, 0*2)
  SCell ptup1 = K.sPointel( pup );  // pointel (3*2,3*2, 2*2)
  SCell ptup2 = K.sTranslation( ptup1, Point::diagonal() ); // pointel (4*2, 4*2, 3*2)

  viewer << ptlow << ptup1 << ptup2; 
  
  // drawing cells of dimension 0
  SCell p1= K.sCell(Point(0,0,2),false);  // pointel (0*2,0*2,2*2)  
  SCell p2= K.sCell(Point(0,2,2));  // ...
  SCell p3= K.sCell(Point(2,2,2),false);
  SCell p4= K.sCell(Point(2,0,2));
  SCell p5= K.sCell(Point(0,0,4),false);
  SCell p6= K.sCell(Point(0,2,4));
  SCell p7= K.sCell(Point(2,2,4), false);
  SCell p8= K.sCell(Point(2,0,4));
  viewer << p1 << p2 << p3 << p4 << p5 << p6 << p7 << p8;
  
  // drawing Cells of dimension 1
  SCell linel0 = K.sCell( Point( 1, 0, 2 ) );  // linel (2*1+1, 0, 2*2)
  SCell linel1 = K.sCell( Point( 1, 2, 2 ) );  // ...
  SCell linel2 = K.sCell( Point( 0, 1, 2 ) ); 
  SCell linel3 = K.sCell( Point( 2, 1, 2 ) ); 
  
  SCell linel4 = K.sCell( Point( 1, 0, 4 ) );
  SCell linel5 = K.sCell( Point( 1, 2, 4 ) );
  SCell linel6 = K.sCell( Point( 0, 1, 4 ) );
  SCell linel7 = K.sCell( Point( 2, 1, 4 ) );

  SCell linel8 = K.sCell( Point( 0, 0, 3 ) );
  SCell linel9 = K.sCell( Point( 0, 2, 3 ) );
  SCell linel10 = K.sCell( Point( 2, 0, 3 ) );
  SCell linel11 = K.sCell( Point( 2, 2, 3 ) );

  
  SCell linel12 = K.sCell( Point( 3, 2, 2 ) );
  
  viewer << linel0<< linel1<< linel2 << linel3 ;
  viewer << linel4<< linel5<< linel6 << linel7 ;
  viewer << linel8<< linel9<< linel10 << linel11 << linel12;
 
  // drawing cells of dimension 2
  
  SCell surfelA = K.sCell( Point( 2, 1, 3 ) ); // surfel (2*2,2*1+1,2*3+1)
  SCell surfelB = K.sCell( Point( 1, 0, 1 ) ); // surfel (2*1,2*0,2*1+1) 
  SCell surfelC = K.sCell( Point( 2, 1, 1 ),false ); // surfel (2*2,2*1+1,2*1+1) 
  viewer << surfelA << surfelB << surfelC;

  // drawing cells of dimension 3  
  SCell vox1 = K.sCell( Point( 3, 3, 3 ) ); // voxel (2*3+1,2*3+1,2*3+1)
  SCell vox2 = K.sCell( Point( 1, 1, 3 ) ,false ); // voxel (2*1+1,2*1+1,2*3+1)  
  viewer << vox1 << vox2;
  
  viewer << CameraPosition(-2.9, 2.96, 2.64)
   << CameraDirection(0.6, -0.43, 0.65)
   << CameraUpVector(0.32, 0.900, 0.29);
  viewer<< Viewer3D::updateDisplay;
  return application.exec();
 
  return 0;
}
开发者ID:gdamiand,项目名称:DGtal,代码行数:75,代码来源:ctopo-1s-3d.cpp


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