aShape = aSelection->context()->shape();
anOriginalShapes.push_back(aShape);
}
- std::shared_ptr<GeomAlgoAPI_MakeVolume> anAlgo(new GeomAlgoAPI_MakeVolume(anOriginalShapes));
+ std::shared_ptr<GeomAlgoAPI_MakeVolume> anAlgo(
+ new GeomAlgoAPI_MakeVolume(anOriginalShapes, false));
GeomShapePtr aVolumeRes = anAlgo->shape();
// check and process result of volume maker
aShape = aSelection->context()->shape();
anOriginalShapes.push_back(aShape);
}
- std::shared_ptr<GeomAlgoAPI_MakeVolume> anAlgo(new GeomAlgoAPI_MakeVolume(anOriginalShapes));
+ std::shared_ptr<GeomAlgoAPI_MakeVolume> anAlgo(
+ new GeomAlgoAPI_MakeVolume(anOriginalShapes, false));
// check and process result of volume maker
GeomShapePtr aResShape = getSingleSubshape(anAlgo->shape());
storeResult(anOriginalShapes, aResShape, anAlgo);
anOriginalShapes.push_back(aShape);
}
- std::shared_ptr<GeomAlgoAPI_MakeVolume> anAlgorithm(new GeomAlgoAPI_MakeVolume(anOriginalShapes));
+ std::shared_ptr<GeomAlgoAPI_MakeVolume> anAlgorithm(
+ new GeomAlgoAPI_MakeVolume(anOriginalShapes, false));
if (!anAlgorithm->isDone()) {
theError = "MakeVolume algorithm failed.";
//=================================================================================================
std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_MakeVolume::make(const ListOfShape& theFaces)
{
- GeomAlgoAPI_MakeVolume aMkVolAlgo(theFaces);
+ GeomAlgoAPI_MakeVolume aMkVolAlgo(theFaces, false);
GeomShapePtr aResult;
if(aMkVolAlgo.isDone() && !aMkVolAlgo.shape()->isNull() && aMkVolAlgo.isValid())
aResult = aMkVolAlgo.shape();
}
//=================================================================================================
-GeomAlgoAPI_MakeVolume::GeomAlgoAPI_MakeVolume(const ListOfShape& theFaces)
+GeomAlgoAPI_MakeVolume::GeomAlgoAPI_MakeVolume(
+ const ListOfShape& theFaces, const bool theAvoidInternal)
{
+ myAvoidInternal = theAvoidInternal;
build(theFaces);
}
// parameters of the volume maker
aVolumeMaker->SetArguments(anArgs);
aVolumeMaker->SetIntersect(true); // split edges and faces
- aVolumeMaker->SetAvoidInternalShapes(true);
+ aVolumeMaker->SetAvoidInternalShapes(myAvoidInternal);
aVolumeMaker->SetGlue(BOPAlgo_GlueOff);
// building and getting result
/// \brief Perform building solid (compsolid) from a list of faces.
class GeomAlgoAPI_MakeVolume : public GeomAlgoAPI_MakeShape
{
+ bool myAvoidInternal; // to remove internal faces from the result
public:
/// \brief Perform making volume.
/// \param[in] theObjects list of faces.
GEOMALGOAPI_EXPORT static std::shared_ptr<GeomAPI_Shape> make(const ListOfShape& theFaces);
/// Constructor.
- GEOMALGOAPI_EXPORT GeomAlgoAPI_MakeVolume(const ListOfShape& theFaces);
+ /// \param theFaces faces that will construct a solid
+ /// \param theAvoidInternal to remove internal faces from the result
+ GEOMALGOAPI_EXPORT GeomAlgoAPI_MakeVolume(const ListOfShape& theFaces,
+ const bool theAvoidInternal);
private:
/// Builds resulting shape.
DEFINE_STANDARD_RTTIEXT(Model_Application, TDocStd_Application)
//! Retuns the application: one per process
- MODEL_EXPORT static Handle_Model_Application getApplication();
+ MODEL_EXPORT static Handle(Model_Application) getApplication();
//! Returns the document by the identifier
//! \returns false of document is not yet created/not loaded
MODEL_EXPORT std::shared_ptr<Model_Document> document(const int theDocID);
ModuleBase_ViewerPrs::ModuleBase_ViewerPrs(ObjectPtr theResult,
const GeomShapePtr& theShape,
- Handle_SelectMgr_EntityOwner theOwner)
+ Handle(SelectMgr_EntityOwner) theOwner)
: myResult(theResult),
myShape(theShape),
myOwner(theOwner)
default:
return isModified;
}
- NCollection_DataMap<TopoDS_Shape, Handle_AIS_InteractiveObject>& aShapeMap =
+ NCollection_DataMap<TopoDS_Shape, Handle(AIS_InteractiveObject)>& aShapeMap =
anOperationPrs->shapesMap();
PartSet_OperationPrs::fillShapeList(aFeatureShapes, myWorkshop, aShapeMap);
if (anEdge)
aLengths[i] = anEdge->length();
}
- return std::min(aLengths[0], aLengths[1]) / 6.0;
+ return (aLengths[0] < aLengths[1] ? aLengths[0] : aLengths[1]) / 6.0;
}
std::set<FeaturePtr> findFeaturesToRemove(const FeaturePtr theFeature,
/// \param theDimAspect an aspect to be changed
/// \param theDimValue an arrow value
/// \param theTextSize an arrow value
-extern void updateArrows(Handle_Prs3d_DimensionAspect theDimAspect,
+extern void updateArrows(Handle(Prs3d_DimensionAspect) theDimAspect,
double theDimValue, double theTextSize, SketcherPrs_Tools::LocationType theLocationType);
#define PI 3.1415926535897932
/// \param theDimAspect an aspect to be changed
/// \param theDimValue an arrow value
/// \param theTextSize an arrow value
-extern void updateArrows(Handle_Prs3d_DimensionAspect theDimAspect,
+extern void updateArrows(Handle(Prs3d_DimensionAspect) theDimAspect,
double theDimValue, double theTextSize, SketcherPrs_Tools::LocationType theLocationType);
/// It depends on the modes, in which the object is activated in the context
/// \param theObject an object
/// \param theOwners a map of entity owners
- void entityOwners(const Handle_AIS_InteractiveObject& theObject,
+ void entityOwners(const Handle(AIS_InteractiveObject)& theObject,
SelectMgr_IndexedMapOfOwner& theOwners) const;
/// Return the IO from the viewer presentation.