PeriDyno 1.0.0
Loading...
Searching...
No Matches
PointSet.h
Go to the documentation of this file.
1
16#pragma once
17#include "TopologyConstants.h"
19
20namespace dyno
21{
27
28 template<typename TDataType>
29 class PointSet : public TopologyModule
30 {
31 DECLARE_TCLASS(PointSet, TDataType)
32 public:
33 typedef typename TDataType::Real Real;
34 typedef typename TDataType::Coord Coord;
35
36 PointSet();
37 ~PointSet() override;
38
40
41 void setPoints(const std::vector<Coord>& pos);
42 void setPoints(const DArray<Coord>& pos);
43 void setSize(int size);
44
45
46 int getPointSize() { return mCoords.size(); };
47
52
53 //Transform
54 void scale(const Real s);
55 void scale(const Coord s);
56 void translate(const Coord t);
57
58 virtual void rotate(const Coord angle);
59 virtual void rotate(const Quat<Real> q);
60
61 void loadObjFile(std::string filename);
62
63 virtual bool isEmpty();
64
65 virtual void clear();
66
71
72 protected:
74 };
75}
76
#define DECLARE_TCLASS(name, T1)
Definition Object.h:87
A PointSet stores the coordinates for a set of independent points.
Definition PointSet.h:8
virtual void clear()
Definition PointSet.cpp:24
virtual void rotate(const Quat< Real > q)
void requestBoundingBox(Coord &lo, Coord &hi)
Return the lower and upper bounds for all points.
~PointSet() override
Definition PointSet.cpp:10
DArray< Coord > & getPoints()
Return the array of points.
Definition PointSet.h:70
void scale(const Real s)
void scale(const Coord s)
void loadObjFile(std::string filename)
int getPointSize()
Definition PointSet.h:46
void setPoints(const std::vector< Coord > &pos)
DArray< Coord > mCoords
Definition PointSet.h:73
virtual void rotate(const Coord angle)
void translate(const Coord t)
void setPoints(const DArray< Coord > &pos)
TDataType::Real Real
Definition PointSet.h:33
TDataType::Coord Coord
Definition PointSet.h:34
virtual bool isEmpty()
void setSize(int size)
void copyFrom(PointSet< TDataType > &pointSet)
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:25
Array< T, DeviceType::GPU > DArray
Definition Array.inl:89