HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
pyOperators.h File Reference
#include "pxr/pxr.h"
#include "pxr/base/vt/api.h"
+ Include dependency graph for pyOperators.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  PXR_NAMESPACE_OPEN_SCOPE::_ArrayPyOpHelp< T >
 
struct  PXR_NAMESPACE_OPEN_SCOPE::_ArrayPyOpHelp< bool >
 

Namespaces

 PXR_NAMESPACE_OPEN_SCOPE
 

Macros

#define VTOPERATOR_WRAP_PYTYPE_BASE(op, method, pytype, isRightVer)
 
#define VTOPERATOR_WRAP_PYTYPE(op, method, pytype)   VTOPERATOR_WRAP_PYTYPE_BASE(op, method, pytype, false)
 
#define VTOPERATOR_WRAP_PYTYPE_R(op, method, pytype)   VTOPERATOR_WRAP_PYTYPE_BASE(op, method, pytype, true)
 
#define VTOPERATOR_WRAP(lmethod, rmethod)
 
#define VTOPERATOR_WRAP_NONCOMM(lmethod, rmethod)
 
#define VTOPERATOR_WRAPDECLARE_BASE(op, method, rettype)
 
#define VTOPERATOR_WRAPDECLARE(op, lmethod, rmethod)
 
#define VTOPERATOR_WRAP_PYTYPE_BOOL_BASE(func, arg1, arg2, expr)
 
#define VTOPERATOR_WRAP_PYTYPE_BOOL(func, pytype, op)
 
#define VTOPERATOR_WRAP_BOOL(func, op)
 
#define VTOPERATOR_WRAPDECLARE_BOOL(func)
 

Macro Definition Documentation

#define VTOPERATOR_WRAP (   lmethod,
  rmethod 
)
Value:
VTOPERATOR_WRAP_PYTYPE(lmethod,lmethod,tuple) \
VTOPERATOR_WRAP_PYTYPE(lmethod,lmethod,list) \
VTOPERATOR_WRAP_PYTYPE(lmethod,rmethod,tuple) \
VTOPERATOR_WRAP_PYTYPE(lmethod,rmethod,list)
#define VTOPERATOR_WRAP_PYTYPE(op, method, pytype)
Definition: pyOperators.h:86

Definition at line 96 of file pyOperators.h.

#define VTOPERATOR_WRAP_BOOL (   func,
  op 
)
Value:
#define VTOPERATOR_WRAP_PYTYPE_BOOL(func, pytype, op)
Definition: pyOperators.h:144
GLenum func
Definition: glcorearb.h:783

Definition at line 152 of file pyOperators.h.

#define VTOPERATOR_WRAP_NONCOMM (   lmethod,
  rmethod 
)
Value:
VTOPERATOR_WRAP_PYTYPE(lmethod,lmethod,tuple) \
VTOPERATOR_WRAP_PYTYPE(lmethod,lmethod,list) \
VTOPERATOR_WRAP_PYTYPE_R(lmethod,rmethod,tuple) \
VTOPERATOR_WRAP_PYTYPE_R(lmethod,rmethod,list)
#define VTOPERATOR_WRAP_PYTYPE(op, method, pytype)
Definition: pyOperators.h:86
#define VTOPERATOR_WRAP_PYTYPE_R(op, method, pytype)
Definition: pyOperators.h:90

Definition at line 103 of file pyOperators.h.

#define VTOPERATOR_WRAP_PYTYPE (   op,
  method,
  pytype 
)    VTOPERATOR_WRAP_PYTYPE_BASE(op, method, pytype, false)

Definition at line 86 of file pyOperators.h.

#define VTOPERATOR_WRAP_PYTYPE_BASE (   op,
  method,
  pytype,
  isRightVer 
)
Value:
template <typename T> static \
VtArray<T> method##pytype(VtArray<T> vec, pytype obj) { \
size_t length = len(obj); \
if (length != vec.size()) { \
TfPyThrowValueError("Non-conforming inputs for operator " \
#method); \
return VtArray<T>(); \
} \
VtArray<T> ret(vec.size()); \
for (size_t i = 0; i < length; ++i) { \
if (!extract<T>(obj[i]).check()) \
TfPyThrowValueError("Element is of incorrect type."); \
if (isRightVer) { \
ret[i] = _ArrayPyOpHelp<T>:: op ( \
(T)extract<T>(obj[i]), vec[i]); \
} \
else { \
ret[i] = _ArrayPyOpHelp<T>:: op ( \
vec[i], (T)extract<T>(obj[i])); \
} \
} \
return ret; \
}
GLuint GLsizei GLsizei * length
Definition: glcorearb.h:795
TF_API void TfPyThrowValueError(const char *msg)
Definition: types.h:170
if(num_boxed_items<=0)
Definition: UT_RTreeImpl.h:697
* for(int i=0;i< n_subtasks;++i)*tasks.push(pool-> push(myfunc))
Definition: UT_RTreeImpl.h:685

