00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef AR_VRMLINT_H
00023 #define AR_VRMLINT_H
00024
00025 #include <iostream>
00026 #include <fstream>
00027 #include <boost/algorithm/string/predicate.hpp>
00028 #include <boost/utility.hpp>
00029 #include <openvrml/browser.h>
00030 #include <openvrml/gl/viewer.h>
00031 #include <openvrml/bounding_volume.h>
00032 #ifdef _WIN32
00033 # include <windows.h>
00034 #endif
00035
00036 class arVrmlBrowser : public openvrml::browser {
00037 public:
00038 arVrmlBrowser();
00039
00040 private:
00041 virtual std::auto_ptr<openvrml::resource_istream>
00042 do_get_resource(const std::string & uri);
00043 };
00044
00045 class arVrmlViewer : public openvrml::gl::viewer {
00046
00047 public:
00048 explicit arVrmlViewer();
00049 ~arVrmlViewer() throw ();
00050
00051 char filename[512];
00052 double translation[3];
00053 double rotation[4];
00054 double scale[3];
00055 bool internal_light;
00056
00057 void timerUpdate();
00058 void redraw();
00059 void setInternalLight( bool f );
00060
00061 protected:
00062 virtual void post_redraw();
00063 virtual void set_cursor(openvrml::gl::viewer::cursor_style c);
00064 virtual void swap_buffers();
00065 virtual void set_timer(double);
00066
00067
00068 virtual void set_viewpoint(const openvrml::vec3f & position,
00069 const openvrml::rotation & orientation,
00070 float fieldOfView,
00071 float avatarSize,
00072 float visibilityLimit);
00073
00074 virtual viewer::object_t insert_background(const std::vector<float> & groundAngle,
00075 const std::vector<openvrml::color> & groundColor,
00076 const std::vector<float> & skyAngle,
00077 const std::vector<openvrml::color> & skyColor,
00078 const openvrml::image & front,
00079 const openvrml::image & back,
00080 const openvrml::image & left,
00081 const openvrml::image & right,
00082 const openvrml::image & top,
00083 const openvrml::image & bottom);
00084
00085 virtual viewer::object_t insert_dir_light(float ambientIntensity,
00086 float intensity,
00087 const openvrml::color & color,
00088 const openvrml::vec3f & direction);
00089
00090 virtual viewer::object_t insert_point_light(float ambientIntensity,
00091 const openvrml::vec3f & attenuation,
00092 const openvrml::color & color,
00093 float intensity,
00094 const openvrml::vec3f & location,
00095 float radius);
00096
00097 virtual viewer::object_t insert_spot_light(float ambientIntensity,
00098 const openvrml::vec3f & attenuation,
00099 float beamWidth,
00100 const openvrml::color & color,
00101 float cutOffAngle,
00102 const openvrml::vec3f & direction,
00103 float intensity,
00104 const openvrml::vec3f & location,
00105 float radius);
00106 virtual openvrml::bounding_volume::intersection
00107 intersect_view_volume(const openvrml::bounding_volume & bvolume) const;
00108 };
00109
00110 #endif