00001 #ifndef _JOT_GTEX_BASIC_TEXTURE_H
00002 #define _JOT_GTEX_BASIC_TEXTURE_H
00003
00004 #include "dlhandler/dlhandler.H"
00005 #include "mesh/gtexture.H"
00006 #include "std/config.H"
00007 #include "gtex/util.H"
00008
00009
00010
00011
00012
00013
00014 class OGLTexture : public GTexture {
00015 protected:
00016
00017 void check_patch_texture_map();
00018
00019 public:
00020
00021 OGLTexture(Patch *patch = 0, StripCB* cb=0) :
00022 GTexture(patch, cb ? cb : new GLStripCB) {}
00023 virtual ~OGLTexture() {}
00024
00025
00026 DEFINE_RTTI_METHODS2("OGLTexture", GTexture, CDATA_ITEM *);
00027
00028
00029 bool set_face_culling() const;
00030
00031
00032
00033
00034
00035
00036 int draw_id_sils(bool omit_concave_sils, GLfloat width);
00037 int draw_id_triangles(
00038 bool use_polygon_offset,
00039 bool draw_id_colors,
00040 double offset_factor = Config::get_var_dbl("BMESH_OFFSET_FACTOR", 12.0,true),
00041 double offset_units = Config::get_var_dbl("BMESH_OFFSET_UNITS", 1.0,true)
00042 );
00043 int draw_id_creases(GLfloat width);
00044
00045
00046 int draw_stencil();
00047
00048
00049
00050
00051 void draw_vert_and_edge_strips(
00052 bool disable_lights = 0,
00053 GLfloat line_width = 3,
00054 GLfloat point_size = 5,
00055 bool set_color = 1,
00056 CCOLOR& color = COLOR::black
00057 ) const;
00058
00059
00060 virtual int draw_vis_ref();
00061 virtual int draw_id_ref();
00062 };
00063
00064
00065
00066
00067
00068
00069
00070 class BasicTexture : public OGLTexture {
00071 public:
00072
00073 BasicTexture(Patch* patch = 0, StripCB* cb=0) : OGLTexture(patch,cb){}
00074 virtual ~BasicTexture() { delete_dl(); }
00075
00076
00077 DEFINE_RTTI_METHODS2("BasicTexture", OGLTexture, CDATA_ITEM *);
00078
00079
00080 virtual void changed() { _dl.invalidate(); }
00081
00082
00083 virtual int draw(CVIEWptr& v);
00084
00085 virtual int dl_valid(CVIEWptr& v);
00086
00087
00088 protected:
00089 DLhandler _dl;
00090
00091 void delete_dl() {
00092 _dl.delete_all_dl();
00093 }
00094 };
00095
00096 #endif // _JOT_GTEX_BASIC_TEXTURE_H
00097
00098