Definition at line 60 of file pyOperators.h.

#define VTOPERATOR_WRAP_PYTYPE_BOOL (   func,
  pytype,
  op 
)
Value:
VtArray<T> const &vec, pytype const &obj, \
(vec[i] op (T)extract<T>(obj[i])) ) \
pytype const &obj,VtArray<T> const &vec, \
((T)extract<T>(obj[i]) op vec[i]) )
Definition: types.h:170
GLenum func
Definition: glcorearb.h:783
#define VTOPERATOR_WRAP_PYTYPE_BOOL_BASE(func, arg1, arg2, expr)
Definition: pyOperators.h:124

Definition at line 144 of file pyOperators.h.

#define VTOPERATOR_WRAP_PYTYPE_BOOL_BASE (   func,
  arg1,
  arg2,
  expr 
)
Value:
template <typename T> static \
VtArray<bool> Vt##func(arg1, arg2) \
{ \
size_t length = len(obj); \
if (length != vec.size()) { \
TfPyThrowValueError("Non-conforming inputs for " #func); \
return VtArray<bool>(); \
} \
VtArray<bool> ret(vec.size()); \
for (size_t i = 0; i < length; ++i) { \
if (!extract<T>(obj[i]).check()) \
TfPyThrowValueError("Element is of incorrect type."); \
ret[i] = expr; \
} \
return ret; \
}
GLuint GLsizei GLsizei * length
Definition: glcorearb.h:795
TF_API void TfPyThrowValueError(const char *msg)
Definition: types.h:170
GLenum func
Definition: glcorearb.h:783
if(num_boxed_items<=0)
Definition: UT_RTreeImpl.h:697
* for(int i=0;i< n_subtasks;++i)*tasks.push(pool-> push(myfunc))
Definition: UT_RTreeImpl.h:685

Definition at line 124 of file pyOperators.h.

#define VTOPERATOR_WRAP_PYTYPE_R (   op,
  method,
  pytype 
)    VTOPERATOR_WRAP_PYTYPE_BASE(op, method, pytype, true)

Definition at line 90 of file pyOperators.h.

#define VTOPERATOR_WRAPDECLARE (   op,
  lmethod,
  rmethod 
)
Value:
.def(#rmethod,rmethod##tuple<Type>) \
.def(#rmethod,rmethod##list<Type>)
#define VTOPERATOR_WRAPDECLARE_BASE(op, method, rettype)
Definition: pyOperators.h:110

Definition at line 117 of file pyOperators.h.

#define VTOPERATOR_WRAPDECLARE_BASE (   op,
  method,
  rettype 
)
Value:
.def(self op self) \
.def(self op Type()) \
.def(Type() op self) \
.def(#method,method##tuple<rettype>) \
.def(#method,method##list<rettype>)

Definition at line 110 of file pyOperators.h.

#define VTOPERATOR_WRAPDECLARE_BOOL (   func)
Value:
def(#func,(VtArray<bool> (*) \
(VtArray<Type> const &,VtArray<Type> const &)) \
Vt##func<Type>); \
def(#func,(VtArray<bool> (*) \
(Type const &,VtArray<Type> const &)) \
Vt##func<Type>); \
def(#func,(VtArray<bool> (*) \
(VtArray<Type> const &,Type const &)) \
Vt##func<Type>); \
def(#func,(VtArray<bool> (*) \
(VtArray<Type> const &,tuple const &)) \
Vt##func<Type>); \
def(#func,(VtArray<bool> (*) \
(tuple const &,VtArray<Type> const &)) \
Vt##func<Type>); \
def(#func,(VtArray<bool> (*) \
(VtArray<Type> const &,list const &)) \
Vt##func<Type>); \
def(#func,(VtArray<bool> (*) \
(list const &,VtArray<Type> const &)) \
Vt##func<Type>);
Definition: types.h:170
GLenum func
Definition: glcorearb.h:783

Definition at line 157 of file pyOperators.h.