GteFluid3EnforceStateBoundary.h
Go to the documentation of this file.
1 // David Eberly, Geometric Tools, Redmond WA 98052
2 // Copyright (c) 1998-2017
3 // Distributed under the Boost Software License, Version 1.0.
4 // http://www.boost.org/LICENSE_1_0.txt
5 // http://www.geometrictools.com/License/Boost/LICENSE_1_0.txt
6 // File Version: 3.0.0 (2016/06/19)
7 
8 #pragma once
9 
12 #include <Graphics/GteTexture3.h>
13 
14 namespace gte
15 {
16 
17 class GraphicsEngine;
18 
20 {
21 public:
22  // Construction. Clamp the velocity vectors at the image boundary to
23  // ensure they do not point outside the domain. For example, let
24  // image(x,y,z) have velocity (vx,vy,vz). At the boundary pixel
25  // (x,y,0), the velocity is clamped to (vx,vy,0). The density is
26  // set to zero on the image boundary.
27  Fluid3EnforceStateBoundary(std::shared_ptr<ProgramFactory> const& factory,
28  int xSize, int ySize, int zSize, int numXThreads, int numYThreads, int numZThreads);
29 
30  // Set the density and velocity values at the image boundary as described
31  // in the comments for the constructor. The state texture has texels
32  // (velocity.x, velocity.y, velocity.z, density).
33  void Execute(std::shared_ptr<GraphicsEngine> const& engine,
34  std::shared_ptr<Texture3> const& state);
35 
36 private:
37  int mNumXGroups, mNumYGroups, mNumZGroups;
38  std::shared_ptr<ComputeProgram> mCopyXFace;
39  std::shared_ptr<ComputeProgram> mWriteXFace;
40  std::shared_ptr<ComputeProgram> mCopyYFace;
41  std::shared_ptr<ComputeProgram> mWriteYFace;
42  std::shared_ptr<ComputeProgram> mCopyZFace;
43  std::shared_ptr<ComputeProgram> mWriteZFace;
44  std::shared_ptr<Texture2> mXMin;
45  std::shared_ptr<Texture2> mXMax;
46  std::shared_ptr<Texture2> mYMin;
47  std::shared_ptr<Texture2> mYMax;
48  std::shared_ptr<Texture2> mZMin;
49  std::shared_ptr<Texture2> mZMax;
50 
51  // Shader source code as strings.
52  static std::string const msGLSLSource;
53  static std::string const msHLSLSource;
54  static std::string const* msSource[ProgramFactory::PF_NUM_API];
55 };
56 
57 }
std::shared_ptr< ComputeProgram > mCopyXFace
std::shared_ptr< ComputeProgram > mCopyZFace
std::shared_ptr< ComputeProgram > mWriteXFace
GLsizei const GLchar *const * string
Definition: glcorearb.h:809
std::shared_ptr< ComputeProgram > mWriteZFace
std::shared_ptr< ComputeProgram > mCopyYFace
std::shared_ptr< ComputeProgram > mWriteYFace
#define GTE_IMPEXP
Definition: GTEngineDEF.h:63


geometric_tools_engine
Author(s): Yijiang Huang
autogenerated on Thu Jul 18 2019 03:59:59