v2.0.0
Loading...
Searching...
No Matches
meshfactory.h
Go to the documentation of this file.
1//=============================================================================================================
26
27#ifndef MESHFACTORY_H
28#define MESHFACTORY_H
29
30//=============================================================================================================
31// INCLUDES
32//=============================================================================================================
33
34#include "../disp3D_global.h"
35
36#include <QVector3D>
37#include <QMatrix4x4>
38#include <QColor>
39#include <Eigen/Core>
40#include <memory>
41
42class BrainSurface;
43
44//=============================================================================================================
53{
54public:
55 MeshFactory() = delete; // Static-only class
56
57 //=========================================================================================================
67 static std::shared_ptr<BrainSurface> createSphere(const QVector3D &center,
68 float radius,
69 const QColor &color,
70 int subdivisions = 1);
71
72 //=========================================================================================================
82 static std::shared_ptr<BrainSurface> createPlate(const QVector3D &center,
83 const QMatrix4x4 &orientation,
84 const QColor &color,
85 float size);
86
87 //=========================================================================================================
98 static std::shared_ptr<BrainSurface> createBarbell(const QVector3D &center,
99 const QMatrix4x4 &orientation,
100 const QColor &color,
101 float size);
102
103 //=========================================================================================================
116 static std::shared_ptr<BrainSurface> createBatchedSpheres(const QVector<QVector3D> &positions,
117 float radius,
118 const QColor &color,
119 int subdivisions = 1);
120
121 //=========================================================================================================
132 static std::shared_ptr<BrainSurface> createCylinder(const QVector3D &from,
133 const QVector3D &to,
134 float radius,
135 const QColor &color,
136 int sides = 12);
137
138 //=========================================================================================================
145 static int sphereVertexCount(int subdivisions = 1);
146
147private:
148 //=========================================================================================================
156 static void buildIcosphere(QVector<Eigen::Vector3f> &vertices,
157 QVector<Eigen::Vector3i> &faces,
158 int subdivisions);
159};
160
161#endif // MESHFACTORY_H
Library export/import macros and namespace marker for the disp3D library.
#define DISP3DSHARED_EXPORT
MeshFactory()=delete
static std::shared_ptr< BrainSurface > createPlate(const QVector3D &center, const QMatrix4x4 &orientation, const QColor &color, float size)
static std::shared_ptr< BrainSurface > createBatchedSpheres(const QVector< QVector3D > &positions, float radius, const QColor &color, int subdivisions=1)
static std::shared_ptr< BrainSurface > createBarbell(const QVector3D &center, const QMatrix4x4 &orientation, const QColor &color, float size)
static int sphereVertexCount(int subdivisions=1)
static std::shared_ptr< BrainSurface > createCylinder(const QVector3D &from, const QVector3D &to, float radius, const QColor &color, int sides=12)
static std::shared_ptr< BrainSurface > createSphere(const QVector3D &center, float radius, const QColor &color, int subdivisions=1)
Renderable cortical surface mesh with per-vertex color, curvature data, and GPU buffer management.