Select Git revision
Forked from
gmsh / gmsh
Source project has a limited visibility.
GModel.h 24.78 KiB
// Gmsh - Copyright (C) 1997-2012 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to <gmsh@geuz.org>.
#ifndef _GMODEL_H_
#define _GMODEL_H_
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <string>
#include "GVertex.h"
#include "GEdge.h"
#include "GFace.h"
#include "GRegion.h"
#include "SPoint3.h"
#include "SBoundingBox3d.h"
template <class scalar> class simpleFunction;
class FM_Internals;
class GEO_Internals;
class OCC_Internals;
class ACIS_Internals;
class smooth_normals;
class FieldManager;
class CGNSOptions;
class gLevelset;
class discreteFace;
class discreteRegion;
class MElementOctree;
class GModelFactory;
// A geometric model. The model is a "not yet" non-manifold B-Rep.
class GModel
{
private:
friend class OCCFactory;
std::multimap<std::pair<std::vector<int>, std::vector<int> >,
std::pair<std::string, std::vector<int> > > _homologyRequests;
std::set<GRegion*, GEntityLessThan> _chainRegions;
std::set<GFace*, GEntityLessThan> _chainFaces;
std::set<GEdge*, GEntityLessThan> _chainEdges;
std::set<GVertex*, GEntityLessThan> _chainVertices;
int _readMSH2(const std::string &name);
int _writeMSH2(const std::string &name, double version=2.2, bool binary=false,
bool saveAll=false, bool saveParametric=false,
double scalingFactor=1.0, int elementStartNum=0,
int saveSinglePartition=0,
bool multipleView=false);
protected:
// the name of the model
std::string _name;
// the name of the file the model was read from
std::string _fileName;
// the visibility flag
char _visible;
// vertex and element caches to speed-up direct access by tag (only
// used for post-processing I/O)
std::vector<MVertex*> _vertexVectorCache;
std::map<int, MVertex*> _vertexMapCache;
std::vector<MElement*> _elementVectorCache;
std::map<int, MElement*> _elementMapCache;
std::map<int, int> _elementIndexCache;