Open Inventor Release 2024.1.1
 
Loading...
Searching...
No Matches
SoDistributeAction.h
1/*=======================================================================
2 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
3 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
4 *** ***
5 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
6 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
7 *** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
8 *** ***
9 *** RESTRICTED RIGHTS LEGEND ***
10 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
11 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
12 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
13 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
14 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
15 *** ***
16 *** COPYRIGHT (C) 1996-2014 BY FEI S.A.S, ***
17 *** BORDEAUX, FRANCE ***
18 *** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20/*=======================================================================
21** Author : Ludovic PEINE (Jun 2007)
22**=======================================================================*/
23
24
25#ifndef SO_DISTRIBUTE_ACTION
26#define SO_DISTRIBUTE_ACTION
27
28#include <Inventor/actions/SoSubAction.h>
29
64{
65 SO_ACTION_HEADER(SoDistributeAction);
66
67public:
76
81
85#ifndef HIDDEN_FROM_DOC
86 virtual ~SoDistributeAction();
87#endif // HIDDEN_FROM_DOC
88
93 void setDistributeMethod( DistributeMethod distribMethod );
94
99
100private:
101
102 static void initClass();
103 static void exitClass();
104
109 void setInitialWeight ( uint32_t initWeight );
110
115 void setAverageWeight( uint32_t newAverage );
116
120 uint32_t getAverageWeight();
121
125 uint32_t getCurrentRUId();
126
130 void setCurrentRUId( uint32_t currentRenderUnitId );
131
132
136 void setRUIdWeight( uint32_t renderUnitId, uint32_t weight );
137
141 uint32_t getRUIdWeight( uint32_t renderUnitId );
142
146 uint32_t setCurRUIdWeight( uint32_t weight );
147
151 uint32_t getRemainingWeight();
152
156 void setRemainingWeight( uint32_t weight );
157
161 uint32_t getBruteForceRUId();
162
163private:
164
171 void beginTraversal( SoNode* node );
172
173private:
174
175 DistributeMethod m_distributeMethod;
176 uint32_t m_averageWeight;
177 uint32_t m_currentRenderUnitId;
178 uint32_t* m_weightAssigned;
179 uint32_t m_initialWeight;
180 uint32_t m_remainingWeight;
181
182 void resetParam();
183 uint32_t getNextRUId();
184};
185
186// INLINE METHODS
187
188inline void
190{
191 m_distributeMethod = distribMethod;
192}
193
196{
197 return m_distributeMethod;
198}
199
200inline uint32_t
201SoDistributeAction::getAverageWeight()
202{
203 return m_averageWeight;
204}
205
206inline void
207SoDistributeAction::setAverageWeight( uint32_t newAverage )
208{
209 m_averageWeight = newAverage;
210}
211
212inline uint32_t
213SoDistributeAction::getCurrentRUId()
214{
215 return m_currentRenderUnitId;
216}
217
218inline void
219SoDistributeAction::setCurrentRUId( uint32_t currentRenderUnitId )
220{
221 m_currentRenderUnitId = currentRenderUnitId;
222}
223
224inline uint32_t
225SoDistributeAction::getRemainingWeight()
226{
227 return m_remainingWeight;
228}
229
230inline void
231SoDistributeAction::setRemainingWeight( uint32_t weight )
232{
233 m_remainingWeight = weight;
234}
235
236#endif // SO_DISTRIBUTE_ACTION
237
238
239
240
Abstract base class for all actions.
Definition SoAction.h:132
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> Computes a distr...
SoDistributeAction()
Constructor.
DistributeMethod getDistributeMethod()
Returns the algorithm used to distribute the scene graph.
DistributeMethod
Algorithms for scene graph distribution.
void setDistributeMethod(DistributeMethod distribMethod)
Destructor.
Abstract base class for all database nodes.
Definition SoNode.h:145