GA/GA_GBMacros.h File Reference

Create macros which emulate the macros in the obsolete GB library. More...

#include "GA_GBElement.h"
#include "GA_GBIterators.h"
#include "GA_EdgeGroup.h"
#include "GA_Detail.h"
#include "GA_BreakpointGroup.h"

Go to the source code of this file.

Defines

#define GA_FOR_ALL_PRIMITIVES(gdp, prim)
#define GA_FOR_SAFE_PRIMITIVES(gdp, prim, next)
#define GA_FOR_SAFE_POINTS(gdp, cur_point, next)
#define GA_FOR_MASK_PRIMITIVES(gdp, prim, mask)
#define GA_FOR_ALL_GROUP_PRIMITIVES(gdp, grp, prim)
#define GA_FOR_SAFE_GROUP_PRIMITIVES(gdp, grp, prim, next)
#define GA_FOR_ALL_OPT_GROUP_PRIMITIVES(gdp, grp, prim)   GA_FOR_ALL_GROUP_PRIMITIVES(gdp,grp,prim)
#define GA_FOR_SAFE_OPT_GROUP_PRIMITIVES(gdp, grp, prim, next)   GA_FOR_SAFE_GROUP_PRIMITIVES(gdp,grp,prim,next)
#define GA_FOR_ALL_GPOINTS(gdp, point)
#define GA_FOR_ALL_PTOFF(gdp, ptoff)
#define GA_FOR_ALL_GROUP_PTOFF(gdp, grp, ptoff)
#define GA_FOR_ALL_GPOINTS_NC(gdp, PtType, pt)   for (GA_GBPointIteratorNoCache<PtType> pt(*(gdp)); !pt.atEnd(); ++pt)
#define GA_FOR_ALL_GPOINTS_NC_CONST(gdp, PtType, pt)   for (GA_GBPointIteratorNoCacheConst<PtType> pt(*(gdp)); !pt.atEnd(); ++pt)
#define GA_FOR_ALL_GROUP_POINTS(gdp, grp, point)
#define GA_FOR_ALL_GROUP_POINTS_NC(gdp, grp, PtType, pt)   for (GA_GBPointIteratorNoCache<PtType> pt(*(gdp),grp); !pt.atEnd(); ++pt)
#define GA_FOR_ALL_GROUP_POINTS_NC_CONST(gdp, grp, PtType, pt)   for (GA_GBPointIteratorNoCacheConst<PtType> pt(*(gdp),grp); !pt.atEnd(); ++pt)
#define GA_FOR_ALL_OPT_GROUP_POINTS(gdp, grp, point)   GA_FOR_ALL_GROUP_POINTS(gdp, grp, point)
#define GA_FOR_ALL_OPT_GROUP_POINTS_NC(gdp, grp, PtType, point)   GA_FOR_ALL_GROUP_POINTS_NC(gdp, grp, PtType, point)
#define GA_FOR_ALL_OPT_GROUP_POINTS_NC_CONST(gdp, grp, PtType, point)   GA_FOR_ALL_GROUP_POINTS_NC_CONST(gdp, grp, PtType, point)
#define GA_FOR_PAIRS_OF_POINTS(gdp1, point1, gdp2, point2)
#define GA_FOR_PAIRS_OF_GROUP_POINTS(gdp1, grp1, point1, gdp2, grp2, point2)
#define GA_FOR_PAIRS_OF_OPT_GROUP_POINTS(gdp1, grp1, point1, gdp2, grp2, point2)   GA_FOR_PAIRS_OF_GROUP_POINTS(gdp1, grp1, point1, gdp2, grp2, point2)
#define GA_FOR_PAIRS_OF_PRIMITIVES(gdp1, prim1, gdp2, prim2)
#define GA_FOR_PAIRS_OF_GROUP_PRIMITIVES(gdp1, grp1, prim1, gdp2, grp2, prim2)
#define GA_FOR_PAIRS_OF_OPT_GROUP_PRIMITIVES(gdp1, grp1, prim1, gdp2, grp2, prim2)   GA_FOR_PAIRS_OF_GROUP_PRIMITIVES(gdp1,grp1,prim1, gdp2,grp2,prim2)
#define GA_FOR_ALL_GROUP_EDGES(group, edge)
#define GA_FOR_ALL_GROUP_EDGES_INCL_PRIMS(group, edge, prim)
#define GA_FOR_SAFE_GROUP_EDGES(group, edge)   GA_FOR_ALL_GROUP_EDGES(group, edge)
#define GA_FOR_SAFE_GROUP_EDGES_INCL_PRIMS(group, edge, prim)   GA_FOR_ALL_GROUP_EDGES_INCL_PRIMS(group, edge, prim)
#define GA_FOR_ALL_GROUP_BREAKPOINTS(group, bkp)
#define GA_FOR_ALL_POINTGROUPS(gdp, grp)
#define GA_FOR_ALL_PRIMGROUPS(gdp, grp)
#define GA_FOR_ALL_ATTRIBUTES(dict, A)
#define GA_FOR_ALL_DETAIL_ATTRIBUTES(gdp, A)   GA_FOR_ALL_ATTRIBUTES((gdp)->getAttributeDict(GA_ATTRIB_GLOBAL), A)
#define GA_FOR_ALL_PRIMITIVE_ATTRIBUTES(gdp, A)   GA_FOR_ALL_ATTRIBUTES((gdp)->getAttributeDict(GA_ATTRIB_PRIMITIVE), A)
#define GA_FOR_ALL_POINT_ATTRIBUTES(gdp, A)   GA_FOR_ALL_ATTRIBUTES((gdp)->getAttributeDict(GA_ATTRIB_POINT), A)
#define GA_FOR_ALL_VERTEX_ATTRIBUTES(gdp, A)   GA_FOR_ALL_ATTRIBUTES((gdp)->getAttributeDict(GA_ATTRIB_VERTEX), A)
#define GA_FOR_ALL_GROUPS(grptable, grp)   for (GA_GroupTable::iterator<GA_ElementGroup> lcl_it = (grptable).beginTraverse(); !lcl_it.atEnd() && ((grp) = lcl_it.group()); ++lcl_it)


Detailed Description

Create macros which emulate the macros in the obsolete GB library.

Definition in file GA_GBMacros.h.


Define Documentation

#define GA_FOR_ALL_ATTRIBUTES ( dict,
 ) 

Value:

for (GA_AttributeDict::iterator it=dict.begin(); \
                !it.atEnd() && (A = it.attrib()); ++it)
Iterate over all attributes in a GA_AttributeDict

Definition at line 264 of file GA_GBMacros.h.

#define GA_FOR_ALL_DETAIL_ATTRIBUTES ( gdp,
 )     GA_FOR_ALL_ATTRIBUTES((gdp)->getAttributeDict(GA_ATTRIB_GLOBAL), A)

Iterate over all global/detail attributes in the geometry

Definition at line 270 of file GA_GBMacros.h.

#define GA_FOR_ALL_GPOINTS ( gdp,
point   ) 

Value:

for (GA_GBPointIterator it(*(gdp)); \
                (point = GA_Detail::GB_MACRO_CAST(gdp, it.getPoint())); ++it)
Iterate over all points.
Examples:
SIM/SIM_SolverHair.C, and SOP/SOP_IKSample.C.

Definition at line 105 of file GA_GBMacros.h.

#define GA_FOR_ALL_GPOINTS_NC ( gdp,
PtType,
pt   )     for (GA_GBPointIteratorNoCache<PtType> pt(*(gdp)); !pt.atEnd(); ++pt)

Iterate over all points. The underlying GEO_Point will be reused, so do not cache the resulting pointer!

Definition at line 126 of file GA_GBMacros.h.

#define GA_FOR_ALL_GPOINTS_NC_CONST ( gdp,
PtType,
pt   )     for (GA_GBPointIteratorNoCacheConst<PtType> pt(*(gdp)); !pt.atEnd(); ++pt)

Definition at line 128 of file GA_GBMacros.h.

#define GA_FOR_ALL_GROUP_BREAKPOINTS ( group,
bkp   ) 

Value:

for (GA_BreakpointGroup::iterator it=(group)->begin(); \
                        !it.atEnd() && (bkp = &it.getBreakpoint()); \
                        it.advance())
Iterate over breakpoints in the specified group.

Definition at line 235 of file GA_GBMacros.h.

#define GA_FOR_ALL_GROUP_EDGES ( group,
edge   ) 

Value:

for (GA_EdgeGroup::iterator it=(group)->begin(); \
                        !it.atEnd() && (edge = &it.getEdge()); \
                        it.advance())
Iterate over edges in the specified group.

Definition at line 208 of file GA_GBMacros.h.

#define GA_FOR_ALL_GROUP_EDGES_INCL_PRIMS ( group,
edge,
prim   ) 

Value:

for (GA_EdgeGroup::iterator it=(group)->begin(); \
                        !it.atEnd() && (edge = &it.getEdge()) && \
                        ((prim = it.getPrimitive()) || true); \
                        it.advance())
Iterate over edges in the specified group.

Definition at line 215 of file GA_GBMacros.h.

#define GA_FOR_ALL_GROUP_POINTS ( gdp,
grp,
point   ) 

Value:

for (GA_GBPointIterator it(*(gdp), grp); \
                (point = GA_Detail::GB_MACRO_CAST(gdp, it.getPoint())); ++it)
Iterate over all points in group.
See also:
GA_RTIElementGroup
Examples:
POP/POP_CircleForce.C, POP/POP_LocalForce.C, and POP/POP_SpotLight.C.

Definition at line 133 of file GA_GBMacros.h.

#define GA_FOR_ALL_GROUP_POINTS_NC ( gdp,
grp,
PtType,
pt   )     for (GA_GBPointIteratorNoCache<PtType> pt(*(gdp),grp); !pt.atEnd(); ++pt)

Iterate over all points in group.

See also:
GA_RTIElementGroup The point will be reused for all the iterations, so do not cache the resulting pointer!

Definition at line 141 of file GA_GBMacros.h.

#define GA_FOR_ALL_GROUP_POINTS_NC_CONST ( gdp,
grp,
PtType,
pt   )     for (GA_GBPointIteratorNoCacheConst<PtType> pt(*(gdp),grp); !pt.atEnd(); ++pt)

Definition at line 143 of file GA_GBMacros.h.

#define GA_FOR_ALL_GROUP_PRIMITIVES ( gdp,
grp,
prim   ) 

Value:

for (GA_GBPrimitiveIterator it(*(gdp), grp); \
                (prim=GA_Detail::GB_MACRO_CAST(gdp, it.getPrimitive())); \
                ++it)
Iterate over all primitives in group.
See also:
GA_RTIElementGroup

Definition at line 74 of file GA_GBMacros.h.

#define GA_FOR_ALL_GROUP_PTOFF ( gdp,
grp,
ptoff   ) 

Value:

GA_Offset   lcl_start, lcl_end;     \
    for (GA_Iterator lcl_it((gdp)->getPointRange(grp)); lcl_it.blockAdvance(lcl_start, lcl_end); )      \
        for (ptoff = lcl_start; ptoff < lcl_end; ++ptoff)
Iterate over all points in a group via point offsets.

Definition at line 118 of file GA_GBMacros.h.

#define GA_FOR_ALL_GROUPS ( grptable,
grp   )     for (GA_GroupTable::iterator<GA_ElementGroup> lcl_it = (grptable).beginTraverse(); !lcl_it.atEnd() && ((grp) = lcl_it.group()); ++lcl_it)

Definition at line 288 of file GA_GBMacros.h.

#define GA_FOR_ALL_OPT_GROUP_POINTS ( gdp,
grp,
point   )     GA_FOR_ALL_GROUP_POINTS(gdp, grp, point)

