/* Copyright (c) 1997-2006 Ewgenij Gawrilow, Michael Joswig (Technische Universitaet Berlin, Germany) http://www.math.tu-berlin.de/polymake, mailto:polymake@math.tu-berlin.de This program 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, or (at your option) any later version: http://www.gnu.org/licenses/gpl.txt. This program 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. */ #ifndef _POLYMAKE_SCHLEGEL_WINDOW_H #define _POLYMAKE_SCHLEGEL_WINDOW_H "$Project: polymake $$Id: SchlegelWindow.h 7315 2006-04-02 21:37:53Z gawrilow $" #include #include #include #include namespace polymake { namespace polytope { // One instance of this class per window, providing several simultaneously visible projection facets class SchlegelWindow { int d, proj_facet; typedef Map param_map; typedef Map iparam_map; param_map params; iparam_map iparams; Matrix Vertices, NeighborFacets, Points, inv_Rotation; Vector ViewRay, FacetPoint; bool constrained; public: typedef std::pair > dragged_point; // index and new coordinates SchlegelWindow(const Matrix& V, const Matrix& F, const Graph<>& FG, const Vector& FacetPoint_arg, const Vector& InteriorPoint, int facet_index, const double& zoom_arg); int get_proj_facet() const { return proj_facet; } const Matrix& get_points() const { return Points; } const iparam_map& get_iparams() const { return iparams; } const param_map& get_params() const { return params; } const double& get_param(const std::string& key) { return params[key];} const bool& get_iparam(const std::string& key) { return iparams[key]; } void set_param(const std::string& key, const double val) { params[key] = val; compute_points();} void set_iparam(const std::string& key, bool value) { iparams[key] = value; } enum drag_response { drag_OK, drag_ignore, drag_boundary }; drag_response drag_point(dragged_point& dragged, const IncidenceMatrix<>& VIF); std::pair< Vector, Vector > reconstruct_params() const; private: void compute_points(); double inverse_zoom(); }; } } #endif // _POLYMAKE_SCHLEGEL_WINDOW_H // Local Variables: // mode:C++ // c-basic-offset:3 // End: