PeriDyno 0.8.2
ObjPointLoader.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"
7
8namespace dyno
9{
10 template <typename TDataType> class TriangleSet;
18 template<typename TDataType>
19 class ObjPoint : public Node
20 {
21 DECLARE_TCLASS(ObjPoint, TDataType)
22 public:
23
24 typedef typename TDataType::Real Real;
25 typedef typename TDataType::Coord Coord;
26 typedef typename TDataType::Matrix Matrix;
27
28 typedef typename ::dyno::Quat<Real> TQuat;
29
31
32 //void update() override;
33
34 public:
35 DEF_VAR(Vec3f, Location, 0, "Node location");
36 DEF_VAR(Vec3f, Rotation, 0, "Node rotation");
37 DEF_VAR(Vec3f, Scale, Vec3f(1.0f), "Node scale");
38
39 DEF_VAR(FilePath, FileName, "", "");
40 //DEF_VAR(std::string, InputPath, "", "");
41 DEF_VAR(Real, Radius, 1, "Point Radius");
43
44 DEF_VAR(bool, Sequence, false, "Import Sequence");
45
46 DEF_VAR(Coord, Center, Coord(0), "");
47 DEF_VAR(Coord, Velocity, Coord(0), "");
48 DEF_VAR(Coord, AngularVelocity, Coord(0), "");
49 DEF_INSTANCE_STATE(TopologyModule, Topology, "Topology");
50 //DEF_INSTANCE_STATE(TriangleSet<TDataType>, TriangleSet, "");
51
52 protected:
53 void resetStates() override;
54 void updateStates() override;
55 void loadObj(PointSet<TDataType>& Pointset,std::string filename);
56 void convertData(TriangleSet<TDataType>& Triangleset, std::string filename,PointSet<TDataType>& PointSet);
57
58 private:
62
64
67 Real PI = 3.1415926535;
68 };
69}
#define DECLARE_TCLASS(name, T1)
Definition: Object.h:87
double Real
Definition: Typedef.inl:23
TDataType::Coord Coord
Quat< Real > rotQuat
DEF_VAR(Vec3f, Location, 0, "Node location")
DEF_VAR(Coord, AngularVelocity, Coord(0), "")
void updateStates() override
DEF_INSTANCE_STATE(TopologyModule, Topology, "Topology")
void convertData(TriangleSet< TDataType > &Triangleset, std::string filename, PointSet< TDataType > &PointSet)
void loadObj(PointSet< TDataType > &Pointset, std::string filename)
DEF_VAR(bool, Sequence, false, "Import Sequence")
GLPointVisualModule * pointrender
::dyno::Quat< Real > TQuat
DEF_VAR(Vec3f, Rotation, 0, "Node rotation")
void resetStates() override
TDataType::Real Real
DEF_VAR(Coord, Velocity, Coord(0), "")
DArray< Coord > initPos
DEF_VAR(Coord, Center, Coord(0), "")
TDataType::Matrix Matrix
DEF_INSTANCE_OUT(PointSet< TDataType >, PointSet, "")
DEF_VAR(Vec3f, Scale, Vec3f(1.0f), "Node scale")
DEF_VAR(FilePath, FileName, "", "")
DEF_VAR(Real, Radius, 1, "Point Radius")
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