19 # define HIO_API __declspec (dllexport) 21 # define HIO_API __attribute__ ((visibility ("default"))) 29 using Matrix = std::array<float, 16>;
30 using RGBAColor = std::array<float, 4>;
31 using RGBColor = std::array<float, 3>;
32 using Point = std::array<float, 3>;
34 using StringArray = std::vector<std::string>;
35 using MatrixArray = std::vector<Matrix>;
36 using KeyArray = std::vector<HC_KEY>;
37 using FloatArray = std::vector<float>;
38 using IntArray = std::vector<int>;
39 using PointArray = std::vector<Point>;
40 using RGBColorArray = std::vector<RGBColor>;
41 using RGBAColorArray = std::vector<RGBAColor>;
43 static inline uint32_t extract_uint32_t(
float const & a)
46 memcpy(&i, &a,
sizeof(
float));
50 static inline bool float_match(
float const & a,
float const & b) {
51 uint32_t va = extract_uint32_t(a);
52 uint32_t vb = extract_uint32_t(b);
54 if (((va | vb) & 0x7FFFFFFF) == 0)
67 Vector(
float x,
float y,
float z) : x(x), y(y), z(z) {}
68 Vector(
Point const & p) : x(p[0]), y(p[1]), z(p[2]) {}
69 Vector(
Vector const & that) : x(that.x), y(that.y), z(that.z) {}
71 bool operator== (
Vector const & v)
const {
72 return float_match(x, v.x) && float_match(y, v.y) && float_match(z, v.z);
74 bool operator!= (
Vector const & v)
const {
return !(*
this == v); }
76 Vector const operator+(
Vector const & v)
const {
return Vector(x + v.x, y + v.y, z + v.z); }
77 Vector const operator-(
Vector const & v)
const {
return Vector(x - v.x, y - v.y, z - v.z); }
78 Vector & operator+=(
Vector const & v) { x += v.x; y += v.y; z += v.z;
return *
this; }
79 Vector & operator-=(
Vector const & v) { x -= v.x; y -= v.y; z -= v.z;
return *
this; }
81 Vector const operator*(
float s)
const {
return Vector(s * x, s * y, s * z); }
82 Vector const operator/(
float s)
const {
return operator*(1.0f / s); }
83 Vector & operator*=(
float s) { x *= s; y *= s; z *= s;
return *
this; }
84 Vector & operator/=(
float s) {
return operator*=(1.0f / s); }
86 inline float Dot(
Vector const & v)
const {
return x * v.x + y * v.y + z * v.z; }
87 inline float Length()
const {
return sqrt(Dot(*
this)); }
88 inline Vector & Normalize()
90 float length = Length();
97 inline Vector const Normalized()
const 100 return copy.Normalize();
105 HC_Compute_Cross_Product(
this, &v, &cross);
112 inline Vector operator*(
float s,
Vector const & v) {
return v * s; }
114 using VectorArray = std::vector<Vector>;
169 HIO_API
void * CreateOutput(
HIOManager *manager);
Definition: HIOUtilityHTML.h:120
Definition: HIOManager.h:1442
virtual HFileOutputResult FileOutputByKey(const char *filename, HC_KEY key, HOutputHandlerOptions *options)
Definition: HIOUtilityHTML.h:60
const char * GetOutputTypesString()
Definition: HIOUtilityHTML.h:134
const char * GetOutputName()
Definition: HIOUtilityHTML.h:131
HOutputHandlerStyle GetOutputStyle()
Definition: HIOUtilityHTML.h:137
#define HOutputOpFileOutputByKey
This HOutputHandler supports output from a segment key.
Definition: HIOManager.h:73
Definition: HDWFMisc.h:22
HOutputHandlerStyle
Definition: HIOManager.h:854
HOutputHandler an abstract base class for model and image output.
Definition: HIOManager.h:1255
virtual void RegisterOutputHandlerTypes()=0
Definition: HIOManager.h:900
HIOUtilityHTML()
Definition: HIOUtilityHTML.h:124
void SetOutputOps(unsigned long ops)
This sets the HOutputOp.
Definition: HIOManager.h:1420
A header file containing the HIO classes for passing to HBaseView::FileInput and HBaseView::FileOutpu...
Definition: GrownKeyPath.h:5