本文整理汇总了C++中TopTools_IndexedMapOfShape::Clear方法的典型用法代码示例。如果您正苦于以下问题:C++ TopTools_IndexedMapOfShape::Clear方法的具体用法?C++ TopTools_IndexedMapOfShape::Clear怎么用?C++ TopTools_IndexedMapOfShape::Clear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TopTools_IndexedMapOfShape
的用法示例。
在下文中一共展示了TopTools_IndexedMapOfShape::Clear方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PrintItemCount
void OCC_Connect::PrintItemCount(TopoDS_Shape const &shape) const
{
TopTools_IndexedMapOfShape imap;
TopExp::MapShapes(shape,TopAbs_VERTEX,imap);
cout << "Input map contains " << imap.Extent() << " vertices\n";
imap.Clear();
TopExp::MapShapes(shape,TopAbs_EDGE,imap);
cout << "Input map contains " << imap.Extent() << " edges\n";
imap.Clear();
TopExp::MapShapes(shape,TopAbs_FACE,imap);
cout << "Input map contains " << imap.Extent() << " faces\n";
imap.Clear();
TopExp::MapShapes(shape,TopAbs_SOLID,imap);
cout << "Input map contains " << imap.Extent() << " solids\n";
imap.Clear();
TopExp::MapShapes(shape,TopAbs_COMPSOLID,imap);
cout << "Input map contains " << imap.Extent() << " compsolids\n";
imap.Clear();
TopExp::MapShapes(shape,TopAbs_COMPOUND,imap);
cout << "Input map contains " << imap.Extent() << " compounds\n";
}
示例2: OCCGeometry
OCCGeometry()
{
somap.Clear();
shmap.Clear();
fmap.Clear();
wmap.Clear();
emap.Clear();
vmap.Clear();
}
示例3: sampleKitchen
//================================================================
// Function : TexturesExt_Presentation::sampleKitchen
// Purpose : kitchen with texturized items in it.
//================================================================
void TexturesExt_Presentation::sampleKitchen()
{
TopoDS_Shape aShape;
if (!loadShape(aShape, "Kitchen\\Room.brep"))
return;
gp_Trsf aTrsf;
gp_Ax3 NewCoordSystem (gp_Pnt(-1,-1, -1),gp_Dir(0,0,1));
gp_Ax3 CurrentCoordSystem(gp_Pnt(0,0,0),gp_Dir(0,0,1));
aTrsf.SetDisplacement(CurrentCoordSystem, NewCoordSystem);
aShape.Location(TopLoc_Location(aTrsf));
moveScale(aShape);
// draw kitchen room whithout one wall (to better see the insides)
TopTools_IndexedMapOfShape aFaces;
TopExp::MapShapes(aShape, TopAbs_FACE, aFaces);
Standard_Integer nbFaces = aFaces.Extent();
// create a wooden kitchen floor
// the floor's face will be textured with texture from chataignier.gif
DISP(Texturize(aFaces(5),"plancher.gif",1,1,2,1));
// texturize other faces of the room with texture from wallpaper.gif (walls)
DISP(Texturize(aFaces(1),"wallpaper.gif",1,1,8,6));
DISP(Texturize(aFaces(3),"wallpaper.gif",1,1,8,6));
DISP(Texturize(aFaces(4),"wallpaper.gif",1,1,8,6));
// DISP(drawShape(aFaces(1), Quantity_NOC_LIGHTPINK, Standard_False));
// DISP(drawShape(aFaces(3), Quantity_NOC_LIGHTPINK, Standard_False));
// DISP(drawShape(aFaces(4), Quantity_NOC_LIGHTPINK, Standard_False));
// texturize furniture items with "wooden" texture
if (loadShape(aShape, "Kitchen\\MODERN_Table_1.brep"))
{
moveScale(aShape);
DISP(Texturize(aShape, "chataignier.gif"));
}
if (loadShape(aShape, "Kitchen\\MODERN_Chair_1.brep"))
{
moveScale(aShape);
DISP(Texturize(aShape, "chataignier.gif"));
}
if (loadShape(aShape, "Kitchen\\MODERN_Cooker_1.brep"))
{
moveScale(aShape);
aFaces.Clear();
TopExp::MapShapes(aShape, TopAbs_FACE, aFaces);
nbFaces = aFaces.Extent();
for (Standard_Integer i = 1; i <= nbFaces; i++)
{
if (i >= 59)
DISP(drawShape(aFaces(i), Graphic3d_NOM_STEEL, Standard_False));
else if (i >= 29)
DISP(drawShape(aFaces(i), Graphic3d_NOM_ALUMINIUM, Standard_False));
else if (i == 28)
DISP(Texturize(aFaces(i), "cookerplate.gif"));
else
DISP(Texturize(aFaces(i), "chataignier.gif"));
}
}
if (loadShape(aShape, "Kitchen\\MODERN_Cooker_1_opened.brep"))
{
moveScale(aShape);
DISP(Texturize(aShape, "chataignier.gif"));
}
if (loadShape(aShape, "Kitchen\\MODERN_Exhaust_1.brep"))
{
moveScale(aShape);
DISP(drawShape(aShape, Graphic3d_NOM_STONE, Standard_False));
}
if (loadShape(aShape, "Kitchen\\MODERN_MVCooker_1.brep"))
{
moveScale(aShape);
DISP(drawShape(aShape, Graphic3d_NOM_SILVER, Standard_False));
}
if (loadShape(aShape, "Kitchen\\MODERN_MVCooker_1_opened.brep"))
{
moveScale(aShape);
DISP(drawShape(aShape, Graphic3d_NOM_SILVER, Standard_False));
}
if (loadShape(aShape, "Kitchen\\MODERN_Sink_1.brep"))
{
moveScale(aShape);
aFaces.Clear();
TopExp::MapShapes(aShape, TopAbs_FACE, aFaces);
nbFaces = aFaces.Extent();
for (Standard_Integer i = 1; i <= nbFaces; i++)
{
if (i < 145)
DISP(drawShape(aFaces(i), Graphic3d_NOM_ALUMINIUM, Standard_False));
//.........这里部分代码省略.........
示例4: FillSameDomainFaces
//=======================================================================
// function: FillSameDomainFaces
// purpose:
//=======================================================================
void GEOMAlgo_Builder::FillSameDomainFaces()
{
Standard_Boolean bIsSDF, bHasImage1, bHasImage2, bForward;
Standard_Integer i, j, aNbFF, nF1, nF2, aNbPBInOn, aNbC, aNbSE;
Standard_Integer aNbF1, aNbF2, i2s, aNbSD;
TopTools_MapOfShape aMFence;
TopTools_ListOfShape aLX1, aLX2;
TopTools_ListIteratorOfListOfShape aItF1, aItF2;
NMTTools_ListOfCoupleOfShape aLCS;
//
const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
NMTTools_PaveFiller* pPF=myPaveFiller;
NMTDS_InterfPool* pIP=pPF->IP();
BOPTools_CArray1OfSSInterference& aFFs=pIP->SSInterferences();
const Handle(IntTools_Context)& aCtx= pPF->Context();
//
//
//mySameDomainShapes.Clear();
//
// 1. For each FF find among images of faces
// all pairs of same domain faces (SDF) [=> aLCS]
aNbFF=aFFs.Extent();
for (i=1; i<=aNbFF; ++i) {
BOPTools_SSInterference& aFF=aFFs(i);
aFF.Indices(nF1, nF2);
//
const TopoDS_Face& aF1=TopoDS::Face(aDS.Shape(nF1));
const TopoDS_Face& aF2=TopoDS::Face(aDS.Shape(nF2));
//
// if there are no in/on 2D split parts the faces nF1, nF2
// can not be SDF
const BOPTools_ListOfPaveBlock& aLPBInOn=aFF.PaveBlocks();
aNbPBInOn=aLPBInOn.Extent();
//
//===
const TColStd_ListOfInteger& aLSE=aFF.SharedEdges();
aNbSE=aLSE.Extent();
if (!aNbPBInOn && !aNbSE) {
continue;
}
//===
//
// if there is at least one section edge between faces nF1, nF2
// they can not be SDF
BOPTools_SequenceOfCurves& aSC=aFF.Curves();
aNbC=aSC.Length();
if (aNbC) {
continue;
}
//
// the faces are suspected to be SDF.
// Try to find SDF among images of nF1, nF2
aMFence.Clear();
//
//--------------------------------------------------------
bHasImage1=mySplitFaces.HasImage(aF1);
bHasImage2=mySplitFaces.HasImage(aF2);
//
aLX1.Clear();
if (!bHasImage1) {
aLX1.Append(aF1);
}
//
aLX2.Clear();
if (!bHasImage2) {
aLX2.Append(aF2);
}
//
const TopTools_ListOfShape& aLF1r=(bHasImage1)? mySplitFaces.Image(aF1) : aLX1;
const TopTools_ListOfShape& aLF2r=(bHasImage2)? mySplitFaces.Image(aF2) : aLX2;
//
TopTools_DataMapOfIntegerShape aMIS;
TColStd_ListIteratorOfListOfInteger aItLI;
NMTDS_BoxBndTreeSelector aSelector;
NMTDS_BoxBndTree aBBTree;
NCollection_UBTreeFiller <Standard_Integer, Bnd_Box> aTreeFiller(aBBTree);
//
aNbF1=aLF1r.Extent();
aNbF2=aLF2r.Extent();
bForward=(aNbF1<aNbF2);
//
const TopTools_ListOfShape& aLF1=bForward ? aLF1r : aLF2r;
const TopTools_ListOfShape& aLF2=bForward ? aLF2r : aLF1r;
//
// 1. aTreeFiller
aItF2.Initialize(aLF2);
for (i2s=1; aItF2.More(); aItF2.Next(), ++i2s) {
Bnd_Box aBoxF2s;
//
const TopoDS_Face& aF2s=*((TopoDS_Face*)(&aItF2.Value()));
//
BRepBndLib::Add(aF2s, aBoxF2s);
//
aMIS.Bind(i2s, aF2s);
//
aTreeFiller.Add(i2s, aBoxF2s);
//.........这里部分代码省略.........
示例5: FillInternalShapes
//=======================================================================
//function :FillInternalShapes
//purpose :
//=======================================================================
void GEOMAlgo_Builder::FillInternalShapes()
{
myErrorStatus=0;
//
const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS();
NMTTools_PaveFiller* pPF=myPaveFiller;
const Handle(IntTools_Context)& aCtx= pPF->Context();
//
//Standard_Boolean bHasImage;
Standard_Integer i, j, jT, aNbS, aNbSI, aNbSx, aNbSd;
TopAbs_ShapeEnum aType, aT[]={ TopAbs_VERTEX, TopAbs_EDGE };
TopAbs_State aState;
TopTools_ListIteratorOfListOfShape aIt, aIt1;
TopTools_IndexedDataMapOfShapeListOfShape aMSx;
TopTools_IndexedMapOfShape aMx;
TopTools_MapOfShape aMSI, aMFence, aMSOr;
TopTools_MapIteratorOfMapOfShape aItM;
TopTools_ListOfShape aLSI, aLSd;
TopoDS_Iterator aItS;
BRep_Builder aBB;
//
// 1. Shapes to process
//
// 1.1 Shapes from pure arguments aMSI
// 1.1.1 vertex, edge
for (i=0; i<2; ++i) {
jT=(Standard_Integer)aT[i];
const TopTools_ListOfShape &aLS=myShapes1[jT];
aIt.Initialize(aLS);
for (; aIt.More(); aIt.Next()) {
const TopoDS_Shape& aS=aIt.Value();
if (aMFence.Add(aS)) {
aLSI.Append(aS);
}
}
}
// 1.1.2 wire
{
jT=(Standard_Integer)TopAbs_WIRE;
const TopTools_ListOfShape &aLW=myShapes1[jT];
aIt.Initialize(aLW);
for (; aIt.More(); aIt.Next()) {
const TopoDS_Shape& aW=aIt.Value();
aItS.Initialize(aW);
for (; aItS.More(); aItS.Next()) {
const TopoDS_Shape& aE=aItS.Value();
if (aMFence.Add(aE)) {
aLSI.Append(aE);
}
}
}
}
// 1.1.3 theirs images/sources
aIt1.Initialize(aLSI);
for (; aIt1.More(); aIt1.Next()) {
const TopoDS_Shape& aS=aIt1.Value();
if (myImages.HasImage(aS)) {
const TopTools_ListOfShape &aLSp=myImages.Image(aS);
aIt.Initialize(aLSp);
for (; aIt.More(); aIt.Next()) {
const TopoDS_Shape& aSI=aIt.Value();
aMSI.Add(aSI);
}
}
else {
aMSI.Add(aS);
}
}
aLSI.Clear();
aNbSI=aMSI.Extent();
//
// 2. Internal vertices, edges from source solids
aMFence.Clear();
aLSd.Clear();
//
aNbS=aDS.NumberOfShapesOfTheObject();
for (i=1; i<=aNbS; ++i) {
const TopoDS_Shape& aS=aDS.Shape(i);
aType=aS.ShapeType();
if (aType==TopAbs_SOLID) {
//
aMx.Clear();
OwnInternalShapes(aS, aMx);
//
aNbSx=aMx.Extent();
for (j=1; j<=aNbSx; ++j) {
const TopoDS_Shape& aSI=aMx(j);
if (myImages.HasImage(aSI)) {
const TopTools_ListOfShape &aLSp=myImages.Image(aSI);
aIt.Initialize(aLSp);
for (; aIt.More(); aIt.Next()) {
const TopoDS_Shape& aSp=aIt.Value();
aMSI.Add(aSp);
}
}
else {
//.........这里部分代码省略.........