HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GA_Range Class Reference

A range of elements in an index-map. More...

#include <GA_Range.h>

+ Inheritance diagram for GA_Range:

Classes

class  emptyrange
 
class  enditerator
 
class  ignore_order
 
class  includetemporaries
 
class  ordered
 
class  pointref
 
class  primitiveref
 
class  safedeletions
 

Public Types

typedef GA_Iterator const_iterator
 
typedef GA_Iterator iterator
 

Public Member Functions

bool empty () const
 Determine whether a range is empty. More...
 
 GA_Range (const GA_IndexMap &map, const GA_OffsetList &offsetlist, GA_Size start=0, GA_Size end=-1)
 
 GA_Range (const GA_ElementGroup &group, bool complement=false)
 
 GA_Range (const GA_IndexMap &map, const GA_ElementGroup *group, bool complement=false)
 
 GA_Range (const GA_Detail &geo, GA_Offset point, GA_AttributeOwner owner, pointref, bool harden)
 
 GA_Range (const GA_Detail &geo, const GA_Range &point_range, GA_AttributeOwner type, pointref, bool harden)
 
 GA_Range (const GA_Detail &geo, GA_Offset prim, GA_AttributeOwner owner, primitiveref, bool harden)
 
 GA_Range (const GA_Detail &geo, const GA_Range &primitive_range, GA_AttributeOwner type, primitiveref, bool harden)
 
 GA_Range (const GA_Detail &geo, const GA_Range &primitive_range, GA_AttributeOwner type, primitiveref, ordered, bool harden)
 
 GA_Range (const GA_IndexMap &map, includetemporaries)
 
void adopt (GA_RangeTypeInterface *r)
 
bool isValid () const
 Check whether range is valid (i.e. has an implementation) More...
 
GA_AttributeOwner getOwner () const
 Query type of element. More...
 
bool isEmpty () const
 Check whether the range is empty. More...
 
GA_Size getMaxEntries () const
 Get an upper bound on the range. More...
 
GA_Size getEntries () const
 Get an accurate count of the entries in the range. More...
 
bool areTraversalDeletionsSafe () const
 
bool canContainDuplicates () const
 
const GA_RangeMemberQueryallocMemberQuery () const
 
const GA_RangeTypeInterfacegetRTI () const
 Accessor for RTI. More...
 
 GA_Range ()
 
 GA_Range (const GA_RangeTypeInterface &range)
 
 GA_Range (const GA_Range &src)
 
 ~GA_Range ()
 
GA_Iterator begin () const
 
GA_Iterator end () const
 
 GA_Range (const GA_Range &src, ordered, bool descending=false)
 
 GA_Range (const GA_Range &src, safedeletions)
 
 GA_Range (const GA_IndexMap &map, emptyrange)
 
 GA_Range (const GA_IndexMap &map)
 
 GA_Range (const GA_IndexMap &map, GA_Offset start, GA_Offset end)
 
 GA_Range (const GA_IndexMap &map, GA_Index start, GA_Index end, ordered)
 
 GA_Range (const GA_IndexMap &map, GA_Index start, GA_Index end, GA_Size step, ordered)
 
 GA_Range (const GA_ElementGroup &group, ignore_order, bool complement=false)
 
 GA_Range (const GA_IndexMap &map, const GA_ElementGroup *group, ignore_order, bool complement=false)
 
const GA_Rangeoperator= (const GA_Range &src)
 
bool operator== (const GA_Range &src) const
 

Friends

class GA_RangeTypeInterface
 
class GA_SplittableRange
 

Detailed Description

A range of elements in an index-map.

A range specifies a selection/collection of elements in an index map for iteration. The membership state of individual elements can also be queried (

See Also
allocMemberQuery()).

Iteration over a range, performed by instantiating a GA_Iterator, does not affect the range object itself. The begin() method can be used to initialize a basic iterator.

Custom range types are implemented by subclassing GA_RangeTypeInterface.

Examples:
SOP/SOP_BrushHairLen.C, and tetprim/GEO_PrimTetra.C.

Definition at line 42 of file GA_Range.h.

Member Typedef Documentation

Definition at line 45 of file GA_Range.h.

Definition at line 46 of file GA_Range.h.

Constructor & Destructor Documentation

GA_Range::GA_Range ( )

Constructor/destructors

GA_Range::GA_Range ( const GA_RangeTypeInterface range)

Constructor/destructors

GA_Range::GA_Range ( const GA_Range src)

Constructor/destructors

GA_Range::~GA_Range ( )

Constructor/destructors

GA_Range::GA_Range ( const GA_Range src,
ordered  ,
bool  descending = false 
)

Interface for making another range into an ordered range.

Parameters
descendingIf true, the index order is going to be in a descending order. If false, it's ascending.
GA_Range::GA_Range ( const GA_Range src,
safedeletions   
)

Interface for making another range into one where deletions are safe to perform during the traversal.

GA_Range::GA_Range ( const GA_IndexMap map,
emptyrange   
)

An empty range.

GA_Range::GA_Range ( const GA_IndexMap map)
explicit

Convenience constructor to construct an offset range The range includes start, but doesn't include end.

See Also
GA_RTIOffset
GA_Range::GA_Range ( const GA_IndexMap map,
GA_Offset  start,
GA_Offset  end 
)

Convenience constructor to construct an offset range The range includes start, but doesn't include end.

See Also
GA_RTIOffset
GA_Range::GA_Range ( const GA_IndexMap map,
GA_Index  start,
GA_Index  end,
ordered   
)

Convenience constructor to construct an index range

See Also
GA_RTIIndex
GA_Range::GA_Range ( const GA_IndexMap map,
GA_Index  start,
GA_Index  end,
GA_Size  step,
ordered   
)

Convenience constructor to construct an index range

See Also
GA_RTIIndex
GA_Range::GA_Range ( const GA_IndexMap map,
const GA_OffsetList offsetlist,
GA_Size  start = 0,
GA_Size  end = -1 
)

Constructor to create a range containing the offsets in the given list. If end < 0, it will be set to the offsetlist.entries()

See Also
GA_RTIOffsetList
GA_Range::GA_Range ( const GA_ElementGroup group,
bool  complement = false 
)
explicit

Construct a range of the elements in a given group

See Also
GA_RTIElementGroup
GA_Range::GA_Range ( const GA_IndexMap map,
const GA_ElementGroup group,
bool  complement = false 
)

Construct a range of the elements in a given group

See Also
GA_RTIElementGroup
GA_Range::GA_Range ( const GA_ElementGroup group,
ignore_order  ,
bool  complement = false 
)

Construct a range of the elements in a given group, ignoring its order even if it is ordered.

See Also
GA_RTIElementGroup
GA_Range::GA_Range ( const GA_IndexMap map,
const GA_ElementGroup group,
ignore_order  ,
bool  complement = false 
)

Construct a range of the elements in a given group, ignoring its order even if it is ordered.

See Also
GA_RTIElementGroup
GA_Range::GA_Range ( const GA_Detail geo,
GA_Offset  point,
GA_AttributeOwner  owner,
pointref  ,
bool  harden 
)

Construct a range of all the elements referencing a given point. The harden argument determines whether it is safe to use this range after the point has been deleted. If the point will exist for the lifetime of the range, harden can be false and thus more efficient.

For example, to find all the vertices which reference point number 3:

GA_Range(geo, 3, GA_ATTRIB_VERTEX, GA_Range::pointref, false);
See Also
GA_RTIPointRef
GA_Range::GA_Range ( const GA_Detail geo,
const GA_Range point_range,
GA_AttributeOwner  type,
pointref  ,
bool  harden 
)

Construct a range of all primitives/vertices referenced by the points in the given range. The harden argument determines whether it is safe to use this range after the point has been deleted. If the point will exist for the lifetime of the range, harden can be false and thus more efficient.

GA_Range(geo, geo.getPointRange(), GA_ATTRIB_PRIMITIVE, false);
GA_Range(geo, geo.getPointRange(), GA_ATTRIB_VERTEX, false);
See Also
GA_RTIPointComprehension
GA_Range::GA_Range ( const GA_Detail geo,
GA_Offset  prim,
GA_AttributeOwner  owner,
primitiveref  ,
bool  harden 
)

Construct a range of all the elements used by a given primitive. The harden argument determines whether it is safe to use this range after the primitive has been deleted. If the primitive will exist for the lifetime of the range, harden can be false, and thus more efficient. If vertices are added or removed during traversal and harden is true, only the original vertices will be traversed, but behaviour is undefined if harden is false.

For example, to find all the points which referenced by primitive 3:

