You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
845 B
42 lines
845 B
#pragma once
|
|
|
|
#ifndef OUTPUTSURFMESH_H
|
|
#define OUTPUTSURFMESH_H
|
|
#include <vector>
|
|
#include <string>
|
|
#include <iostream>
|
|
|
|
|
|
|
|
class OutputSurfMesh
|
|
{
|
|
public:
|
|
float scale;
|
|
int num_nodes;
|
|
int num_triangles;
|
|
|
|
// Node coordinates: [x/y/z][index]
|
|
std::vector<std::vector<double>> xyznode;
|
|
|
|
// Triangles: [n0/n1/n2][triangle_index]
|
|
std::vector<std::vector<int>> triangles;
|
|
|
|
// [i][nx, ny, nz]
|
|
std::vector<std::vector<double>> normals;
|
|
|
|
OutputSurfMesh() : scale(1.0f), num_nodes(0), num_triangles(0) {}
|
|
|
|
void readFromFile(const std::string& filename);
|
|
|
|
|
|
void printSummary() const;
|
|
const std::vector<double>& getNode(int idx) const;
|
|
|
|
std::vector<int> getTriangle(int idx) const;
|
|
std::vector<double> getNormal(int idx) const;
|
|
|
|
void computeTriangleNormals();
|
|
|
|
};
|
|
|
|
#endif
|
|
|