Buran Motion Planning Framework
stl_shape.h
1 #pragma once
2 
3 
4 #include <GL/glut.h>
5 #include <vector>
6 #include <memory>
7 #include <fstream>
8 #include "MT_Point3.h"
9 #include "SOLID.h"
10 
11 namespace bmpf {
12 
16  class StlShape {
17  public:
22  static std::shared_ptr<StlShape> fromStlFile(const std::string &path);
23 
31  static std::vector<float> readStl(const std::string &path);
32 
37  explicit StlShape(std::vector<float> points);
38 
42  ~StlShape();
43 
47  void paintGL() const;
48 
53  std::vector<float> &getPointList() { return _pointsList; }
54 
59  DT_ShapeHandle getDTShape() const { return _dtShape; }
60 
65  unsigned int getPolygonCnt() const { return _polygonCnt; }
66 
67  private:
73  static std::vector<float> getCoords(char *data);
74 
78  DT_ShapeHandle _dtShape{};
82  MT_Point3 *_points;
86  unsigned int _polygonCnt;
90  DT_VertexBaseHandle _base;
95  std::vector<float> _pointsList;
96  };
97 }
bmpf::StlShape::paintGL
void paintGL() const
Definition: stl_shape.cpp:134
bmpf::StlShape::getPointList
std::vector< float > & getPointList()
Definition: stl_shape.h:53
bmpf::StlShape::readStl
static std::vector< float > readStl(const std::string &path)
Definition: stl_shape.cpp:45
bmpf::StlShape::getPolygonCnt
unsigned int getPolygonCnt() const
Definition: stl_shape.h:65
bmpf::StlShape::StlShape
StlShape(std::vector< float > points)
Definition: stl_shape.cpp:9
bmpf::StlShape
Definition: stl_shape.h:16
bmpf::StlShape::fromStlFile
static std::shared_ptr< StlShape > fromStlFile(const std::string &path)
Definition: stl_shape.cpp:117
bmpf::StlShape::getDTShape
DT_ShapeHandle getDTShape() const
Definition: stl_shape.h:59
bmpf::StlShape::~StlShape
~StlShape()
Definition: stl_shape.cpp:125