1 /* === S I N F G =========================================================== */
2 /*! \file blineconvert.h
3 ** \brief Template Header
5 ** $Id: blineconvert.h,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
8 ** Copyright (c) 2002 Robert B. Quattlebaum Jr.
10 ** This software and associated documentation
11 ** are CONFIDENTIAL and PROPRIETARY property of
12 ** the above-mentioned copyright holder.
14 ** You may not copy, print, publish, or in any
15 ** other way distribute this software without
16 ** a prior written agreement with
17 ** the copyright holder.
20 /* ========================================================================= */
22 /* === S T A R T =========================================================== */
24 #ifndef __SINFG_BLINE_CONVERT_H
25 #define __SINFG_BLINE_CONVERT_H
27 /* === H E A D E R S ======================================================= */
29 #include <sinfg/general.h>
30 #include <sinfg/blinepoint.h>
34 /* === M A C R O S ========================================================= */
36 /* === T Y P E D E F S ===================================================== */
38 /* === C L A S S E S & S T R U C T S ======================================= */
48 sinfg::Real tangentscale;
49 sinfg::Real error; //negative error will indicate invalid;
51 cpindex(int ci, sinfg::Real s=0, sinfg::Real e=-1)
52 :curind(ci), tangentscale(s), error(e)
55 cpindex(const cpindex & o)
56 :curind(o.curind), tangentscale(o.tangentscale), error(o.error)
59 const cpindex & operator = (const cpindex & rhs)
62 tangentscale = rhs.tangentscale;
67 bool operator < (const cpindex &rhs) const
69 return curind < rhs.curind;
72 //point is obviously in[curind]
73 //tangent scale will get reset to the smallest (or something else depending on experimentation)
78 std::vector<sinfg::Point> f; //the preprocessed input cache
79 std::vector<sinfg::Real> f_w;
81 //temporary point storage for vector calc
82 std::vector<sinfg::Point> ftemp;
84 std::vector<sinfg::Vector> df; //the derivative cache
85 std::vector<sinfg::Real> cvt; //the curvature cache
87 std::vector<int> brk; //the break point cache
89 std::vector<sinfg::Real> di, //cumulative distance
90 d_i; //distance between adjacent segments
92 std::vector<sinfg::Point> work; //the working point cache for the entire curve
93 std::vector<cpindex> curind;
101 //Converter properties
102 sinfg::Real pixelwidth;
103 sinfg::Real smoothness; //actual error will be smoothness*pixelwidth (for global set pixelwidth = 1)
107 static void EnforceMinWidth(std::list<sinfg::BLinePoint> &bline, sinfg::Real min_pressure);
108 void operator ()(std::list<sinfg::BLinePoint> &out, const std::list<sinfg::Point> &in,const std::list<sinfg::Real> &in_w);
111 }; // END of namespace sinfgapp
113 /* === E N D =============================================================== */