Skip to content

Commit

Permalink
Eliminate backend/frame.h. (POV-Ray#427)
Browse files Browse the repository at this point in the history
Also clean up various header files and file headers along the way, mainly in the back-end module.
  • Loading branch information
c-lipka authored Jul 17, 2021
1 parent 9353683 commit ec53583
Show file tree
Hide file tree
Showing 61 changed files with 626 additions and 474 deletions.
20 changes: 14 additions & 6 deletions source/backend/bounding/boundingtask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/// @parblock
///
/// Persistence of Vision Ray Tracer ('POV-Ray') version 3.8.
/// Copyright 1991-2018 Persistence of Vision Raytracer Pty. Ltd.
/// Copyright 1991-2021 Persistence of Vision Raytracer Pty. Ltd.
///
/// POV-Ray is free software: you can redistribute it and/or modify
/// it under the terms of the GNU Affero General Public License as
Expand All @@ -31,24 +31,32 @@
///
/// @endparblock
///
//------------------------------------------------------------------------------
// SPDX-License-Identifier: AGPL-3.0-or-later
//******************************************************************************

// Unit header file must be the first file included within POV-Ray *.cpp files (pulls in config)
#include "backend/bounding/boundingtask.h"

// Standard C++ header files
#include <set>

// Boost header files
#include <boost/bind.hpp>
#if POV_MULTITHREADED
#include <boost/thread.hpp>
#endif

// frame.h must always be the first POV file included (pulls in platform config)
#include "backend/frame.h"
#include "backend/bounding/boundingtask.h"

// POV-Ray header files (core module)
#include "core/bounding/bsptree.h"
#include "core/math/matrix.h"
#include "core/scene/object.h"
#include "core/scene/tracethreaddata.h"

// POV-Ray header files (POVMS module)
#include "povms/povmsid.h"

// POV-Ray header files (backend module)
#include "backend/scene/backendscenedata.h"
#include "backend/support/task.h"

Expand Down Expand Up @@ -224,4 +232,4 @@ void BoundingTask::SendFatalError(Exception& e)
POVMS_SendMessage(msg);
}

}
} // end of namespace
15 changes: 12 additions & 3 deletions source/backend/bounding/boundingtask.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/// @parblock
///
/// Persistence of Vision Ray Tracer ('POV-Ray') version 3.8.
/// Copyright 1991-2018 Persistence of Vision Raytracer Pty. Ltd.
/// Copyright 1991-2021 Persistence of Vision Raytracer Pty. Ltd.
///
/// POV-Ray is free software: you can redistribute it and/or modify
/// it under the terms of the GNU Affero General Public License as
Expand All @@ -31,14 +31,23 @@
///
/// @endparblock
///
//------------------------------------------------------------------------------
// SPDX-License-Identifier: AGPL-3.0-or-later
//******************************************************************************

#ifndef POVRAY_BACKEND_BOUNDINGTASK_H
#define POVRAY_BACKEND_BOUNDINGTASK_H

// Module config header file must be the first file included within POV-Ray unit header files
#include "backend/configbackend.h"

// Standard C++ header files
#include <vector>

#include "backend/frame.h"
// POV-Ray header files (core module)
#include "core/coretypes.h"

// POV-Ray header files (backend module)
#include "backend/render/rendertask.h"

namespace pov
Expand Down Expand Up @@ -67,6 +76,6 @@ class BoundingTask : public SceneTask
void SendFatalError(pov_base::Exception& e);
};

}
} // end of namespace

#endif // POVRAY_BACKEND_BOUNDINGTASK_H
4 changes: 3 additions & 1 deletion source/backend/configbackend.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/// @parblock
///
/// Persistence of Vision Ray Tracer ('POV-Ray') version 3.8.
/// Copyright 1991-2018 Persistence of Vision Raytracer Pty. Ltd.
/// Copyright 1991-2021 Persistence of Vision Raytracer Pty. Ltd.
///
/// POV-Ray is free software: you can redistribute it and/or modify
/// it under the terms of the GNU Affero General Public License as
Expand All @@ -33,6 +33,8 @@
///
/// @endparblock
///
//------------------------------------------------------------------------------
// SPDX-License-Identifier: AGPL-3.0-or-later
//******************************************************************************

#ifndef POVRAY_BACKEND_CONFIGBACKEND_H
Expand Down
16 changes: 9 additions & 7 deletions source/backend/control/benchmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/// @parblock
///
/// Persistence of Vision Ray Tracer ('POV-Ray') version 3.8.
/// Copyright 1991-2018 Persistence of Vision Raytracer Pty. Ltd.
/// Copyright 1991-2021 Persistence of Vision Raytracer Pty. Ltd.
///
/// POV-Ray is free software: you can redistribute it and/or modify
/// it under the terms of the GNU Affero General Public License as
Expand All @@ -32,14 +32,17 @@
///
/// @endparblock
///
//------------------------------------------------------------------------------
// SPDX-License-Identifier: AGPL-3.0-or-later
//******************************************************************************

#include <cstdio>

// frame.h must always be the first POV file included (pulls in platform config)
#include "backend/frame.h"
// Unit header file must be the first file included within POV-Ray *.cpp files (pulls in config)
#include "backend/control/benchmark.h"

// C++ variants of standard C header files
#include <cstdio>

// POV-Ray header files (backend module)
#include "backend/control/benchmark_ini.h"
#include "backend/control/benchmark_pov.h"

Expand Down Expand Up @@ -77,5 +80,4 @@ unsigned int Get_Benchmark_Version (void)
return (0x0203) ; // Benchmark version 2.03
}

}

} // end of namespace
15 changes: 10 additions & 5 deletions source/backend/control/benchmark.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/// @parblock
///
/// Persistence of Vision Ray Tracer ('POV-Ray') version 3.8.
/// Copyright 1991-2017 Persistence of Vision Raytracer Pty. Ltd.
/// Copyright 1991-2021 Persistence of Vision Raytracer Pty. Ltd.
///
/// POV-Ray is free software: you can redistribute it and/or modify
/// it under the terms of the GNU Affero General Public License as
Expand All @@ -31,10 +31,15 @@
///
/// @endparblock
///
//------------------------------------------------------------------------------
// SPDX-License-Identifier: AGPL-3.0-or-later
//******************************************************************************

#ifndef BENCHMARK_H
#define BENCHMARK_H
#ifndef POVRAY_BACKEND_BENCHMARK_H
#define POVRAY_BACKEND_BENCHMARK_H

// Module config header file must be the first file included within POV-Ray unit header files
#include "backend/configbackend.h"

namespace pov
{
Expand All @@ -46,6 +51,6 @@ namespace pov
bool Write_Benchmark_File (const char *Scene_File_Name, const char *INI_File_Name) ;
unsigned int Get_Benchmark_Version (void) ;

}
} // end of namespace

#endif
#endif // POVRAY_BACKEND_BENCHMARK_H
22 changes: 14 additions & 8 deletions source/backend/control/messagefactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/// @parblock
///
/// Persistence of Vision Ray Tracer ('POV-Ray') version 3.8.
/// Copyright 1991-2018 Persistence of Vision Raytracer Pty. Ltd.
/// Copyright 1991-2021 Persistence of Vision Raytracer Pty. Ltd.
///
/// POV-Ray is free software: you can redistribute it and/or modify
/// it under the terms of the GNU Affero General Public License as
Expand All @@ -31,20 +31,26 @@
///
/// @endparblock
///
//------------------------------------------------------------------------------
// SPDX-License-Identifier: AGPL-3.0-or-later
//******************************************************************************

#include <boost/thread.hpp>
// Unit header file must be the first file included within POV-Ray *.cpp files (pulls in config)
#include "backend/control/messagefactory.h"

// Boost header files
#include <boost/bind.hpp>
#if POV_MULTITHREADED
#include <boost/thread.hpp>
#endif

// frame.h must always be the first POV file included (pulls in platform config)
#include "backend/frame.h"
#include "backend/control/messagefactory.h"
// POV-Ray header files (base module)
#include "base/pov_err.h"

// POV-Ray header files (POVMS module)
#include "povms/povmscpp.h"
#include "povms/povmsid.h"

#include "base/pov_err.h"

// this must be the last file included
#include "base/povdebug.h"

