亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
日韩午夜激情视频| 日韩精品欧美精品| 日韩电影免费一区| 岛国精品一区二区| 欧美精品一二三区| 亚洲色图视频网站| 国产九色精品成人porny| 69av一区二区三区| 欧美国产精品专区| 精东粉嫩av免费一区二区三区| 91官网在线免费观看| 国产精品成人在线观看| 久久99热这里只有精品| 欧美日韩免费在线视频| 一区二区三区欧美日韩| 成人免费高清视频| 国产亚洲美州欧州综合国| 日韩av二区在线播放| 欧美日韩一区二区不卡| 亚洲激情欧美激情| 成人午夜av电影| 久久久久高清精品| 国内不卡的二区三区中文字幕| 欧美色偷偷大香| 亚洲一区二区三区激情| 色婷婷综合视频在线观看| 国产精品不卡一区| www.av精品| 亚洲三级在线免费观看| 国产成人综合精品三级| 26uuu国产一区二区三区 | 91久久精品网| 亚洲视频一区二区在线| 色一情一乱一乱一91av| 亚洲日本va在线观看| 91年精品国产| 亚洲午夜久久久久中文字幕久| 欧美影院午夜播放| 亚洲成人激情av| 欧美一区二区三区视频免费播放 | 欧美高清视频一二三区| 日韩制服丝袜av| 欧美一激情一区二区三区| 精品在线亚洲视频| 国产女人18水真多18精品一级做 | 欧美一区二区三区性视频| 日韩二区在线观看| 精品美女在线观看| 成人免费视频视频在线观看免费| 亚洲视频在线观看一区| 777色狠狠一区二区三区| 欧美aaa在线| 久久这里只有精品首页| 国产一区二区三区免费播放| 国产精品久久久久久久岛一牛影视| av亚洲精华国产精华| 午夜精品一区在线观看| 精品处破学生在线二十三| 国产成人在线免费观看| 一区二区高清视频在线观看| 欧美mv和日韩mv国产网站| 国产精品18久久久久久vr| 亚洲天堂免费看| 日韩免费视频一区二区| 欧美在线观看视频一区二区三区| 伊人开心综合网| 精品女同一区二区| 91九色最新地址| 精品午夜久久福利影院| 一区二区三区日韩欧美精品 | 精品视频一区三区九区| 激情综合网激情| 一区二区在线免费观看| 国产亚洲福利社区一区| 欧美日韩一区二区在线观看视频| 国产一区二区成人久久免费影院| 亚洲激情av在线| 国产欧美日韩综合精品一区二区| 欧美乱妇15p| www.性欧美| 黄网站免费久久| 亚洲成av人片一区二区三区| 欧美激情一区二区三区全黄| 欧美人xxxx| 色婷婷激情综合| 国产69精品久久久久777| 丝袜美腿一区二区三区| 亚洲人精品午夜| 欧美激情一区二区三区| 精品国产污污免费网站入口 | 678五月天丁香亚洲综合网| 91色porny蝌蚪| 粉嫩av一区二区三区粉嫩| 久久精品久久精品| 三级在线观看一区二区| 一区二区三区精密机械公司| 国产精品天天摸av网| 26uuu亚洲综合色| 欧美一区二区三区系列电影| 欧美色综合影院| 日本电影亚洲天堂一区| 日本道在线观看一区二区| 色综合一个色综合亚洲| 99久久精品免费看| www.日韩大片| 99久久国产综合精品色伊| www.亚洲人| 色系网站成人免费| 99精品欧美一区二区三区小说| 成人污污视频在线观看| www.爱久久.com| 91麻豆swag| 在线视频亚洲一区| 欧美中文字幕久久| 欧美三级视频在线| 欧美视频一区在线观看| 欧美亚洲自拍偷拍| 欧美乱妇23p| 欧美精三区欧美精三区| 911精品产国品一二三产区| 欧美日本韩国一区二区三区视频| 欧美日韩精品一区二区三区四区 | 精品午夜一区二区三区在线观看| 麻豆91免费观看| 黄色资源网久久资源365| 国产原创一区二区三区| 国产成人av在线影院| 成人福利在线看| 日本高清不卡在线观看| 欧美精品v日韩精品v韩国精品v| 555www色欧美视频| 久久久久久久综合色一本| 国产精品久久久久久久久免费相片 | 在线视频欧美精品| 欧美精品18+| 久久久www成人免费毛片麻豆| 国产精品美女久久久久久久网站| 亚洲欧美日韩久久| 五月激情丁香一区二区三区| 欧美aaa在线| 不卡av免费在线观看| 欧美性受xxxx黑人xyx性爽| 欧美一区二区三区四区久久| 国产婷婷色一区二区三区在线| 亚洲摸摸操操av| 麻豆国产精品官网| 91影院在线观看| 91精品国产一区二区| 日本一二三不卡| 三级精品在线观看| 国产盗摄一区二区| 69成人精品免费视频| 亚洲欧美在线观看| 美女一区二区视频| 99国产精品国产精品毛片| 欧美一级欧美三级| 亚洲欧美日韩综合aⅴ视频| 麻豆91在线播放| 欧美曰成人黄网| 久久精品视频免费| 首页国产欧美久久| 91在线免费播放| 久久众筹精品私拍模特| 日韩精品亚洲专区| 日本高清不卡视频| 亚洲免费在线视频| 老色鬼精品视频在线观看播放| 99精品视频在线免费观看| 日韩欧美电影一二三| 亚洲精品国产无套在线观| 精品一区二区三区免费| 欧美日韩国产一级二级| 最新久久zyz资源站| 韩国三级中文字幕hd久久精品| 精品视频1区2区3区| 最新日韩在线视频| 成人午夜av在线| 久久久久久久综合狠狠综合| 秋霞午夜鲁丝一区二区老狼| 91成人在线精品| 亚洲精品视频观看| 成人97人人超碰人人99| 久久免费国产精品| 美日韩一级片在线观看| 91精品免费在线观看| 日韩国产欧美在线观看| 欧美色图片你懂的| 一区二区三区四区视频精品免费| 成+人+亚洲+综合天堂| 中文字幕精品在线不卡| 国产精品一区专区| 久久精品无码一区二区三区| 韩国v欧美v亚洲v日本v| 欧美videos中文字幕| 久久国产欧美日韩精品| 日韩欧美一级二级三级久久久| 日韩不卡一区二区三区| 日韩三级视频中文字幕| 老司机午夜精品99久久| 久久综合999|