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.2 by greg, Wed Jul 26 23:27:44 2023 UTC vs.
Revision 2.3 by greg, Mon Jul 31 23:14:02 2023 UTC

# Line 22 | Line 22 | typedef void   RayReportCall(RAY *r, void *cd);
22   /// Multi-threaded simulation manager base class
23   class RadSimulManager {
24          int                     nThreads;       // number of active threads
25 protected:
26                                /// How many cores are there?
27        static int              GetNCores();
25   public:
26                                  RadSimulManager(const char *octn = NULL) {
27                                          LoadOctree(octn);
# Line 35 | Line 32 | class RadSimulManager { (public)
32                                  }
33                                  /// Load octree and prepare renderer
34          bool                    LoadOctree(const char *octn);
35 +                                /// How many cores are there?
36 +        static int              GetNCores();
37                                  /// Set number of computation threads (0 => #cores)
38          int                     SetThreadCount(int nt = 0);
39                                  /// Check thread count (1 means no multi-threading)
# Line 48 | Line 47 | class RadSimulManager { (public)
47                                          return (octname && nsceneobjs > 0);
48                                  }
49                                  /// Close octree, free data, return status
50 <        int                     Cleanup();
50 >        int                     Cleanup(bool everything = false);
51   };
52  
53   /// Flags to control rendering operations
# Line 76 | Line 75 | class RtraceSimulManager : public RadSimulManager { (p
75                                          SetCookedCall(cb, cd);
76                                          traceCall = NULL; tcData = NULL;
77                                  }
78 <                                ~RtraceSimulManager() {}
78 >                                ~RtraceSimulManager() {
79 >                                        FlushQueue();
80 >                                }
81                                  /// Set number of computation threads (0 => #cores)
82          int                     SetThreadCount(int nt = 0) {
83                                          if (nt <= 0) nt = GetNCores();
# Line 91 | Line 92 | class RtraceSimulManager : public RadSimulManager { (p
92          bool                    EnqueueRay(const FVECT org, const FVECT dir,
93                                                  RNUMBER rID = 0) {
94                                          if (dir == org+1)
95 <                                                return EnqueueBundle((const FVECT *)org, 1, rID);
95 >                                                return(EnqueueBundle((const FVECT *)org, 1, rID) > 0);
96                                          FVECT   orgdir[2];
97                                          VCOPY(orgdir[0], org); VCOPY(orgdir[1], dir);
98 <                                        return EnqueueBundle(orgdir, 1, rID);
98 >                                        return(EnqueueBundle(orgdir, 1, rID) > 0);
99                                  }
100                                  /// Set/change cooked ray callback & FIFO flag
101          void                    SetCookedCall(RayReportCall *cb, void *cd = NULL) {
# Line 116 | Line 117 | class RtraceSimulManager : public RadSimulManager { (p
117                                  /// Finish pending rays and complete callbacks
118          bool                    FlushQueue();
119                                  /// Close octree, free data, return status
120 <        int                     Cleanup() {
120 >        int                     Cleanup(bool everything = false) {
121                                          SetCookedCall(NULL);
122                                          SetTraceCall(NULL);
123                                          rtFlags = 0;
124                                          UpdateMode();
125                                          lastRayID = 0;
126 <                                        return RadSimulManager::Cleanup();
126 >                                        return RadSimulManager::Cleanup(everything);
127                                  }
128   };
129  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines