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

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

?? ply.c.svn-base

?? fast marching method
?? SVN-BASE
?? 第 1 頁 / 共 5 頁
字號:
/*The interface routines for reading and writing PLY polygon files.Greg Turk---------------------------------------------------------------A PLY file contains a single polygonal _object_.An object is composed of lists of _elements_.  Typical elements arevertices, faces, edges and materials.Each type of element for a given object has one or more _properties_associated with the element type.  For instance, a vertex element mayhave as properties the floating-point values x,y,z and the three unsignedchars representing red, green and blue.-----------------------------------------------------------------------Copyright (c) 1998 Georgia Institute of Technology.  All rights reserved.     Permission to use, copy, modify and distribute this software and its   documentation for any purpose is hereby granted without fee, provided   that the above copyright notice and this permission notice appear in   all copies of this software and that you do not sell the software.     THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND,   EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY   WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.   */#include <stdio.h>#include <stdlib.h>#include <math.h>#include <string.h>#include "ply.h"char *type_names[] = {  /* names of scalar types */"invalid","int8", "int16", "int32", "uint8", "uint16", "uint32", "float32", "float64",};char *old_type_names[] = {  /* old names of types for backward compatability */"invalid","char", "short", "int", "uchar", "ushort", "uint", "float", "double",};int ply_type_size[] = {  0, 1, 2, 4, 1, 2, 4, 4, 8};#define NO_OTHER_PROPS  -1#define DONT_STORE_PROP  0#define STORE_PROP       1#define OTHER_PROP       0#define NAMED_PROP       1/* returns 1 if strings are equal, 0 if not */int equal_strings(char *, char *);/* find an element in a plyfile's list */PlyElement *find_element(PlyFile *, char *);/* find a property in an element's list */PlyProperty *find_property(PlyElement *, char *, int *);/* write to a file the word describing a PLY file data type */void write_scalar_type (FILE *, int);/* read a line from a file and break it up into separate words */char **get_words(FILE *, int *, char **);/* write an item to a file */void write_binary_item(FILE *, int, unsigned int, double, int);void write_ascii_item(FILE *, int, unsigned int, double, int);/* add information to a PLY file descriptor */void add_element(PlyFile *, char **, int);void add_property(PlyFile *, char **, int);void add_comment(PlyFile *, char *);void add_obj_info(PlyFile *, char *);/* copy a property */void copy_property(PlyProperty *, PlyProperty *);/* store a value into where a pointer and a type specify */void store_item(char *, int, int, unsigned int, double);/* return the value of a stored item */void get_stored_item( void *, int, int *, unsigned int *, double *);/* return the value stored in an item, given ptr to it and its type */double get_item_value(char *, int);/* get binary or ascii item and store it according to ptr and type */void get_ascii_item(char *, int, int *, unsigned int *, double *);void get_binary_item(FILE *, int, int *, unsigned int *, double *);/* get a bunch of elements from a file */void ascii_get_element(PlyFile *, char *);void binary_get_element(PlyFile *, char *);/* memory allocation */static char *my_alloc(int, int, char *);/*************//*  Writing  *//*************//******************************************************************************Given a file pointer, get ready to write PLY data to the file.Entry:  fp         - the given file pointer  nelems     - number of elements in object  elem_names - list of element names  file_type  - file type, either ascii or binaryExit:  returns a pointer to a PlyFile, used to refer to this file, or NULL if error******************************************************************************/PlyFile *ply_write(  FILE *fp,  int nelems,  char **elem_names,  int file_type){  int i;  PlyFile *plyfile;  PlyElement *elem;  /* check for NULL file pointer */  if (fp == NULL)    return (NULL);  /* create a record for this object */  plyfile = (PlyFile *) myalloc (sizeof (PlyFile));  plyfile->file_type = file_type;  plyfile->num_comments = 0;  plyfile->num_obj_info = 0;  plyfile->num_elem_types = nelems;  plyfile->version = 1.0;  plyfile->fp = fp;  plyfile->other_elems = NULL;  /* tuck aside the names of the elements */  plyfile->elems = (PlyElement **) myalloc (sizeof (PlyElement *) * nelems);  for (i = 0; i < nelems; i++) {    elem = (PlyElement *) myalloc (sizeof (PlyElement));    plyfile->elems[i] = elem;    elem->name = strdup (elem_names[i]);    elem->num = 0;    elem->nprops = 0;  }  /* return pointer to the file descriptor */  return (plyfile);}/******************************************************************************Open a polygon file for writing.Entry:  filename   - name of file to read from  nelems     - number of elements in object  elem_names - list of element names  file_type  - file type, either ascii or binaryExit:  returns a file identifier, used to refer to this file, or NULL if error******************************************************************************/PlyFile *open_for_writing_ply(  char *filename,  int nelems,  char **elem_names,  int file_type){  int i;  PlyFile *plyfile;  PlyElement *elem;  char *name;  FILE *fp;  /* tack on the extension .ply, if necessary */  name = (char *) myalloc (sizeof (char) * (strlen (filename) + 5));  strcpy (name, filename);  if (strlen (name) < 4 ||      strcmp (name + strlen (name) - 4, ".ply") != 0)      strcat (name, ".ply");  /* open the file for writing */  fp = fopen (name, "w");  if (fp == NULL) {    return (NULL);  }  /* create the actual PlyFile structure */  plyfile = ply_write (fp, nelems, elem_names, file_type);  if (plyfile == NULL)    return (NULL);  /* return pointer to the file descriptor */  return (plyfile);}/******************************************************************************Describe an element, including its properties and how many will be writtento the file.Entry:  plyfile   - file identifier  elem_name - name of element that information is being specified about  nelems    - number of elements of this type to be written  nprops    - number of properties contained in the element  prop_list - list of properties******************************************************************************/void element_layout_ply(  PlyFile *plyfile,  char *elem_name,  int nelems,  int nprops,  PlyProperty *prop_list){  int i;  PlyElement *elem;  PlyProperty *prop;  /* look for appropriate element */  elem = find_element (plyfile, elem_name);  if (elem == NULL) {    fprintf(stderr,"element_layout_ply: can't find element '%s'\n",elem_name);    exit (-1);  }  elem->num = nelems;  /* copy the list of properties */  elem->nprops = nprops;  elem->props = (PlyProperty **) myalloc (sizeof (PlyProperty *) * nprops);  elem->store_prop = (char *) myalloc (sizeof (char) * nprops);  for (i = 0; i < nprops; i++) {    prop = (PlyProperty *) myalloc (sizeof (PlyProperty));    elem->props[i] = prop;    elem->store_prop[i] = NAMED_PROP;    copy_property (prop, &prop_list[i]);  }}/******************************************************************************Describe a property of an element.Entry:  plyfile   - file identifier  elem_name - name of element that information is being specified about  prop      - the new property******************************************************************************/void ply_describe_property(  PlyFile *plyfile,  char *elem_name,  PlyProperty *prop){  PlyElement *elem;  PlyProperty *elem_prop;  /* look for appropriate element */  elem = find_element (plyfile, elem_name);  if (elem == NULL) {    fprintf(stderr, "ply_describe_property: can't find element '%s'\n",            elem_name);    return;  }  /* create room for new property */  if (elem->nprops == 0) {    elem->props = (PlyProperty **) myalloc (sizeof (PlyProperty *));    elem->store_prop = (char *) myalloc (sizeof (char));    elem->nprops = 1;  }  else {    elem->nprops++;    elem->props = (PlyProperty **)                  realloc (elem->props, sizeof (PlyProperty *) * elem->nprops);    elem->store_prop = (char *)                  realloc (elem->store_prop, sizeof (char) * elem->nprops);  }  /* copy the new property */  elem_prop = (PlyProperty *) myalloc (sizeof (PlyProperty));  elem->props[elem->nprops - 1] = elem_prop;  elem->store_prop[elem->nprops - 1] = NAMED_PROP;  copy_property (elem_prop, prop);}/******************************************************************************State how many of a given element will be written.Entry:  plyfile   - file identifier  elem_name - name of element that information is being specified about  nelems    - number of elements of this type to be written******************************************************************************/void element_count_ply(  PlyFile *plyfile,  char *elem_name,  int nelems){  int i;  PlyElement *elem;  PlyProperty *prop;  /* look for appropriate element */  elem = find_element (plyfile, elem_name);  if (elem == NULL) {    fprintf(stderr,"element_count_ply: can't find element '%s'\n",elem_name);    exit (-1);  }  elem->num = nelems;}/******************************************************************************Signal that we've described everything a PLY file's header and that theheader should be written to the file.Entry:  plyfile - file identifier******************************************************************************/void header_complete_ply(PlyFile *plyfile){  int i,j;  FILE *fp = plyfile->fp;  PlyElement *elem;  PlyProperty *prop;  fprintf (fp, "ply\n");  switch (plyfile->file_type) {    case PLY_ASCII:      fprintf (fp, "format ascii 1.0\n");      break;    case PLY_BINARY_BE:      fprintf (fp, "format binary_big_endian 1.0\n");      break;    case PLY_BINARY_LE:      fprintf (fp, "format binary_little_endian 1.0\n");      break;    default:      fprintf (stderr, "ply_header_complete: bad file type = %d\n",               plyfile->file_type);      exit (-1);  }  /* write out the comments */  for (i = 0; i < plyfile->num_comments; i++)    fprintf (fp, "comment %s\n", plyfile->comments[i]);  /* write out object information */  for (i = 0; i < plyfile->num_obj_info; i++)    fprintf (fp, "obj_info %s\n", plyfile->obj_info[i]);  /* write out information about each element */  for (i = 0; i < plyfile->num_elem_types; i++) {    elem = plyfile->elems[i];    fprintf (fp, "element %s %d\n", elem->name, elem->num);    /* write out each property */    for (j = 0; j < elem->nprops; j++) {      prop = elem->props[j];      if (prop->is_list == PLY_LIST) {        fprintf (fp, "property list ");        write_scalar_type (fp, prop->count_external);        fprintf (fp, " ");        write_scalar_type (fp, prop->external_type);        fprintf (fp, " %s\n", prop->name);      }      else if (prop->is_list == PLY_STRING) {        fprintf (fp, "property string");        fprintf (fp, " %s\n", prop->name);      }      else {        fprintf (fp, "property ");        write_scalar_type (fp, prop->external_type);        fprintf (fp, " %s\n", prop->name);      }    }  }  fprintf (fp, "end_header\n");}/******************************************************************************Specify which elements are going to be written.  This should be calledbefore a call to the routine ply_put_element().Entry:  plyfile   - file identifier  elem_name - name of element we're talking about******************************************************************************/void put_element_setup_ply(PlyFile *plyfile, char *elem_name){  PlyElement *elem;  elem = find_element (plyfile, elem_name);  if (elem == NULL) {    fprintf(stderr, "put_element_setup_ply: can't find element '%s'\n", elem_name);    exit (-1);  }  plyfile->which_elem = elem;}/******************************************************************************Write an element to the file.  This routine assumes that we'rewriting the type of element specified in the last call to the routineput_element_setup_ply().Entry:  plyfile  - file identifier  elem_ptr - pointer to the element******************************************************************************/void put_element_ply(PlyFile *plyfile, void *elem_ptr){  int i,j,k;  FILE *fp = plyfile->fp;  PlyElement *elem;  PlyProperty *prop;  char *item;  char *elem_data;  char **item_ptr;  int list_count;  int item_size;  int int_val;  unsigned int uint_val;  double double_val;  char **other_ptr;  elem = plyfile->which_elem;  elem_data = (char *) elem_ptr;  other_ptr = (char **) (((char *) elem_ptr) + elem->other_offset);  /* write out either to an ascii or binary file */  if (plyfile->file_type == PLY_ASCII) {    /* write an ascii file */    /* write out each property of the element */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩电影免费在线| 午夜精品久久久久久久99樱桃| 9191国产精品| 欧美唯美清纯偷拍| 91高清视频免费看| 欧美日韩视频专区在线播放| 欧美性受xxxx黑人xyx| 欧美一级理论片| ww亚洲ww在线观看国产| 久久婷婷综合激情| 国产精品免费aⅴ片在线观看| 国产欧美精品一区二区色综合朱莉| 国产欧美日本一区二区三区| 亚洲另类在线视频| 蜜臀av一级做a爰片久久| 国产酒店精品激情| 色噜噜久久综合| 久久影院电视剧免费观看| 中文字幕在线观看不卡视频| 视频一区视频二区中文字幕| 国产成人av影院| 欧美日韩国产中文| 国产日韩欧美不卡| 日本不卡视频在线| 不卡视频一二三| 欧美成人艳星乳罩| 亚洲大尺度视频在线观看| 成人h版在线观看| 日韩欧美国产电影| 香蕉影视欧美成人| 色美美综合视频| 18成人在线视频| 国产不卡视频一区| 国产婷婷色一区二区三区在线| 日本人妖一区二区| 欧美一区二区三区系列电影| 伊人婷婷欧美激情| 91麻豆成人久久精品二区三区| 2024国产精品视频| 精品无人码麻豆乱码1区2区 | 国产无人区一区二区三区| 蓝色福利精品导航| 精品精品国产高清a毛片牛牛 | 91蜜桃视频在线| 亚洲私人黄色宅男| 91在线视频网址| 亚洲一区二区av在线| 欧美视频完全免费看| 日韩av午夜在线观看| 精品捆绑美女sm三区| 国产一区二区精品久久91| 中文av一区特黄| 91黄色免费版| 国产专区欧美精品| 国产精品久久久久一区| 欧美三级日韩在线| 国产在线视频不卡二| 亚洲精品中文在线影院| 亚洲欧美日韩电影| 亚洲欧洲美洲综合色网| 国内不卡的二区三区中文字幕 | 亚洲日本在线看| 日韩午夜中文字幕| 成人av在线网站| 美女视频一区二区三区| 亚洲色图制服诱惑 | 精品一区二区三区日韩| 亚洲国产高清不卡| 日韩你懂的在线播放| 一本大道av一区二区在线播放| 日韩精品电影一区亚洲| 国产精品三级视频| 久久蜜桃av一区精品变态类天堂| 91在线精品秘密一区二区| 国产一区二区三区在线观看免费 | 免费av成人在线| 亚洲欧美日韩在线播放| 国产精品每日更新| 精品国产成人系列| 日韩欧美一级在线播放| 欧美亚洲动漫另类| 在线观看视频一区二区| 91丨porny丨国产| 99久久精品国产观看| 成人动漫在线一区| 国产成人免费视频网站| 国产成人亚洲综合a∨婷婷图片| 精品无人区卡一卡二卡三乱码免费卡 | 国产肉丝袜一区二区| 久久综合给合久久狠狠狠97色69| 欧美一个色资源| 日韩精品一区在线| 欧美大片在线观看| 久久精品视频在线免费观看| 国产亚洲视频系列| 亚洲欧美另类久久久精品2019| 亚洲欧美日韩国产中文在线| 亚洲大尺度视频在线观看| 日韩精品久久理论片| 国产精品中文字幕日韩精品| 成人av片在线观看| 在线播放视频一区| 国产婷婷色一区二区三区四区| 国产精品色在线观看| 一卡二卡三卡日韩欧美| 激情综合色播激情啊| 99久久伊人网影院| 宅男在线国产精品| 亚洲欧洲日本在线| 日本少妇一区二区| 在线亚洲人成电影网站色www| 日韩精品资源二区在线| 亚洲影院在线观看| 国产麻豆精品theporn| 欧美日韩精品一区二区三区四区 | 国产精品久久久久久久久晋中| 亚洲一区二区av在线| jvid福利写真一区二区三区| 欧美私人免费视频| 国产精品美女久久久久aⅴ | 91久久免费观看| 国产日韩v精品一区二区| 天堂午夜影视日韩欧美一区二区| 韩国欧美一区二区| 欧美一二三四区在线| 亚洲综合男人的天堂| 成人不卡免费av| 久久久久久久综合| 日韩在线播放一区二区| 成人激情小说乱人伦| 久久综合国产精品| 国产精品911| 中文字幕欧美日本乱码一线二线| 久久99国产精品免费| 久久青草国产手机看片福利盒子 | 日本韩国欧美在线| 亚洲国产一二三| 日韩一二在线观看| 精品一区二区三区在线视频| 欧美电影免费观看高清完整版在线| 亚洲成人久久影院| 91精品国产91久久久久久一区二区| 婷婷中文字幕综合| 日韩亚洲欧美在线| 国产成人免费视| 中文字幕在线观看不卡视频| 欧美最猛性xxxxx直播| 污片在线观看一区二区 | 水蜜桃久久夜色精品一区的特点| 欧美二区在线观看| 成人sese在线| 一级日本不卡的影视| 欧美综合天天夜夜久久| 卡一卡二国产精品| 中文字幕一区二区三区精华液| 在线欧美一区二区| 国产一区二区视频在线| 日韩一区在线播放| 欧美一区二区啪啪| 91麻豆国产精品久久| 国产麻豆精品95视频| 午夜精品成人在线视频| 国产精品久久久久久久久久久免费看| 91成人国产精品| 成人午夜视频免费看| 另类的小说在线视频另类成人小视频在线 | 欧美久久久久久久久| zzijzzij亚洲日本少妇熟睡| 日韩电影在线观看电影| 亚洲日本在线看| 中文字幕一区二区三中文字幕 | 天天操天天干天天综合网| 欧美激情综合五月色丁香小说| 777奇米成人网| 欧美亚洲图片小说| 色一情一伦一子一伦一区| 国产精品538一区二区在线| 国产一区二区三区精品欧美日韩一区二区三区 | 精品在线一区二区| 免费在线视频一区| 狠狠色狠狠色综合系列| 极品美女销魂一区二区三区免费| 日韩和的一区二区| 狠狠狠色丁香婷婷综合久久五月| 免费成人性网站| 午夜精品福利一区二区三区蜜桃| 日韩区在线观看| 国产精一区二区三区| 天天综合色天天综合| 亚洲123区在线观看| 国产一区视频导航| 99精品在线免费| 91精品国产福利| 国产欧美一区二区精品婷婷 | 一区二区三区波多野结衣在线观看| 亚洲欧美欧美一区二区三区| 日韩av网站免费在线| 国产精品一区二区免费不卡| 色综合一区二区三区| 欧美mv日韩mv亚洲|