示例#1
0
inline int _I(int b){
    int a = MOD, x1 = 0, x2 = 1, q; while (1){
        q = a / b, a %= b;
        if (!a) return x2;
        DEC(x1, pdt(q, x2));

        q = b / a, b %= a;
        if (!b) return x1;
        DEC(x2, pdt(q, x1));
    }
}
示例#2
0
inline int gcd(int m, int n, int &x, int &y){

    x = 1, y = 0; int xx = 0, yy = 1, q;

    while (1){
        q = m / n, m %= n;
        if (!m){x = xx, y = yy; return n;}
        DEC(x, pdt(q, xx)), DEC(y, pdt(q, yy));
        q = n / m, n %= m;
        if (!n) return m;
        DEC(xx, pdt(q, x)), DEC(yy, pdt(q, y));
    }
}
示例#3
0
void ImportShp::execComm(Document_Interface *doc,
                             QWidget *parent, QString /*cmd*/)
{
    dibSHP pdt(parent);
    int result = pdt.exec();
    if (result == QDialog::Accepted)
        pdt.procesFile(doc);
}
示例#4
0
void AsciiFile::execComm(Document_Interface *doc,
                             QWidget *parent, QString cmd)
{
    Q_UNUSED(cmd);
    dibPunto pdt(parent);
    int result = pdt.exec();
    if (result == QDialog::Accepted)
        pdt.procesFile(doc);
}
示例#5
0
void DECC::execComm(Document_Interface *doc,
                    QWidget *parent, QString cmd)
{
    Q_UNUSED(doc);
    DialogDECC pdt(parent,doc);
    int result =  pdt.exec();
    //if (result == QDialog::Accepted)
    //  pdt.procesAction(doc);
}
示例#6
0
void LC_Sample::execComm(Document_Interface *doc,
                             QWidget *parent)
{
    Q_UNUSED(doc);
    lc_Sampledlg pdt(parent);
    int result =  pdt.exec();
    if (result == QDialog::Accepted)
        pdt.procesAction(doc);
}
示例#7
0
void LC_tank::execComm(Document_Interface *doc,
                             QWidget *parent, QString cmd)
{
    Q_UNUSED(doc);
    Q_UNUSED(cmd);
    lc_tankdlg pdt(parent);
    int result =  pdt.exec();
    if (result == QDialog::Accepted)
        pdt.procesAction(doc);
}
示例#8
0
const wxDateTime *CPanelHistory::GetDateTime()
{
  // return a pointer to the selected wxDateTime
  // or NULL is "Current" is selected
  int n = m_pComboHistory->GetSelection();
  wxDateTime *pdt(NULL);
  if(n > 0)
  {
    n--;
    pdt = &(m_vTime.at(n));
  }
  return pdt;
}
int main()
{
  typedef CGAL::Creator_uniform_3<double, Point> Creator;
  CGAL::Random random(7);
  CGAL::Random_points_in_cube_3<Point, Creator> in_cube(1, random);
  std::vector<Point> pts;

  // Generating 1000 random points
  for (int i=0 ; i < 1000 ; i++) {
    Point p = *in_cube++;
    pts.push_back(p);
  }

  // Define the periodic cube
  P3DT3 pdt(PK::Iso_cuboid_3(-1,-1,-1,1,1,1));
  // Heuristic for inserting large point sets (if pts is reasonably large)
  pdt.insert(pts.begin(), pts.end(), true);
  // As pdt won't be modified anymore switch to 1-sheeted cover if possible
  if (pdt.is_triangulation_in_1_sheet()) pdt.convert_to_1_sheeted_covering();
  std::cout << "Periodic Delaunay computed." << std::endl;

  // compute alpha shape
  Alpha_shape_3 as(pdt);
  std::cout << "Alpha shape computed in REGULARIZED mode by default."
	    << std::endl;

   // find optimal alpha values
  Alpha_shape_3::NT alpha_solid = as.find_alpha_solid();
  Alpha_shape_3::Alpha_iterator opt = as.find_optimal_alpha(1);
  std::cout << "Smallest alpha value to get a solid through data points is "
	    << alpha_solid << std::endl;
  std::cout << "Optimal alpha value to get one connected component is "
	    <<  *opt    << std::endl;
  as.set_alpha(*opt);
  assert(as.number_of_solid_components() == 1);
  return 0;
}
示例#10
0
CStdString PDFDocumentTagger::GetPdfClassification(const CStdString& sFileName)
{
	PDFDocumentTagger pdt(sFileName);
	return pdt.GetClassification();
}
示例#11
0
CStdString PDFDocumentTagger::GetPdfRestrictionLevel(const CStdString& sFileName)
{
	PDFDocumentTagger pdt(sFileName);
	return pdt.GetRestrictionLevel();
}
示例#12
0
inline int qtt(int a, int b){return pdt(a, _I(b));}
示例#13
0
inline int pdt(int a, int b, int c, int d){return pdt(pdt(a, b), pdt(c, d));}
示例#14
0
inline int pdt(int a, int b, int c){return pdt(a, pdt(b, c));}