HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GA_AIFCopyData.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: GA_AIFCopyData.h ( GA Library, C++)
7  *
8  * COMMENTS: Attribute Interface to copy data
9  */
10 
11 #ifndef __GA_AIFCopyData__
12 #define __GA_AIFCopyData__
13 
14 #include "GA_API.h"
15 #include "GA_Types.h"
16 
17 class GA_Range;
18 class GA_Attribute;
19 class GA_AIFTuple;
20 class GA_AIFStringTuple;
21 
22 /// @brief Attribute Interface class to copy attribute data
23 ///
24 /// Copy
26 {
27 public:
29  virtual ~GA_AIFCopyData();
30 
31  /// Copy attribute values for a single element.
32  virtual bool copy(GA_Attribute &d, GA_Offset di,
33  const GA_Attribute &s, GA_Offset si) const = 0;
34 
35  /// Copy attribute values for a range of elements.
36  /// See the @c parallelCopy() method.
37  virtual bool copy(GA_Attribute &d, const GA_Range &di,
38  const GA_Attribute &s, const GA_Range &si) const=0;
39 
40  /// Assign all elements of a range from a single attribute value.
41  /// @note The default implementation just calls copy() for each element
42  /// in the destination range.
43  virtual bool fill(GA_Attribute &d, const GA_Range &di,
44  const GA_Attribute &s, GA_Offset si) const;
45 
46 protected:
47  /// Convenience method to perform a parallel copy (by calling the
48  /// individual copy multiple times).
49  bool parallelCopy(GA_Attribute &d, const GA_Range &di,
50  const GA_Attribute &s, const GA_Range &si) const;
51 
52  /// @{
53  /// Convenience method to copy data using the AIFTuple interface.
54  /// Data is copied using the highest precision floating point format
55  bool tupleCopy(const GA_AIFTuple *tuple,
56  GA_Attribute &d, GA_Offset di,
57  const GA_Attribute &s, GA_Offset si) const;
58  bool tupleCopy(const GA_AIFTuple *tuple,
59  GA_Attribute &d, const GA_Range &di,
60  const GA_Attribute &s, const GA_Range &si) const;
61  /// @}
62 
63  /// @{
64  /// Convenience method to copy data using the AIFStringTuple interface.
65  /// Data is copied using the highest precision floating point format
66  bool tupleCopy(const GA_AIFStringTuple *tuple,
67  GA_Attribute &d, GA_Offset di,
68  const GA_Attribute &s, GA_Offset si) const;
69  bool tupleCopy(const GA_AIFStringTuple *tuple,
70  GA_Attribute &d, const GA_Range &di,
71  const GA_Attribute &s, const GA_Range &si) const;
72  /// @}
73 };
74 
75 #endif
Definition of a geometry attribute.
Definition: GA_Attribute.h:198
OIIO_UTIL_API bool copy(string_view from, string_view to, std::string &err)
GLdouble s
Definition: glad.h:3009
#define GA_API
Definition: GA_API.h:14
FMT_NOINLINE FMT_CONSTEXPR auto fill(OutputIt it, size_t n, const fill_t< Char > &fill) -> OutputIt
Definition: format.h:1262
A range of elements in an index-map.
Definition: GA_Range.h:42
GA_Size GA_Offset
Definition: GA_Types.h:646
Attribute Interface class to copy attribute data.
Generic Attribute Interface class to access an attribute as a tuple.
Definition: GA_AIFTuple.h:32
Generic Attribute Interface class to work with string indices directly, rather than string values...