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.7 by greg, Wed May 1 22:06:09 2024 UTC vs.
Revision 2.14 by greg, Mon Sep 16 19:18:32 2024 UTC

# Line 23 | Line 23 | typedef int    RayReportCall(RAY *r, void *cd);
23  
24   /// Multi-threaded simulation manager base class
25   class RadSimulManager {
26 +        char *                  header;                 // header (less intro and format)
27 +        int                     hlen;                   // header string length
28   protected:
29                                  // Assign ray to subthread (fails if NThreads()<2)
30          bool                    SplitRay(RAY *r);
31   public:
32                                  RadSimulManager(const char *octn = NULL) {
33 +                                        header = NULL; hlen = 0;
34                                          LoadOctree(octn);
35                                  }
36                                  ~RadSimulManager() {
# Line 35 | Line 38 | class RadSimulManager { (public)
38                                  }
39                                  /// Load octree and prepare renderer
40          bool                    LoadOctree(const char *octn);
41 +                                /// Prepare header from previous input (or clear)
42 +                                /// Normally called during octree load
43 +        bool                    NewHeader(const char *inspec=NULL);
44 +                                /// Add a line to header (adds newline if none)
45 +        bool                    AddHeader(const char *str);
46 +                                /// Append program line to header
47 +        bool                    AddHeader(int ac, char *av[]);
48 +                                /// Get header lines or empty string
49 +        const char *            GetHeadStr() const {
50 +                                        return hlen ? header : "";
51 +                                }
52 +                                /// Look for specific header keyword, return value
53 +        const char *            GetHeadStr(const char *key, bool inOK = false) const;
54                                  /// How many cores are available?
55          static int              GetNCores();
56                                  /// Set number of computation threads (0 => #cores)
# Line 91 | Line 107 | class RtraceSimulManager : public RadSimulManager { (p
107          int                     SetThreadCount(int nt = 0) {
108                                          if (nt <= 0) nt = castonly ? 1 : GetNCores();
109                                          if (nt == NThreads()) return nt;
110 <                                        if (FlushQueue() < 0) return 0;
110 >                                        if (nt < NThreads() && FlushQueue() < 0) return 0;
111                                          return RadSimulManager::SetThreadCount(nt);
112                                  }
113                                  /// Add ray bundle to queue w/ optional 1st ray ID
# Line 127 | Line 143 | class RtraceSimulManager : public RadSimulManager { (p
143          int                     FlushQueue();
144                                  /// Close octree, free data, return status
145          int                     Cleanup(bool everything = false) {
130                                        FlushQueue();
146                                          SetCookedCall(NULL);
147                                          SetTraceCall(NULL);
148                                          rtFlags = 0;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines