--- ray/src/rt/RpictSimulManager.h 2024/08/19 16:41:40 2.4 +++ ray/src/rt/RpictSimulManager.h 2024/09/16 19:18:32 2.8 @@ -1,4 +1,4 @@ -/* RCSid $Id: RpictSimulManager.h,v 2.4 2024/08/19 16:41:40 greg Exp $ */ +/* RCSid $Id: RpictSimulManager.h,v 2.8 2024/09/16 19:18:32 greg Exp $ */ /* * RpictSimulManager.h * @@ -251,9 +251,10 @@ class RpictSimulManager : protected RtraceSimulManager COLORV * barPix; // current render bar pixels float * barDepth; // current render bar depths bool SetTile(const int ti[2]); - bool RenderRect(); + bool RenderRect(const int x0 = 0, const int y0 = 0); bool ComputePixel(int x, int y); - bool BelowSampThresh(int x, int y, const int noff[4][2]) const; + bool BelowSampThresh(const int x, const int y, + const int noff[4][2]) const; void FillSquare(const int x, const int y, const int noff[4][2]); void NewBar(int ht = 0); bool LowerBar(int v, int ytop); @@ -275,7 +276,7 @@ class RpictSimulManager : protected RtraceSimulManager frameNo = 0; } ~RpictSimulManager() { - NewBar(); + delete [] barPix; delete [] barDepth; } /// Load octree and prepare renderer bool LoadOctree(const char *octn) { @@ -294,9 +295,13 @@ class RpictSimulManager : protected RtraceSimulManager return RtraceSimulManager::AddHeader(ac, av); } /// Get header lines if any - const char * GetHeader() const { - return RtraceSimulManager::GetHeader(); + const char * GetHeadStr() const { + return RtraceSimulManager::GetHeadStr(); } + /// Look for specific header keyword, return value + const char * GetHeadStr(const char *key, bool inOK = false) const { + return RtraceSimulManager::GetHeadStr(key, inOK); + } /// Set number of computation threads (0 => #cores) int SetThreadCount(int nt = 0) { return RtraceSimulManager::SetThreadCount(nt); @@ -381,7 +386,7 @@ class RpictSimulManager : protected RtraceSimulManager const int *tile=NULL); /// Render and write a frame to the named file /// Include any header lines set prior to call - /// Picture file must not already exist + /// Picture file must not exist /// Write pixels to stdout if !pfname /// Write depth to a command if dfname[0]=='!' RenderDataType RenderFrame(const char *pfname, @@ -390,6 +395,16 @@ class RpictSimulManager : protected RtraceSimulManager /// Resume partially finished rendering /// Picture file must exist with valid header RenderDataType ResumeFrame(const char *pfname, + const char *dfname=NULL); + /// Prepare new picture (and depth) output + /// Called by RenderFrame() + RenderDataType NewOutput(FILE *pdfp[2], const char *pfname, + RenderDataType dt=RDTrgbe, + const char *dfname=NULL); + /// Reopen existing picture (and depth) file + /// Called by ResumeFrame() + /// File pointers @ end of header (before res.) + RenderDataType ReopenOutput(FILE *pdfp[2], const char *pfname, const char *dfname=NULL); /// Close octree, free data, return status int Cleanup(bool everything = false) {