HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GEO_VolumeOptions.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: GEO_VolumeOptions.h (GEO Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __GEO_VOLUMEOPTIONS_H_INCLUDED__
12 #define __GEO_VOLUMEOPTIONS_H_INCLUDED__
13 
14 #include <UT/UT_VoxelArray.h>
15 
16 #include "GEO_API.h"
17 
19 {
25 };
26 
28 {
35 };
36 
38 {
40  {
41  }
43  : myMode(mode)
44  , myIso(iso)
45  , myDensity(density)
46  {
47  }
48  bool operator==(const GEO_VolumeOptions &v) const
49  {
50  return (myMode == v.myMode
51  && myIso == v.myIso
52  && myDensity == v.myDensity);
53  }
54  bool operator!=(const GEO_VolumeOptions &v) const
55  {
56  return !(*this == v);
57  }
58 
59  GEO_VolumeVis myMode;
60  fpreal myIso;
61  fpreal myDensity;
62 };
63 
64 /// Return string token from GEO_VolumeBorder enum value
65 GEO_API const char * GEOgetVolumeBorderToken(
67 /// Return GEO_VolumeBorder enum value from string token. def is returned if
68 /// token is unknown.
70  const char *token,
71  GEO_VolumeBorder def);
72 
73 /// Return string token from GEO_VolumeVis enum value
74 GEO_API const char * GEOgetVolumeVisToken(
75  GEO_VolumeVis vis);
76 /// Return GEO_VolumeVis enum value from string token. def is returned if
77 /// token is unknown.
79  const char *vis,
80  GEO_VolumeVis def);
81 
82 inline size_t format(char *buf, size_t bufsize, const GEO_VolumeBorder &v)
83 {
84  UT::Format::Writer writer(buf, bufsize);
86  return f.format(writer, "{}", {GEOgetVolumeBorderToken(v)});
87 }
88 
89 inline size_t format(char *buf, size_t bufsize, const GEO_VolumeVis &v)
90 {
91  UT::Format::Writer writer(buf, bufsize);
93  return f.format(writer, "{}", {GEOgetVolumeVisToken(v)});
94 }
95 
96 #endif // __GEO_VOLUMEOPTIONS_H_INCLUDED__
bool operator==(const GEO_VolumeOptions &v) const
GEO_API const char * GEOgetVolumeBorderToken(GEO_VolumeBorder border)
Return string token from GEO_VolumeBorder enum value.
GLenum GLuint GLsizei bufsize
Definition: glcorearb.h:1817
size_t format(W &writer, const char *format, std::initializer_list< ArgValue > args)
const GLdouble * v
Definition: glcorearb.h:836
bool operator!=(const GEO_VolumeOptions &v) const
GEO_API GEO_VolumeBorder GEOgetVolumeBorderEnum(const char *token, GEO_VolumeBorder def)
GEO_VolumeVis myMode
Definition: GEO_PrimVDB.h:68
GLfloat f
Definition: glcorearb.h:1925
GEO_VolumeOptions(GEO_VolumeVis mode, fpreal iso, fpreal density)
size_t format(char *buf, size_t bufsize, const GEO_VolumeBorder &v)
GEO_VolumeBorder
GEO_API const char * GEOgetVolumeVisToken(GEO_VolumeVis vis)
Return string token from GEO_VolumeVis enum value.
#define GEO_API
Definition: GEO_API.h:10
GEO_VolumeVis
GLenum mode
Definition: glcorearb.h:98
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glcorearb.h:2539
GEO_API GEO_VolumeVis GEOgetVolumeVisEnum(const char *vis, GEO_VolumeVis def)
double fpreal
Definition: SYS_Types.h:263
GLint GLint GLsizei GLint border
Definition: glcorearb.h:107