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.16 by greg, Wed Oct 23 23:40:41 2024 UTC vs.
Revision 2.17 by greg, Wed Nov 13 02:43:51 2024 UTC

# Line 27 | Line 27 | class RadSimulManager {
27          char *                  header;                 // header (less intro and format)
28          int                     hlen;                   // header string length
29   protected:
30 <                                // Assign ray to subthread (fails if NThreads()<2)
31 <        bool                    SplitRay(RAY *r);
30 >        bool                    SplitRay(RAY *r) {
31 >                                        return (ray_pnprocs && ray_psend(r) > 0);
32 >                                }
33   public:
34                                  RadSimulManager(const char *octn = NULL) {
35                                          header = NULL; hlen = 0;
# Line 65 | Line 66 | class RadSimulManager {
66                                          return ray_pnprocs + !ray_pnprocs;
67                                  }
68                                  /// How many threads are currently unoccupied?
69 <        int                     ThreadsAvailable() const;
69 >        int                     ThreadsAvailable() const {
70 >                                        return ray_pnprocs ? ray_pnidle : 1;
71 >                                }
72                                  /// Are we ready?
73          bool                    Ready() const {
74                                          return (octname && nobjects > 0);
75                                  }
76                                  /// Process a ray (in subthread), optional result
77 <        bool                    ProcessRay(RAY *r);
77 >        int                     ProcessRay(RAY *r);
78                                  /// Wait for next result (or fail)
79          bool                    WaitResult(RAY *r);
80                                  /// Close octree, free data, return status
# Line 120 | Line 123 | class RtraceSimulManager : public RadSimulManager { (p
123          int                     EnqueueBundle(const FVECT orig_direc[], int n,
124                                                  RNUMBER rID0 = 0);
125                                  /// Enqueue a single ray w/ optional ray ID
126 <        bool                    EnqueueRay(const FVECT org, const FVECT dir,
126 >        int                     EnqueueRay(const FVECT org, const FVECT dir,
127                                                  RNUMBER rID = 0) {
128                                          if (dir == org+1)
129                                                  return(EnqueueBundle((const FVECT *)org, 1, rID) > 0);
130                                          FVECT   orgdir[2];
131                                          VCOPY(orgdir[0], org); VCOPY(orgdir[1], dir);
132 <                                        return(EnqueueBundle(orgdir, 1, rID) > 0);
132 >                                        return EnqueueBundle(orgdir, 1, rID);
133                                  }
134                                  /// Set/change cooked ray callback
135          void                    SetCookedCall(RayReportCall *cb, void *cd = NULL) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines