NVIDIA Iray API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
itriangle_connectivity.h
Go to the documentation of this file.
1 //*****************************************************************************
2 // Copyright 1986, 2014 NVIDIA Corporation. All rights reserved.
3 //*****************************************************************************
6 //*****************************************************************************
7 
8 #ifndef MI_NEURAYLIB_ITRIANGLE_CONNECTIVITY_H
9 #define MI_NEURAYLIB_ITRIANGLE_CONNECTIVITY_H
10 
12 #include <mi/neuraylib/identifier.h>
13 
14 namespace mi {
15 
20 struct Triangle_point_indices_struct
24 {
25  Uint32 index[3];
26 };
27 
32 {
33 public:
35  Triangle_point_indices() { index[0] = 0; index[1] = 0; index[2] = 0; }
36 
39  index[0] = e1;
40  index[1] = e2;
41  index[2] = e3;
42  }
43 
46  index[0] = other.index[0];
47  index[1] = other.index[1];
48  index[2] = other.index[2];
49  }
50 
52  Uint32& operator[]( Uint32 i) { return index[i]; }
53 
55  const Uint32& operator[]( Uint32 i) const { return index[i]; }
56 
61  int compare( const Triangle_point_indices& other) const {
62  if ( index[0] < other.index[0]) return -1;
63  if ( index[0] > other.index[0]) return 1;
64  if ( index[1] < other.index[1]) return -1;
65  if ( index[1] > other.index[1]) return 1;
66  if ( index[2] < other.index[2]) return -1;
67  if ( index[2] > other.index[2]) return 1;
68  return 0;
69  }
70 
72  bool operator==( const Triangle_point_indices& other) const {
73  return compare(other) == 0;
74  }
75 
77  bool operator!=( const Triangle_point_indices& other) const {
78  return compare(other) != 0;
79  }
80 
82  bool operator< ( const Triangle_point_indices& other) const {
83  return compare(other) < 0;
84  }
85 
87  bool operator<=( const Triangle_point_indices& other) const {
88  return compare(other) <= 0;
89  }
90 
92  bool operator> ( const Triangle_point_indices& other) const {
93  return compare(other) > 0;
94  }
95 
97  bool operator>=( const Triangle_point_indices& other) const {
98  return compare(other) >= 0;
99  }
100 };
101 
142  public base::Interface_declare<0x47cf1faa,0x609d,0x44ee,0xa3,0x6a,0xca,0x02,0x92,0xf7,0x6a,0x40>
143 {
144 public:
146 
147 
149  virtual Uint32 triangles_size() const = 0;
150 
160  virtual Sint32 set_triangle_indices( Triangle_handle_struct t, const Uint32* indices) = 0;
161 
173  Triangle_handle_struct t, Uint32 v0, Uint32 v1, Uint32 v2) = 0;
174 
185 
190  virtual Uint32 get_triangle_index( Triangle_handle_struct t, Uint32 vertex) const = 0;
191 
197  Triangle_handle_struct t) const = 0;
198 
203  virtual bool is_valid_connectivity() const = 0;
204 
206 
208 
213  virtual bool has_attribute( Mesh_attribute_name name) const = 0;
214 
228  Mesh_attribute_name name, Uint32 dim = 1) const = 0;
229 
235  virtual const IAttribute_vector* access_attribute_vector( Mesh_attribute_name name) const = 0;
236 
248 
264 
266 
268 
272  virtual Connectivity_map_type get_map_type() const = 0;
273 
275 };
276 
277 } // namespace mi
278 
279 #endif // MI_NEURAYLIB_ITRIANGLE_CONNECTIVITY_H