Iterate over all points in group, but the group can be NULL.

See also:
GA_RTIElementGroup
Examples:
SOP/SOP_CustomBrush.C, SOP/SOP_Flatten.C, SOP/SOP_PointWave.C, and SOP/SOP_TimeCompare.C.

Definition at line 149 of file GA_GBMacros.h.

#define GA_FOR_ALL_OPT_GROUP_POINTS_NC ( gdp,
grp,
PtType,
point   )     GA_FOR_ALL_GROUP_POINTS_NC(gdp, grp, PtType, point)

Iterate over all points in group, but the group can be NULL.

See also:
GA_RTIElementGroup The point will be reused for all the iterations, so do not cache the resulting pointer!

Definition at line 157 of file GA_GBMacros.h.

#define GA_FOR_ALL_OPT_GROUP_POINTS_NC_CONST ( gdp,
grp,
PtType,
point   )     GA_FOR_ALL_GROUP_POINTS_NC_CONST(gdp, grp, PtType, point)

Definition at line 159 of file GA_GBMacros.h.

#define GA_FOR_ALL_OPT_GROUP_PRIMITIVES ( gdp,
grp,
prim   )     GA_FOR_ALL_GROUP_PRIMITIVES(gdp,grp,prim)

Iterate over all primitives in group, but the group can be NULL.

See also:
GA_RTIElementGroup

Definition at line 92 of file GA_GBMacros.h.

#define GA_FOR_ALL_POINT_ATTRIBUTES ( gdp,
 )     GA_FOR_ALL_ATTRIBUTES((gdp)->getAttributeDict(GA_ATTRIB_POINT), A)

Iterate over all point attributes in the geometry

Definition at line 280 of file GA_GBMacros.h.

#define GA_FOR_ALL_POINTGROUPS ( gdp,
grp   ) 

Value:

for (GA_GroupTable::iterator<GA_ElementGroup> \
            __iter = (gdp)->getElementGroupTable(GA_ATTRIB_POINT).beginTraverse(),\
            __end = (gdp)->getElementGroupTable(GA_ATTRIB_POINT).endTraverse();\
         __iter != __end && \
            (grp = static_cast<GA_ElementGroupTableT<GA_ATTRIB_POINT>::GROUP_TYPE *>(__iter.group())); \
         ++__iter)
Iterate over all point GA_ElementGroups
Warning:
It is NOT safe to add or remove point groups during this loop.

Definition at line 243 of file GA_GBMacros.h.

#define GA_FOR_ALL_PRIMGROUPS ( gdp,
grp   ) 

Value:

for (GA_GroupTable::iterator<GA_ElementGroup> \
            __iter = (gdp)->getElementGroupTable(GA_ATTRIB_PRIMITIVE).beginTraverse(),\
            __end = (gdp)->getElementGroupTable(GA_ATTRIB_PRIMITIVE).endTraverse();\
         __iter != __end && \
            (grp = static_cast<GA_ElementGroupTableT<GA_ATTRIB_PRIMITIVE>::GROUP_TYPE *>(__iter.group())); \
         ++__iter)
Iterate over all primitive GA_ElementGroups
Warning:
It is NOT safe to add or remove point groups during this loop.

Definition at line 254 of file GA_GBMacros.h.

#define GA_FOR_ALL_PRIMITIVE_ATTRIBUTES ( gdp,
 )     GA_FOR_ALL_ATTRIBUTES((gdp)->getAttributeDict(GA_ATTRIB_PRIMITIVE), A)

Iterate over all primitive attributes in the geometry

Definition at line 275 of file GA_GBMacros.h.

#define GA_FOR_ALL_PRIMITIVES ( gdp,
prim   ) 

Value:

for (GA_GBPrimitiveIterator it(*(gdp)); \
                (prim = GA_Detail::GB_MACRO_CAST(gdp, it.getPrimitive())); ++it)
