qancestor.h
来自「算断裂的」· C头文件 代码 · 共 67 行
H
67 行
// ------------------------------------------------------------------// qancestor.h//// This file contains a class for lookup up ancestors of topological// faces of a brep.// ------------------------------------------------------------------// 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.// ------------------------------------------------------------------#ifndef QANCESTOR_H#define QANCESTOR_H#include "qbrep.h"// sample usage of this class is as follows. Suppose g is // a brep and fspec is a facespec of that brep. Then we say// Ancestor_Lookup anc_lookup(g);// for (Ancestor_Lookup::Loop_over_ancestors aloop(anc_lookup,fspec);// aloop.notdone();// ++aloop) {// ... do something with aloop.ancestor_fspec();// }class QMG::Brep::Ancestor_Lookup {private: typedef map<Face_Spec, int> OneTableType; typedef map<Face_Spec, OneTableType > TableType; TableType lookup_tab_;public: explicit Ancestor_Lookup(const Brep& g); class Loop_over_ancestors; friend class Loop_over_ancestors; class Loop_over_ancestors { private: Face_Spec thisspec_; OneTableType::const_iterator current_; OneTableType::const_iterator end_; const Ancestor_Lookup& anc_; public: Loop_over_ancestors(const Ancestor_Lookup& anc, const Brep::Face_Spec& fspec); bool notdone() const {return current_ != end_;} void operator++() {++current_;} const Face_Spec& ancestor_fspec() const {return current_ -> first;} int occurrence_count() const {return current_ -> second;} };};#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?