UnityMol  0.9.6-875
UnityMol viewer / In developement
GenerateMesh Class Reference

Public Member Functions

void GM (Vector3[] Mvertices, int[] Mtriangles, Vector3 center, int surfaceNb, Color[] Colors)
 

Static Public Member Functions

static void CreateSurfaceObjects (float[,,] voxels, float threshold, Vector3 delta, Vector3 origin, Color[] colors, int isPos, bool electro=false)
 

Static Private Member Functions

static void ProperlyCalculateNormals (MeshData mData)
 
static Mesh GenerateTextureCoordinates (Mesh mesh)
 
static Mesh CalculateMeshTangents (Mesh mesh)
 
static void FlipTriangles (MeshData mData)
 
static void FlipNormals (MeshData mData)
 
static void OffsetVertices (MeshData mData)
 
static void CreateSurfaceObjects (List< Mesh > meshes, int isPos)
 
static void SetDims ()
 
static void DebugDims ()
 
static void InitGenMesh (float[,,] vox, float thresh, Vector3 d, Vector3 o)
 

Static Private Attributes

static Vector3 CENTER = new Vector3(0f,0f,0f)
 
static float[,,] VOXELS
 
static Vector3 DELTA
 
static Vector3 ORIGIN
 
static Vector3 OFFSET_ORIGIN
 
static Transform DADDY
 
static string TAG
 
static int XDIM
 
static int YDIM
 
static int ZDIM
 
static int SLICE_WIDTH = 80
 
static float S_FUDGE_FACTOR = 18f
 
static Vector3 FUDGE_FACTOR = new Vector3(S_FUDGE_FACTOR, S_FUDGE_FACTOR, S_FUDGE_FACTOR)
 
static bool ELECTRO = false
 

Detailed Description

Definition at line 72 of file GenerateMesh.cs.

Member Function Documentation

static Mesh GenerateMesh.CalculateMeshTangents ( Mesh  mesh)
staticprivate

Definition at line 159 of file GenerateMesh.cs.

static void GenerateMesh.CreateSurfaceObjects ( List< Mesh >  meshes,
int  isPos 
)
staticprivate

Definition at line 299 of file GenerateMesh.cs.

References SurfaceManager.addSurface(), SurfaceManager.addSurfaceNeg(), SurfaceManager.addSurfacePos(), CENTER, DADDY, and UnityMolMain.getSurfaceManager().

Referenced by CreateSurfaceObjects(), ReadDX.isoSurface(), and PDBtoDEN.ProSurface().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void GenerateMesh.CreateSurfaceObjects ( float  voxels[,,],
float  threshold,
Vector3  delta,
Vector3  origin,
Color[]  colors,
int  isPos,
bool  electro = false 
)
static

Creates the surface objects.

Parameters
voxelsVoxels, i.e. the scalar field used to compute the surface.
thresholdThe threshold on which the isosurface is based.
deltaDelta parameter from the grid, basically the size of each cell.
originOrigin of the grid.
colorsColors. Kept from previous implementation, but doesn't do anything here. I'm only keeping it because I'm not sure what it was used for. — Alexandre
tagTag for the objects to be created.
electroTrue if this is an electrostatic field isosurface.

Definition at line 382 of file GenerateMesh.cs.

References AdjacencySets.AddAllTriangles(), SmoothFilter.AdjSetsSmoother(), MarchingCubes.CreateMesh(), CreateSurfaceObjects(), FlipTriangles(), ReadDX.GetDelta(), ReadDX.GetOrigin(), InitGenMesh(), OffsetVertices(), ProperlyCalculateNormals(), ElectrostaticManager.readdx, SetDims(), Splitting.Split(), MeshData.triangles, and MeshData.vertices.

+ Here is the call graph for this function:

static void GenerateMesh.DebugDims ( )
staticprivate

Definition at line 337 of file GenerateMesh.cs.

static void GenerateMesh.FlipNormals ( MeshData  mData)
staticprivate

Definition at line 244 of file GenerateMesh.cs.

References MeshData.normals.

static void GenerateMesh.FlipTriangles ( MeshData  mData)
staticprivate

