00001 /* 00002 * PROPRIETARY INFORMATION. This software is proprietary to 00003 * Side Effects Software Inc., and is not to be reproduced, 00004 * transmitted, or disclosed in any way without written permission. 00005 * 00006 * Produced by: 00007 * Cristin Barghiel 00008 * Side Effects Software Inc. 00009 * 20 Maud St. 00010 * Toronto, Ontario, M5V 2M5 00011 * Canada 00012 * 416-366-4607 00013 * 00014 * NAME: Geometry Library (C++) 00015 * 00016 * COMMENTS: 00017 * A class that implements forward differencing for parametric functions. 00018 * Handles orders up to GB_MAXORDER. The code does fwd. differencing on 00019 * surfaces and curves. 00020 * 00021 * 00022 */ 00023 00024 00025 #ifndef __GB_FwdDiff_h__ 00026 #define __GB_FwdDiff_h__ 00027 00028 #include "GB_API.h" 00029 #include <SYS/SYS_Types.h> 00030 #include "GB_Defines.h" // defines GB_MAXORDER 00031 00032 class GB_API GB_FwdDiff { 00033 public: 00034 // Constructor that takes the U anv V order of the functions, and 00035 // the stepsize in each parametric direction. vOrd should be 1 when 00036 // dealing with curves. 00037 GB_FwdDiff(int uOrd=4, fpreal uIncrem=1.0f, int vOrd=1, fpreal vIncrem=1.0f); 00038 00039 // Trivial destructor. 00040 virtual ~GB_FwdDiff() { } 00041 00042 // Initialize the differencer with data. This is a no-op if the 00043 // differencer is already using those parameters. 00044 void initialize(int uOrd=4, fpreal uIncrem=1.0f, 00045 int vOrd=1, fpreal vIncrem=1.0f); 00046 00047 // Query the private elements. 00048 int getUOrder(void) const { return uOrder; } 00049 int getVOrder(void) const { return vOrder; } 00050 fpreal getUStep(void) const { return uStep; } 00051 fpreal getVStep(void) const { return vStep; } 00052 00053 protected: 00054 // The order of the functions in U and V directions. 00055 int uOrder; 00056 int vOrder; 00057 00058 // The walking increment. 00059 fpreal uStep; 00060 fpreal vStep; 00061 00062 // Matrices that store results to be shared between calls to walk(). 00063 fpreal uMatx[GB_MAXORDER][GB_MAXORDER]; 00064 fpreal vMatx[GB_MAXORDER][GB_MAXORDER]; 00065 00066 private: 00067 00068 }; 00069 00070 #endif
1.5.9