PeriDyno 1.0.0
Loading...
Searching...
No Matches
TriangleMeshWriter.h
Go to the documentation of this file.
1/*
2This Module is designed to output mesh file of TriangleSet;
3the output file format: obj
4*/
5
6#pragma once
9
10#include "Topology/TriangleSet.h"
11
12#include <string>
13#include <memory>
14
15namespace dyno
16{
17 template<typename TDataType>
19 {
21
22 public:
23 typedef typename TDataType::Real Real;
24 typedef typename TDataType::Coord Coord;
26
27
28 DECLARE_ENUM(OutputType,
29 TriangleMesh = 0,
30 PointCloud = 1);
31
33 virtual ~TriangleMeshWriter();
34
35 void outputSurfaceMesh(std::shared_ptr<TriangleSet<TDataType>> triangleset);
36 void outputPointCloud(std::shared_ptr<PointSet<TDataType>> pointset);
37
38 void output()override;
39
40
41 public:
42
43 DEF_INSTANCE_IN(TopologyModule, Topology, "Input TriangleSet");
44 DEF_ENUM(OutputType, OutputType, OutputType::TriangleMesh, "OutputType")
45
46
47
48
49 protected:
50
51 std::string file_postfix = ".obj";
52 int mFileIndex = 0;
53 int count = -1;
54 bool skipFrame = false;
55
56 };
57}
#define DEF_ENUM(enum_type, enum_name, enum_value, desc)
#define DECLARE_TCLASS(name, T1)
Definition Object.h:87
A PointSet stores the coordinates for a set of independent points.
Definition PointSet.h:8
Vector< PointType, 3 > Triangle
DECLARE_ENUM(OutputType, TriangleMesh=0, PointCloud=1)
TopologyModule::Triangle Triangle
DEF_INSTANCE_IN(TopologyModule, Topology, "Input TriangleSet")
void outputPointCloud(std::shared_ptr< PointSet< TDataType > > pointset)
void outputSurfaceMesh(std::shared_ptr< TriangleSet< TDataType > > triangleset)
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:25