00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef VRS_IO_CUBEMAPWRITER_H
00029 #define VRS_IO_CUBEMAPWRITER_H
00030
00031 #include <vrs/io/objectwriter.h>
00032 #include <vrs/image/image.h>
00033 #include <vrs/opengl/cubemaptexturegl.h>
00034
00035 namespace VRS {
00036 class SceneThing;
00037 class Camera;
00038 class LookAt;
00039 class GLCanvas;
00040
00042 class VRS_CORE_API CubeMapCreator : SharedObj {
00043 public:
00051 static SO<Iterator<SO<Image> > > createCubeMapImagesFromScene(
00052 SO<SceneThing> scene,
00053 VRS::Vector from,
00054 unsigned int size = 512,
00055 SO<VRS::GLCanvas> canvas = NULL );
00060 static SO<Iterator<SO<Image> > > loadCubeMapImages(
00061 std::string baseName);
00066 static void writeCubeMapImages(
00067 SO<Iterator<SO<Image> > > images,
00068 std::string baseName);
00070 static void createAndWriteCubeMapImages(
00071 SO<SceneThing> scene,
00072 VRS::Vector from,
00073 std::string baseName = "cubemap",
00074 int size = 512,
00075 SO<VRS::GLCanvas> canvas = NULL);
00076 private:
00077 static bool findCamera(
00078 SO<SceneThing> scene,
00079 SceneThing*& parent,
00080 Camera*& camera);
00081
00082 static void orientLookAt(
00083 SO<LookAt> lookAt,
00084 CubeMapTextureGL::Side side);
00085
00086 static void writeSide(
00087 SO<Image> image,
00088 CubeMapTextureGL::Side side,
00089 std::string baseName);
00090
00091 static SO<Image> loadSide(
00092 CubeMapTextureGL::Side side,
00093 std::string baseName);
00094
00095 static std::string getSideExtension(
00096 CubeMapTextureGL::Side side);
00097
00098 VRS_TYPEINFO(CubeMapCreator, SharedObj);
00099 };
00100
00101 }
00102
00103 #endif // VRS_IO_CUBEMAPWRITER_H