Geom Software - C++ Programming and Geometry Libraries
WOF Documentation pages v1.16
Mesh.h
1 // Copyright (C) Geom Software e.U, Bernhard Kornberger, Graz/Austria
2 //
3 // This file is part of the WOF software. WOF is commercial software.
4 // Users holding a license may use this file in accordance with the
5 // License Agreement.
6 //
7 // This software is provided AS IS with NO WARRANTY OF ANY KIND,
8 // INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS
9 // FOR A PARTICULAR PURPOSE.
10 //
11 // Please contact the author if any conditions of this licensing are
12 // not clear to you.
13 //
14 // Author: Bernhard Kornberger, bkorn (at) geom.at
15 // http://www.geom.at
16 
17 #pragma once
18 
19 #include <vector>
20 #include <memory>
21 #include "Point3.h"
22 
23 namespace GEOM_WOF {
24 
25 
26 class RMesh; // FWD
27 class Mesh; // FWD
28 
30 typedef std::shared_ptr<Mesh> MeshPtr;
31 
32 
37 class CLASS_DECLSPEC Mesh
38 {
39 public:
42  Mesh(RMesh* pRMesh);
45  ~Mesh();
46  Mesh(const Mesh&)=delete;
47  Mesh& operator=(const Mesh&)=delete;
48 
51  size_t getNumT() const;
52 
59  void getTriangles(std::vector<Point3*>& vTriangleCorners) const;
64  void getPoints(std::vector<Point3*>& vPoints) const;
88  void contrastSpread(double lowerSkipFrac=.01,double upperSkipFrac=.01);
89 
90 
97 
98  void getVertexIndexData(std::vector<Point3*>& vVertices,
99  std::vector<int>& vCornerIndices) const;
106  bool writePly_BIN(const std::string& name) const;
113  bool writePly_ASCII(const std::string& name) const;
120  bool writeGeomview_ASCII(const std::string& name) const;
128  bool writeStl_ASCII(const std::string& name) const;
135  void printStatistics(const std::string& name) const;
140  double getAverageEdgeLength() const;
141 
142 
144  RMesh* getRMesh();
145 
146 private:
147  RMesh* pRMesh;
148 };
149 
150 
151 
152 } // NAMESPACE
153 
154 
3D Mesh class
Definition: Mesh.h:38
~Mesh()
Destructor.
bool writeStl_ASCII(const std::string &name) const
Write STL (ASCII)
Mesh(RMesh *pRMesh)
Constructor.
void getTriangles(std::vector< Point3 * > &vTriangleCorners) const
Get Triangles.
bool writePly_BIN(const std::string &name) const
Write Ply (Binary)
void contrastSpread(double lowerSkipFrac=.01, double upperSkipFrac=.01)
Get the Mesh as Vertices and Indices.
size_t getNumT() const
Get the number of triangles.
bool writeGeomview_ASCII(const std::string &name) const
Write Geomview.
void printStatistics(const std::string &name) const
Print Statistics.
void colorizeFilledHoles()
Colorize filled holes.
bool writePly_ASCII(const std::string &name) const
Write Ply (ASCII)
void getPoints(std::vector< Point3 * > &vPoints) const
Get Points.
double getAverageEdgeLength() const
Get the average edge length.
Definition: Point3.h:23
std::shared_ptr< Mesh > MeshPtr
Definition: Mesh.h:27