Chi-Tech
chi_surfacemesh.h
Go to the documentation of this file.
1#ifndef CHI_MESH_SURFACEMESH_H
2#define CHI_MESH_SURFACEMESH_H
3
4#include<stdio.h>
5#include <vector>
6
7#include"../chi_mesh.h"
8
9//###################################################################
10/** Generic surface mesh class.
11This class facilitates many functions within the mesh environment including
12logically determining volumes.*/
14{
15protected:
16 std::vector<chi_mesh::Vertex> vertices_;
17 std::vector<chi_mesh::Vertex> tex_vertices_; ///< Texture vertices
18 std::vector<chi_mesh::Normal> normals_;
19 std::vector<chi_mesh::Face> faces_;
20 std::vector<chi_mesh::Edge> lines_;
21 std::vector<chi_mesh::PolyFace*> poly_faces_; ///<Polygonal faces
22
23 std::vector<int> physical_region_map_;
24
25public:
26 const std::vector<chi_mesh::Vertex>&
27 GetVertices() const {return vertices_;}
28
29 const std::vector<chi_mesh::Face>&
30 GetTriangles() const {return faces_;}
31
32 const std::vector<chi_mesh::PolyFace*>&
33 GetPolygons() const {return poly_faces_;}
34
35 //constrdestr.cc
38 friend std::ostream& operator<<(std::ostream& os, SurfaceMesh& dt);
39 //loadexport.cc
40 int ImportFromOBJFile(const std::string& fileName,bool as_poly=false,
41 const chi_mesh::Vector3& transform=Vector3(0,0,0));
42 int ImportFromTriangleFiles(const char* fileName, bool as_poly);
43 int ImportFromMshFiles(const char* fileName, bool as_poly);
44 void ExportToOBJFile(const char* fileName);
45 void ExportToPolyFile(const char* fileName);
46 static SurfaceMesh*
47 CreateFromDivisions(std::vector<double>& vertices_1d_x,
48 std::vector<double>& vertices_1d_y);
49
50 //internalconn.cc
52
53 //checksense.cc
54 bool CheckNegativeSense(double x, double y, double z);
55
56 //splitbypatch.cc
57 void SplitByPatch(std::vector<chi_mesh::SurfaceMesh*>& patches);
58
59 //extractopenedges.cc
60 void ExtractOpenEdgesToObj(const char* fileName);
61
62 //meshstats.cc
63 void CheckCyclicDependencies(int num_angles);
64 void GetMeshStats();
65 void ComputeLoadBalancing(std::vector<double>& x_cuts,
66 std::vector<double>& y_cuts);
67
68};
69
70#endif//CHI_MESH_SURFACEMESH_H
void SplitByPatch(std::vector< chi_mesh::SurfaceMesh * > &patches)
const std::vector< chi_mesh::Face > & GetTriangles() const
static SurfaceMesh * CreateFromDivisions(std::vector< double > &vertices_1d_x, std::vector< double > &vertices_1d_y)
int ImportFromTriangleFiles(const char *fileName, bool as_poly)
void ComputeLoadBalancing(std::vector< double > &x_cuts, std::vector< double > &y_cuts)
void ExportToOBJFile(const char *fileName)
const std::vector< chi_mesh::Vertex > & GetVertices() const
void ExportToPolyFile(const char *fileName)
std::vector< int > physical_region_map_
void CheckCyclicDependencies(int num_angles)
std::vector< chi_mesh::Edge > lines_
int ImportFromMshFiles(const char *fileName, bool as_poly)
friend std::ostream & operator<<(std::ostream &os, SurfaceMesh &dt)
std::vector< chi_mesh::PolyFace * > poly_faces_
Polygonal faces.
std::vector< chi_mesh::Vertex > tex_vertices_
Texture vertices.
bool CheckNegativeSense(double x, double y, double z)
std::vector< chi_mesh::Vertex > vertices_
int ImportFromOBJFile(const std::string &fileName, bool as_poly=false, const chi_mesh::Vector3 &transform=Vector3(0, 0, 0))
std::vector< chi_mesh::Face > faces_
void ExtractOpenEdgesToObj(const char *fileName)
std::vector< chi_mesh::Normal > normals_
const std::vector< chi_mesh::PolyFace * > & GetPolygons() const
VectorN< 3 > Vector3