GA_Range(geo, 3, GA_ATTRIB_VERTEX, GA_Range::primitiveref);
See Also
GA_RTIPrimitiveRef
GA_Range::GA_Range ( const GA_Detail geo,
const GA_Range primitive_range,
GA_AttributeOwner  type,
primitiveref  ,
bool  harden 
)

Construct a range of all points/vertices referenced by the primitives in the given range. The harden argument determines whether it is safe to use this range after the primitive has been deleted. If the primitive will exist for the lifetime of the range, harden can be false and thus more efficient.

GA_Range(geo, geo.getPrimitiveRange(), GA_ATTRIB_POINT);
GA_Range(geo, geo.getPrimitiveRange(), GA_ATTRIB_VERTEX);
See Also
GA_RTIPrimitiveComprehension
GA_Range::GA_Range ( const GA_Detail geo,
const GA_Range primitive_range,
GA_AttributeOwner  type,
primitiveref  ,
ordered  ,
bool  harden 
)

Construct a range of all points/vertices referenced by the primitives in the given range. The harden argument determines whether it is safe to use this range after the primitive has been deleted. If the primitive will exist for the lifetime of the range, harden can be false and thus more efficient.

This version delivers the points/vertices in the order imposed by the primitive_range. This is equivalent to traversing the vertices of each primitive with a GA_Primitive::const_iterator as it is visited.

GA_Range(geo, geo.getPrimitiveRange(), GA_ATTRIB_POINT);
GA_Range(geo, geo.getPrimitiveRange(), GA_ATTRIB_VERTEX);
See Also
GA_RTIPrimitiveComprehension
GA_Range::GA_Range ( const GA_IndexMap map,
includetemporaries   
)

Iterate over all elements in the index map, including any temporary elements. This should be used within ATI's when changing data for all elements (including temporaries).

Member Function Documentation

void GA_Range::adopt ( GA_RangeTypeInterface r)
inline

Take ownership of the given GA_RangeTypeInterface. This is used to avoid unnecessary calls to GA_RangeTypeInterface::copy().

Definition at line 228 of file GA_Range.h.

const GA_RangeMemberQuery* GA_Range::allocMemberQuery ( ) const

Allocate an object for testing the membership of individual elements to this range. The caller is responsible for deleting this object, which should not outlive the allocating range.

Behaviour of this object is undefined for any elements that have been deleted or moved since its creation.

bool GA_Range::areTraversalDeletionsSafe ( ) const
inline

Query if it is safe to delete an element during traversal. If not, you can build an equivalent range by calling: GA_Range(initial_range, GA_Range::safedeletions)

Definition at line 247 of file GA_Range.h.

GA_Iterator GA_Range::begin ( ) const

Default iterator

Examples:
tetprim/GEO_PrimTetra.C.
bool GA_Range::canContainDuplicates ( ) const
inline

Query if the range contains duplicates. If it cannot, then optimizations can be made assuming that there are no duplicates in the range. This defaults to true.

Definition at line 256 of file GA_Range.h.

bool GA_Range::empty ( void  ) const
inline

Determine whether a range is empty.

Definition at line 63 of file GA_Range.h.

GA_Iterator GA_Range::end ( ) const

Default iterator

GA_Size GA_Range::getEntries ( ) const
inline

Get an accurate count of the entries in the range.

Definition at line 242 of file GA_Range.h.

GA_Size GA_Range::getMaxEntries ( ) const
inline

Get an upper bound on the range.

Definition at line 240 of file GA_Range.h.

GA_AttributeOwner GA_Range::getOwner ( ) const
inline

Query type of element.

Definition at line 234 of file GA_Range.h.

const GA_RangeTypeInterface* GA_Range::getRTI ( ) const
inline

Accessor for RTI.

Definition at line 286 of file GA_Range.h.

bool GA_Range::isEmpty ( ) const
inline

Check whether the range is empty.

Definition at line 237 of file GA_Range.h.

bool GA_Range::isValid ( ) const
inline

Check whether range is valid (i.e. has an implementation)

Definition at line 231 of file GA_Range.h.

const GA_Range& GA_Range::operator= ( const GA_Range src)
inline

Operators

Definition at line 218 of file GA_Range.h.

bool GA_Range::operator== ( const GA_Range src) const

Operators

Friends And Related Function Documentation

friend class GA_RangeTypeInterface
friend

Definition at line 302 of file GA_Range.h.

friend class GA_SplittableRange
friend

Definition at line 303 of file GA_Range.h.


The documentation for this class was generated from the following file: