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

Comparing ray/src/rt/RtraceSimulManager.h (file contents):
Revision 2.19 by greg, Tue Nov 19 20:50:36 2024 UTC vs.
Revision 2.21 by greg, Thu Jan 2 16:16:49 2025 UTC

# Line 36 | Line 36 | class RadSimulManager { (public)
36                                          LoadOctree(octn);
37                                  }
38                                  ~RadSimulManager() {
39 <                                        Cleanup();
39 >                                        // Cleanup();
40                                  }
41                                  /// Load octree and prepare renderer
42          bool                    LoadOctree(const char *octn);
# Line 96 | Line 96 | class RtraceSimulManager : public RadSimulManager {
96          static void             RTracer(RAY *r);
97                                  // Call-back for FIFO
98          static int              Rfifout(RAY *r);
99 + protected:
100                                  // Check for changes to render flags, etc.
101          bool                    UpdateMode();
101 protected:
102          RNUMBER                 lastRayID;      // last ray ID assigned
103   public:
104          int                     rtFlags;        // operation (RT*) flags
# Line 112 | Line 112 | class RtraceSimulManager : public RadSimulManager {
112                                  ~RtraceSimulManager() {
113                                          FlushQueue();
114                                  }
115 +                                /// Load octree and prepare renderer
116 +        bool                    LoadOctree(const char *octn) {
117 +                                        if ((octn != NULL) & (octname != NULL) &&
118 +                                                        !strcmp(octn, octname))
119 +                                                return true;
120 +                                        srcFollowed.NewBitMap(0);
121 +                                        curFlags &= ~RTtraceSources;
122 +                                        return RadSimulManager::LoadOctree(octn);
123 +                                }
124                                  /// Set number of computation threads (0 => #cores)
125          int                     SetThreadCount(int nt = 0) {
126                                          if (nt <= 0) nt = castonly ? 1 : GetNCores();
# Line 145 | Line 154 | class RtraceSimulManager : public RadSimulManager {
154                                          if (nt > 1) SetThreadCount(1);
155                                          traceCall = cb;
156                                          tcData = cb ? cd : NULL;
157 +                                        UpdateMode();
158                                          if (nt > 1) SetThreadCount(nt);
159                                  }
150                                /// Are we ready?
151        bool                    Ready() const {
152                                        return (cookedCall != NULL) | (traceCall != NULL) &&
153                                                RadSimulManager::Ready();
154                                }
160                                  /// Finish pending rays and complete callbacks (return #sent)
161          int                     FlushQueue();
162                                  /// Close octree, free data, return status
163          int                     Cleanup(bool everything = false) {
164 <                                        SetCookedCall(NULL);
165 <                                        SetTraceCall(NULL);
166 <                                        rtFlags = 0;
164 >                                        int     st = RadSimulManager::Cleanup(everything);
165 >                                        srcFollowed.NewBitMap(0);
166 >                                        curFlags &= ~RTtraceSources;
167 >                                        if (everything) {
168 >                                                SetCookedCall(NULL);
169 >                                                SetTraceCall(NULL);
170 >                                                rtFlags &= ~RTmask;
171 >                                        }
172                                          UpdateMode();
173                                          lastRayID = 0;
174 <                                        return RadSimulManager::Cleanup(everything);
174 >                                        return st;
175                                  }
176   };
177  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines