ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/Development/ray/src/rt/RcontribSimulManager.h
(Generate patch)

Comparing ray/src/rt/RcontribSimulManager.h (file contents):
Revision 2.7 by greg, Fri Nov 8 15:49:34 2024 UTC vs.
Revision 2.12 by greg, Fri Oct 17 17:43:53 2025 UTC

# Line 66 | Line 66 | class RcontribOutput { (public)
66                                  }
67                                  /// Update output row count
68          bool                    SetRowsDone(int r) {
69 <                                        if (!rData | (0 >= r) | (r > nRows)) return false;
69 >                                        if (!rData | (0 > r) | (r > nRows)) return false;
70                                          char *  rbuf = (char *)rData->GetMemory(rowCountPos, 17, 0);
71                                          sprintf(rbuf, "%-16d", r);
72                                          rbuf[16] = '\n';        // replaces nul byte
# Line 108 | Line 108 | class RcontribOutput { (public)
108  
109   typedef double          DCOLORV;        // color accumulator type
110  
111 /// Modifier channel for recording contributions (no constructor/destructor)
112 struct RcontribMod;
113
114 /// Allocate rcontrib accumulator
115 extern RcontribMod *    NewRcMod(const char *prms = NULL, const char *binexpr = NULL, int ncbins = 1);
111   /// Free an RcontribMod
112   extern lut_free_t       FreeRcMod;
113  
# Line 207 | Line 202 | class RcontribSimulManager : protected RtraceSimulMana
202                                          modLUT.freek = efree;
203                                          modLUT.freed = FreeRcMod;
204                                          kid = NULL; kidRow = NULL; nkids = 0;
210                                        rtFlags = RTtraceSources;
211                                        SetTraceCall(&RctCall, this);
205                                          outOp = RCOnew;
206                                          cdsF = &defDataShare;
207                                          xres = yres = 0;
208                                          accum = 1;
209 +                                        if (octname) {
210 +                                                SetTraceCall(&RctCall, this);
211 +                                                rtFlags |= RTtraceSources;
212 +                                                UpdateMode();
213 +                                        }
214                                  }
215                                  ~RcontribSimulManager() {
216                                          if (nkids >= 0) ClearModifiers();
# Line 230 | Line 228 | class RcontribSimulManager : protected RtraceSimulMana
228                                  }
229                                  /// Load octree and prepare renderer
230          bool                    LoadOctree(const char *octn) {
231 <                                        return RtraceSimulManager::LoadOctree(octn);
231 >                                        if (octname) Cleanup(false);
232 >                                        if (!RtraceSimulManager::LoadOctree(octn))
233 >                                                return false;
234 >                                        SetTraceCall(&RctCall, this);
235 >                                        rtFlags |= RTtraceSources;
236 >                                        return UpdateMode();
237                                  }
238                                  /// Prepare header from previous input (or clear)
239          bool                    NewHeader(const char *inspec=NULL) {
# Line 323 | Line 326 | class RcontribSimulManager : protected RtraceSimulMana
326          void                    ClearModifiers() {
327                                          if (rowsDone.Length()) {
328                                                  SetThreadCount(1);
326                                                cow_doneshare();
329                                                  rowsDone.NewBitMap(0);
330 +                                                rInPos = 0;
331                                          }
332                                          lu_done(&modLUT);
333                                          delete outList; outList = NULL;
# Line 333 | Line 336 | class RcontribSimulManager : protected RtraceSimulMana
336                                  /// Close octree, free data, return status
337          int                     Cleanup(bool everything = false) {
338                                          ClearModifiers();
339 +                                        cow_doneshare();
340 +                                        if (everything) {
341 +                                                dtyp = 'f';
342 +                                                outOp = RCOnew;
343 +                                                cdsF = &defDataShare;
344 +                                                xres = yres = 0;
345 +                                                accum = 1;
346 +                                                rtFlags &= ~RCmask;
347 +                                        }
348                                          return RtraceSimulManager::Cleanup(everything);
349                                  }
350   };
351 +
352 + extern const char *     formstr(int f);         // string from format
353  
354   #endif /* RcontribSimulManager_h */

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)