HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GU_GridT< INT_TYPE > Struct Template Reference

#include <GU_Grid.h>

Public Types

enum  PrimitiveType : unsigned char {
  PrimitiveType::POLYGON, PrimitiveType::MESH, PrimitiveType::NURBS, PrimitiveType::BEZIER,
  PrimitiveType::POLYSOUP, PrimitiveType::POINTS
}
 

Public Member Functions

 SYS_STATIC_ASSERT (GA_MAX_ORDER< 16)
 
 GU_GridT ()
 
 ~GU_GridT ()
 
void precompute ()
 
void initSingleGrid (exint nedgerows, exint nedgecols, INT_TYPE start_pt=INT_TYPE(0))
 
void initColTube (exint nedgerows, exint nedgecols, INT_TYPE start_pt=INT_TYPE(0))
 
void initRowTube (exint nedgerows, exint nedgecols, INT_TYPE start_pt=INT_TYPE(0))
 
void initColSphere (exint nedgerows, exint nedgecols, INT_TYPE start_pt=INT_TYPE(0), INT_TYPE end_pt=INT_TYPE(1), INT_TYPE start_mid_pt=INT_TYPE(2))
 
void initRowSphere (exint nedgerows, exint nedgecols, INT_TYPE start_pt=INT_TYPE(0), INT_TYPE end_pt=INT_TYPE(1), INT_TYPE start_mid_pt=INT_TYPE(2))
 
void initSplitRowSphere (exint nedgerows, exint nedgecols, INT_TYPE start_pt=INT_TYPE(0), INT_TYPE end_pt=INT_TYPE(1), INT_TYPE start_mid_pt=INT_TYPE(2))
 
void initSplitColSphere (exint nedgerows, exint nedgecols, INT_TYPE start_pt=INT_TYPE(0), INT_TYPE end_pt=INT_TYPE(1), INT_TYPE start_mid_pt=INT_TYPE(2))
 
void initTorus (exint nedgerows, exint nedgecols, INT_TYPE start_pt=INT_TYPE(0))
 
void initColCone (exint nedgerows, exint nedgecols, bool row0_pole=true, INT_TYPE start_pt=INT_TYPE(0), INT_TYPE start_mid_pt=INT_TYPE(1))
 
void clear ()
 
INT_TYPE getPoint (exint row, exint col) const
 
bool doesRowWrap (exint row) const
 
bool doesColWrap (exint col) const
 
void shiftPoints (INT_TYPE shift)
 
bool isInvalidTPSurf () const
 
void fixTPSurf ()
 

Public Attributes

GEO_SurfaceType mySurfaceType
 
PrimitiveType myPrimitiveType
 
unsigned char myBasisOrderU:4
 
unsigned char myBasisOrderV:4
 
bool myUnrollCurves:1
 
bool myFirstRowIfNotWrapped:1
 
bool myLastRowIfNotWrapped:1
 
bool myFirstColIfNotWrapped:1
 
bool myLastColIfNotWrapped:1
 
bool myTriangularPoles:1
 
bool myCurvesIfBasisRowCol:1
 
INT_TYPE myRow0Step
 
INT_TYPE * myRow0Array
 
INT_TYPE myRow1Step
 
INT_TYPE * myRow1Array
 
INT_TYPE myCol0Step
 
INT_TYPE * myCol0Array
 
INT_TYPE myCol1Step
 
INT_TYPE * myCol1Array
 
exint myNumEdgeRows
 
exint myNumEdgeCols
 
INT_TYPE myCorners [4]
 
INT_TYPE myRow0Start
 
union {
   INT_TYPE   myRow0Step
 
   INT_TYPE *   myRow0Array
 
}; 
 
INT_TYPE myRow1Start
 
union {
   INT_TYPE   myRow1Step
 
   INT_TYPE *   myRow1Array
 
}; 
 
INT_TYPE myCol0Start
 
union {
   INT_TYPE   myCol0Step
 
   INT_TYPE *   myCol0Array
 
}; 
 
INT_TYPE myCol1Start
 
union {
   INT_TYPE   myCol1Step
 
   INT_TYPE *   myCol1Array
 
}; 
 
INT_TYPE myMiddleStart
 
INT_TYPE myMiddleColStep
 
INT_TYPE myMiddleRowStep
 
bool myAllWrapU:1
 
bool myAllWrapV:1
 
bool myNoWrapU:1
 
bool myNoWrapV:1
 
exint myNumPrimitives
 
exint myNumVertices
 

Detailed Description

template<typename INT_TYPE = GA_Offset>
struct GU_GridT< INT_TYPE >

Definition at line 41 of file GU_Grid.h.