Definition at line 232 of file GenerateMesh.cs.

References MeshData.triangles.

Referenced by CreateSurfaceObjects().

+ Here is the caller graph for this function:

static Mesh GenerateMesh.GenerateTextureCoordinates ( Mesh  mesh)
staticprivate

Definition at line 147 of file GenerateMesh.cs.

void GenerateMesh.GM ( Vector3[]  Mvertices,
int[]  Mtriangles,
Vector3  center,
int  surfaceNb,
Color[]  Colors 
)
static void GenerateMesh.InitGenMesh ( float  vox[,,],
float  thresh,
Vector3  d,
Vector3  o 
)
staticprivate

Definition at line 345 of file GenerateMesh.cs.

References SurfaceManager.getParentGameObject(), UnityMolMain.getSurfaceManager(), ORIGIN, MarchingCubes.SetModeToCubes(), and MarchingCubes.SetTarget().

Referenced by CreateSurfaceObjects().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void GenerateMesh.OffsetVertices ( MeshData  mData)
staticprivate

Definition at line 253 of file GenerateMesh.cs.

References OFFSET_ORIGIN, and MeshData.vertices.

Referenced by CreateSurfaceObjects().

+ Here is the caller graph for this function:

static void GenerateMesh.ProperlyCalculateNormals ( MeshData  mData)
staticprivate

This computes the normal vectors from a MeshData object, and adds them to it.

This is necessary because Unity3D can only do it for real Mesh objects, but this creates artifacts at the edges when said meshes are created by splitting a surface.

Parameters
mDataThe MeshData object to which normals will be added.

Definition at line 96 of file GenerateMesh.cs.

References MeshData.normals, MeshData.triangles, and MeshData.vertices.

Referenced by CreateSurfaceObjects().

+ Here is the caller graph for this function:

static void GenerateMesh.SetDims ( )
staticprivate

Definition at line 331 of file GenerateMesh.cs.

Referenced by CreateSurfaceObjects().

+ Here is the caller graph for this function:

Member Data Documentation

Vector3 GenerateMesh.CENTER = new Vector3(0f,0f,0f)
staticprivate

Definition at line 74 of file GenerateMesh.cs.

Referenced by CreateSurfaceObjects().

Transform GenerateMesh.DADDY
staticprivate

Definition at line 79 of file GenerateMesh.cs.

Referenced by CreateSurfaceObjects().

Vector3 GenerateMesh.DELTA
staticprivate

Definition at line 76 of file GenerateMesh.cs.

bool GenerateMesh.ELECTRO = false
staticprivate

Definition at line 85 of file GenerateMesh.cs.

Vector3 GenerateMesh.FUDGE_FACTOR = new Vector3(S_FUDGE_FACTOR, S_FUDGE_FACTOR, S_FUDGE_FACTOR)
staticprivate

Definition at line 84 of file GenerateMesh.cs.

Vector3 GenerateMesh.OFFSET_ORIGIN
staticprivate

Definition at line 78 of file GenerateMesh.cs.

Referenced by OffsetVertices().

Vector3 GenerateMesh.ORIGIN
staticprivate

Definition at line 77 of file GenerateMesh.cs.

Referenced by InitGenMesh().

float GenerateMesh.S_FUDGE_FACTOR = 18f
staticprivate

Definition at line 83 of file GenerateMesh.cs.

int GenerateMesh.SLICE_WIDTH = 80
staticprivate

Definition at line 82 of file GenerateMesh.cs.

string GenerateMesh.TAG
staticprivate

Definition at line 80 of file GenerateMesh.cs.

float [,,] GenerateMesh.VOXELS
staticprivate

Definition at line 75 of file GenerateMesh.cs.

int GenerateMesh.XDIM
staticprivate

Definition at line 81 of file GenerateMesh.cs.

int GenerateMesh.YDIM
staticprivate

Definition at line 81 of file GenerateMesh.cs.

int GenerateMesh.ZDIM
staticprivate

Definition at line 81 of file GenerateMesh.cs.


The documentation for this class was generated from the following file: