Cortex  10.0.0-a4
PTCParticleIO.h
1 //
3 // Copyright (c) 2007, Image Engine Design Inc. All rights reserved.
4 //
5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are
7 // met:
8 //
9 // * Redistributions of source code must retain the above copyright
10 // notice, this list of conditions and the following disclaimer.
11 //
12 // * Redistributions in binary form must reproduce the above copyright
13 // notice, this list of conditions and the following disclaimer in the
14 // documentation and/or other materials provided with the distribution.
15 //
16 // * Neither the name of Image Engine Design nor the names of any
17 // other contributors to this software may be used to endorse or
18 // promote products derived from this software without specific prior
19 // written permission.
20 //
21 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
22 // IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
23 // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
25 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
26 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
27 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
28 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
31 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 //
34 
35 #ifndef IE_CORERI_PTCPARTICLEIO_H
36 #define IE_CORERI_PTCPARTICLEIO_H
37 
38 #include "pointcloud.h"
39 
40 #define PTC_HEADER_BBOX_FLOATS 6
41 #define PTC_HEADER_MATRIX_FLOATS 16
42 #define PTC_HEADER_FORMAT_FLOATS 3
43 #define PTC_MAX_VARIABLES 1024
44 
45 
46 namespace IECoreRI
47 {
48 
49 namespace PTCParticleIO
50 {
51 
52  enum VarType
53  {
54  Color = 0,
55  Point,
56  Normal,
57  Vector,
58  Float,
59  Matrix,
60  VarTypeCount,
61  };
62 
63  struct Record
64  {
65  VarType type;
66  int position;
67  };
68 
69  struct PTCHeader
70  {
71  bool valid;
72  int nPoints;
73  bool hasBbox, hasWorld2eye, hasWorld2ndc, hasFormat;
74  float bbox[ PTC_HEADER_BBOX_FLOATS ];
75  int datasize;
76  float world2eye[ PTC_HEADER_MATRIX_FLOATS ];
77  float world2ndc[ PTC_HEADER_MATRIX_FLOATS ];
78  float format[ PTC_HEADER_FORMAT_FLOATS ];
79  int nvars;
80  char const *varnames[ PTC_MAX_VARIABLES ];
81  char const *vartypes[ PTC_MAX_VARIABLES ];
82  std::map<std::string, Record > attributes;
83  };
84 
85  struct PTCType
86  {
87  std::string name;
88  int nFloats;
89  };
90 
91  extern PTCType ptcVariableTypes[];
92 
93  extern void checkPTCParticleIO();
94 
95 #ifdef PRMANEXPORT
96  typedef char ** CharPtrPtr;
99 #else
100  typedef const char ** CharPtrPtr;
101 #endif
102 
103 } // namespace PTCParticleIO
104 
105 } // namespace IECoreRI
106 
107 #endif // IE_CORERI_PTCPARTICLEIO_H
The IECoreRI namespace holds all the functionality implemented in libIECoreRI.
Definition: IECoreRI.h:41