1 | #pragma once
|
---|
2 | #include "SharedRuns.h"
|
---|
3 | #include "RenderTechnique.h"
|
---|
4 |
|
---|
5 | /**
|
---|
6 | @brief Base abstract class __declspec( dllexport ) for a collection of techniques.
|
---|
7 |
|
---|
8 | This is a helper class __declspec( dllexport ), to collect RenderTechnique instances bound to a single renderable.
|
---|
9 | It's main task is to recieve and forward messages to each RenderTechnique.
|
---|
10 | */
|
---|
11 | class __declspec( dllexport ) TechniqueGroup
|
---|
12 | {
|
---|
13 | public:
|
---|
14 | /**
|
---|
15 | @brief Constructor.
|
---|
16 | */
|
---|
17 | TechniqueGroup(void);
|
---|
18 |
|
---|
19 |
|
---|
20 | /**
|
---|
21 | @brief Adds an empty SharedRuns parent.
|
---|
22 |
|
---|
23 | Used after creating a new TechniqueGroup.
|
---|
24 |
|
---|
25 | @param sharedRuns pointer to the SharedRun instance this RenderTechniques will use.
|
---|
26 | */
|
---|
27 | void addSharedRun(SharedRuns* sharedRuns){parentSharedRuns = sharedRuns;
|
---|
28 | parentSharedRuns->addTechniqueGroup(this);}
|
---|
29 | /**
|
---|
30 | @brief Retrieves the shared runs.
|
---|
31 |
|
---|
32 | @result pointer to the SharedRun instance this RenderTechniques uses.
|
---|
33 | */
|
---|
34 | SharedRuns* getSharedRuns(){return parentSharedRuns;}
|
---|
35 | /**
|
---|
36 | @brief Adds a rendertechnique to the group.
|
---|
37 |
|
---|
38 | @param technique the RenderTechnique instance to add.
|
---|
39 | */
|
---|
40 | virtual void addRenderTechnique(RenderTechnique* technique)=0;
|
---|
41 | /**
|
---|
42 | @brief Updates all rendertechniques
|
---|
43 |
|
---|
44 | @param framenum current framenumber
|
---|
45 | */
|
---|
46 | virtual void update(unsigned long frameNum) = 0;
|
---|
47 | /**
|
---|
48 | @brief Called after one of the rendering runs changes.
|
---|
49 |
|
---|
50 | This message will be forwarded to each RenderTechique.
|
---|
51 |
|
---|
52 | @param runType enum describing the type of the changed run
|
---|
53 | @param run pointer to the changed RenderingRun
|
---|
54 | */
|
---|
55 | virtual void runChanged(RenderingRunType runType, RenderingRun* run) = 0;
|
---|
56 | /**
|
---|
57 | @brief Called after one of the rendering runs updates.
|
---|
58 |
|
---|
59 | This message will be forwarded to each RenderTechique.
|
---|
60 |
|
---|
61 | @param runType enum describing the type of the updated run
|
---|
62 | @param run pointer to the updated RenderingRun
|
---|
63 | */
|
---|
64 | virtual void runUpdated(RenderingRunType runType, RenderingRun* run) = 0;
|
---|
65 |
|
---|
66 | /**
|
---|
67 | @brief Updates the connected SharedRuns boundary.
|
---|
68 | */
|
---|
69 | virtual void updateBounds()
|
---|
70 | {
|
---|
71 | parentSharedRuns->updateBounds();
|
---|
72 | }
|
---|
73 | /**
|
---|
74 | @brief Validates the connected SharedRuns instance.
|
---|
75 | */
|
---|
76 | virtual void validateSharedRuns()
|
---|
77 | {
|
---|
78 | parentSharedRuns->validate();
|
---|
79 | }
|
---|
80 |
|
---|
81 | protected:
|
---|
82 |
|
---|
83 | /**
|
---|
84 | @brief Pointer to the connected SharedRuns instance each technique uses.
|
---|
85 | */
|
---|
86 | SharedRuns* parentSharedRuns;
|
---|
87 | };
|
---|