X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModel%2FModel_ResultConstruction.cpp;h=443c9ce9f24316fbef0b2f1d9c924866f5061d82;hb=061a63480f6840b6d945f7744b3b972e2d4cb25d;hp=e614fd89ca4f73ece682dcf6ff20d9cdb039bf80;hpb=5297856d2148995c4dcb0561f895a6a22db7086b;p=modules%2Fshaper.git diff --git a/src/Model/Model_ResultConstruction.cpp b/src/Model/Model_ResultConstruction.cpp index e614fd89c..443c9ce9f 100644 --- a/src/Model/Model_ResultConstruction.cpp +++ b/src/Model/Model_ResultConstruction.cpp @@ -45,8 +45,8 @@ std::shared_ptr Model_ResultConstruction::shape() Model_ResultConstruction::Model_ResultConstruction() { myIsInHistory = true; + myIsInfinite = false; myFacesUpToDate = false; - setIsConcealed(false); } void Model_ResultConstruction::setIsInHistory(const bool isInHistory) @@ -59,14 +59,16 @@ int Model_ResultConstruction::facesNum() if (!myFacesUpToDate) { std::shared_ptr aWirePtr = std::dynamic_pointer_cast(myShape); - std::list > aFaces; - GeomAlgoAPI_SketchBuilder::createFaces(aWirePtr->origin(), aWirePtr->dirX(), - aWirePtr->norm(), aWirePtr, aFaces); - std::list >::iterator aFIter = aFaces.begin(); - for(; aFIter != aFaces.end(); aFIter++) { - std::shared_ptr aFace(new GeomAPI_Face(*aFIter)); - if (aFace.get()) - myFaces.push_back(aFace); + if (aWirePtr.get()) { + std::list > aFaces; + GeomAlgoAPI_SketchBuilder::createFaces(aWirePtr->origin(), aWirePtr->dirX(), + aWirePtr->norm(), aWirePtr, aFaces); + std::list >::iterator aFIter = aFaces.begin(); + for(; aFIter != aFaces.end(); aFIter++) { + std::shared_ptr aFace(new GeomAPI_Face(*aFIter)); + if (aFace.get() && !aFace->isNull()) + myFaces.push_back(aFace); + } } myFacesUpToDate = true; } @@ -77,3 +79,18 @@ std::shared_ptr Model_ResultConstruction::face(const int theIndex) { return myFaces[theIndex]; } + +bool Model_ResultConstruction::isInfinite() +{ + return myIsInfinite; +} + +void Model_ResultConstruction::setInfinite(const bool theInfinite) +{ + myIsInfinite = theInfinite; +} + +void Model_ResultConstruction::setIsConcealed(const bool theValue) +{ + // do nothing: the construction element is never consealed +}