X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModel%2FModel_ResultConstruction.cpp;h=41e1a9b166a43771fac03ba55775eae2b17f9c5c;hb=1c4fdb35d274c6205676a78e58edc196c28e7c4f;hp=2998e9f2db8a4879186ed9cbb458051d027100d1;hpb=32dbb28fad617a31eb5da8022149411e865eb634;p=modules%2Fshaper.git diff --git a/src/Model/Model_ResultConstruction.cpp b/src/Model/Model_ResultConstruction.cpp index 2998e9f2d..41e1a9b16 100644 --- a/src/Model/Model_ResultConstruction.cpp +++ b/src/Model/Model_ResultConstruction.cpp @@ -15,7 +15,7 @@ void Model_ResultConstruction::initAttributes() { // append the color attribute. It is empty, the attribute will be filled by a request DataPtr aData = data(); - aData->addAttribute(COLOR_ID(), ModelAPI_AttributeIntArray::type()); + aData->addAttribute(COLOR_ID(), ModelAPI_AttributeIntArray::typeId()); } void Model_ResultConstruction::colorConfigInfo(std::string& theSection, std::string& theName, @@ -44,7 +44,9 @@ std::shared_ptr Model_ResultConstruction::shape() Model_ResultConstruction::Model_ResultConstruction() { + myIsDisabled = true; // by default it is not initialized and false to be after created myIsInHistory = true; + myIsInfinite = false; myFacesUpToDate = false; setIsConcealed(false); } @@ -59,14 +61,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->dirY(), 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()) + myFaces.push_back(aFace); + } } myFacesUpToDate = true; } @@ -77,3 +81,13 @@ 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; +}