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.20 by greg, Mon Dec 16 20:18:36 2024 UTC vs.
Revision 2.22 by greg, Thu Jan 9 17:25:37 2025 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines