/* -*- C++ -*- * Copyright ©2004 Hugo Mills * * This software is distributed under the terms of the GNU GPL v3 * For more information on the GPL, see the file COPYING or * visit http://www.gnu.org/ * * This software is distributed without warranty */ #ifndef XFMAP_CYLORTHOGRAPHIC_H #define XFMAP_CYLORTHOGRAPHIC_H #include "magellan/xfmap.h" class XfMap_CylindricalOrthographic : public XfMap { public: XfMap_CylindricalOrthographic(double std) : stdparallel(std), scale(cos(std)) { } virtual ~XfMap_CylindricalOrthographic() { } virtual bool f(dvec2&, const dvec3&) const; virtual bool g(dvec3&, const dvec2&) const; static XfMap* parser( ConfigLexer* lex, const std::string& type, const std::string& subtype = "" ); class CylindricalOrthographic_TraceState : public TraceState { public: virtual ~CylindricalOrthographic_TraceState() { } dvec2 previous; // Only need this representation, because all // points on the sphere map to points on the // map }; // Initialise a path trace at a given point virtual TraceState* initpath(TPCInsertIterator it, const dvec3& point) const; // Takes 3D points as input. Map and insert the relevant 2D points // (including start and end), if any, using the iterator. Should // use f(), ideally. virtual void pathpoint(TraceState* state, TPCInsertIterator it, const dvec3& point) const; // Add segments of a path around the edge of the projection // between two given lambda values. Include the start point, but // not the end point. virtual void tracepath(TPCInsertIterator it, double startlambda, double endlambda) const; private: double stdparallel; double scale; }; #endif