Member Enumeration Documentation

template<typename INT_TYPE = GA_Offset>
enum GU_GridT::PrimitiveType : unsigned char
strong
Enumerator
POLYGON 
MESH 
NURBS 
BEZIER 
POLYSOUP 
POINTS 

Definition at line 79 of file GU_Grid.h.

Constructor & Destructor Documentation

template<typename INT_TYPE = GA_Offset>
GU_GridT< INT_TYPE >::GU_GridT ( )
inline

NOTE: The bools can't be in-class initialized, since they're bitfields, and the C++ standard evidently missed the case of bitfields. NOTE: The row and col starts are non-negative, so that destructing a default constructed grid won't crash.

Definition at line 153 of file GU_Grid.h.

template<typename INT_TYPE = GA_Offset>
GU_GridT< INT_TYPE >::~GU_GridT ( )
inline

Definition at line 168 of file GU_Grid.h.

Member Function Documentation

template<typename INT_TYPE = GA_Offset>
void GU_GridT< INT_TYPE >::clear ( )
inline

Free memory allocations owned by this. NOTE: This intentionally does not clear myPrimitiveType, mySurfaceType, myBasisOrderU, myBasisOrderV, or myUnrollCurves.

Definition at line 258 of file GU_Grid.h.

template<typename INT_TYPE = GA_Offset>
bool GU_GridT< INT_TYPE >::doesColWrap ( exint  col) const
inline

Definition at line 325 of file GU_Grid.h.

template<typename INT_TYPE = GA_Offset>
bool GU_GridT< INT_TYPE >::doesRowWrap ( exint  row) const
inline

Definition at line 313 of file GU_Grid.h.

template<typename INT_TYPE = GA_Offset>
void GU_GridT< INT_TYPE >::fixTPSurf ( )
inline

Definition at line 397 of file GU_Grid.h.

template<typename INT_TYPE = GA_Offset>
INT_TYPE GU_GridT< INT_TYPE >::getPoint ( exint  row,
exint  col 
) const
inline

Definition at line 282 of file GU_Grid.h.

template<typename INT_TYPE = GA_Offset>
void GU_GridT< INT_TYPE >::initColCone ( exint  nedgerows,
exint  nedgecols,
bool  row0_pole = true,
INT_TYPE  start_pt = INT_TYPE(0),
INT_TYPE  start_mid_pt = INT_TYPE(1) 
)

NOTE: mySurfaceType & myPrimitiveType must be set before calling, and so should myFirstRowIfNotWrapped, myLastRowIfNotWrapped, and myUnrollCurves if rows/cols/rowcol, or myTriangularPoles if quads/tris. NOTE: You'll probably want to set myFirstRowIfNotWrapped or myLastRowIfNotWrapped to false, depending on row0_pole. NOTE: You don't need to call precompute() after this.

template<typename INT_TYPE >
void GU_GridT< INT_TYPE >::initColSphere ( exint  nedgerows,
exint  nedgecols,
INT_TYPE  start_pt = INT_TYPE(0),
INT_TYPE  end_pt = INT_TYPE(1),
INT_TYPE  start_mid_pt = INT_TYPE(2) 
)

This is the sphere most people expect, with north and south poles (row=0/nedgerows). NOTE: mySurfaceType & myPrimitiveType must be set before calling, and so should myFirstRowIfNotWrapped, myLastRowIfNotWrapped, and myUnrollCurves if rows/cols/rowcol, or myTriangularPoles if quads/tris. NOTE: You'll probably want to set myFirstRowIfNotWrapped and myLastRowIfNotWrapped to false, to match the Sphere SOP. NOTE: You don't need to call precompute() after this.

Definition at line 1363 of file GU_GridImpl.h.

template<typename INT_TYPE >
void GU_GridT< INT_TYPE >::initColTube ( exint  nedgerows,
exint  nedgecols,
INT_TYPE  start_pt = INT_TYPE(0) 
)

NOTE: mySurfaceType & myPrimitiveType must be set before calling, and so should myFirstRowIfNotWrapped, myLastRowIfNotWrapped, and myUnrollCurves if rows/cols/rowcol. NOTE: You don't need to call precompute() after this.

Definition at line 1184 of file GU_GridImpl.h.

template<typename INT_TYPE >
void GU_GridT< INT_TYPE >::initRowSphere ( exint  nedgerows,
exint  nedgecols,
INT_TYPE  start_pt = INT_TYPE(0),
INT_TYPE  end_pt = INT_TYPE(1),
INT_TYPE  start_mid_pt = INT_TYPE(2) 
)

