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

? 歡迎來(lái)到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? ply.c

?? 在MATLAB環(huán)境下的level set方法的實(shí)現(xiàn)
?? C
?? 第 1 頁(yè) / 共 5 頁(yè)
字號(hào):
/*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 */

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久亚洲高清| 韩国女主播成人在线| 亚洲欧美偷拍卡通变态| 亚洲视频中文字幕| 亚洲精品国久久99热| 亚洲在线中文字幕| 亚洲va欧美va天堂v国产综合| 亚洲制服丝袜av| 五月天一区二区三区| 91丨九色porny丨蝌蚪| 国产福利电影一区二区三区| 国产福利不卡视频| av在线不卡观看免费观看| 色噜噜夜夜夜综合网| 在线观看日韩一区| 在线成人免费视频| 精品日韩欧美在线| 中文字幕免费观看一区| 亚洲精品videosex极品| 亚洲成人先锋电影| 国产一区二区三区香蕉| 99精品国产一区二区三区不卡| 91黄色免费看| 日韩欧美国产麻豆| 欧美高清在线视频| 亚洲va韩国va欧美va| 精品一区二区三区av| 成人免费观看视频| 欧美午夜精品久久久久久超碰 | 日韩免费电影一区| 国产网站一区二区| 一区二区国产视频| 久久国产人妖系列| 99热精品国产| 欧美日韩一区不卡| 久久精品在这里| 亚洲综合一二区| 国产呦精品一区二区三区网站| www.日韩在线| 欧美精品在欧美一区二区少妇| 精品美女一区二区| 一区二区三区欧美激情| 麻豆高清免费国产一区| 99视频在线观看一区三区| 欧美日韩欧美一区二区| 国产亚洲人成网站| 亚洲高清免费在线| 成人一区在线观看| 制服丝袜成人动漫| 亚洲欧洲av色图| 激情小说欧美图片| 欧美无砖专区一中文字| 亚洲国产精品av| 99精品在线观看视频| 欧美日韩精品三区| 亚洲国产精品99久久久久久久久| 偷窥少妇高潮呻吟av久久免费| 国产91高潮流白浆在线麻豆| 在线观看成人小视频| 欧美激情在线观看视频免费| 男女男精品网站| 91福利在线导航| 中文在线免费一区三区高中清不卡| 亚洲aaa精品| 91无套直看片红桃| 久久综合狠狠综合久久综合88| 亚洲影视资源网| 99r国产精品| 国产亚洲综合在线| 久久99国产精品久久99果冻传媒| 欧美日韩国产综合久久| 亚洲三级视频在线观看| 成人性生交大片免费看视频在线| 欧美大片一区二区| 日韩电影免费一区| 欧美男生操女生| 亚洲一二三区视频在线观看| 99久久久久久| 国产精品高潮久久久久无| 国产高清不卡一区二区| 日韩精品一区二区三区老鸭窝| 午夜影院久久久| 欧洲视频一区二区| 亚洲欧美一区二区久久| 9i在线看片成人免费| 国产精品麻豆久久久| 国产精品一区三区| 久久精品夜色噜噜亚洲aⅴ| 久久国产精品色婷婷| 91精品国产综合久久久久| 婷婷开心久久网| 欧美精品国产精品| 日本欧美一区二区| 欧美一区二区视频在线观看2022 | 成人一道本在线| 国产日韩欧美综合在线| 国产成人8x视频一区二区| 久久一留热品黄| 国产麻豆视频一区二区| 久久久久久久久99精品| 国产一区不卡视频| 国产女主播在线一区二区| 成人一级视频在线观看| 中文字幕一区二区日韩精品绯色| 粉嫩av一区二区三区| 中文字幕亚洲一区二区av在线 | 久久影音资源网| 国产精品一卡二| 中文字幕免费一区| 99免费精品视频| 夜夜嗨av一区二区三区中文字幕 | 色8久久人人97超碰香蕉987| 亚洲精品一二三| 欧美三级韩国三级日本一级| 日韩国产高清在线| 亚洲精品在线一区二区| 成人综合日日夜夜| 亚洲精品乱码久久久久久黑人 | 精品免费国产一区二区三区四区| 麻豆精品一区二区| 国产亚洲精品7777| 91偷拍与自偷拍精品| 爽好久久久欧美精品| 欧美sm极限捆绑bd| 成人永久看片免费视频天堂| 亚洲欧美经典视频| 欧美日韩国产片| 黄色日韩三级电影| 亚洲欧美日韩久久精品| 欧美精品一级二级三级| 激情国产一区二区| 亚洲欧美激情插| 91 com成人网| 成人激情动漫在线观看| 亚洲18色成人| 久久久久高清精品| 一本色道久久综合精品竹菊| 日本va欧美va精品发布| 国产精品素人视频| 欧美日韩一区不卡| 粉嫩aⅴ一区二区三区四区| 亚洲动漫第一页| 国产亚洲va综合人人澡精品 | www国产成人免费观看视频 深夜成人网| 国产一区二区影院| 亚洲最大成人网4388xx| 精品国产一区二区三区忘忧草| 99久久精品国产麻豆演员表| 青青草国产成人99久久| 国产精品初高中害羞小美女文| 91精品久久久久久久99蜜桃| 成人黄色av电影| 免费在线看一区| 亚洲欧美偷拍三级| 久久久噜噜噜久噜久久综合| 欧美三级资源在线| 成人中文字幕在线| 久久福利资源站| 有码一区二区三区| 国产亚洲一本大道中文在线| 欧美电影一区二区三区| jlzzjlzz亚洲日本少妇| 久久国产精品色| 亚洲成人av中文| 18涩涩午夜精品.www| 久久免费视频一区| 日韩亚洲欧美中文三级| 在线中文字幕一区二区| 成人免费视频播放| 狠狠色丁香婷综合久久| av电影天堂一区二区在线观看| 毛片一区二区三区| 午夜不卡av在线| 亚洲综合在线五月| 中文字幕在线不卡视频| 精品国精品国产| 欧美一区二区三区免费在线看| 91免费看片在线观看| 成人伦理片在线| 国产精品综合一区二区三区| 日本不卡高清视频| 性欧美疯狂xxxxbbbb| 亚洲精品欧美在线| 亚洲日本一区二区三区| 国产精品无圣光一区二区| 久久综合九色综合97婷婷女人| 欧美二区三区91| 欧美高清你懂得| 欧美日韩一区高清| 欧美日韩在线免费视频| 91久久精品国产91性色tv| 91色|porny| 99在线精品观看| 99精品久久免费看蜜臀剧情介绍| 国产成人免费视频| 丁香激情综合五月| 不卡高清视频专区| av一区二区三区| 97se亚洲国产综合在线| 成人91在线观看|