TODO: The GA_ prefix is necessary while GA needs to coexist with GB. Once GB has been entirely replaced, we'll remove the GA_ prefix for source compatibility. Iterates over primitives, assigning prim to the current primitive
Examples:
field3d/f3d_io.C, GEO/GEO_VoxelTranslator.C, SOP/SOP_PrimVOP.C, and standalone/geo2voxel.C.

Definition at line 38 of file GA_GBMacros.h.

#define GA_FOR_ALL_PTOFF ( gdp,
ptoff   ) 

Value:

GA_Offset   lcl_start, lcl_end;     \
    for (GA_Iterator lcl_it((gdp)->getPointRange()); lcl_it.blockAdvance(lcl_start, lcl_end); ) \
        for (ptoff = lcl_start; ptoff < lcl_end; ++ptoff)
Iterate over all points via offsets.

Definition at line 111 of file GA_GBMacros.h.

#define GA_FOR_ALL_VERTEX_ATTRIBUTES ( gdp,
 )     GA_FOR_ALL_ATTRIBUTES((gdp)->getAttributeDict(GA_ATTRIB_VERTEX), A)

Iterate over all vertex attributes in the geometry

Definition at line 285 of file GA_GBMacros.h.

#define GA_FOR_MASK_PRIMITIVES ( gdp,
prim,
mask   ) 

Value:

for (GA_GBPrimitiveIterator it(*(gdp), mask); \
                (prim=GA_Detail::GB_MACRO_CAST(gdp, it.getPrimitive())); \
                ++it)
Iterates over primitives, filtering only primitives which match the type mask specified. mask can be either GA_PrimCompat::TypeMask or a family mask.
See also:
GA_Primitive::getTypeId(), GA_Primitive::getFamilyMask(), GA_Primitive::getPrimitiveId()

Definition at line 67 of file GA_GBMacros.h.

#define GA_FOR_PAIRS_OF_GROUP_POINTS ( gdp1,
grp1,
point1,
gdp2,
grp2,
point2   ) 

Value:

for (GA_GBPointIterator it(*(gdp1), grp1, *(gdp2), grp2); \
                (point1=GA_Detail::GB_MACRO_CAST(gdp1, it.getPoint())) && \
                (point2=GA_Detail::GB_MACRO_CAST(gdp2, it.getPoint2())); ++it)
Iterate over points in the specified groups across both GA_Details in a pairwise fashion.

Definition at line 172 of file GA_GBMacros.h.

#define GA_FOR_PAIRS_OF_GROUP_PRIMITIVES ( gdp1,
grp1,
prim1,
gdp2,
grp2,
prim2   ) 

Value:

for (GA_GBPrimitiveIterator it(*(gdp1), grp1, *(gdp2), grp2); \
                (prim1=GA_Detail::GB_MACRO_CAST(gdp1, it.getPrimitive())) && \
                (prim2=GA_Detail::GB_MACRO_CAST(gdp2, it.getPrimitive2())); \
                ++it)
Iterate over points in the specified groups across both GA_Details in a pairwise fashion.

Definition at line 194 of file GA_GBMacros.h.

#define GA_FOR_PAIRS_OF_OPT_GROUP_POINTS ( gdp1,
grp1,
point1,
gdp2,
grp2,
point2   )     GA_FOR_PAIRS_OF_GROUP_POINTS(gdp1, grp1, point1, gdp2, grp2, point2)

Iterate over points in the specified groups across both GA_Details in a pairwise fashion. Groups may be NULL.

Definition at line 180 of file GA_GBMacros.h.

#define GA_FOR_PAIRS_OF_OPT_GROUP_PRIMITIVES ( gdp1,
grp1,
prim1,
gdp2,
grp2,
prim2   )     GA_FOR_PAIRS_OF_GROUP_PRIMITIVES(gdp1,grp1,prim1, gdp2,grp2,prim2)

Iterate over primitives in the specified groups across both GA_Details in a pairwise fashion. Groups may be NULL.

Definition at line 203 of file GA_GBMacros.h.