Expand Down Expand Up @@ -129,4 +135,4 @@ void MessageFactory::SendMessage(MessageClass mc, WarningLevel level, const char
(void)POVMS_Send(nullptr, &msg, nullptr, kPOVMSSendMode_NoReply);
}

}
} // end of namespace
16 changes: 12 additions & 4 deletions source/backend/control/messagefactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/// @parblock
///
/// Persistence of Vision Ray Tracer ('POV-Ray') version 3.8.
/// Copyright 1991-2018 Persistence of Vision Raytracer Pty. Ltd.
/// Copyright 1991-2021 Persistence of Vision Raytracer Pty. Ltd.
///
/// POV-Ray is free software: you can redistribute it and/or modify
/// it under the terms of the GNU Affero General Public License as
Expand All @@ -31,16 +31,24 @@
///
/// @endparblock
///
//------------------------------------------------------------------------------
// SPDX-License-Identifier: AGPL-3.0-or-later
//******************************************************************************

#ifndef POVRAY_BACKEND_MESSAGEFACTORY_H
#define POVRAY_BACKEND_MESSAGEFACTORY_H

#include "povms/povmscpp.h"
#include "povms/povmsid.h"
// Module config header file must be the first file included within POV-Ray unit header files
#include "backend/configbackend.h"

// POV-Ray header files (base module)
#include "base/messenger.h"

// POV-Ray header files (POVMS module)
#include "povms/povmscpp.h"
#include "povms/povmsid.h"

// POV-Ray header files (backend module)
#include "backend/control/renderbackend.h"

namespace pov
Expand All @@ -66,6 +74,6 @@ class MessageFactory : public GenericMessenger
const UCS2 *filename = nullptr, POV_LONG line = -1, POV_LONG column = -1, POV_OFF_T offset = -1);
};

}
} // end of namespace

#endif // POVRAY_BACKEND_MESSAGEFACTORY_H
16 changes: 10 additions & 6 deletions source/backend/control/renderbackend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/// @parblock
///
/// Persistence of Vision Ray Tracer ('POV-Ray') version 3.8.
/// Copyright 1991-2018 Persistence of Vision Raytracer Pty. Ltd.
/// Copyright 1991-2021 Persistence of Vision Raytracer Pty. Ltd.
///
/// POV-Ray is free software: you can redistribute it and/or modify
/// it under the terms of the GNU Affero General Public License as
Expand All @@ -31,17 +31,21 @@
///
/// @endparblock
///
//------------------------------------------------------------------------------
// SPDX-License-Identifier: AGPL-3.0-or-later
//******************************************************************************

// frame.h must always be the first POV file included (pulls in platform config)
#include "backend/frame.h"
// Unit header file must be the first file included within POV-Ray *.cpp files (pulls in config)
#include "backend/control/renderbackend.h"

// POV-Ray header files (base module)
#include "base/pov_err.h"

// POV-Ray header files (POVMS module)
#include "povms/povmscpp.h"
#include "povms/povmsid.h"

#include "base/pov_err.h"

// POV-Ray header files (backend module)
#include "backend/povray.h"
#include "backend/control/scene.h"
#include "backend/scene/view.h"
Expand Down Expand Up @@ -784,4 +788,4 @@ void RenderBackend::MakeDoneResult(POVMS_Message& result)
result = newmsg;
}

}
} // end of namespace
16 changes: 12 additions & 4 deletions source/backend/control/renderbackend.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/// @parblock
///
/// Persistence of Vision Ray Tracer ('POV-Ray') version 3.8.
/// Copyright 1991-2017 Persistence of Vision Raytracer Pty. Ltd.
/// Copyright 1991-2021 Persistence of Vision Raytracer Pty. Ltd.
///
/// POV-Ray is free software: you can redistribute it and/or modify
/// it under the terms of the GNU Affero General Public License as
Expand All @@ -31,18 +31,26 @@
///
/// @endparblock
///
//------------------------------------------------------------------------------
// SPDX-License-Identifier: AGPL-3.0-or-later
//******************************************************************************

#ifndef POVRAY_BACKEND_RENDERBACKEND_H
#define POVRAY_BACKEND_RENDERBACKEND_H

// Module config header file must be the first file included within POV-Ray unit header files
#include "backend/configbackend.h"

// Standard C++ header files
#include <map>
#include <set>

#include "povms/povmscpp.h"

// POV-Ray header files (base module)
#include "base/stringutilities.h"

// POV-Ray header files (POVMS module)
#include "povms/povmscpp.h"

namespace pov
{

Expand Down Expand Up @@ -132,6 +140,6 @@ class RenderBackend : public POVMS_MessageReceiver
void MakeDoneResult(POVMS_Message& result);
};

}
} // end of namespace

#endif // POVRAY_BACKEND_RENDERBACKEND_H
Loading

0 comments on commit ec53583

Please sign in to comment.