gm_write.cpp

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

CPP
55
字号
// ------------------------------------------------------------------// gm_write.cpp//// This file contains the driver function for gm_write, which writes// a brep or mesh to a file in ascii format.// ------------------------------------------------------------------// 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 "qsimpcomp.h"#include "qbrep.h"#include "qfrontend.h"#include <fstream>#define GM_ROUTINE_NAME gm_write#define GM_ROUTINE_NAME_Q "gm_write"namespace {  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::ofstream;        argvalhandle.verify_nargin(2, 2, GM_ROUTINE_NAME_Q);    returnvalhandle.verify_nargout(0, 0, GM_ROUTINE_NAME_Q);    ofstream outfile(argvalhandle.get_string(1).c_str());    if (!outfile)      throw_error("Unable to open output file in gm_write");    int linecount = 0;    Object_Type_Code code = argvalhandle.determine_argument_type(0);    if (code == BREP)       outfile << argvalhandle.get_brep(0);    else      outfile << argvalhandle.get_simpcomp(0);    return;  }}#include "gm_entrypoint.cpp"

⌨️ 快捷键说明

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