NVIDIA Iray API Home  Up
 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, 2016 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 #include <mi/neuraylib/version.h>
14 
15 namespace mi {
16 
17 namespace neuraylib {
18 
23 struct Triangle_point_indices_struct
27 {
28  Uint32 index[3];
29 };
30 
35 {
36 public:
38  Triangle_point_indices() { index[0] = 0; index[1] = 0; index[2] = 0; }
39 
42  index[0] = e1;
43  index[1] = e2;
44  index[2] = e3;
45  }
46 
49  index[0] = other.index[0];
50  index[1] = other.index[1];
51  index[2] = other.index[2];
52  }
53 
55  Uint32& operator[]( Uint32 i) { return index[i]; }
56 
58  const Uint32& operator[]( Uint32 i) const { return index[i]; }
59 
64  int compare( const Triangle_point_indices& other) const {
65  if ( index[0] < other.index[0]) return -1;
66  if ( index[0] > other.index[0]) return 1;
67  if ( index[1] < other.index[1]) return -1;
68  if ( index[1] > other.index[1]) return 1;
69  if ( index[2] < other.index[2]) return -1;
70  if ( index[2] > other.index[2]) return 1;
71  return 0;
72  }
73 
75  bool operator==( const Triangle_point_indices& other) const {
76  return compare(other) == 0;
77  }
78 
80  bool operator!=( const Triangle_point_indices& other) const {
81  return compare(other) != 0;
82  }
83 
85  bool operator< ( const Triangle_point_indices& other) const {
86  return compare(other) < 0;
87  }
88 
90  bool operator<=( const Triangle_point_indices& other) const {
91  return compare(other) <= 0;
92  }
93 
95  bool operator> ( const Triangle_point_indices& other) const {
96  return compare(other) > 0;
97  }
98 
100  bool operator>=( const Triangle_point_indices& other) const {
101  return compare(other) >= 0;
102  }
103 };
104 
145  public base::Interface_declare<0x47cf1faa,0x609d,0x44ee,0xa3,0x6a,0xca,0x02,0x92,0xf7,0x6a,0x40>
146 {
147 public:
149 
150 
152  virtual Uint32 triangles_size() const = 0;
153 
167  virtual Sint32 set_triangle_indices( Triangle_handle_struct t, const Uint32* indices) = 0;
168 
184  Triangle_handle_struct t, Uint32 v0, Uint32 v1, Uint32 v2) = 0;
185 
200 
205  virtual Uint32 get_triangle_index( Triangle_handle_struct t, Uint32 vertex) const = 0;
206 
212  Triangle_handle_struct t) const = 0;
213 
218  virtual bool is_valid_connectivity() const = 0;
219 
221 
223 
228  virtual bool has_attribute( Mesh_attribute_name name) const = 0;
229 
249  Mesh_attribute_name name, Uint32 dim = 1) const = 0;
250 
256  virtual const IAttribute_vector* access_attribute_vector( Mesh_attribute_name name) const = 0;
257 
269 
285 
295 
297 
299 
303  virtual Connectivity_map_type get_map_type() const = 0;
304 
306 };
307  // end group mi_neuray_leaf_nodes
309 
310 } // namespace neuraylib
311 
312 #ifdef MI_NEURAYLIB_DEPRECATED_NAMESPACE_MI_TRANSITION
320 #endif // MI_NEURAYLIB_DEPRECATED_NAMESPACE_MI_TRANSITION
321 
322 } // namespace mi
323 
324 #endif // MI_NEURAYLIB_ITRIANGLE_CONNECTIVITY_H