Subversion Repositories gelsvn

Rev

Rev 656 | Rev 662 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 656 Rev 657
Line 35... Line 35...
35
        }
35
        }
36
 
36
 
37
        Console theConsole;
37
        Console theConsole;
38
        Console::variable<int> active;
38
        Console::variable<int> active;
39
        Console::variable<std::string> display_render_mode;
39
        Console::variable<std::string> display_render_mode;
40
        Console::variable<std::string> edit_mode;
40
        Console::variable<float> brush_size;
41
        Console::variable<int> display_smooth_shading;
41
        Console::variable<int> display_smooth_shading;
42
        Console::variable<float> display_gamma;
42
        Console::variable<float> display_gamma;
43
 
43
 
44
    public:
44
    public:
45
        MeshEditor():active(0), display_render_mode("normal"), display_smooth_shading(true),
45
        MeshEditor():active(0), display_render_mode("normal"), brush_size(0.01), display_smooth_shading(true),
46
        display_gamma(2.2) {}
46
        display_gamma(2.2) {}
47
 
47
 
48
        /// Initialize the mesh editor. Do this only when OpenGL state is available.
48
        /// Initialize the mesh editor. Do this only when OpenGL state is available.
49
        void init();
49
        void init();
50
        
50
        
-
 
51
        bool select_vertex(const CGLA::Vec2i& pos) {
-
 
52
            return active_visobj().select_vertex(pos);
-
 
53
        }
-
 
54
        
-
 
55
         HMesh::VertexAttributeVector<int>& get_vertex_selection()  {
-
 
56
            return active_visobj().get_vertex_selection();
-
 
57
        }
-
 
58
        
-
 
59
 
51
        
60
        
52
        /** Tests whether the position passed as argument is on the mesh (return true) 
61
        /** Tests whether the position passed as argument is on the mesh (return true) 
53
         or background (false). This function also retains the 3D unprojection of the 
62
         or background (false). This function also retains the 3D unprojection of the 
54
         grabbed position. */
63
         grabbed position. */
55
        bool grab_mesh(const CGLA::Vec2i& pos);
64
        bool grab_mesh(const CGLA::Vec2i& pos);
Line 59... Line 68...
59
         according to the vector from grabbed to dragged position. */
68
         according to the vector from grabbed to dragged position. */
60
        bool drag_mesh(const CGLA::Vec2i& pos);
69
        bool drag_mesh(const CGLA::Vec2i& pos);
61
        
70
        
62
        /** Releases the mesh. We are no longer dragging. */
71
        /** Releases the mesh. We are no longer dragging. */
63
        void release_mesh();
72
        void release_mesh();
64
        
-
 
65
        
-
 
66
 
73
 
67
        // GLViewController stuff
74
        // GLViewController stuff
68
        void reshape(int w, int h);
75
        void reshape(int w, int h);
69
        void grab_ball(TrackBallAction action, const CGLA::Vec2i& pos);
76
        void grab_ball(TrackBallAction action, const CGLA::Vec2i& pos);
70
        void roll_ball(const CGLA::Vec2i& pos);
77
        void roll_ball(const CGLA::Vec2i& pos);