if(GeomAlgoAPI_ShapeTools::volume(aBoolAlgo.shape()) > 1.e-7) {
std::shared_ptr<ModelAPI_ResultBody> aResultBody = document()->createBody(data(), aResultIndex);
- loadNamingDS(aResultBody, anObject, aBoolAlgo.shape(), aTools, *aBoolAlgo.makeShape(), *aBoolAlgo.mapOfShapes());
+ loadNamingDS(aResultBody, anObject, aTools, aBoolAlgo.shape(), *aBoolAlgo.makeShape(), *aBoolAlgo.mapOfShapes());
setResult(aResultBody, aResultIndex);
aResultIndex++;
}
if(GeomAlgoAPI_ShapeTools::volume(aFillerAlgo.shape()) > 1.e-7) {
std::shared_ptr<ModelAPI_ResultBody> aResultBody = document()->createBody(data(), aResultIndex);
- loadNamingDS(aResultBody, aCompSolid, aFillerAlgo.shape(), aTools, aMakeShapeList, aMapOfShapes);
+ loadNamingDS(aResultBody, aCompSolid, aTools, aFillerAlgo.shape(), aMakeShapeList, aMapOfShapes);
setResult(aResultBody, aResultIndex);
aResultIndex++;
}
}
std::shared_ptr<ModelAPI_ResultBody> aResultBody = document()->createBody(data(), aResultIndex);
- loadNamingDS(aResultBody, anOriginalSolids.front(), aShape, anOriginalSolids, aMakeShapeList, aMapOfShapes);
+ loadNamingDS(aResultBody, anOriginalSolids.front(), anOriginalSolids, aShape, aMakeShapeList, aMapOfShapes);
setResult(aResultBody, aResultIndex);
aResultIndex++;
break;
//=================================================================================================
void FeaturesPlugin_Boolean::loadNamingDS(std::shared_ptr<ModelAPI_ResultBody> theResultBody,
const std::shared_ptr<GeomAPI_Shape> theBaseShape,
- const std::shared_ptr<GeomAPI_Shape> theResultShape,
const ListOfShape& theTools,
+ const std::shared_ptr<GeomAPI_Shape> theResultShape,
GeomAlgoAPI_MakeShape& theMakeShape,
GeomAPI_DataMapOfShapeShape& theMapOfShapes)
{
/// Load Naming data structure of the feature to the document
void loadNamingDS(std::shared_ptr<ModelAPI_ResultBody> theResultBody,
const std::shared_ptr<GeomAPI_Shape> theBaseShape,
- const std::shared_ptr<GeomAPI_Shape> theResultShape,
const ListOfShape& theTools,
+ const std::shared_ptr<GeomAPI_Shape> theResultShape,
GeomAlgoAPI_MakeShape& theMakeShape,
GeomAPI_DataMapOfShapeShape& theMapOfShapes);
};
#include <ModelAPI_Validator.h>
#include <GeomAlgoAPI_Partition.h>
+#include <GeomAlgoAPI_MakeShapeCustom.h>
#include <GeomAlgoAPI_MakeShapeList.h>
#include <GeomAlgoAPI_ShapeTools.h>
//=================================================================================================
void FeaturesPlugin_Partition::execute()
{
- ListOfShape anObjects, aTools;
+ ListOfShape anObjects, aTools, aToolsForNaming;
// Getting objects.
AttributeSelectionListPtr anObjectsSelList = selectionList(FeaturesPlugin_Partition::OBJECT_LIST_ID());
anObjects.push_back(anObject);
}
+ GeomAlgoAPI_MakeShapeList aMakeShapeList;
+
// Getting tools.
AttributeSelectionListPtr aToolsSelList = selectionList(FeaturesPlugin_Partition::TOOL_LIST_ID());
for (int aToolsIndex = 0; aToolsIndex < aToolsSelList->size(); aToolsIndex++) {
std::shared_ptr<ModelAPI_AttributeSelection> aToolAttr = aToolsSelList->value(aToolsIndex);
std::shared_ptr<GeomAPI_Shape> aTool = aToolAttr->value();
- if (!aTool.get()) {
+ if(!aTool.get()) {
// it could be a construction plane
ResultPtr aContext = aToolAttr->context();
- if (aContext.get()) {
+ if(aContext.get()) {
aTool = GeomAlgoAPI_ShapeTools::faceToInfinitePlane(aContext->shape());
+ std::shared_ptr<GeomAlgoAPI_MakeShapeCustom> aMkShCustom(new GeomAlgoAPI_MakeShapeCustom);
+ aMkShCustom->addModified(aContext->shape(), aTool);
+ aMakeShapeList.append(aMkShCustom);
+ aTools.push_back(aTool);
+ aToolsForNaming.push_back(aContext->shape());
}
+ } else {
+ aTools.push_back(aTool);
+ aToolsForNaming.push_back(aTool);
}
- if (!aTool.get()) {
- return;
- }
- aTools.push_back(aTool);
}
int aResultIndex = 0;
if (GeomAlgoAPI_ShapeTools::volume(aPartitionAlgo.shape()) > 1.e-7) {
std::shared_ptr<ModelAPI_ResultBody> aResultBody = document()->createBody(data(), aResultIndex);
- aResultBody->store(aPartitionAlgo.shape());
- loadNamingDS(aResultBody, anObject, aTools, aPartitionAlgo);
+ aMakeShapeList.append(aPartitionAlgo.makeShape());
+ GeomAPI_DataMapOfShapeShape aMapOfShapes = *aPartitionAlgo.mapOfShapes().get();
+ loadNamingDS(aResultBody, anObject, aToolsForNaming, aPartitionAlgo.shape(), aMakeShapeList, aMapOfShapes);
setResult(aResultBody, aResultIndex);
aResultIndex++;
}
void FeaturesPlugin_Partition::loadNamingDS(std::shared_ptr<ModelAPI_ResultBody> theResultBody,
const std::shared_ptr<GeomAPI_Shape> theBaseShape,
const ListOfShape& theTools,
- const GeomAlgoAPI_Partition& thePartitionAlgo)
+ const std::shared_ptr<GeomAPI_Shape> theResultShape,
+ GeomAlgoAPI_MakeShape& theMakeShape,
+ GeomAPI_DataMapOfShapeShape& theMapOfShapes)
{
//load result
- if(theBaseShape->isEqual(thePartitionAlgo.shape())) {
- theResultBody->store(thePartitionAlgo.shape());
+ if(theBaseShape->isEqual(theResultShape)) {
+ theResultBody->store(theResultShape);
} else {
const int aModifyTag = 1;
const int aDeletedTag = 2;
const int aSubsolidsTag = 3; /// sub solids will be placed at labels 3, 4, etc. if result is compound of solids
- theResultBody->storeModified(theBaseShape, thePartitionAlgo.shape(), aSubsolidsTag);
-
- std::shared_ptr<GeomAlgoAPI_MakeShape> aMkShape = thePartitionAlgo.makeShape();
- std::shared_ptr<GeomAPI_DataMapOfShapeShape> aMapOfShapes = thePartitionAlgo.mapOfShapes();
+ theResultBody->storeModified(theBaseShape, theResultShape, aSubsolidsTag);
std::string aModName = "Modified";
- theResultBody->loadAndOrientModifiedShapes(aMkShape.get(), theBaseShape, GeomAPI_Shape::FACE,
- aModifyTag, aModName, *aMapOfShapes.get());
- theResultBody->loadDeletedShapes(aMkShape.get(), theBaseShape, GeomAPI_Shape::FACE, aDeletedTag);
+ theResultBody->loadAndOrientModifiedShapes(&theMakeShape, theBaseShape, GeomAPI_Shape::FACE,
+ aModifyTag, aModName, theMapOfShapes);
+ theResultBody->loadDeletedShapes(&theMakeShape, theBaseShape, GeomAPI_Shape::FACE, aDeletedTag);
for(ListOfShape::const_iterator anIter = theTools.begin(); anIter != theTools.end(); anIter++) {
- theResultBody->loadAndOrientModifiedShapes(aMkShape.get(), *anIter, GeomAPI_Shape::FACE,
- aModifyTag, aModName, *aMapOfShapes.get());
- theResultBody->loadDeletedShapes(aMkShape.get(), *anIter, GeomAPI_Shape::FACE, aDeletedTag);
+ theResultBody->loadAndOrientModifiedShapes(&theMakeShape, *anIter, GeomAPI_Shape::FACE,
+ aModifyTag, aModName, theMapOfShapes);
+ theResultBody->loadDeletedShapes(&theMakeShape, *anIter, GeomAPI_Shape::FACE, aDeletedTag);
}
}
}
void loadNamingDS(std::shared_ptr<ModelAPI_ResultBody> theResultBody,
const std::shared_ptr<GeomAPI_Shape> theBaseShape,
const ListOfShape& theTools,
- const GeomAlgoAPI_Partition& thePartitionAlgo);
+ const std::shared_ptr<GeomAPI_Shape> theResultShape,
+ GeomAlgoAPI_MakeShape& theMakeShape,
+ GeomAPI_DataMapOfShapeShape& theMapOfShapes);
};
GeomAPI_PlanarEdges.h
GeomAPI_AISObject.h
GeomAPI_IPresentable.h
- GeomAPI_Curve.h
+ GeomAPI_Curve.h
+ GeomAPI_DataMapOfShapeMapOfShapes.h
GeomAPI_DataMapOfShapeShape.h
GeomAPI_ICustomPrs.h
GeomAPI_Vertex.h
GeomAPI_PlanarEdges.cpp
GeomAPI_AISObject.cpp
GeomAPI_Curve.cpp
+ GeomAPI_DataMapOfShapeMapOfShapes.cpp
GeomAPI_DataMapOfShapeShape.cpp
GeomAPI_Vertex.cpp
GeomAPI_ICustomPrs.cpp
#include "GeomAPI_Circ.h"
#include "GeomAPI_Circ2d.h"
#include "GeomAPI_Curve.h"
+ #include "GeomAPI_DataMapOfShapeMapOfShapes.h"
#include "GeomAPI_DataMapOfShapeShape.h"
#include "GeomAPI_Dir.h"
#include "GeomAPI_Dir2d.h"
%shared_ptr(GeomAPI_Circ)
%shared_ptr(GeomAPI_Circ2d)
%shared_ptr(GeomAPI_Curve)
+%shared_ptr(GeomAPI_DataMapOfShapeMapOfShapes)
%shared_ptr(GeomAPI_DataMapOfShapeShape)
%shared_ptr(GeomAPI_Dir)
%shared_ptr(GeomAPI_Dir2d)
%include "GeomAPI_Circ.h"
%include "GeomAPI_Circ2d.h"
%include "GeomAPI_Curve.h"
+%include "GeomAPI_DataMapOfShapeMapOfShapes.h"
%include "GeomAPI_DataMapOfShapeShape.h"
%include "GeomAPI_Dir.h"
%include "GeomAPI_Dir2d.h"
--- /dev/null
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
+// File: GeomAPI_DataMapOfShapeMapOfShapes.cpp
+// Created: 4 September 2015
+// Author: Dmitry Bobylev
+
+#include <GeomAPI_DataMapOfShapeMapOfShapes.h>
+
+#include <NCollection_DataMap.hxx>
+#include <NCollection_Map.hxx>
+#include <TopoDS_Shape.hxx>
+
+#define MY_MAP implPtr<NCollection_DataMap<TopoDS_Shape, NCollection_Map<TopoDS_Shape> > >()
+
+//=================================================================================================
+GeomAPI_DataMapOfShapeMapOfShapes::GeomAPI_DataMapOfShapeMapOfShapes()
+: GeomAPI_Interface(new NCollection_DataMap<TopoDS_Shape, NCollection_Map<TopoDS_Shape> >)
+{}
+
+//=================================================================================================
+bool GeomAPI_DataMapOfShapeMapOfShapes::bind(const std::shared_ptr<GeomAPI_Shape> theKey,
+ const ListOfShape& theItems)
+{
+ const TopoDS_Shape& aKey = theKey->impl<TopoDS_Shape>();
+ for(ListOfShape::const_iterator anIt = theItems.cbegin(); anIt != theItems.cend(); anIt++) {
+ const TopoDS_Shape& anItem = (*anIt)->impl<TopoDS_Shape>();
+ if(MY_MAP->IsBound(aKey)) {
+ MY_MAP->ChangeFind(aKey).Add(anItem);
+ } else {
+ NCollection_Map<TopoDS_Shape> anItems;
+ anItems.Add(anItem);
+ MY_MAP->Bind(aKey, anItems);
+ }
+ }
+
+ return true;
+}
+
+//=================================================================================================
+bool GeomAPI_DataMapOfShapeMapOfShapes::add(const std::shared_ptr<GeomAPI_Shape> theKey,
+ const std::shared_ptr<GeomAPI_Shape> theItem)
+{
+ const TopoDS_Shape& aKey = theKey->impl<TopoDS_Shape>();
+ const TopoDS_Shape& anItem = theItem->impl<TopoDS_Shape>();
+ if(MY_MAP->IsBound(aKey)) {
+ return MY_MAP->ChangeFind(aKey).Add(anItem) == Standard_True;
+ } else {
+ NCollection_Map<TopoDS_Shape> anItems;
+ anItems.Add(anItem);
+ return MY_MAP->Bind(aKey, anItems) == Standard_True;
+ }
+}
+
+//=================================================================================================
+bool GeomAPI_DataMapOfShapeMapOfShapes::isBound(const std::shared_ptr<GeomAPI_Shape> theKey) const
+{
+ const TopoDS_Shape& aKey = theKey->impl<TopoDS_Shape>();
+ return MY_MAP->IsBound(aKey) == Standard_True;
+}
+
+//=================================================================================================
+bool GeomAPI_DataMapOfShapeMapOfShapes::find(const std::shared_ptr<GeomAPI_Shape> theKey,
+ ListOfShape& theItems) const
+{
+ const TopoDS_Shape& aKey = theKey->impl<TopoDS_Shape>();
+
+ if(MY_MAP->IsBound(aKey) == Standard_False) {
+ return false;
+ }
+
+ const NCollection_Map<TopoDS_Shape>& aMap = MY_MAP->Find(aKey);
+ for(NCollection_Map<TopoDS_Shape>::Iterator anIt(aMap); anIt.More(); anIt.Next()) {
+ std::shared_ptr<GeomAPI_Shape> aShape(new GeomAPI_Shape);
+ aShape->setImpl(new TopoDS_Shape(anIt.Value()));
+ theItems.push_back(aShape);
+ }
+}
+
+//=================================================================================================
+bool GeomAPI_DataMapOfShapeMapOfShapes::unBind(const std::shared_ptr<GeomAPI_Shape> theKey)
+{
+ const TopoDS_Shape& aKey = theKey->impl<TopoDS_Shape>();
+ return MY_MAP->UnBind(aKey) == Standard_True;
+}
+
+//=================================================================================================
+int GeomAPI_DataMapOfShapeMapOfShapes::size() const
+{
+ return MY_MAP->Size();
+}
--- /dev/null
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
+// File: GeomAPI_DataMapOfShapeMapOfShapes.h
+// Created: 4 September 2015
+// Author: Dmitry Bobylev
+
+#ifndef GeomAPI_DataMapOfShapeMapOfShapes_H_
+#define GeomAPI_DataMapOfShapeMapOfShapes_H_
+
+#include <GeomAPI_Interface.h>
+
+#include <GeomAPI_Shape.h>
+
+/**\class GeomAPI_DataMapOfShapeMapOfShapes
+ * \ingroup DataModel
+ * \brief DataMap of Shape - Map of Shapes defined by TopoDS_Shapes
+ */
+class GeomAPI_DataMapOfShapeMapOfShapes : public GeomAPI_Interface
+{
+public:
+ /// Constructor.Creates empty map.
+ GEOMAPI_EXPORT GeomAPI_DataMapOfShapeMapOfShapes();
+
+ /** \brief Binds list of shapes to the key shape.
+ \param[in] theKey key shape.
+ \param[in] theItems list of shapes. If shapes have duplications in list only one will be stored.
+ \returns true if items bound successfully.
+ */
+ GEOMAPI_EXPORT bool bind(const std::shared_ptr<GeomAPI_Shape> theKey,
+ const ListOfShape& theItems);
+
+ /** \brief Adds item to the map bounded to the key.
+ \param[in] theKey key shape.
+ \param[in] theItem item shape.
+ \returns true if item bounded successfully. False if it is already bound.
+ */
+ GEOMAPI_EXPORT bool add(const std::shared_ptr<GeomAPI_Shape> theKey,
+ const std::shared_ptr<GeomAPI_Shape> theItem);
+
+ /// \return true if theKey is stored in the map.
+ GEOMAPI_EXPORT bool isBound(const std::shared_ptr<GeomAPI_Shape> theKey) const;
+
+ /// \return list of shapes bounded to theKey.
+ GEOMAPI_EXPORT bool find(const std::shared_ptr<GeomAPI_Shape> theKey,
+ ListOfShape& theItems) const;
+
+ /// Undinds shapes from theKey.
+ GEOMAPI_EXPORT bool unBind(const std::shared_ptr<GeomAPI_Shape> theKey);
+
+ /// \return size of map.
+ GEOMAPI_EXPORT int size() const;
+};
+
+#endif
* \ingroup DataModel
* \brief This class is used to explore subshapes on shape.
*/
-
class GeomAPI_ShapeExplorer : public GeomAPI_Interface
{
public:
/// Default constructor. Creates an empty explorer, becomes usefull after Init.
- GEOMAPI_EXPORT
+ GEOMAPI_EXPORT
GeomAPI_ShapeExplorer();
/** \brief Constructs an explorer to search on theShape, for shapes of type toFind,
\param[in] toFind shape type to find.
\param[in] toAvoid shape type to avoid.
*/
- GEOMAPI_EXPORT
+ GEOMAPI_EXPORT
GeomAPI_ShapeExplorer(const std::shared_ptr<GeomAPI_Shape>& theShape,
const GeomAPI_Shape::ShapeType toFind,
const GeomAPI_Shape::ShapeType toAvoid = GeomAPI_Shape::SHAPE);
\param[in] toFind shape type to find.
\param[in] toAvoid shape type to avoid.
*/
- GEOMAPI_EXPORT
+ GEOMAPI_EXPORT
void init(const std::shared_ptr<GeomAPI_Shape>& theShape,
const GeomAPI_Shape::ShapeType toFind,
const GeomAPI_Shape::ShapeType toAvoid = GeomAPI_Shape::SHAPE);
/// \return true if there are more shapes in the exploration.
- GEOMAPI_EXPORT
+ GEOMAPI_EXPORT
bool more() const;
/// Moves to the next Shape in the exploration or do nothing if there are no more shapes to explore.
- GEOMAPI_EXPORT
+ GEOMAPI_EXPORT
void next();
- /// Returns the current shape in the exploration or empty pointer if this explorer has no more shapes to explore.
- GEOMAPI_EXPORT
+ /// \return the current shape in the exploration or empty pointer if this explorer has no more shapes to explore.
+ GEOMAPI_EXPORT
std::shared_ptr<GeomAPI_Shape> current();
/// Reinitialize the exploration with the original arguments.
- GEOMAPI_EXPORT
+ GEOMAPI_EXPORT
void reinit();
- /// Returns the current depth of the exploration. 0 is the shape to explore itself.
- GEOMAPI_EXPORT
+ /// \return the current depth of the exploration. 0 is the shape to explore itself.
+ GEOMAPI_EXPORT
int depth() const;
/// Clears the content of the explorer. It will return False on more().
- GEOMAPI_EXPORT
+ GEOMAPI_EXPORT
void clear();
};
GeomAlgoAPI_Rotation.h
GeomAlgoAPI_Movement.h
GeomAlgoAPI_MakeShape.h
+ GeomAlgoAPI_MakeShapeCustom.h
GeomAlgoAPI_MakeShapeList.h
GeomAlgoAPI_DFLoader.h
GeomAlgoAPI_Placement.h
GeomAlgoAPI_Rotation.cpp
GeomAlgoAPI_Movement.cpp
GeomAlgoAPI_MakeShape.cpp
+ GeomAlgoAPI_MakeShapeCustom.cpp
GeomAlgoAPI_MakeShapeList.cpp
GeomAlgoAPI_DFLoader.cpp
GeomAlgoAPI_Placement.cpp
#include "GeomAlgoAPI_Extrusion.h"
#include "GeomAlgoAPI_FaceBuilder.h"
#include "GeomAlgoAPI_MakeShape.h"
+ #include "GeomAlgoAPI_MakeShapeCustom.h"
#include "GeomAlgoAPI_MakeShapeList.h"
#include "GeomAlgoAPI_Movement.h"
#include "GeomAlgoAPI_Placement.h"
%include "GeomAlgoAPI_Extrusion.h"
%include "GeomAlgoAPI_FaceBuilder.h"
%include "GeomAlgoAPI_MakeShape.h"
+%include "GeomAlgoAPI_MakeShapeCustom.h"
%include "GeomAlgoAPI_MakeShapeList.h"
%include "GeomAlgoAPI_Movement.h"
%include "GeomAlgoAPI_Placement.h"
const std::shared_ptr<GeomAPI_Shape> theBaseShape);
/// Returns a shape built by the shape construction algorithm
- GEOMALGOAPI_EXPORT const std::shared_ptr<GeomAPI_Shape> shape() const;
+ GEOMALGOAPI_EXPORT virtual const std::shared_ptr<GeomAPI_Shape> shape() const;
/// Returns the list of shapes generated from the shape \a theShape
GEOMALGOAPI_EXPORT virtual void generated(
GEOMALGOAPI_EXPORT virtual void modified(
const std::shared_ptr<GeomAPI_Shape> theShape, ListOfShape& theHistory);
- /// Returns whether the shape is an edge
+ /// Returns whether the shape is deleted
GEOMALGOAPI_EXPORT virtual bool isDeleted(const std::shared_ptr<GeomAPI_Shape> theShape);
protected:
--- /dev/null
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
+// File: GeomAlgoAPI_MakeShapeCustom.cpp
+// Created: 4 September 2015
+// Author: Dmitry Bobylev
+
+#include <GeomAlgoAPI_MakeShapeCustom.h>
+
+//=================================================================================================
+GeomAlgoAPI_MakeShapeCustom::GeomAlgoAPI_MakeShapeCustom()
+: GeomAlgoAPI_MakeShape()
+{}
+
+//=================================================================================================
+void GeomAlgoAPI_MakeShapeCustom::setResult(const std::shared_ptr<GeomAPI_Shape> theShape)
+{
+ myShape = theShape;
+}
+
+//=================================================================================================
+bool GeomAlgoAPI_MakeShapeCustom::addModified(const std::shared_ptr<GeomAPI_Shape> theBase,
+ const std::shared_ptr<GeomAPI_Shape> theResult)
+{
+ return myModified.add(theBase, theResult);
+}
+
+//=================================================================================================
+bool GeomAlgoAPI_MakeShapeCustom::addGenerated(const std::shared_ptr<GeomAPI_Shape> theBase,
+ const std::shared_ptr<GeomAPI_Shape> theResult)
+{
+ return myGenerated.add(theBase, theResult);
+}
+
+//=================================================================================================
+bool GeomAlgoAPI_MakeShapeCustom::addDeleted(const std::shared_ptr<GeomAPI_Shape> theShape)
+{
+ return myDeleted.bind(theShape, theShape);
+}
+
+//=================================================================================================
+const std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_MakeShapeCustom::shape() const
+{
+ return myShape;
+}
+
+//=================================================================================================
+void GeomAlgoAPI_MakeShapeCustom::generated(const std::shared_ptr<GeomAPI_Shape> theShape,
+ ListOfShape& theHistory)
+{
+ ListOfShape aGenerated;
+ myGenerated.find(theShape, aGenerated);
+ theHistory.insert(theHistory.end(), aGenerated.begin(), aGenerated.end());
+}
+
+//=================================================================================================
+void GeomAlgoAPI_MakeShapeCustom::modified(const std::shared_ptr<GeomAPI_Shape> theShape,
+ ListOfShape& theHistory)
+{
+ ListOfShape aModified;
+ myModified.find(theShape, aModified);
+ theHistory.insert(theHistory.end(), aModified.begin(), aModified.end());
+}
+
+//=================================================================================================
+bool GeomAlgoAPI_MakeShapeCustom::isDeleted(const std::shared_ptr<GeomAPI_Shape> theShape)
+{
+ return myDeleted.isBound(theShape);
+}
\ No newline at end of file
--- /dev/null
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
+// File: GeomAlgoAPI_MakeShapeCustom.h
+// Created: 4 September 2015
+// Author: Dmitry Bobylev
+
+#ifndef GeomAlgoAPI_MakeShapeCustom_H_
+#define GeomAlgoAPI_MakeShapeCustom_H_
+
+#include <GeomAlgoAPI_MakeShape.h>
+
+#include <GeomAPI_DataMapOfShapeMapOfShapes.h>
+#include <GeomAPI_DataMapOfShapeShape.h>
+
+/** \class GeomAlgoAPI_MakeShapeCustom
+ * \ingroup DataAlgo
+ * \brief Interface to the root class of all topological shapes constructions
+ */
+class GeomAlgoAPI_MakeShapeCustom : public GeomAlgoAPI_MakeShape
+{
+public:
+ /// Default constructor
+ GEOMALGOAPI_EXPORT GeomAlgoAPI_MakeShapeCustom();
+
+ /// Sets result shape.
+ GEOMALGOAPI_EXPORT void setResult(const std::shared_ptr<GeomAPI_Shape> theShape);
+
+ /// Adds modified shape.
+ GEOMALGOAPI_EXPORT bool addModified(const std::shared_ptr<GeomAPI_Shape> theBase,
+ const std::shared_ptr<GeomAPI_Shape> theResult);
+
+ /// Adds generated shape.
+ GEOMALGOAPI_EXPORT bool addGenerated(const std::shared_ptr<GeomAPI_Shape> theBase,
+ const std::shared_ptr<GeomAPI_Shape> theResult);
+
+ /// Adds deleted shape.
+ GEOMALGOAPI_EXPORT bool addDeleted(const std::shared_ptr<GeomAPI_Shape> theShape);
+
+ /// \return a shape built by the shape construction algorithms
+ GEOMALGOAPI_EXPORT virtual const std::shared_ptr<GeomAPI_Shape> shape() const;
+
+ /// \return the list of shapes generated from the shape theShape
+ GEOMALGOAPI_EXPORT virtual void generated(const std::shared_ptr<GeomAPI_Shape> theShape,
+ ListOfShape& theHistory);
+
+ /// \return the list of shapes modified from the shape theShape
+ GEOMALGOAPI_EXPORT virtual void modified(const std::shared_ptr<GeomAPI_Shape> theShape,
+ ListOfShape& theHistory);
+
+ /// \return whether the shape is deleted
+ GEOMALGOAPI_EXPORT virtual bool isDeleted(const std::shared_ptr<GeomAPI_Shape> theShape);
+
+private:
+ std::shared_ptr<GeomAPI_Shape> myShape;
+ GeomAPI_DataMapOfShapeMapOfShapes myGenerated;
+ GeomAPI_DataMapOfShapeMapOfShapes myModified;
+ GeomAPI_DataMapOfShapeShape myDeleted;
+};
+
+#endif
\ No newline at end of file
/** \class GeomAlgoAPI_MakeShapeList
* \ingroup DataAlgo
- * \brief Interface to the root class of all topological shapes constructions
+ * \brief List of topological shapes constructions
*/
class GeomAlgoAPI_MakeShapeList : public GeomAlgoAPI_MakeShape
{
GEOMALGOAPI_EXPORT void append(const GeomAlgoAPI_MakeShapeList& theMakeShapeList);
/// \return a shape built by the shape construction algorithms
- GEOMALGOAPI_EXPORT const std::shared_ptr<GeomAPI_Shape> shape() const;
+ GEOMALGOAPI_EXPORT virtual const std::shared_ptr<GeomAPI_Shape> shape() const;
/// \return the list of shapes generated from the shape \a theShape
GEOMALGOAPI_EXPORT virtual void generated(const std::shared_ptr<GeomAPI_Shape> theShape,
GEOMALGOAPI_EXPORT virtual void modified(const std::shared_ptr<GeomAPI_Shape> theShape,
ListOfShape& theHistory);
- /// Returns whether the shape is deleted
+ /// \return whether the shape is deleted
GEOMALGOAPI_EXPORT virtual bool isDeleted(const std::shared_ptr<GeomAPI_Shape> theShape);
private: