亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ellipse.c

?? 給予QT的qps開源最新源碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
/****************************************************************************/
/* RSC IDENTIFIER:  Ellipsoid
 *
 * ABSTRACT
 *
 *    The purpose of ELLIPSOID is to provide access to ellipsoid parameters 
 *    for a collection of common ellipsoids.  A particular ellipsoid can be 
 *    accessed by using its standard 2-letter code to find its index in the 
 *    ellipsoid table.  The index can then be used to retrieve the ellipsoid 
 *    name and parameters.
 *
 *    By sequentially retrieving all of the ellipsoid codes and/or names, a 
 *    menu of the available ellipsoids can be constructed.  The index values 
 *    resulting from selections from this menu can then be used to access the 
 *    parameters of the selected ellipsoid.
 *
 *    This component depends on a data file named "ellips.dat", which contains
 *    the ellipsoid parameter values.  A copy of this file must be located in 
 *    the directory specified by the environment variable "ELLIPSOID_DATA", if 
 *    defined, or else in the current directory, whenever a program containing 
 *    this component is executed.
 *
 *    Additional ellipsoids can be added to this file, either manually or using 
 *    the Create_Ellipsoid function.  However, if a large number of ellipsoids 
 *    are added, the ellipsoid table array size in this component will have to 
 *    be increased.
 *
 * ERROR HANDLING
 *
 *    This component checks parameters for valid values.  If an invalid value
 *    is found, the error code is combined with the current error code using 
 *    the bitwise or.  This combining allows multiple error codes to be
 *    returned. The possible error codes are:
 *
 *  ELLIPSE_NO_ERROR             : No errors occured in function
 *  ELLIPSE_FILE_OPEN_ERROR      : Ellipsoid file opening error
 *  ELLIPSE_INITIALIZE_ERROR     : Ellipsoid table can not initialize
 *  ELLIPSE_TABLE_OVERFLOW_ERROR : Ellipsoid table overflow
 *  ELLIPSE_NOT_INITIALIZED_ERROR: Ellipsoid table not initialized properly
 *  ELLIPSE_INVALID_INDEX_ERROR  : Index is an invalid value
 *  ELLIPSE_INVALID_CODE_ERROR   : Code was not found in table
 *  ELLIPSE_A_ERROR              : Semi-major axis less than or equal to zero
 *  ELLIPSE_INV_F_ERROR          : Inverse flattening outside of valid range
 *	                                (250 to 350)
 *  ELLIPSE_IN_USE_ERROR         : User defined ellipsoid is in use by a user 
 *                                  defined datum
 *  ELLIPSE_NOT_USERDEF_ERROR    : Ellipsoid is not user defined - cannot be
 *                                  deleted
 *
 * REUSE NOTES
 *
 *    Ellipsoid is intended for reuse by any application that requires Earth
 *    approximating ellipsoids.
 *     
 * REFERENCES
 *
 *    Further information on Ellipsoid can be found in the Reuse Manual.
 *
 *    Ellipsoid originated from :  U.S. Army Topographic Engineering Center (USATEC)
 *                                 Geospatial Information Division (GID)
 *                                 7701 Telegraph Road
 *                                 Alexandria, VA  22310-3864
 *
 * LICENSES
 *
 *    None apply to this component.
 *
 * RESTRICTIONS
 *
 *    Ellipsoid has no restrictions.
 *
 * ENVIRONMENT
 *
 *    Ellipsoid was tested and certified in the following environments
 *
 *    1. Solaris 2.5
 *    2. Windows 95 
 *
 * MODIFICATIONS
 *
 *    Date              Description
 *    ----              -----------
 *    11-19-95          Original Code
 *    17-Jan-97         Moved local constants out of public interface
 *                      Improved efficiency in algorithms (GEOTRANS)
 *    24-May-99         Added user-defined ellipsoids (GEOTRANS for JMTK)
 *
 */


/***************************************************************************/
/*
 *                               INCLUDES
 */
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include "datum.h"
#include "ellipse.h"

/* 
 *    ctype.h    - standard C character handling library
 *    stdio.h    - standard C input/output library
 *    stdlib.h   - standard C general utilities library
 *    string.h   - standard C string handling library
 *    datum.h    - used to determine if user defined ellipsoid 
 *                  is in use by a user defined datum
 *    ellipse.h  - prototype error checking and error codes
 */


/***************************************************************************/
/*
 *                             GLOBAL DATA STRUCTURES
 */

#define MAX_ELLIPSOIDS        32  /* Maximum number of ellipsoids in table */
#define ELLIPSOID_CODE_LENGTH  3  /* Length of ellipsoid code (including null) */
#define ELLIPSOID_NAME_LENGTH 30  /* Max length of ellipsoid name */
#define ELLIPSOID_BUF         90
#define FILENAME_LENGTH      128
#define FALSE 0
#define TRUE  1

const char *WGS84_Ellipsoid_Code = "WE";
const char *WGS72_Ellipsoid_Code = "WD";

typedef struct Ellipsoid_Table_Row
{
  char Name[ELLIPSOID_NAME_LENGTH];
  char Code[ELLIPSOID_CODE_LENGTH];
  double A;
  double B;
  double Recp_F;
  long User_Defined;  /* Identifies a user defined ellipsoid */
} Ellipsoid_Row;

static Ellipsoid_Row Ellipsoid_Table[MAX_ELLIPSOIDS];
static long WGS84_Index = 0;           /* Index of WGS84 in ellipsoid table */
static long WGS72_Index = 0;           /* Index of WGS72 in ellipsoid table */
static long Number_of_Ellipsoids = 0;  /* Number of ellipsoids in table */
static long Ellipsoid_Initialized = 0; /* Indicates successful initialization */

/***************************************************************************/
/*                              FUNCTIONS                                  */


void Assign_Ellipsoid_Row (Ellipsoid_Row *destination, 
                           const Ellipsoid_Row *source)
{ /* Begin Assign_Ellipsoid_Row */
/*
 *   destination  : The destination of the copy         (output)
 *   source       : The source for the copy             (input)
 *
 * The function Assign_Ellipsoid_Row copies ellipsoid data.
 */

  strcpy(destination->Name, source->Name);
  strcpy(destination->Code, source->Code);
  destination->A = source->A;
  destination->B = source->B;
  destination->Recp_F = source->Recp_F;
  destination->User_Defined = source->User_Defined;
} /* End Assign_Ellipsoid_Row */


long Initialize_Ellipsoids () 
{ /* Begin Initialize_Ellipsoids */
/*
 * The function Initialize_Ellipsoids reads ellipsoid data from ellips.dat in
 * the current directory and builds the ellipsoid table from it.  If an 
 * error occurs, the error code is returned, otherwise ELLIPSE_NO_ERROR is 
 * returned.
 */

  char *PathName;
  char FileName[FILENAME_LENGTH];
  FILE *fp = NULL;                    /* File pointer to file ellips.dat     */
  char buffer[ELLIPSOID_BUF];
  long index = 0;                     /* Array index                         */
  long error_code = ELLIPSE_NO_ERROR;

  if (Ellipsoid_Initialized)
  {
    return error_code;
  }

  /*  Check the environment for a user provided path, else current directory;   */
  /*  Build a File Name, including specified or default path:                   */

  PathName = getenv( "ELLIPSOID_DATA" );
  if (PathName != NULL)
  {
    strcpy( FileName, PathName );
    strcat( FileName, "/" );
  }
  else
  {
    strcpy( FileName, "./" );
  }
  strcat( FileName, "ellips.dat" );

  /*  Open the File READONLY, or Return Error Condition:                        */

  if (( fp = fopen( FileName, "r" ) ) == NULL)
  {
    return ( ELLIPSE_FILE_OPEN_ERROR);
  }

  /* read file */
  while ((!feof(fp)) && (!error_code))
  {
    if (index <= MAX_ELLIPSOIDS)
    {
      if (fgets(buffer, ELLIPSOID_BUF, fp))
      {
        sscanf(buffer, "%30c %s %lf %lf %lf",
               Ellipsoid_Table[index].Name,
               Ellipsoid_Table[index].Code,
               &(Ellipsoid_Table[index].A),
               &(Ellipsoid_Table[index].B),
               &(Ellipsoid_Table[index].Recp_F));
        if (Ellipsoid_Table[index].Name[0] == '*')
        {
          int i;
          Ellipsoid_Table[index].User_Defined = TRUE;
          for (i = 0; i < ELLIPSOID_NAME_LENGTH; i++)
            Ellipsoid_Table[index].Name[i] = Ellipsoid_Table[index].Name[i+1];
        }
        else
          Ellipsoid_Table[index].User_Defined = FALSE;
        Ellipsoid_Table[index].Name[ELLIPSOID_NAME_LENGTH - 1] = '\0'; /* null terminate */
        index++;
      }
    }
    else
      error_code |= ELLIPSE_TABLE_OVERFLOW_ERROR;
  } 
  fclose(fp);
  Number_of_Ellipsoids = index;

  if (error_code)
  {
    Ellipsoid_Initialized = 0;
    Number_of_Ellipsoids = 0;
  }
  else
    Ellipsoid_Initialized = 1;

  /* Store WGS84 Index*/
  if (Ellipsoid_Index(WGS84_Ellipsoid_Code, &WGS84_Index))
    error_code |= ELLIPSE_INITIALIZE_ERROR;

  /* Store WGS72 Index*/
  if (Ellipsoid_Index(WGS72_Ellipsoid_Code, &WGS72_Index))
    error_code |= ELLIPSE_INITIALIZE_ERROR;

  return (error_code);
} /* End of Initialize_Ellipsoids */


