How to use TopTools_DataMapIteratorOfDataMapOfShapeListOfShape

TopTools_DataMapIteratorOfDataMapOfShapeListOfShape


Introduction

TopTools_DataMapIteratorOfDataMapOfShapeListOfShape  is a class in Open CASCADE Technology (OCCT) Library which allows it iterates over key-value pairs between TopoDS_Shape and TopTools_DataMapOfShapeListOfShape. TopTools_DataMapOfShapeListOFShape is used to store a map between 3D shape and its sub-shapes or similar use cases. This iterator is useful when working with large and complex data maps and this is more efficient than processing the entire maps at once.

Example

Here is an example of how to use the TopTools_DataMapIteratorOfDataMapOfShapeListOFShape class.

#include <TopTools_DataMapIteratorOfDataMapOfShapeListOfShape.hxx>

// map of shape-shape map assiciation
TopTools_DataMapOfShapeListOfShape shapeMap;
// initialize the iterator
TopTools_DataMapIteratorOfDataMapOfShapeListOfShape itr(shapeMap);
for (; itr.More(); itr.Next())
{
    // get the current association
    const TopoDS_Shape& keyShape = itr.Key();     // key
    const TopTools_ListOfShape& shapeList = itr.Value(); // value

    // iterate over TopTools_ListOfShape
    TopTools_ListIteratorOfListOfShape itr1(shapeList);
    for (; itr1.More(); itr1.Next())
    {
        const TopoDS_Shape& shape = itr1.Value();
    }
}


Post a Comment

Previous Post Next Post