-// Copyright (C) 2014-2017 CEA/DEN, EDF R&D
+// Copyright (C) 2014-2023 CEA, EDF
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef FeaturesPlugin_Partition_H_
#define FeaturesPlugin_Partition_H_
-#include "FeaturesPlugin.h"
+#include "FeaturesPlugin_VersionedBoolean.h"
#include <ModelAPI_Feature.h>
#include <GeomAlgoAPI_Partition.h>
/// \ingroup Plugins
/// \brief Feature for applying of Partition operations on Shapes. Partition makes conjunctional
/// faces of solids as shared. The result of partitions is a compsolid.
-class FeaturesPlugin_Partition : public ModelAPI_Feature
+class FeaturesPlugin_Partition : public FeaturesPlugin_VersionedBoolean
{
public:
/// Feature kind.
return MY_BASE_OBJECTS_ID;
}
+ /// Attribute name of use fuzzy parameter.
+ inline static const std::string& USE_FUZZY_ID()
+ {
+ static const std::string MY_USE_FUZZY_ID("use_fuzzy");
+ return MY_USE_FUZZY_ID;
+ }
+
+ /// Attribute name of fuzzy parameter.
+ inline static const std::string& FUZZY_PARAM_ID()
+ {
+ static const std::string MY_FUZZY_PARAM_ID("fuzzy_param");
+ return MY_FUZZY_PARAM_ID;
+ }
+
/// \return the kind of a feature.
FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
{
return MY_KIND;
}
- /// Creates a new part document if needed
+ /// Performs the algorithm and stores results it in the data structure.
FEATURESPLUGIN_EXPORT virtual void execute();
/// Request for initialization of data model of the feature: adding all attributes
const GeomShapePtr theResultShape,
const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape,
const int theIndex = 0);
+
+ /// Cut all of unused subs of compsolids by the full compsolid of the first selected object,
+ /// and vice versa, cut all objects of Partition by not used subs of the first selected object.
+ /// Store results of operation to the separated lists of shapes.
+ bool cutSubs(GeomAPI_ShapeHierarchy& theHierarchy,
+ ListOfShape& theUsed,
+ ListOfShape& theNotUsed,
+ const double theFuzzy,
+ std::shared_ptr<GeomAlgoAPI_MakeShapeList>& theMakeShapeList,
+ std::string& theError);
};
#endif