Static factory for procedural mesh primitives.
More...
#include <meshfactory.h>
|
| static std::shared_ptr< BrainSurface > | createSphere (const QVector3D ¢er, float radius, const QColor &color, int subdivisions=1) |
| static std::shared_ptr< BrainSurface > | createPlate (const QVector3D ¢er, const QMatrix4x4 &orientation, const QColor &color, float size) |
| static std::shared_ptr< BrainSurface > | createBarbell (const QVector3D ¢er, 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 int | sphereVertexCount (int subdivisions=1) |
Static factory for procedural mesh primitives.
All methods return fully constructed BrainSurface objects ready for rendering. This eliminates duplicated icosahedron / plate / barbell code that was spread across BrainView::onRowsInserted.
Definition at line 61 of file meshfactory.h.
◆ MeshFactory()
| MeshFactory::MeshFactory |
( |
| ) |
|
|
delete |
◆ createBarbell()
| std::shared_ptr< BrainSurface > MeshFactory::createBarbell |
( |
const QVector3D & | center, |
|
|
const QMatrix4x4 & | orientation, |
|
|
const QColor & | color, |
|
|
float | size ) |
|
static |
Create a barbell shape (two spheres connected by a thin rod), used for MEG gradiometers.
- Parameters
-
| [in] | center | World-space center. |
| [in] | orientation | 3×3 rotation embedded in a 4×4 matrix (coil_trans). |
| [in] | color | Surface color. |
| [in] | size | Overall size scale in meters. |
- Returns
- Shared pointer to the created BrainSurface.
Definition at line 222 of file meshfactory.cpp.
◆ createBatchedSpheres()
| std::shared_ptr< BrainSurface > MeshFactory::createBatchedSpheres |
( |
const QVector< QVector3D > & | positions, |
|
|
float | radius, |
|
|
const QColor & | color, |
|
|
int | subdivisions = 1 ) |
|
static |
Create a batched mesh of identical spheres at multiple positions (used for source space points, digitizer points, etc.).
All spheres are merged into a single BrainSurface for efficient rendering.
- Parameters
-
| [in] | positions | World-space positions for each sphere. |
| [in] | radius | Sphere radius in meters. |
| [in] | color | Sphere color. |
| [in] | subdivisions | Number of subdivision passes per sphere. |
- Returns
- Shared pointer to the batched BrainSurface.
Definition at line 314 of file meshfactory.cpp.
◆ createPlate()
| std::shared_ptr< BrainSurface > MeshFactory::createPlate |
( |
const QVector3D & | center, |
|
|
const QMatrix4x4 & | orientation, |
|
|
const QColor & | color, |
|
|
float | size ) |
|
static |
Create a thin oriented rectangular plate (used for MEG magnetometers).
- Parameters
-
| [in] | center | World-space center. |
| [in] | orientation | 3×3 rotation embedded in a 4×4 matrix (coil_trans). |
| [in] | color | Surface color. |
| [in] | size | Side length in meters (plate is size × size × thin). |
- Returns
- Shared pointer to the created BrainSurface.
Definition at line 171 of file meshfactory.cpp.
◆ createSphere()
| std::shared_ptr< BrainSurface > MeshFactory::createSphere |
( |
const QVector3D & | center, |
|
|
float | radius, |
|
|
const QColor & | color, |
|
|
int | subdivisions = 1 ) |
|
static |
Create a subdivided icosahedron sphere.
- Parameters
-
| [in] | center | World-space center of the sphere. |
| [in] | radius | Radius in meters. |
| [in] | color | Surface color. |
| [in] | subdivisions | Number of subdivision passes (0 = 20 tris, 1 = 80 tris). |
- Returns
- Shared pointer to the created BrainSurface.
Definition at line 138 of file meshfactory.cpp.
◆ sphereVertexCount()
| int MeshFactory::sphereVertexCount |
( |
int | subdivisions = 1 | ) |
|
|
static |
Number of vertices in a subdivided icosahedron (for picking calculations).
- Parameters
-
| [in] | subdivisions | Number of subdivision passes. |
- Returns
- Number of vertices.
Definition at line 128 of file meshfactory.cpp.
The documentation for this class was generated from the following files: