Visual Computing Library
Loading...
Searching...
No Matches
ply.h
1/*****************************************************************************
2 * VCLib *
3 * Visual Computing Library *
4 * *
5 * Copyright(C) 2021-2025 *
6 * Visual Computing Lab *
7 * ISTI - Italian National Research Council *
8 * *
9 * All rights reserved. *
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the Mozilla Public License Version 2.0 as published *
13 * by the Mozilla Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 * This program is distributed in the hope that it will be useful, *
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
19 * Mozilla Public License Version 2.0 *
20 * (https://www.mozilla.org/en-US/MPL/2.0/) for more details. *
21 ****************************************************************************/
22
23#ifndef VCL_LOAD_SAVE_PLY_DETAIL_PLY_H
24#define VCL_LOAD_SAVE_PLY_DETAIL_PLY_H
25
26#include <vclib/misc/tokenizer.h>
27
28#include <list>
29
30namespace vcl::detail {
31
32// put all these enumeration names inside a ply namespace, to avoid collisions
33
34namespace ply {
35
36typedef enum { ASCII, BINARY_LITTLE_ENDIAN, BINARY_BIG_ENDIAN, UNKNOWN } Format;
37
38typedef enum { VERTEX, FACE, EDGE, TRISTRIP, MATERIAL, OTHER } ElementType;
39
40typedef enum { RGB, RGBA } ColorMode;
41
42typedef enum {
43 unknown = -1,
44 x,
45 y,
46 z,
47 nx,
48 ny,
49 nz,
50 red,
51 green,
52 blue,
53 alpha,
54 quality,
55 texture_u,
56 texture_v,
57 texnumber,
58 vertex_indices,
59 texcoord,
60 vertex1,
61 vertex2
62} PropertyName;
63
64using PropertyType = PrimitiveType;
65
66} // namespace ply
67
68struct PlyProperty
69{
70 ply::PropertyName name;
71 ply::PropertyType type;
72 bool list = false;
73 ply::PropertyType listSizeType;
74 std::string unknownPropertyName; // when a property is not recognized
75};
76
77struct PlyElement
78{
79 ply::ElementType type;
80 std::list<PlyProperty> properties;
81 uint numberElements;
82 std::string unknownElementType; // when an element is not recognized
83};
84
85} // namespace vcl::detail
86
87#endif // VCL_LOAD_SAVE_PLY_DETAIL_PLY_H
PrimitiveType
A simple type that enumerates the main primitive types.
Definition base.h:58