1 //******************************************************************************
2 ///
3 /// @file backend/bounding/boundingtask.h
4 ///
5 /// @todo   What's in here?
6 ///
7 /// @copyright
8 /// @parblock
9 ///
10 /// Persistence of Vision Ray Tracer ('POV-Ray') version 3.8.
11 /// Copyright 1991-2021 Persistence of Vision Raytracer Pty. Ltd.
12 ///
13 /// POV-Ray is free software: you can redistribute it and/or modify
14 /// it under the terms of the GNU Affero General Public License as
15 /// published by the Free Software Foundation, either version 3 of the
16 /// License, or (at your option) any later version.
17 ///
18 /// POV-Ray is distributed in the hope that it will be useful,
19 /// but WITHOUT ANY WARRANTY; without even the implied warranty of
20 /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21 /// GNU Affero General Public License for more details.
22 ///
23 /// You should have received a copy of the GNU Affero General Public License
24 /// along with this program.  If not, see <http://www.gnu.org/licenses/>.
25 ///
26 /// ----------------------------------------------------------------------------
27 ///
28 /// POV-Ray is based on the popular DKB raytracer version 2.12.
29 /// DKBTrace was originally written by David K. Buck.
30 /// DKBTrace Ver 2.0-2.12 were written by David K. Buck & Aaron A. Collins.
31 ///
32 /// @endparblock
33 ///
34 //------------------------------------------------------------------------------
35 // SPDX-License-Identifier: AGPL-3.0-or-later
36 //******************************************************************************
37 
38 #ifndef POVRAY_BACKEND_BOUNDINGTASK_H
39 #define POVRAY_BACKEND_BOUNDINGTASK_H
40 
41 // Module config header file must be the first file included within POV-Ray unit header files
42 #include "backend/configbackend.h"
43 
44 // Standard C++ header files
45 #include <vector>
46 
47 // POV-Ray header files (core module)
48 #include "core/coretypes.h"
49 
50 // POV-Ray header files (backend module)
51 #include "backend/render/rendertask.h"
52 
53 namespace pov
54 {
55 
56 class SceneData;
57 class TraceThreadData;
58 
59 class BoundingTask : public SceneTask
60 {
61     public:
62         BoundingTask(shared_ptr<BackendSceneData> sd, unsigned int bt, size_t seed);
63         virtual ~BoundingTask();
64 
65         virtual void Run();
66         virtual void Stopped();
67         virtual void Finish();
68 
69         void AppendObject(ObjectPtr p);
70 
GetSceneDataPtr()71         inline TraceThreadData *GetSceneDataPtr() { return reinterpret_cast<TraceThreadData *>(GetDataPtr()); }
72     private:
73         shared_ptr<BackendSceneData> sceneData;
74         unsigned int boundingThreshold;
75 
76         void SendFatalError(pov_base::Exception& e);
77 };
78 
79 } // end of namespace
80 
81 #endif // POVRAY_BACKEND_BOUNDINGTASK_H
82