#define GA_FOR_PAIRS_OF_POINTS ( gdp1,
point1,
gdp2,
point2   ) 

Value:

for (GA_GBPointIterator it(*(gdp1), NULL, *(gdp2), NULL); \
                (point1=GA_Detail::GB_MACRO_CAST(gdp1, it.getPoint())) && \
                (point2=GA_Detail::GB_MACRO_CAST(gdp2, it.getPoint2())); ++it)
Iterate over points in both GA_Details in a pairwise fashion.

Definition at line 164 of file GA_GBMacros.h.

#define GA_FOR_PAIRS_OF_PRIMITIVES ( gdp1,
prim1,
gdp2,
prim2   ) 

Value:

for (GA_GBPrimitiveIterator it(*(gdp1), NULL, *(gdp2), NULL); \
                (prim1=GA_Detail::GB_MACRO_CAST(gdp1, it.getPrimitive())) && \
                (prim2=GA_Detail::GB_MACRO_CAST(gdp2, it.getPrimitive2())); \
                ++it)
Iterate over primitives in both GA_Details in a pairwise fashion.

Definition at line 185 of file GA_GBMacros.h.

#define GA_FOR_SAFE_GROUP_EDGES ( group,
edge   )     GA_FOR_ALL_GROUP_EDGES(group, edge)

Iterate over edges in the specified group. Edges may be deleted during traversal.

Definition at line 224 of file GA_GBMacros.h.

#define GA_FOR_SAFE_GROUP_EDGES_INCL_PRIMS ( group,
edge,
prim   )     GA_FOR_ALL_GROUP_EDGES_INCL_PRIMS(group, edge, prim)

Iterate over edges in the specified group. Edges may be deleted during traversal.

Definition at line 230 of file GA_GBMacros.h.

#define GA_FOR_SAFE_GROUP_PRIMITIVES ( gdp,
grp,
prim,
next   ) 

Value:

for (GA_GBPrimitiveIterator it(*(gdp),grp,GA_Range::safedeletions()); \
                (prim=GA_Detail::GB_MACRO_CAST(gdp, it.getPrimitive())) && \
                ((next=GA_Detail::GB_MACRO_CAST(gdp, it.getNextPrimitive())) \
                 || true); \
                ++it)
Iterates over primitives in group, but primitives may be deleted during the iteration.
See also:
GA_RTIElementGroup

Definition at line 82 of file GA_GBMacros.h.

#define GA_FOR_SAFE_OPT_GROUP_PRIMITIVES ( gdp,
grp,
prim,
next   )     GA_FOR_SAFE_GROUP_PRIMITIVES(gdp,grp,prim,next)

Iterate over all primitives in group, but the group can be NULL and primitives may be deleted during the iteration.

See also:
GA_RTIElementGroup

Definition at line 99 of file GA_GBMacros.h.

#define GA_FOR_SAFE_POINTS ( gdp,
cur_point,
next   ) 

Value:

for (GA_GBPointIterator it(*(gdp), GA_Range::safedeletions()); \
                (cur_point = GA_Detail::GB_MACRO_CAST(gdp, it.getPoint())) && \
                ((next=GA_Detail::GB_MACRO_CAST(gdp, it.getNextPoint())) \
                 || true); \
                ++it)
Iterates over points, but points may be deleted during iteration.

Definition at line 54 of file GA_GBMacros.h.

#define GA_FOR_SAFE_PRIMITIVES ( gdp,
prim,
next   ) 

Value:

for (GA_GBPrimitiveIterator it(*(gdp), GA_Range::safedeletions()); \
                (prim=GA_Detail::GB_MACRO_CAST(gdp, it.getPrimitive())) && \
                ((next=GA_Detail::GB_MACRO_CAST(gdp, it.getNextPrimitive())) \
                 || true); \
                ++it)
Iterates over primitives, but primitives may be deleted during the iteration.

Definition at line 45 of file GA_GBMacros.h.


Generated on Thu Jan 31 00:28:54 2013 for HDK by  doxygen 1.5.9