long Create_Ellipsoid (const char* Code,
                       const char* Name,
                       double a,
                       double f)
{ /* Begin Create_Ellipsoid */
/*
 *   Code     : 2-letter ellipsoid code.                      (input)
 *   Name     : Name of the new ellipsoid                     (input)
 *   a        : Semi-major axis, in meters, of new ellipsoid  (input)
 *   f        : Flattening of new ellipsoid.                  (input)
 *
 * The function Create_Ellipsoid creates a new ellipsoid with the specified
 * Code, name, and axes.  If the ellipsoid table has not been initialized,
 * the specified code is already in use, or a new version of the ellips.dat 
 * file cannot be created, an error code is returned, otherwise ELLIPSE_NO_ERROR 
 * is returned.  Note that the indexes of all ellipsoids in the ellipsoid
 * table may be changed by this function.
 */

  long error_code = ELLIPSE_NO_ERROR;
  long index = 0;
  long code_length = 0;
  char *PathName;
  char FileName[FILENAME_LENGTH];
  char ellipsoid_code[ELLIPSOID_CODE_LENGTH];
  FILE *fp = NULL;                    /* File pointer to file ellips.dat     */
  double inv_f = 1 / f;

  if (!Ellipsoid_Initialized)
    error_code |= ELLIPSE_NOT_INITIALIZED_ERROR;
  else if (!(Number_of_Ellipsoids < MAX_ELLIPSOIDS))
    error_code |= ELLIPSE_TABLE_OVERFLOW_ERROR;
  else
  {
    code_length = strlen(Code);
    if ((!Ellipsoid_Index(Code, &index)) || (code_length > (ELLIPSOID_CODE_LENGTH-1)))
      error_code |= ELLIPSE_INVALID_CODE_ERROR;
    if (a <= 0.0)
      error_code |= ELLIPSE_A_ERROR;
    if ((inv_f < 250) || (inv_f > 350))
    { /* Inverse flattening must be between 250 and 350 */
      error_code |= ELLIPSE_INV_F_ERROR;
    }
    if (!error_code)
    {
      long i;
      strcpy(ellipsoid_code,Code);
      /* Convert code to upper case */
      for (i = 0; i < code_length; i++)
        ellipsoid_code[i] = toupper(ellipsoid_code[i]);
      index = Number_of_Ellipsoids;
      strcpy(Ellipsoid_Table[index].Name, Name);
      strcpy(Ellipsoid_Table[index].Code, ellipsoid_code);
      Ellipsoid_Table[index].A = a;
      Ellipsoid_Table[index].B = a * (1 - f);
      Ellipsoid_Table[index].Recp_F = inv_f;
      Ellipsoid_Table[index].User_Defined = TRUE;
      Number_of_Ellipsoids++;
      /*output updated ellipsoid table*/
      PathName = getenv( "ELLIPSOID_DATA" );
      if (PathName != NULL)
      {
        strcpy( FileName, PathName );
        strcat( FileName, "/" );
      }
      else
      {
        strcpy( FileName, "./" );
      }
      strcat( FileName, "ellips.dat" );

      if ((fp = fopen(FileName, "w")) == NULL)
      { /* fatal error */
        return ELLIPSE_FILE_OPEN_ERROR;
      }
      /* write file */
      index = 0;
      while (index < Number_of_Ellipsoids)
      {
        if (Ellipsoid_Table[index].User_Defined)
          fprintf(fp, "*%-29s %-2s %11.3f %12.4f %13.9f \n",
                  Ellipsoid_Table[index].Name,
                  Ellipsoid_Table[index].Code,
                  Ellipsoid_Table[index].A,
                  Ellipsoid_Table[index].B,
                  Ellipsoid_Table[index].Recp_F);
        else
          fprintf(fp, "%-29s  %-2s %11.3f %12.4f %13.9f \n",
                  Ellipsoid_Table[index].Name,
                  Ellipsoid_Table[index].Code,
                  Ellipsoid_Table[index].A,
                  Ellipsoid_Table[index].B,
                  Ellipsoid_Table[index].Recp_F);
        index++;
      }
      fclose(fp);
      /* Store WGS84 */
      Ellipsoid_Index(WGS84_Ellipsoid_Code, &WGS84_Index);
      /* Store WGS72 */
      Ellipsoid_Index(WGS72_Ellipsoid_Code, &WGS72_Index);
    }
  }
  return (error_code);
} /* End Create_Ellipsoid */


