Welcome to mirror list, hosted at ThFree Co, Russian Federation.

ntl_geometryshader.h « intern « elbeem « intern - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 61598556b7e57bd16d81ab62c5fefad7449dd7dc (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
/** \file elbeem/intern/ntl_geometryshader.h
 *  \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"
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 ouput 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; 
};

#endif