This is the sphere most people DON'T expect, with east and west poles (col=0/nedgecols). NOTE: mySurfaceType & myPrimitiveType must be set before calling, and so should myFirstColIfNotWrapped, myLastColIfNotWrapped, and myUnrollCurves if rows/cols/rowcol, or myTriangularPoles if quads/tris. NOTE: You'll probably want to set myFirstColIfNotWrapped and myLastColIfNotWrapped to false, to match the Sphere SOP. NOTE: You don't need to call precompute() after this.

Definition at line 1454 of file GU_GridImpl.h.

template<typename INT_TYPE >
void GU_GridT< INT_TYPE >::initRowTube ( exint  nedgerows,
exint  nedgecols,
INT_TYPE  start_pt = INT_TYPE(0) 
)

NOTE: mySurfaceType & myPrimitiveType must be set before calling, and so should myFirstColIfNotWrapped, myLastColIfNotWrapped, and myUnrollCurves if rows/cols/rowcol. NOTE: You don't need to call precompute() after this.

Definition at line 1273 of file GU_GridImpl.h.

template<typename INT_TYPE >
void GU_GridT< INT_TYPE >::initSingleGrid ( exint  nedgerows,
exint  nedgecols,
INT_TYPE  start_pt = INT_TYPE(0) 
)

NOTE: mySurfaceType & myPrimitiveType must be set before calling, and so should myFirstRowIfNotWrapped, myLastRowIfNotWrapped, myFirstColIfNotWrapped, and myLastColIfNotWrapped if rows/cols/rowcol. NOTE: You don't need to call precompute() after this.

Definition at line 1094 of file GU_GridImpl.h.

template<typename INT_TYPE >
void GU_GridT< INT_TYPE >::initSplitColSphere ( exint  nedgerows,
exint  nedgecols,
INT_TYPE  start_pt = INT_TYPE(0),
INT_TYPE  end_pt = INT_TYPE(1),
INT_TYPE  start_mid_pt = INT_TYPE(2) 
)

This is effectively a slice of a col sphere, with north and south poles (row=0/nedgerows). NOTE: mySurfaceType & myPrimitiveType must be set before calling, and so should myFirstRowIfNotWrapped, myLastRowIfNotWrapped, and myUnrollCurves if rows/cols/rowcol, or myTriangularPoles if quads/tris. NOTE: You'll probably want to set myFirstRowIfNotWrapped and myLastRowIfNotWrapped to false, to match the Sphere SOP. NOTE: You don't need to call precompute() after this.

Definition at line 1653 of file GU_GridImpl.h.

template<typename INT_TYPE >
void GU_GridT< INT_TYPE >::initSplitRowSphere ( exint  nedgerows,
exint  nedgecols,
INT_TYPE  start_pt = INT_TYPE(0),
INT_TYPE  end_pt = INT_TYPE(1),
INT_TYPE  start_mid_pt = INT_TYPE(2) 
)

This is effectively a slice of a row sphere, with north and south poles (col=0/nedgecols). NOTE: mySurfaceType & myPrimitiveType must be set before calling, and so should myFirstRowIfNotWrapped, myLastRowIfNotWrapped, and myUnrollCurves if rows/cols/rowcol, or myTriangularPoles if quads/tris. NOTE: You'll probably want to set myFirstRowIfNotWrapped and myLastRowIfNotWrapped to false, to match the Sphere SOP. NOTE: You don't need to call precompute() after this.

Definition at line 1545 of file GU_GridImpl.h.

template<typename INT_TYPE >
void GU_GridT< INT_TYPE >::initTorus ( exint  nedgerows,
exint  nedgecols,
INT_TYPE  start_pt = INT_TYPE(0) 
)

NOTE: mySurfaceType & myPrimitiveType must be set before calling, and so should myUnrollCurves if rows/cols/rowcol. NOTE: You don't need to call precompute() after this.

Definition at line 1744 of file GU_GridImpl.h.

template<typename INT_TYPE = GA_Offset>
bool GU_GridT< INT_TYPE >::isInvalidTPSurf ( ) const
inline

Definition at line 375 of file GU_Grid.h.

template<typename INT_TYPE >
void GU_GridT< INT_TYPE >::precompute ( )

This computes myAllWrapU, myAllWrapV, myNoWrapU, and myNoWrapV after everything else is set.

Definition at line 1006 of file GU_GridImpl.h.

template<typename INT_TYPE = GA_Offset>
void GU_GridT< INT_TYPE >::shiftPoints ( INT_TYPE  shift)
inline

Definition at line 339 of file GU_Grid.h.

template<typename INT_TYPE = GA_Offset>
GU_GridT< INT_TYPE >::SYS_STATIC_ASSERT ( )