long Delete_Ellipsoid (const char* Code) 
{/* Begin Delete_Ellipsoid */
/*
 *   Code     : 2-letter ellipsoid code.                      (input)
 *
 * The function Delete_Ellipsoid deletes a user defined ellipsoid with 
 * the specified Code.  If the ellipsoid table has not been created,
 * the specified code is in use by a user defined datum, or a new version   
 * of the ellips.dat file cannot be created, an error code is returned, 
 * otherwise ELLIPSE_NO_ERROR is returned.  Note that the indexes of all  
 * ellipsoids in the ellipsoid table may be changed by this function.
 */

  long error_code = ELLIPSE_NO_ERROR;
  long index = 0;
  char *PathName;
  char FileName[FILENAME_LENGTH];
  FILE *fp = NULL;                    /* File pointer to file ellips.dat     */

  if (!Ellipsoid_Initialized)
    error_code |= ELLIPSE_NOT_INITIALIZED_ERROR;
  else
  {
    if (!Ellipsoid_Index(Code, &index))
    {
      if (Ellipsoid_Table[index-1].User_Defined)
      {
        if (Datum_Uses_Ellipsoid(Code))
          error_code |= ELLIPSE_IN_USE_ERROR;
      }
      else
        error_code |= ELLIPSE_NOT_USERDEF_ERROR;
    }
    else

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一本一道久久a久久精品综合蜜臀| 精品一区二区日韩| 欧美电影免费观看高清完整版| 成人午夜电影小说| 久久疯狂做爰流白浆xx| 亚洲曰韩产成在线| 亚洲免费观看高清完整版在线| 欧美tk丨vk视频| 91麻豆精品国产| 色狠狠色噜噜噜综合网| 成人av影视在线观看| 国产福利不卡视频| 狠狠狠色丁香婷婷综合激情| 强制捆绑调教一区二区| 国产91丝袜在线播放九色| 精品一区二区影视| 极品少妇一区二区三区精品视频| 乱中年女人伦av一区二区| 看片网站欧美日韩| 在线电影欧美成精品| 欧美一区二区三区在线| 精品少妇一区二区三区视频免付费| 欧美精品高清视频| 日韩欧美aaaaaa| 久久久噜噜噜久噜久久综合| 久久久久久久久99精品| 国产日产欧产精品推荐色 | 欧美伊人久久大香线蕉综合69 | 欧美日韩精品高清| 日韩欧美一区电影| 久久久国际精品| 亚洲欧洲综合另类| 秋霞影院一区二区| 国产成人精品亚洲日本在线桃色| av午夜一区麻豆| 欧美一区二区三区在线观看视频| 欧美变态口味重另类| **性色生活片久久毛片| 日日噜噜夜夜狠狠视频欧美人| 黑人精品欧美一区二区蜜桃| 97久久精品人人做人人爽| 777精品伊人久久久久大香线蕉| 久久久国产一区二区三区四区小说| ...xxx性欧美| 国产一区二区三区综合| 欧美色图在线观看| 中文字幕高清一区| 日韩国产欧美在线视频| 91免费视频大全| 久久精品欧美一区二区三区麻豆| 一区二区三区四区在线播放| 国产一区在线观看视频| 777午夜精品免费视频| 国产精品国产三级国产aⅴ入口 | 国精产品一区一区三区mba视频| 在线看一区二区| 国产精品萝li| 国产成人8x视频一区二区| 日韩欧美精品在线视频| 日韩不卡手机在线v区| 欧美午夜在线一二页| 亚洲韩国一区二区三区| 日本久久精品电影| 亚洲色图.com| 色婷婷精品久久二区二区蜜臂av| 欧美国产一区二区| 成人av午夜电影| 亚洲色图在线看| 91国产免费看| 亚洲乱码国产乱码精品精可以看| 99vv1com这只有精品| 亚洲女同女同女同女同女同69| 91在线精品一区二区| 亚洲人成在线播放网站岛国| 99re6这里只有精品视频在线观看 99re8在线精品视频免费播放 | www.久久久久久久久| 亚洲免费三区一区二区| 欧美日韩亚洲综合在线 | 18成人在线观看| 欧美日韩美女一区二区| 日韩中文字幕区一区有砖一区| 伊人婷婷欧美激情| 欧美一级理论片| 成人中文字幕合集| 亚洲精品国产品国语在线app| 欧美日韩精品免费观看视频| 久久爱www久久做| 亚洲色欲色欲www在线观看| 555夜色666亚洲国产免| 国产91精品一区二区麻豆网站| 国产麻豆9l精品三级站| 亚洲一区二区三区精品在线| 精品国产三级电影在线观看| 日韩精品一区国产麻豆| 色婷婷综合久久久中文字幕| 美洲天堂一区二卡三卡四卡视频| 国产精品乱人伦中文| 制服丝袜亚洲色图| 色综合久久中文字幕综合网| 免费欧美高清视频| 亚洲一级二级在线| 亚洲欧美电影一区二区| 久久久亚洲午夜电影| 日韩免费高清视频| 欧美日韩国产综合视频在线观看| 99久久精品99国产精品| 国产美女精品一区二区三区| 亚洲国产精品麻豆| 一区二区三区四区不卡在线| 久久久久久综合| 日韩欧美你懂的| 日韩手机在线导航| 91精品国产麻豆国产自产在线| 欧美色图在线观看| 欧美主播一区二区三区美女| 91视视频在线直接观看在线看网页在线看| 久久精品国产久精国产| 日本中文在线一区| 性做久久久久久免费观看欧美| 樱花草国产18久久久久| 亚洲精品久久7777| 洋洋成人永久网站入口| 亚洲国产一区视频| 日本va欧美va欧美va精品| 日本欧美一区二区三区乱码 | 亚洲免费伊人电影| 一区二区三区中文在线观看| 亚洲高清在线视频| 亚洲成精国产精品女| 奇米影视在线99精品| 国产不卡在线一区| 色诱亚洲精品久久久久久| 欧美老女人第四色| 日韩精品中文字幕在线一区| 久久亚洲精华国产精华液| 中文字幕一区二区三| 伊人色综合久久天天| 蜜臀精品久久久久久蜜臀| 欧美日韩和欧美的一区二区| 日韩精品一区二| 日韩美女视频一区| 日本亚洲欧美天堂免费| 国产精品自在欧美一区| 91丝袜国产在线播放| 6080yy午夜一二三区久久| 中文一区一区三区高中清不卡| 亚洲黄色av一区| 国产在线一区二区| 欧美网站大全在线观看| 久久蜜桃av一区精品变态类天堂 | 久久综合久久综合久久综合| 成人免费在线播放视频| 狠狠色狠狠色合久久伊人| 色偷偷久久人人79超碰人人澡| 欧美一级午夜免费电影| 中文字幕一区三区| 另类小说一区二区三区| 欧美精三区欧美精三区| 亚洲黄色片在线观看| 成人一区二区三区在线观看| 精品日韩一区二区| 日韩电影在线免费| 欧美在线不卡一区| 一区二区三区小说| 色国产综合视频| 一区二区免费看| 欧美日韩免费不卡视频一区二区三区| 亚洲男同性恋视频| proumb性欧美在线观看| 久久久久久久综合| 国产精品18久久久久久vr| 久久婷婷综合激情| 国产高清精品在线| 国产精品伦一区| 99久久久国产精品| 欧美国产成人精品| 99久久777色| 亚洲va韩国va欧美va| 欧美色欧美亚洲另类二区| 天天综合网 天天综合色| 91精品欧美久久久久久动漫| 免费成人在线视频观看| 日韩女优av电影| 国产成人av一区二区三区在线| 国产精品久久免费看| 一本大道av一区二区在线播放| 亚洲欧美欧美一区二区三区| 欧美三区在线观看| 另类人妖一区二区av| 国产精品国产馆在线真实露脸| 欧美影视一区在线| 精品影视av免费| 亚洲乱码中文字幕综合| 日韩欧美专区在线| 91色porny| 另类小说图片综合网| 亚洲丝袜美腿综合| 欧美日韩不卡一区二区| 97se亚洲国产综合自在线观| 日韩在线一二三区|