PeriDyno 0.8.2
ObjLoader.h
Go to the documentation of this file.
1#pragma once
2#include "Node.h"
3#include "Topology/TriangleSet.h"
4#include "Field.h"
5#include "FilePath.h"
6#include "GLWireframeVisualModule.h"
7#include "GLSurfaceVisualModule.h"
9
10
11namespace dyno
12{
13 template <typename TDataType> class TriangleSet;
21 template<typename TDataType>
22 class ObjMesh : public Node
23 {
24 DECLARE_TCLASS(ObjMesh, TDataType)
25 public:
26
27 typedef typename TDataType::Real Real;
28 typedef typename TDataType::Coord Coord;
29 typedef typename TDataType::Matrix Matrix;
30
31 typedef typename ::dyno::Quat<Real> TQuat;
32
34
35 //void update() override;
36
37 public:
38 DEF_VAR(Vec3f, Location, 0, "Node location");
39 DEF_VAR(Vec3f, Rotation, 0, "Node rotation");
40 DEF_VAR(Vec3f, Scale, Vec3f(1.0f), "Node scale");
41
42 DEF_VAR(FilePath, FileName, "", "");
43 //DEF_VAR(std::string, InputPath, "", "");
44
46
47 DEF_VAR(bool, Sequence, false, "Import Sequence");
48 DEF_VAR(Coord, Velocity, Coord(0), "");
49 DEF_VAR(Coord, Center, Coord(0), "");
50 DEF_VAR(Coord, AngularVelocity, Coord(0), "");
51
52 DEF_INSTANCE_STATE(TopologyModule, Topology, "Topology");
53 //DEF_INSTANCE_STATE(TriangleSet<TDataType>, TriangleSet, "");
54 std::shared_ptr <GLSurfaceVisualModule> surfacerender;
55
56 protected:
57 void resetStates() override;
58 void updateStates() override;
59 void loadObj(TriangleSet<TDataType>& Triangleset,std::string filename);
60
61 private:
62
65
67
70 Real PI = 3.1415926535;
71 };
72}
#define DECLARE_TCLASS(name, T1)
Definition: Object.h:87
double Real
Definition: Typedef.inl:23
TDataType::Coord Coord
Definition: ObjLoader.h:28
DEF_VAR(Vec3f, Scale, Vec3f(1.0f), "Node scale")
TDataType::Real Real
Definition: ObjLoader.h:27
DEF_VAR(Coord, Velocity, Coord(0), "")
Coord centerInit
Definition: ObjLoader.h:69
DEF_VAR(Coord, Center, Coord(0), "")
void loadObj(TriangleSet< TDataType > &Triangleset, std::string filename)
DArray< Coord > initPos
Definition: ObjLoader.h:66
DEF_INSTANCE_OUT(TriangleSet< TDataType >, TriangleSet, "")
DEF_INSTANCE_STATE(TopologyModule, Topology, "Topology")
Coord center
Definition: ObjLoader.h:68
void resetStates() override
std::shared_ptr< GLSurfaceVisualModule > surfacerender
Definition: ObjLoader.h:54
DEF_VAR(Coord, AngularVelocity, Coord(0), "")
DEF_VAR(Vec3f, Location, 0, "Node location")
::dyno::Quat< Real > TQuat
Definition: ObjLoader.h:31
DEF_VAR(bool, Sequence, false, "Import Sequence")
TDataType::Matrix Matrix
Definition: ObjLoader.h:29
Matrix rotMat
Definition: ObjLoader.h:64
Quat< Real > rotQuat
Definition: ObjLoader.h:63
void updateStates() override
DEF_VAR(Vec3f, Rotation, 0, "Node rotation")
DEF_VAR(FilePath, FileName, "", "")
This is an implementation of AdditiveCCD based on peridyno.
Definition: Array.h:24
Vector< float, 3 > Vec3f
Definition: Vector3D.h:93
fs::path FilePath
Definition: FilePath.h:6