mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
0. Basic tools for defining classes representing alerts (errors, warnings etc.) and collecting them during execution of algorithms are added in Message package. 1. Refactoring of the Error/Warning reporting system of the algorithms in Boolean Component. To dump the description of the Error/Warning status of the algorithm the DumpErrors/DumpWarnings method should be called. Also, the methods GerErrorMsg(int Error) and GetWarningMsg(int Warning) have been implemented to get the description for the given Error/Warning. All Error/Warning statuses are now listed in the enumeration ErrorStatusEnum/WarningStatusEnum of the algorithm. It is also possible to get the shapes for which the warning has been set by using the method GetWarningShapes(). 2. The new class BOPAlgo_Options has been created to unify the options of the BOPAlgo_* and BRepAlgoAPI* algorithms. 3. The new checks across the algorithms have been added to detect and report errors and warnings. 4. Test cases boolean bopcut_complex B9 E1 E5 E8 boolean bopfuse_complex B4 B5 C9 D1 D4 D5 D6 D7 have been rewritten to use Cells Builder algorithm instead of Boolean Operations algorithm, because latter always returns error "Unsupported Boolean operation" for these cases. 5. New chapter has been added in the user guide for Boolean Operations - Error / Warning reporting system. 6. Added comment to NCollection_List::Remove(Iterator&)
132 lines
4.7 KiB
C++
132 lines
4.7 KiB
C++
// Created by: Peter KURNEV
|
|
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
|
//
|
|
// This file is part of Open CASCADE Technology software library.
|
|
//
|
|
// This library is free software; you can redistribute it and/or modify it under
|
|
// the terms of the GNU Lesser General Public License version 2.1 as published
|
|
// by the Free Software Foundation, with special exception defined in the file
|
|
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
|
// distribution for complete text of the license and disclaimer of any warranty.
|
|
//
|
|
// Alternatively, this file may be used under the terms of Open CASCADE
|
|
// commercial license or contractual agreement.
|
|
|
|
#ifndef _BOPAlgo_BOP_HeaderFile
|
|
#define _BOPAlgo_BOP_HeaderFile
|
|
|
|
#include <Standard.hxx>
|
|
#include <Standard_DefineAlloc.hxx>
|
|
#include <Standard_Handle.hxx>
|
|
|
|
#include <BOPAlgo_Operation.hxx>
|
|
#include <Standard_Integer.hxx>
|
|
#include <TopoDS_Shape.hxx>
|
|
#include <BOPCol_ListOfShape.hxx>
|
|
#include <BOPCol_MapOfShape.hxx>
|
|
#include <BOPAlgo_Builder.hxx>
|
|
#include <BOPCol_BaseAllocator.hxx>
|
|
#include <TopAbs_ShapeEnum.hxx>
|
|
#include <Standard_Boolean.hxx>
|
|
#include <BOPCol_IndexedDataMapOfShapeListOfShape.hxx>
|
|
class TopoDS_Shape;
|
|
class BOPAlgo_PaveFiller;
|
|
|
|
//!
|
|
//! The class represents the Building part of the Boolean Operations
|
|
//! algorithm.<br>
|
|
//! The arguments of the algorithms are divided in two groups - *Objects*
|
|
//! and *Tools*.<br>
|
|
//! The algorithm builds the splits of the given arguments using the intersection
|
|
//! results and combines the result of Boolean Operation of given type:<br>
|
|
//! - *FUSE* - union of two groups of objects;<br>
|
|
//! - *COMMON* - intersection of two groups of objects;<br>
|
|
//! - *CUT* - subtraction of one group from the other.<br>
|
|
//!
|
|
//! The rules for the arguments and type of the operation are the following:<br>
|
|
//! - For Boolean operation *FUSE* all arguments should have equal dimensions;<br>
|
|
//! - For Boolean operation *CUT* the minimal dimension of *Tools* should not be
|
|
//! less than the maximal dimension of *Objects*;<br>
|
|
//! - For Boolean operation *COMMON* the arguments can have any dimension.<br>
|
|
//!
|
|
//! The class is a General Fuse based algorithm. Thus, all options
|
|
//! of the General Fuse algorithm such as Fuzzy mode, safe processing mode,
|
|
//! parallel processing mode, gluing mode and history support are also
|
|
//! available in this algorithm.<br>
|
|
//!
|
|
//! Additionally to the Warnings of the parent class the algorithm returns
|
|
//! the following warnings:
|
|
//! - *BOPAlgo_AlertEmptyShape* - in case some of the input shapes are empty shapes.
|
|
//!
|
|
//! Additionally to Errors of the parent class the algorithm returns
|
|
//! the following Error statuses:
|
|
//! - *BOPAlgo_AlertBOPIsNotSet* - in case the type of Boolean operation is not set;
|
|
//! - *BOPAlgo_AlertBOPNotAllowed* - in case the operation of given type is not allowed on
|
|
//! given inputs;
|
|
//! - *BOPAlgo_AlertSolidBuilderFailed* - in case the BuilderSolid algorithm failed to
|
|
//! produce the Fused solid.
|
|
//!
|
|
class BOPAlgo_BOP : public BOPAlgo_Builder
|
|
{
|
|
public:
|
|
|
|
DEFINE_STANDARD_ALLOC
|
|
|
|
|
|
//! Empty constructor
|
|
Standard_EXPORT BOPAlgo_BOP();
|
|
Standard_EXPORT virtual ~BOPAlgo_BOP();
|
|
|
|
Standard_EXPORT BOPAlgo_BOP(const BOPCol_BaseAllocator& theAllocator);
|
|
|
|
//! Clears internal fields and arguments
|
|
Standard_EXPORT virtual void Clear() Standard_OVERRIDE;
|
|
|
|
//! Adds Tool argument of the operation
|
|
Standard_EXPORT virtual void AddTool (const TopoDS_Shape& theShape);
|
|
|
|
Standard_EXPORT virtual void SetTools (const BOPCol_ListOfShape& theShapes);
|
|
|
|
Standard_EXPORT void SetOperation (const BOPAlgo_Operation theOperation);
|
|
|
|
Standard_EXPORT BOPAlgo_Operation Operation() const;
|
|
|
|
Standard_EXPORT virtual void Perform() Standard_OVERRIDE;
|
|
|
|
protected:
|
|
|
|
Standard_EXPORT virtual void CheckData() Standard_OVERRIDE;
|
|
|
|
//! Performs calculations using prepared Filler
|
|
//! object <thePF>
|
|
Standard_EXPORT virtual void PerformInternal1 (const BOPAlgo_PaveFiller& thePF) Standard_OVERRIDE;
|
|
|
|
Standard_EXPORT virtual void BuildResult (const TopAbs_ShapeEnum theType) Standard_OVERRIDE;
|
|
|
|
Standard_EXPORT void BuildShape();
|
|
|
|
Standard_EXPORT void BuildRC();
|
|
|
|
Standard_EXPORT void BuildSolid();
|
|
|
|
Standard_EXPORT Standard_Boolean IsBoundSplits (const TopoDS_Shape& theS, BOPCol_IndexedDataMapOfShapeListOfShape& theMEF);
|
|
|
|
//! Treatment of the cases with empty shapes.<br>
|
|
//! It returns TRUE if there is nothing to do, i.e.
|
|
//! all shapes in one of the groups are empty shapes.
|
|
Standard_EXPORT Standard_Boolean TreatEmptyShape();
|
|
|
|
|
|
BOPAlgo_Operation myOperation;
|
|
Standard_Integer myDims[2];
|
|
TopoDS_Shape myRC;
|
|
BOPCol_ListOfShape myTools;
|
|
BOPCol_MapOfShape myMapTools;
|
|
|
|
|
|
private:
|
|
|
|
};
|
|
|
|
#endif // _BOPAlgo_BOP_HeaderFile
|