HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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 {
44 
46 };
47 
49 {
50  explicit
53  fpreal iso = 0.0,
54  fpreal density = 1.0,
56  : myMode(mode)
57  , myIso(iso)
58  , myDensity(density)
59  , myLod(lod)
60  {
61  }
62  bool operator==(const GEO_VolumeOptions &v) const
63  {
64  return (myMode == v.myMode
65  && myIso == v.myIso
66  && myDensity == v.myDensity
67  && myLod == v.myLod);
68  }
69  bool operator!=(const GEO_VolumeOptions &v) const
70  {
71  return !(*this == v);
72  }
73 
74  GEO_VolumeVis myMode;
75  fpreal myIso;
76  fpreal myDensity;
78 };
79 
80 /// Return string token from GEO_VolumeBorder enum value
81 GEO_API const char * GEOgetVolumeBorderToken(
83 /// Return GEO_VolumeBorder enum value from string token. def is returned if
84 /// token is unknown.
86  const char *token,
87  GEO_VolumeBorder def);
88 
89 /// Return string token from GEO_VolumeVis enum value
90 GEO_API const char * GEOgetVolumeVisToken(
91  GEO_VolumeVis vis);
92 /// Return GEO_VolumeVis enum value from string token. def is returned if
93 /// token is unknown.
95  const char *vis,
96  GEO_VolumeVis def);
97 
98 /// Return string token from GEO_VolumeVisLod enum value
99 GEO_API const char * GEOgetVolumeVisLodToken(
101 /// Return GEO_VolumeVisLod enum value from string token. def is returned if
102 /// token is unknown.
104  const char *token,
105  GEO_VolumeVisLod def);
106 
107 inline size_t format(char *buf, size_t bufsize, const GEO_VolumeBorder &v)
108 {
109  UT::Format::Writer writer(buf, bufsize);
111  return f.format(writer, "{}", {GEOgetVolumeBorderToken(v)});
112 }
113 
114 inline size_t format(char *buf, size_t bufsize, const GEO_VolumeVis &v)
115 {
116  UT::Format::Writer writer(buf, bufsize);
118  return f.format(writer, "{}", {GEOgetVolumeVisToken(v)});
119 }
120 
121 inline size_t format(char *buf, size_t bufsize, const GEO_VolumeVisLod &v)
122 {
123  UT::Format::Writer writer(buf, bufsize);
125  return f.format(writer, "{}", {GEOgetVolumeVisLodToken(v)});
126 }
127 
128 #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
size_t format(char *buf, size_t bufsize, const GEO_VolumeBorder &v)
GEO_API const char * GEOgetVolumeVisLodToken(GEO_VolumeVisLod lod)
Return string token from GEO_VolumeVisLod enum value.
GEO_VolumeBorder
GEO_VolumeVisLod myLod
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
GEO_API GEO_VolumeVisLod GEOgetVolumeVisLodEnum(const char *token, GEO_VolumeVisLod def)
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:270
GLint GLint GLsizei GLint border
Definition: glcorearb.h:107
GEO_VolumeOptions(GEO_VolumeVis mode=GEO_VOLUMEVIS_SMOKE, fpreal iso=0.0, fpreal density=1.0, GEO_VolumeVisLod lod=GEO_VOLUMEVISLOD_FULL)
GEO_VolumeVisLod
GLint lod
Definition: glcorearb.h:2764