HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GU_SDF.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: Geometry library (C++)
7  *
8  * COMMENTS: Builds a Signed Distance Function from a GU_Detail.
9  * This also supports implicit SDFs. These lack any
10  * voxel representation.
11  */
12 
13 #ifndef __GU_SDF_H__
14 #define __GU_SDF_H__
15 
16 #include "GU_API.h"
17 #include <UT/UT_Vector3.h>
18 #include <UT/UT_VectorTypes.h>
19 #include <UT/UT_BoundingBox.h>
20 #include <UT/UT_Plane.h>
21 #include <UT/UT_VoxelArray.h>
22 #include <UT/UT_PriorityQueue.h>
23 #include <UT/UT_IntArray.h>
24 #include <UT/UT_Array.h>
25 #include <GA/GA_Handle.h>
26 #include <GA/GA_Types.h>
27 #include <GEO/GEO_PrimVolume.h>
28 #include "GU_DetailHandle.h"
29 
30 class GU_Detail;
31 class GA_ROAttributeRef;
32 class GU_RayIntersect;
33 class GEO_PrimPoly;
34 class GEO_Primitive;
35 class GU_SDF;
36 
37 ///
38 /// gu_sdf_qelem
39 /// This is used as an element in our queue.
40 ///
42 {
43 public:
44  // Where we are in the queue.
45  int qpos;
46  // Where we are in the ref array.
47  int refpos;
48  // What our x/y/z cell position is.
49  int x, y, z;
50  // What our value is.
52 };
53 
54 ///
55 /// gu_sdf_voxpos
56 /// This is used to store a specific element of our voxel.
57 ///
59 {
60 public:
62  gu_sdf_voxpos(int px, int py, int pz)
63  {
64  x = px; y = py; z = pz;
65  }
66  int x, y, z;
67 };
68 
69 ///
70 /// gu_sdf_comp
71 /// Comparator used by our queue.
72 ///
74 {
75 public:
76  bool operator()(const gu_sdf_qelem &e1, const gu_sdf_qelem &e2) const
77  {
78  return SYSabs(e1.dist) > SYSabs(e2.dist);
79  }
80  bool operator()(const gu_sdf_qelem *e1, const gu_sdf_qelem *e2) const
81  {
82  return SYSabs(e1->dist) > SYSabs(e2->dist);
83  }
84 };
85 
86 ///
87 /// gu_sdf_queue
88 /// This is a queue of voxels sorted by minimum distance.
89 /// We want to subclass to be able to track where we are in the
90 /// queue. This lets us update the queue when we change our elements
91 /// distance.
92 ///
94  public UT_PriorityQueue<gu_sdf_qelem *, gu_sdf_comp, true>
95 {
96 public:
97  virtual void changedPosition(gu_sdf_qelem *e, unsigned int idx) const
98  {
99  e->qpos = idx;
100  }
101 };
102 
103 ///
104 /// GU_SDFParms
105 /// All the parameters to build an SDF can be set using this class
106 ///
108 {
109 public:
110  GU_SDFParms();
111  virtual ~GU_SDFParms();
112 
113  enum sdfMode
114  {
125  HEIGHTFIELD
126  };
127 
128  /// These set the general method by which the SDF is computed.
129  void setMode(sdfMode mode);
130  sdfMode getMode() const;
131 
132  /// This sets the axis used for planar SDFs.
133  void setPlaneAxis(const UT_Vector3 &axis);
134  const UT_Vector3 &getPlaneAxis() const;
135 
136  /// Sets the divisions used by the SDF. The given values represent
137  /// the number of cells that will be present in each direction.
138  /// The SDF samples the center of the cells to determine their
139  /// values.
140  void setDivisions(int divx, int divy, int divz);
141  void getDivisions(int &divx, int &divy, int &divz) const;
142 
143  /// Determines if we should invert the sense of the SDFs field.
144  void setInvert(bool invert);
145  bool getInvert() const;
146 
147  /// Sets the offset applied to the SDF's field.
148  void setOffset(fpreal offset);
149  fpreal getOffset() const;
150 
151  /// Sets the tolerance to be used for ray intersection
152  /// This is multiplied by the bounding box size of the sdf to
153  /// determine the final tolerance.
154  void setTol(fpreal tol);
155  fpreal getTol() const;
156 
157  /// Sets the volume used for building the sdf.
158  /// This must match the resolution of the sdf's parameters.
159  void setVolume(UT_VoxelArrayF *vol);
160  UT_VoxelArrayF *getVolume() const;
161 
162  /// Sets the bounding box which the SDF will be sampled in.
163  /// Note that the bounding box should fully contain the geometry
164  /// or settings like ForceBounds become meaningless.
165  /// If this method is not called, the bounding box will be set
166  /// to the bounding box of the GDP increased by the expandBounds
167  /// function.
168  void setBBox(const UT_BoundingBox &bbox);
169  bool hasBBox() const;
170  void getBBox(UT_BoundingBox &bbox) const;
171 
172  /// LaserScan will consider only the most extreme intersections along
173  /// each axis, allowing geometry with bad normals or holes to process.
174  /// This is only used with ray-based methods.
175  void setLaserScan(bool laserscan);
176  bool getLaserScan() const;
177 
178  /// FixSigns uses consensus methods to recover from holes.
179  void setFixSigns(int fixsigns);
180  int getFixSigns() const;
181 
182  /// ForceBounds forces all of the outermost voxels to be
183  /// marked as outside. This only applies when FixSigns is set.
184  void setForceBounds(bool forcebounds);
185  bool getForceBounds() const;
186 
187  /// Sets the maximum distance to which the SDF will be evaluated.
188  /// Theoritically, things outside this distance will be left
189  /// at +/- infinitity. In practice, this is still not used.
190  void setMaxDistance(fpreal dist);
191  fpreal getMaxDistance() const;
192 
193  /// Sets the number of neighbours inspected for doing MLS computation
194  /// when constructing from a point cloud.
195  void setNumNeighbour(int numneighbour);
196  int getNumNeighbour() const;
197 
198  void setSweepCount(int sweepcount) { mySweepCount = sweepcount;};
199  int getSweepCount() const { return mySweepCount; }
200 
201  void setSweepThreshold(fpreal sweepthreshold) { mySweepThreshold = sweepthreshold; };
202  fpreal getSweepThreshold() const { return mySweepThreshold; }
203 
204  void setIsoContour(fpreal iso) { myIsoContour = iso; }
205  fpreal getIsoContour() const { return myIsoContour; }
206 
207  void setAlignedVolume(bool aligned) { myAlignedVolume = aligned; }
208  bool getAlignedVolume() const { return myAlignedVolume; }
209 
210  // If the SDF is a VOLUME, has correct signs, and max distance is set, we will want
211  // to make sure the background voxels outside of the narrow band match the sign
212  // of the source volume's voxels.
213  void setMatchSourceSign();
214  bool getMatchSourceSign() const;
215 
216 private:
217 
218  sdfMode myMode;
219  int myDivX, myDivY, myDivZ;
220 
221  bool myInvert;
222 
223  fpreal myTol;
224 
225  UT_VoxelArrayF *myVolume;
226 
227  bool myHasBBox;
228  UT_BoundingBox myBBox;
229 
230  UT_Vector3 myPlaneAxis;
231 
232  bool myLaserScan;
233  int myFixSigns;
234  bool myForceBounds;
235 
236  fpreal myOffset;
237  fpreal myMaxDist;
238 
239  int myNumNeighbour;
240 
241  int mySweepCount;
242  fpreal mySweepThreshold;
243 
244  fpreal myIsoContour;
245 
246  bool myAlignedVolume;
247 
248  bool myMatchSourceSign;
249 };
250 
251 ///
252 /// GU_SDFDelayedBuilder
253 /// This class marshalls the data to build a GU_SDF so it can be
254 /// done multithreaded.
255 ///
257 {
258 public:
260  virtual ~GU_SDFDelayedBuilder();
261 
262  void build();
263 
264  // multithread build of sdfs.
265  static void buildList(UT_Array<GU_SDFDelayedBuilder> &buildlist);
266 
270 
271 private:
273  buildlist.entries() > 1,
274  doBuildList,
275  UT_Array<GU_SDFDelayedBuilder> &, buildlist)
276  void doBuildListPartial(UT_Array<GU_SDFDelayedBuilder> &buildlist,
277  const UT_JobInfo &info);
278 };
279 
280 
281 ///
282 /// GU_SDF
283 /// This class builds a signed distance function from a given GU_Detail.
284 /// Signed distance functions contain an approximate distance to the original
285 /// surface in each voxel cell. If cell is inside the the geometry, it
286 /// has a negative distance. Sidedness of geometry is determined by
287 /// surface normals. The geometry should be relatively watertight.
288 ///
290 {
291 public:
292  GU_SDF();
293  virtual ~GU_SDF();
294 
296  {
297  SDF_EXPLICIT, // Not implicit.
301  SDF_HEIGHTFIELD
302  };
303 
304  /// Expands the given bounding box so it contains a two cell border
305  /// on all sides. This helps condition the SDF stuff by ensuring
306  /// the outer cells are all outside.
307  static void expandBounds(UT_BoundingBox &bbox,
308  int xres, int yres, int zres);
309 
310  /// Build from the given gdp.
311  void build(const GU_Detail *gdp,
312  const GU_SDFParms &parms);
313 
314  /// Initializes an empty sdf of a given resolution and from a given
315  /// bounding box.
316  void initEmpty(const UT_BoundingBox &bbox,
317  int xres, int yres, int zres);
318 
319 
320  UT_VoxelArrayF *getFunction() const { return myVoxels; }
321 
322  /// Returns the transform of a heightfield SDF.
324  { return myHeightXform; }
325 
326  /// Returns the vertical axis of a heightfield SDF.
327  int getHeightAxis() const { return myHeightAxis; }
328 
329  /// Implicit SDFs have no array of voxels, instead defining themselves
330  /// as a simple atomic shape.
331  bool isImplicit() const
332  { return myImplicitType != SDF_EXPLICIT; }
333 
334  bool isValid() const
335  {
336  return (isImplicit() || getFunction() != 0);
337  }
338 
339  /// Returns whether the specified build mode is multithreaded.
340  static bool isMultithreaded(const GU_SDFParms &parms)
341  {
342  return (parms.getMode() == GU_SDFParms::VOLUMESAMPLE);
343  }
344 
345  /// Returns the type of implicit surface, if any.
347  { return myImplicitType; }
348 
349  /// The normal definining the implicit function. This is only
350  /// meaninful for half-plane implicit functions.
352  { return myImplicitNormal; }
353 
354  /// Returns the divisions that the spaces is voxelized into.
355  /// This is meaningful even for implicit surfaces, as they have
356  /// a prefered division set for purposes like advection.
357  void getDivisions(int &xdiv, int &ydiv, int &zdiv) const;
358 
359  /// Calculates the SDF field at the point.
360  fpreal getDistance(const UT_Vector3 &pos) const;
361 
362  // This calculates the distance to the SDF using a faster, but
363  // less accurate method. The tol parameter is set to the
364  // tolerance to which the distance was computed.
365  // Basically, this will point sample the SDF, put the distance to
366  // the point sample in the tol parameter, and return the point sample.
367  // This involves 1/8th of the voxel lookup as a getDistance.
368  fpreal getFastDistance(const UT_Vector3 &pos, fpreal &tol) const;
369 
370  /// Returns the gradient of the SDF at the point.
371  UT_Vector3 getGradient(const UT_Vector3 &pos) const;
372 
373  /// Returns the closest point on the iso surface to the given
374  /// point.
375  /// The Courant-Friedreichs-Lewy condition governs how carefully
376  /// we step to find the solution. 0.9 is near optimal, 0.5 is
377  /// conservative.
378  UT_Vector3 findClosest(const UT_Vector3 &pos,
379  fpreal iso = 0.0,
380  fpreal cfl_cond = 0.9,
381  fpreal tol = 1e-3) const;
382 
383  /// Advects a point according to the SDF's gradient field.
384  /// Advection continues until the point has moved the given distance.
385  /// If normalize_gradient is false, it is moved until the given
386  /// amount of *time* has passed.
387  UT_Vector3 advect(const UT_Vector3 &pos,
388  fpreal dist,
389  fpreal cfl_cond = 0.9f,
390  bool normalize_gradient = true) const;
391 
392  /// Finds the smallest value in the SDF along the given line
393  /// segment. The value must be smaller than the cutoff value.
394  /// Returns false if no close value found.
395  bool findSmallestOnEdge(
396  fpreal &minvalue,
397  UT_Vector3 &result,
398  const UT_Vector3 &a,
399  const UT_Vector3 &b,
400  fpreal cutoff = SYS_FPREAL_MAX) const;
401 
402  /// Finds the smallest value in the SDF inside the given triangle.
403  /// The value must be smaller than the cutoff value.
404  /// Returns false if no close value found.
405  ///
406  /// Note: this algorithm is far from perfect. It does only a very
407  /// partial scan over the interior of the triangle, and it doesn't work
408  /// well with implicit box SDFs.
409  bool findSmallestOnTri(
410  fpreal &minValue,
411  UT_Vector2 &resultBary,
412  const UT_Vector3 &p0,
413  const UT_Vector3 &p1,
414  const UT_Vector3 &p2,
415  fpreal cutoff = SYS_FPREAL_MAX) const;
416 
417 
418  /// Returns the point along a path where it first intersects the SDF.
419  /// If the path doesn't intersect the SDF, this function returns false.
420  /// If the start of the path is inside the SDF, the function returns
421  /// true, and returns the starting point of the path as the intersection.
422  bool findRayIntersection(
423  UT_Vector3 &result,
424  const UT_Vector3 &a,
425  const UT_Vector3 &b,
426  fpreal boundaryvalue = 0.0) const;
427 
428 
429  const UT_Vector3 &getVoxelSize() const { return myVoxelSize; }
430  fpreal getVoxelDiameter() const { return myVoxelDiameter; }
431  const UT_Vector3 &getSize() const { return mySize; }
432  const UT_Vector3 &getOrig() const { return myOrig; }
433 
434  void setOrig(const UT_Vector3 &o);
435  void setSize(const UT_Vector3 &s);
436 
437  /// Computes the center of mass of the SDF.
438  void computeCenterOfMass(
439  UT_Vector3 &centerofmass) const;
440 
441  /// Computes the volume of the SDF.
442  fpreal computeVolume() const;
443 
444  /// Computes the inertial tensor.
445  /// You provide the center of mass for it to use.
446  /// Each sample point of the SDF is treated as a point mass. The
447  /// mass is 0 for cell-points outside of the object, 1 for those
448  /// fully inside, and suitably scaled for others.
449  void computeInertialTensor(UT_DMatrix3 &tensor,
450  const UT_Vector3 &centerofmass) const;
451 
452  /// Returns the amount of memory used by this object.
453  int64 getMemoryUsage() const;
454 
455  /// These invert the sense of the SDF. This means the getDistance()
456  /// function will always return -getDistance(), effectively turning
457  /// the object inside out.
458  /// This does not affect the calculation of volumes, etc!
459  /// (Technically, an inverted SDF has infinite volume, which isn't
460  /// all that useful anyways)
461  bool isInverted() const { return myInvert; }
462  void setInverted(bool invert) { myInvert = invert; }
463 
464  /// These offset the zero isosurface of the SDF. This means that
465  /// getDistance() will always return getDistance() - offset,
466  /// effectively inflating (if offset is positive) or deflating (if
467  /// offset is negative) the object.
468  ///
469  /// Offsetting happens before inversion.
470  fpreal getOffset() const { return myOffset; }
471  void setOffset(fpreal offset) { myOffset = offset; }
472 
473  /// Load and save this SDF.
474  /// This occurs in binary format.
475  void save(std::ostream &os) const;
476  bool load(UT_IStream &is);
477 
478 protected:
479  /// This sends rays along all the major axes. The cell distances
480  /// are set to the distance along the axes to surfaces.
481  void sendRays(const GU_Detail *gdp,
482  bool laserscan,
483  bool usemetafield,
484  fpreal tol);
485 
486  /// This fixes the sign of the distance field by finding a
487  /// consensus among neighbouring voxels.
488  /// This requires myQueueIndices to be present.
489  /// If forcebounds is set, it will make the boundary all positive
490  /// in sign, making it easier to recover from holes.
491  void fixSigns(bool forcebounds);
492 
493  /// This finds consensus among the neighbours of this point
494  /// It may then flip this points sign. If it does so, the
495  /// point and it's neighbours are added to the list to
496  /// be tested in the future.
497  /// This uses myQueueIndices to track if a voxel has been added before.
498  /// Returns 1 if a point flipped, 0 otherwise.
499  int findConsensus(int x, int y, int z,
500  int iteration,
501  fpreal alpha, fpreal beta,
502  UT_Array<gu_sdf_voxpos> &flippedlist);
503 
504  /// Performs a fast sweep along the given axis. Any voxel pair
505  /// that has a bad consensus will be raytested & flipped.
506  /// The flip is then propagated.
507  /// dir is +/-1 to represent a forward or back sweep.
508  int fastSweepCorrect(GU_RayIntersect *isect,
509  int axis, int dir, fpreal alpha,
510  fpreal tol);
511 
512  /// Rasterizers...
513  void rasterize(const GEO_Primitive *prim);
514  void rasterizePoly(const GEO_PrimPoly *poly);
515 
516  /// This takes coordinates in cell space.
517  void rasterizeRawTri(UT_Vector3 p1, UT_Vector3 p2, UT_Vector3 p3);
518 
519  /// This sets the given cell to a specific SDF value. This will be
520  /// considered a finalized value, so it will be written to the
521  /// output voxel array, any QElem will be deleted, and any neighbouring
522  /// cells will get tentative values.
523  /// Propagation to neighbouring cells only occurs if dist < maxdist,
524  /// unless maxdist < 0
525  void setCellDist(int x, int y, int z, fpreal dist,
526  fpreal maxdist=-1.0);
527 
528  /// Sets a tentative value to a given cell.
529  void setCellTentative(int x, int y, int z,
530  fpreal tentative);
531 
532  /// Gets or creates the qelement at the given location. Returns 0
533  /// if the element has already been processed.
534  gu_sdf_qelem *getQElem(int x, int y, int z,
535  bool create=true);
536 
537  /// If you change the weight of the qelem, this will update the queue.
538  void updateQElem(gu_sdf_qelem *qelem);
539 
540  /// Calculates the distance to a cell by using the finalized
541  /// distances to adjacent cells.
542  /// The olddistance is used to determine sign.
543  fpreal findMinDist(int x, int y, int z,
544  fpreal olddist) const;
545 
546  /// Propagate distances from all elements in the queue until maximum
547  /// distance is reached.
548  void propagateQueue(fpreal maxdist);
549 
550  /// Builds a shell of distance values around the geometry
551  /// based on minimum distance values.
552  /// We want to fill in the cell values
553  /// from (x,y,z) to (x+xw-1,y+yw-1,z+zw-1)
554  /// inclusive. We only fill values that are within a band about
555  /// the surface, leaving the rest for FMM. This is because min
556  /// distance calls are expensive!
557  void buildFromMinDist(GU_RayIntersect &isect,
558  int x, int y, int z,
559  int xw, int yw, int zw);
560 
561  /// Builds a shell of distance values around the geometry
562  /// from the point cloud data.
563  /// If normals are present, they are used to calculate sidedness.
564  /// Otherwise, the SDF becomes an unsigned distance-to-implicit surface.
565  void buildFromPointCloud(const GU_Detail *gdp,
566  const GU_SDFParms &parms);
567 
568  /// Builds a shell of distance values around the given iso-contour
569  /// of the volume. This allows one to then reinitialize an SDF function.
570  void buildFromVolume(const UT_VoxelArrayF &src, fpreal isocontour);
571 
572  /// Takes a list of GEO_Points and finds the best fititng
573  /// plane which interpolates them. If noff is not -1, it
574  /// will derive the normals from the point normals.
575  UT_Plane findPlaneFromNeighbour(
576  const UT_Vector3 &sample,
577  const GU_Detail *gdp,
578  const GA_OffsetArray &neighbour,
579  const GA_ROHandleV3 &normalattrib) const;
580 
581 
583  myVoxels->numTiles() > 16,
584  copyVolumeSamples,
585  const GU_Detail *, gdp,
586  const UT_ValArray<const GEO_Primitive *> &, volumes);
587 
588  void copyVolumeSamplesPartial(const GU_Detail *gdp,
589  const UT_ValArray<const GEO_Primitive *> &volumes,
590  const UT_JobInfo &info);
591 
592  /// This is the actual explicit array of voxels. It is not
593  /// present if the SDF array is implicit. It does not incorporate the
594  /// offset or inversion.
596 
597  /// What sort of implicit representation we are using.
598  /// SDF_EXPLICIT if we have none.
600 
602 
603  /// This flags whether we act as if our SDF had the opposite sign
604  /// than it does.
605  bool myInvert;
606  /// This defines how far we should shift the zero isosurface of the SDF.
608 
609  /// Real world coordinates are transformed into the voxel array's 0-1
610  /// space by subtracting myOrig and dividing by mySize.
612 
615 
616  /// This stores the size of a voxel along each axis.
618 
619  /// This caches the diameter of a voxel cell. Ie, myVoxelSize.length()
621 
622  /// These are used in the building stage to rasterize to, and in the
623  /// expansion stage as the priority queues.
628 };
629 
630 #endif
GA_API const UT_StringHolder dist
UT_Vector3 mySize
Definition: GU_SDF.h:611
int refpos
Definition: GU_SDF.h:47
GLboolean invert
Definition: glcorearb.h:548
#define THREADED_METHOD1(CLASSNAME, DOMULTI, METHOD, PARMTYPE1, PARMNAME1)
GEO_PrimVolumeXform myHeightXform
Definition: GU_SDF.h:613
void setIsoContour(fpreal iso)
Definition: GU_SDF.h:204
const UT_Vector3 & getVoxelSize() const
Definition: GU_SDF.h:429
void setAlignedVolume(bool aligned)
Definition: GU_SDF.h:207
GLdouble GLdouble GLdouble z
Definition: glcorearb.h:847
virtual float getVolume(int speaker)
GLboolean GLboolean GLboolean GLboolean a
Definition: glcorearb.h:1221
#define SYSabs(a)
Definition: SYS_Math.h:1367
void setSweepCount(int sweepcount)
Definition: GU_SDF.h:198
fpreal getOffset() const
Definition: GU_SDF.h:470
GLint y
Definition: glcorearb.h:102
void setSweepThreshold(fpreal sweepthreshold)
Definition: GU_SDF.h:201
const UT_Vector3 & getOrig() const
Definition: GU_SDF.h:432
3D Vector class.
Definition: GU_SDF.h:289
static bool isMultithreaded(const GU_SDFParms &parms)
Returns whether the specified build mode is multithreaded.
Definition: GU_SDF.h:340
GU_SDFParms myParms
Definition: GU_SDF.h:267
fpreal myOffset
This defines how far we should shift the zero isosurface of the SDF.
Definition: GU_SDF.h:607
gu_sdf_voxpos(int px, int py, int pz)
Definition: GU_SDF.h:62
UT_VoxelArrayF * myVoxels
Definition: GU_SDF.h:595
void setOffset(fpreal offset)
Definition: GU_SDF.h:471
long long int64
Definition: SYS_Types.h:100
fpreal getVoxelDiameter() const
Definition: GU_SDF.h:430
fpreal getSweepThreshold() const
Definition: GU_SDF.h:202
sdfImplicitType myImplicitType
Definition: GU_SDF.h:599
GLfloat f
Definition: glcorearb.h:1925
const UT_Vector3 & getImplicitNormal() const
Definition: GU_SDF.h:351
UT_IntArray myQueueFreeList
Definition: GU_SDF.h:626
This class provides a way to manage a reference to an attribute permitting Read-Only access...
void setInverted(bool invert)
Definition: GU_SDF.h:462
int myHeightAxis
Definition: GU_SDF.h:614
#define THREADED_METHOD2(CLASSNAME, DOMULTI, METHOD, PARMTYPE1, PARMNAME1, PARMTYPE2, PARMNAME2)
GLintptr offset
Definition: glcorearb.h:664
const UT_Vector3 & getSize() const
Definition: GU_SDF.h:431
UT_Vector3 myImplicitNormal
Definition: GU_SDF.h:601
UT_VoxelArrayF * getFunction() const
Definition: GU_SDF.h:320
GLfloat GLfloat GLfloat alpha
Definition: glcorearb.h:111
const GEO_PrimVolumeXform & getHeightXform() const
Returns the transform of a heightfield SDF.
Definition: GU_SDF.h:323
int qpos
Definition: GU_SDF.h:45
#define GU_API
Definition: GU_API.h:11
int getSweepCount() const
Definition: GU_SDF.h:199
GLboolean GLboolean GLboolean b
Definition: glcorearb.h:1221
bool operator()(const gu_sdf_qelem *e1, const gu_sdf_qelem *e2) const
Definition: GU_SDF.h:80
#define SYS_FPREAL_MAX
Definition: SYS_Types.h:272
GLenum mode
Definition: glcorearb.h:98
exint entries() const
Alias of size(). size() is preferred.
Definition: UT_Array.h:446
GU_SDF * mySDF
Definition: GU_SDF.h:268
fpreal getIsoContour() const
Definition: GU_SDF.h:205
IFDmantra py
Definition: HDK_Image.dox:266
double fpreal
Definition: SYS_Types.h:263
bool isInverted() const
Definition: GU_SDF.h:461
UT_Vector3 myVoxelSize
This stores the size of a voxel along each axis.
Definition: GU_SDF.h:617
sdfMode getMode() const
bool isImplicit() const
Definition: GU_SDF.h:331
virtual int setVolume(int speaker, float vol)
bool operator()(const gu_sdf_qelem &e1, const gu_sdf_qelem &e2) const
Definition: GU_SDF.h:76
GLint GLenum GLint x
Definition: glcorearb.h:408
gu_sdf_queue * myQueue
Definition: GU_SDF.h:627
sdfImplicitType getImplicitType() const
Returns the type of implicit surface, if any.
Definition: GU_SDF.h:346
UT_VoxelArray< int > * myQueueIndices
Definition: GU_SDF.h:624
int getHeightAxis() const
Returns the vertical axis of a heightfield SDF.
Definition: GU_SDF.h:327
fpreal myVoxelDiameter
This caches the diameter of a voxel cell. Ie, myVoxelSize.length()
Definition: GU_SDF.h:620
sdfImplicitType
Definition: GU_SDF.h:295
bool myInvert
Definition: GU_SDF.h:605
gu_sdf_voxpos()
Definition: GU_SDF.h:61
fpreal dist
Definition: GU_SDF.h:51
bool getAlignedVolume() const
Definition: GU_SDF.h:208
UT_ValArray< gu_sdf_qelem * > myQueueElements
Definition: GU_SDF.h:625
GU_ConstDetailHandle myGDH
Definition: GU_SDF.h:269
bool isValid() const
Definition: GU_SDF.h:334
virtual void changedPosition(gu_sdf_qelem *e, unsigned int idx) const
Definition: GU_SDF.h:97
GLenum src
Definition: glcorearb.h:1792