gm_read.cpp

来自「算断裂的」· C++ 代码 · 共 93 行

CPP
93
字号
// ------------------------------------------------------------------// gm_read.cpp//// This file contains the driver function for reading breps or meshes// in ascii format from a file.// ------------------------------------------------------------------// Author: Stephen A. Vavasis// Copyright (c) 1999 by Cornell University.  All rights reserved.// // See the accompanying file 'Copyright' for authorship information,// the terms of the license governing this software, and disclaimers// concerning this software.// ------------------------------------------------------------------// This file is part of the QMG software.  // Version 2.0 of QMG, release date September 3, 1999.// ------------------------------------------------------------------#include "qfrontend.h"#include "qsimpcomp.h"#include "qbrep_constr.h"#include <fstream>#define GM_ROUTINE_NAME gm_read#define GM_ROUTINE_NAME_Q "gm_read"namespace QMG {  extern Object_Type_Code read_header_from_istream(istream& istr, int& line_count);}namespace { #ifdef _MSC_VER    class Bkpt_obj2 {  private:    int j;  public:    Bkpt_obj2(int i) : j(i) { }    ~Bkpt_obj2();  };  Bkpt_obj2::~Bkpt_obj2() {    int k = j + 1;  }#endif  static void worker(const QMG::FrontEnd::ArgValType& argvalhandle,    QMG::FrontEnd::ReturnValType& returnvalhandle,    QMG::FrontEnd::Interpreter& interp) {        using namespace QMG;    using namespace QMG::FrontEnd;    using std::ifstream;        argvalhandle.verify_nargin(1, 1, GM_ROUTINE_NAME_Q);    returnvalhandle.verify_nargout(1, 1, GM_ROUTINE_NAME_Q);    ifstream infile(argvalhandle.get_string(0).c_str());    if (!infile)      throw_error("Unable to open input file in gm_read");    int linecount = 0;    Object_Type_Code code =      read_header_from_istream(infile, linecount);    if (code == UNKNOWN)      throw_error("Unrecognized header information in file");#ifdef _MSC_VER    Bkpt_obj2 a1(1);#endif    if (code == BREP) {#ifdef _MSC_VER      Bkpt_obj2 a2(2);#endif      Brep_Under_Construction b =         Brep_Under_Construction::read_from_istream(infile, true, linecount);      returnvalhandle.put_brep(0,b);    }    else {#ifdef _MSC_VER      Bkpt_obj2 a3(3);#endif      SimpComplex_Under_Construction s =         SimpComplex_Under_Construction::read_from_istream(infile, true, linecount);      returnvalhandle.put_simpcomp(0,s);    }    return;  }}#include "gm_entrypoint.cpp"

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?