Member Data Documentation

union { ... }

These members specify the points of the grid

union { ... }

These members specify the points of the grid

union { ... }

These members specify the points of the grid

union { ... }

These members specify the points of the grid

template<typename INT_TYPE = GA_Offset>
bool GU_GridT< INT_TYPE >::myAllWrapU

NOTE: The following members are cached values computed from the members above, not used for input. After setting the other members, either precompute() must be called or these members must be manually set, before any other functions can be called.

Definition at line 141 of file GU_Grid.h.

template<typename INT_TYPE = GA_Offset>
bool GU_GridT< INT_TYPE >::myAllWrapV

NOTE: The following members are cached values computed from the members above, not used for input. After setting the other members, either precompute() must be called or these members must be manually set, before any other functions can be called.

Definition at line 142 of file GU_Grid.h.

template<typename INT_TYPE = GA_Offset>
unsigned char GU_GridT< INT_TYPE >::myBasisOrderU

NOTE: Basis orders for NURBS and Bezier surfaces must be in the range [2,GA_MAX_ORDER], which fits in 4 bits, since GA_MAX_ORDER==11.

Definition at line 92 of file GU_Grid.h.

template<typename INT_TYPE = GA_Offset>
unsigned char GU_GridT< INT_TYPE >::myBasisOrderV

Definition at line 93 of file GU_Grid.h.

template<typename INT_TYPE = GA_Offset>
INT_TYPE* GU_GridT< INT_TYPE >::myCol0Array

Definition at line 65 of file GU_Grid.h.

template<typename INT_TYPE = GA_Offset>
INT_TYPE GU_GridT< INT_TYPE >::myCol0Start

These members specify the points of the grid

Definition at line 62 of file GU_Grid.h.

template<typename INT_TYPE = GA_Offset>
INT_TYPE GU_GridT< INT_TYPE >::myCol0Step

Definition at line 64 of file GU_Grid.h.

template<typename INT_TYPE = GA_Offset>
INT_TYPE* GU_GridT< INT_TYPE >::myCol1Array

Definition at line 70 of file GU_Grid.h.

template<typename INT_TYPE = GA_Offset>
INT_TYPE GU_GridT< INT_TYPE >::myCol1Start

These members specify the points of the grid

Definition at line 67 of file GU_Grid.h.

template<typename INT_TYPE = GA_Offset>
INT_TYPE GU_GridT< INT_TYPE >::myCol1Step

Definition at line 69 of file GU_Grid.h.

template<typename INT_TYPE = GA_Offset>
INT_TYPE GU_GridT< INT_TYPE >::myCorners[4]

These members specify the points of the grid

Definition at line 51 of file GU_Grid.h.

template<typename INT_TYPE = GA_Offset>
bool GU_GridT< INT_TYPE >::myCurvesIfBasisRowCol

If myPrimitiveType is NURBS or BEZIER, and mySurfaceType is GEO_PATCH_ROWS or GEO_PATCH_COLS or GEO_PATCH_ROWCOL, this indicates whether to create separate curve primitives (true), or a surface primitive with its surface type set correspondingly.

Definition at line 133 of file GU_Grid.h.

template<typename INT_TYPE = GA_Offset>
bool GU_GridT< INT_TYPE >::myFirstColIfNotWrapped

If mySurfaceType is cols or rows and cols, and rows aren't wrapped, if this is true, the first col is present (the usual), else it's not (e.g. the grid might be connected to an existing mesh).

Definition at line 115 of file GU_Grid.h.

template<typename INT_TYPE = GA_Offset>
bool GU_GridT< INT_TYPE >::myFirstRowIfNotWrapped

If mySurfaceType is rows or rows and cols, and columns aren't wrapped, if this is true, the first row is present (the usual), else it's not (e.g. the grid might be connected to an existing mesh).

Definition at line 105 of file GU_Grid.h.

template<typename INT_TYPE = GA_Offset>
bool GU_GridT< INT_TYPE >::myLastColIfNotWrapped

If mySurfaceType is cols or rows and cols, and rows aren't wrapped, if this is true, the final col is present (the usual), else it's not (e.g. the grid might be connected to an existing mesh).

Definition at line 120 of file GU_Grid.h.

template<typename INT_TYPE = GA_Offset>
bool GU_GridT< INT_TYPE >::myLastRowIfNotWrapped

If mySurfaceType is rows or rows and cols, and columns aren't wrapped, if this is true, the final row is present (the usual), else it's not (e.g. the grid might be connected to an existing mesh).

Definition at line 110 of file GU_Grid.h.

