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
42namespace DISP3DLIB
43{
44
45class BrainSurface;
46
47//=============================================================================================================
56{
57public:
58 MeshFactory() = delete; // Static-only class
59
60 //=========================================================================================================
70 static std::shared_ptr<BrainSurface> createSphere(const QVector3D& center,
71 float radius,
72 const QColor& color,
73 int subdivisions = 1);
74
75 //=========================================================================================================
85 static std::shared_ptr<BrainSurface> createPlate(const QVector3D& center,
86 const QMatrix4x4& orientation,
87 const QColor& color,
88 float size);
89
90 //=========================================================================================================
101 static std::shared_ptr<BrainSurface> createBarbell(const QVector3D& center,
102 const QMatrix4x4& orientation,
103 const QColor& color,
104 float size);
105
106 //=========================================================================================================
119 static std::shared_ptr<BrainSurface> createBatchedSpheres(const QVector<QVector3D>& positions,
120 float radius,
121 const QColor& color,
122 int subdivisions = 1);
123
124 //=========================================================================================================
135 static std::shared_ptr<BrainSurface> createCylinder(const QVector3D& from,
136 const QVector3D& to,
137 float radius,
138 const QColor& color,
139 int sides = 12);
140
141 //=========================================================================================================
148 static int sphereVertexCount(int subdivisions = 1);
149
150private:
151 //=========================================================================================================
159 static void buildIcosphere(QVector<Eigen::Vector3f>& vertices,
160 QVector<Eigen::Vector3i>& faces,
161 int subdivisions);
162};
163
164} // namespace DISP3DLIB
165
166#endif // MESHFACTORY_H
Library export/import macros and namespace marker for the disp3D library.
#define DISP3DSHARED_EXPORT
3-D brain visualisation using the Qt RHI rendering backend.
static std::shared_ptr< BrainSurface > createBarbell(const QVector3D &center, const QMatrix4x4 &orientation, const QColor &color, float size)
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 > createBatchedSpheres(const QVector< QVector3D > &positions, float radius, const QColor &color, int subdivisions=1)
static std::shared_ptr< BrainSurface > createSphere(const QVector3D &center, float radius, const QColor &color, int subdivisions=1)
static int sphereVertexCount(int subdivisions=1)
static std::shared_ptr< BrainSurface > createPlate(const QVector3D &center, const QMatrix4x4 &orientation, const QColor &color, float size)
Renderable cortical surface mesh with per-vertex color, curvature data, and GPU buffer management.