00001 /********************************************************************** 00002 * control_frame.H: 00003 **********************************************************************/ 00004 #ifndef CONTROL_FRAME_H_IS_INCLUDED 00005 #define CONTROL_FRAME_H_IS_INCLUDED 00006 00007 #include "disp/colors.H" 00008 #include "color_id_texture.H" 00009 00010 /********************************************************************** 00011 * ControlFrameTexture: 00012 **********************************************************************/ 00013 class ControlFrameTexture : public BasicTexture { 00014 public: 00015 00016 //******** MANAGERS ******** 00017 00018 ControlFrameTexture(Patch* patch = 0, CCOLOR& col = Color::blue_pencil_d) : 00019 BasicTexture(patch, new GLStripCB), 00020 _color(col), 00021 _strip(0) {} 00022 00023 //******** RUN-TIME TYPE ID ******** 00024 00025 DEFINE_RTTI_METHODS2("ControlFrame", BasicTexture, CDATA_ITEM *); 00026 00027 //******** ACCESSORS ******** 00028 00029 int set_color(CCOLOR& c) { _color = c; return 1; } 00030 CCOLOR& color() const { return _color; } 00031 00032 //******** GTexture METHODS ******** 00033 00034 virtual bool draws_filled() const { return false; } 00035 virtual int draw(CVIEWptr& v); 00036 00037 //******** RefImageClient METHODS ******** 00038 00039 virtual int draw_vis_ref() { 00040 cerr << "ControlFrameTexture::draw_vis_ref: not implemented" << endl; 00041 return 0; 00042 } 00043 00044 //******** DATA_ITEM METHODS ******** 00045 00046 virtual DATA_ITEM *dup() const { return new ControlFrameTexture; } 00047 00048 protected: 00049 COLOR _color; // color to use 00050 EdgeStrip* _strip; // edge strip of control mesh edges 00051 00052 //******** UTILITY METHODS ******** 00053 00054 void draw_selected_faces(); 00055 void draw_selected_edges(); 00056 void draw_selected_verts(); 00057 00058 // Draw helper -- draws control curves from level k, 00059 // relative to the control Patch: 00060 void draw_level(CVIEWptr& v, int k); 00061 00062 // Builds the edge strip for level k: 00063 bool build_strip(int k); 00064 }; 00065 00066 #endif // CONTROL_FRAME_H_IS_INCLUDED 00067 00068 /* end of file control_frame.H */