Overte C++ Documentation
SortTask.h
1 //
2 // SortTask.h
3 // render/src/render
4 //
5 // Created by Zach Pomerantz on 2/26/2016.
6 // Copyright 2016 High Fidelity, Inc.
7 //
8 // Distributed under the Apache License, Version 2.0.
9 // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
10 //
11 
12 #ifndef hifi_render_SortTask_h
13 #define hifi_render_SortTask_h
14 
15 #include "Engine.h"
16 
17 namespace render {
18  void depthSortItems(const RenderContextPointer& renderContext, bool frontToBack, const ItemBounds& inItems, ItemBounds& outItems, AABox* bounds = nullptr);
19 
20  class PipelineSortShapes {
21  public:
22  using JobModel = Job::ModelIO<PipelineSortShapes, ItemBounds, ShapeBounds>;
23  void run(const RenderContextPointer& renderContext, const ItemBounds& inItems, ShapeBounds& outShapes);
24  };
25 
26  class DepthSortShapes {
27  public:
28  using JobModel = Job::ModelIO<DepthSortShapes, ShapeBounds, ShapeBounds>;
29 
30  bool _frontToBack;
31  DepthSortShapes(bool frontToBack = true) : _frontToBack(frontToBack) {}
32 
33  void run(const RenderContextPointer& renderContext, const ShapeBounds& inShapes, ShapeBounds& outShapes);
34  };
35 
36  class DepthSortShapesAndComputeBounds {
37  public:
38  using Outputs = VaryingSet2<ShapeBounds, AABox>;
39  using JobModel = Job::ModelIO<DepthSortShapesAndComputeBounds, ShapeBounds, Outputs>;
40 
41  bool _frontToBack;
42  DepthSortShapesAndComputeBounds(bool frontToBack = true) : _frontToBack(frontToBack) {}
43 
44  void run(const RenderContextPointer& renderContext, const ShapeBounds& inShapes, Outputs& outputs);
45  };
46 
47  class DepthSortItems {
48  public:
49  using JobModel = Job::ModelIO<DepthSortItems, ItemBounds, ItemBounds>;
50 
51  bool _frontToBack;
52  DepthSortItems(bool frontToBack = true) : _frontToBack(frontToBack) {}
53 
54  void run(const RenderContextPointer& renderContext, const ItemBounds& inItems, ItemBounds& outItems);
55  };
56 }
57 
58 #endif // hifi_render_SortTask_h;