blob: ddba35936e6116f18d35b1611307b0dc7ee4f158 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
/** \file \ingroup elbeem
*/
/******************************************************************************
*
* El'Beem - Free Surface Fluid Simulation with the Lattice Boltzmann Method
* Copyright 2003-2006 Nils Thuerey
*
* Interface for a geometry shader
*
*****************************************************************************/
#ifndef NTL_GEOMETRYSHADER_H
#define NTL_GEOMETRYSHADER_H
#include "ntl_geometryclass.h"
#ifdef WITH_CXX_GUARDEDALLOC
# include "MEM_guardedalloc.h"
#endif
class ntlGeometryObject;
class ntlRenderGlobals;
class ntlGeometryShader :
public ntlGeometryClass
{
public:
//! Default constructor
inline ntlGeometryShader() :
ntlGeometryClass(), mOutFilename("")
{};
//! Default destructor
virtual ~ntlGeometryShader() {};
//! Return type id
virtual int getTypeId() { return GEOCLASSTID_SHADER; }
/*! Initialize object, should return !=0 upon error */
virtual int initializeShader() = 0;
/*! Do further object initialization after all geometry has been constructed, should return !=0 upon error */
virtual int postGeoConstrInit(ntlRenderGlobals *glob) { glob=NULL; /*unused*/ return 0; };
/*! Get start iterator for all objects */
virtual vector<ntlGeometryObject *>::iterator getObjectsBegin() { return mObjects.begin(); }
/*! Get end iterator for all objects */
virtual vector<ntlGeometryObject *>::iterator getObjectsEnd() { return mObjects.end(); }
/*! notify object that dump is in progress (e.g. for field dump) */
virtual void notifyShaderOfDump(int dumptype, int frameNr,char *frameNrStr,string outfilename) = 0;
/*! get output filename, returns global render outfile if empty */
string getOutFilename( void ) { return mOutFilename; }
protected:
//! vector for the objects
vector<ntlGeometryObject *> mObjects;
/*! surface output name for this simulation */
string mOutFilename;
private:
#ifdef WITH_CXX_GUARDEDALLOC
MEM_CXX_CLASS_ALLOC_FUNCS("ELBEEM:ntlGeometryShader")
#endif
};
#endif
|