PeriDyno 0.9.2
Loading...
Searching...
No Matches
SurfaceMeshLoader.cpp
Go to the documentation of this file.
1#include "SurfaceMeshLoader.h"
2
3namespace dyno
4{
5 IMPLEMENT_TCLASS(SurfaceMeshLoader, TDataType)
6
7 template<typename TDataType>
12
13 template<typename TDataType>
18
19 template<typename TDataType>
21 {
22 if (this->varFileName()->getData() == "")
23 {
24 Log::sendMessage(Log::Error, "File name is not set!");
25 return;
26 }
27
28 if (this->outTriangleSet()->getDataPtr() == nullptr) {
29 this->outTriangleSet()->setDataPtr(std::make_shared<TriangleSet<TDataType>>());
30 }
31
32 auto filename = this->varFileName()->getData();
33
34 auto topo = this->outTriangleSet()->getDataPtr();
35
36 topo->loadObjFile(filename.string());
37
38 topo->scale(this->varScale()->getData());
39 topo->translate(this->varLocation()->getData());
40 }
41
43}
#define DEFINE_CLASS(name)
Definition Object.h:140
#define IMPLEMENT_TCLASS(name, T1)
Definition Object.h:103
@ Error
Error information while executing something.
Definition Log.h:48
static void sendMessage(MessageType type, const std::string &text)
Add a new message to log.
Definition Log.cpp:41
Load a triangular mesh.
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:24
ArrayMap< T, DeviceType::GPU > DArrayMap
Definition ArrayMap.inl:80