template<typename INT_TYPE = GA_Offset>
INT_TYPE GU_GridT< INT_TYPE >::myMiddleColStep

These members specify the points of the grid

Definition at line 73 of file GU_Grid.h.

template<typename INT_TYPE = GA_Offset>
INT_TYPE GU_GridT< INT_TYPE >::myMiddleRowStep

These members specify the points of the grid

Definition at line 74 of file GU_Grid.h.

template<typename INT_TYPE = GA_Offset>
INT_TYPE GU_GridT< INT_TYPE >::myMiddleStart

These members specify the points of the grid

Definition at line 72 of file GU_Grid.h.

template<typename INT_TYPE = GA_Offset>
bool GU_GridT< INT_TYPE >::myNoWrapU

NOTE: The following members are cached values computed from the members above, not used for input. After setting the other members, either precompute() must be called or these members must be manually set, before any other functions can be called.

Definition at line 143 of file GU_Grid.h.

template<typename INT_TYPE = GA_Offset>
bool GU_GridT< INT_TYPE >::myNoWrapV

NOTE: The following members are cached values computed from the members above, not used for input. After setting the other members, either precompute() must be called or these members must be manually set, before any other functions can be called.

Definition at line 144 of file GU_Grid.h.

template<typename INT_TYPE = GA_Offset>
exint GU_GridT< INT_TYPE >::myNumEdgeCols

These are the number of edge rows and edge columns.

Definition at line 46 of file GU_Grid.h.

template<typename INT_TYPE = GA_Offset>
exint GU_GridT< INT_TYPE >::myNumEdgeRows

These are the number of edge rows and edge columns.

Definition at line 45 of file GU_Grid.h.

template<typename INT_TYPE = GA_Offset>
exint GU_GridT< INT_TYPE >::myNumPrimitives

NOTE: The following members are cached values computed from the members above, not used for input. After setting the other members, either precompute() must be called or these members must be manually set, before any other functions can be called.

Definition at line 145 of file GU_Grid.h.

template<typename INT_TYPE = GA_Offset>
exint GU_GridT< INT_TYPE >::myNumVertices

NOTE: The following members are cached values computed from the members above, not used for input. After setting the other members, either precompute() must be called or these members must be manually set, before any other functions can be called.

Definition at line 146 of file GU_Grid.h.

template<typename INT_TYPE = GA_Offset>
PrimitiveType GU_GridT< INT_TYPE >::myPrimitiveType

Definition at line 88 of file GU_Grid.h.

template<typename INT_TYPE = GA_Offset>
INT_TYPE* GU_GridT< INT_TYPE >::myRow0Array

Definition at line 55 of file GU_Grid.h.

template<typename INT_TYPE = GA_Offset>
INT_TYPE GU_GridT< INT_TYPE >::myRow0Start

These members specify the points of the grid

Definition at line 52 of file GU_Grid.h.

template<typename INT_TYPE = GA_Offset>
INT_TYPE GU_GridT< INT_TYPE >::myRow0Step

Definition at line 54 of file GU_Grid.h.

template<typename INT_TYPE = GA_Offset>
INT_TYPE* GU_GridT< INT_TYPE >::myRow1Array

Definition at line 60 of file GU_Grid.h.

template<typename INT_TYPE = GA_Offset>
INT_TYPE GU_GridT< INT_TYPE >::myRow1Start

These members specify the points of the grid

Definition at line 57 of file GU_Grid.h.

template<typename INT_TYPE = GA_Offset>
INT_TYPE GU_GridT< INT_TYPE >::myRow1Step

Definition at line 59 of file GU_Grid.h.

template<typename INT_TYPE = GA_Offset>
GEO_SurfaceType GU_GridT< INT_TYPE >::mySurfaceType

Definition at line 77 of file GU_Grid.h.

template<typename INT_TYPE = GA_Offset>
bool GU_GridT< INT_TYPE >::myTriangularPoles

If adjacent points on the boundary are equal, and mySurfaceType is one of the triangle options or quads, the appropriate polygons will be simple triangles, instead of quads or pairs of triangles. If a boundary quad becomes fully degenerate, no polygon will be output for it.

Definition at line 127 of file GU_Grid.h.

template<typename INT_TYPE = GA_Offset>
bool GU_GridT< INT_TYPE >::myUnrollCurves

If mySurfaceType is rows, cols, or rows and cols, and a particular row or column wraps around (row0[col]==row1[col] or col0[row]==col1[row]), This indicates to create an open curve with an extra vertex (if true), instead of a closed polygon (if false).

Definition at line 100 of file GU_Grid.h.


The documentation for this struct was generated from the following files: