/* Copyright 2005 Nicholas Bishop * * This file is part of SharpConstruct. * * SharpConstruct is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * SharpConstruct is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with SharpConstruct; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef CREATE_H #define CREATE_H #include namespace SharpConstruct { class Mesh; namespace Create { class File { public: File( const std::string& ); bool operator()() const; private: void load_obj_() const; const std::string file_; }; class Cube { public: Cube( const unsigned, const unsigned, const unsigned ); bool operator()(); private: void create_vertices_(); void create_back_vertices_(); void create_top_vertices_(); void create_front_vertices_(); void create_bottom_vertices_(); void create_left_vertices_(); void create_right_vertices_(); void create_polygons_() const; void create_main_polygon_strip_() const; void connect_back_to_bottom_() const; void create_left_and_right_polygons_() const; void create_vertical_connections_() const; void create_horizontal_connections_() const; void create_left_corners_() const; void create_right_corners_() const; void add_quad_( const unsigned, const unsigned, const unsigned, const unsigned ) const; const unsigned rows_, cols_, stacks_; unsigned top_start_, front_start_, bottom_start_; unsigned left_start_, right_start_, right_end_; }; class Sphere { public: Sphere( const unsigned ); bool operator()() const; private: const unsigned divisions_; }; class Plane { public: Plane( const unsigned, const unsigned ); bool operator()() const; private: const unsigned rows_, columns_; }; } } #endif