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


C++ Interaction::get_n1_bonds_at_site方法代码示例

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


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

示例1: MakeSquareLatticeColorImage

void LatticeFile::MakeSquareLatticeColorImage(Interaction& lattice_interaction, string* filename){
  vector<int> measurements = m_lattice.measurements();

  //cout << "MAKING SQUARE LATTICE IMAGE?!" <<endl;
  //pixel_size should be odd
  int pixel_size = 15;

  string write_name;
  if (filename != 0) write_name = *filename;
  else write_name = "temp.png";
  cout << "In LatticeFile::MakeSquareLatticeColorImage - Selected file name "<<write_name<<endl;

  pngwriter png(measurements[1]*pixel_size,measurements[0]*pixel_size,1.0,write_name.c_str());
  Lattice::Coord coord(2,0);
  Site* current_site;

  //draws a little mark in the corner for general good luck, as suggested by Lester.
  png.square(1,1,2,2, 1,2,3);

  //draws all of the sites!
  for (int i = 0; i < measurements[0] ; i ++){
    for (int j = 0 ; j < measurements[1] ; j++){
      coord[0]=i; coord[1]=j;
      int n1_bonds = lattice_interaction.get_n1_bonds_at_site(coord);
      int n2_bonds = lattice_interaction.get_n2_bonds_at_site(coord);
      current_site = m_lattice.get_site(coord);

      //cout << "in LatticeFile::MakeSquareLatticeColorImage" << endl;
      //cout << current_site->occ() << " = occ\n" ;
      //cout << current_site->rot() << " = rot\n" ;
      int rot = (current_site->occ())? current_site->rot() : -1;
      DrawSite(png, pixel_size, coord, rot, m_lattice.R(), n1_bonds, n2_bonds);
    }
    //cout << "iterating sites";
  }
  cout <<endl;
  png.close();
}
开发者ID:jhaberstroh,项目名称:symmetry-lattice-model,代码行数:38,代码来源:latticefile.cpp


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