My Project: openb3dlib.mod/openb3d/src/isosurface.h Source File

My Project

isosurface.h
Go to the documentation of this file.
1 #ifndef METABALL_H
2 #define METABALL_H
3
4 #include "mesh.h"
5
6 #include <iostream>
7 using namespace std;
8
9 class Blob;
10 class FieldArray;
11
12 class Fluid : public Mesh{
13 friend class VoxelTerrain;
14
15 private:
16 int* buffercenter;
17 float ***xzbuffer;
18 float ***xybuffer;
19 float ***yzbuffer;
20
21 void ResetBuffers();
22
23 void MarchingCube(float x, float y, float z, float x1, float y1, float z1, float F[8]);
24
25 float MiddlePoint (float A, float B, float C, float D);
26
27 void BuildCubeGrid (float x, float y, float z, float l,
28 float f1, float f2, float f3, float f4, float f5, float f6, float f7, float f8);
29
30 float (*ScalarField)(float x, float y, float z);
31 public:
32 list<Blob*> metaball_list;
33
34 int render_mode;
35
36 FieldArray* fieldarray;
37
38 void FluidFunction(float (*FieldFunction)(float, float, float));
39 void FluidArray(float* Array, int w, int h, int d);
40
41 float threshold;
42
43 int* cells;
44
45 static Fluid* CreateFluid();
46
47 void FreeEntity(void);
48
49 void Render();
50
51 };
52
53
54 class Blob : public Entity{
55
56 public:
57
58 float charge;
59 Fluid* fluid;
60
61 Blob(){};
62
63 Blob* CopyEntity(Entity* parent_ent=NULL);
64 void FreeEntity(void);
65
66 static Blob* CreateBlob(Fluid* fluid, float radius, Entity* parent_ent=NULL);
67 void Update(){}
68
69 };
70
71 class FieldArray : public Entity{
72
73 public:
74
75 float* data;
76
77 int width, height, depth;
78
79 FieldArray(){};
80
81 FieldArray* CopyEntity(Entity* parent_ent=NULL);
82 void FreeEntity(void);
83
84 void Update(){}
85
86 };
87
88 #endif
FieldArray
Definition: isosurface.h:71
FieldArray::Update
void Update()
Definition: isosurface.h:84
Mesh
Definition: mesh.h:34
Blob::Blob
Blob()
Definition: isosurface.h:61
FluidFunction
void FluidFunction(Fluid *fluid, float(*FieldFunction)(float, float, float))
Definition: functions.cpp:860
Entity::Render
virtual void Render()
Definition: entity.h:278
Fluid::fieldarray
FieldArray * fieldarray
Definition: isosurface.h:36
B
#define B(row, col)
CopyEntity
Entity * CopyEntity(Entity *ent, Entity *parent)
Definition: functions.cpp:421
mesh.h
std
FluidArray
void FluidArray(Fluid *fluid, float *Array, int w, int h, int d)
Definition: functions.cpp:856
Blob::fluid
Fluid * fluid
Definition: isosurface.h:59
FreeEntity
void FreeEntity(Entity *ent)
Definition: functions.cpp:882
FieldArray::FieldArray
FieldArray()
Definition: isosurface.h:79
Fluid
Definition: isosurface.h:12
Fluid::metaball_list
list< Blob * > metaball_list
Definition: isosurface.h:32
VoxelTerrain
Definition: voxterrain.h:7
CreateFluid
Fluid * CreateFluid()
Definition: functions.cpp:1955
Blob::Update
void Update()
Definition: isosurface.h:67
Entity
Definition: entity.h:27
CreateBlob
Blob * CreateBlob(Fluid *fluid, float radius, Entity *parent_ent)
Definition: functions.cpp:453
Blob::charge
float charge
Definition: isosurface.h:58
Fluid::render_mode
int render_mode
Definition: isosurface.h:34
FieldArray::width
int width
Definition: isosurface.h:77
Fluid::cells
int * cells
Definition: isosurface.h:43
Fluid::threshold
float threshold
Definition: isosurface.h:41
Blob
Definition: isosurface.h:54
FieldArray::data
float * data
Definition: isosurface.h:75
A
#define A(row, col)
NULL
#define NULL
Definition: tree.cpp:4