// Getting objects.
TopTools_ListOfShape anObjects;
- for(ListOfShape::const_iterator anObjectsIt = theObjects.begin(); anObjectsIt != theObjects.end(); anObjectsIt++)
+ for(ListOfShape::const_iterator
+ anObjectsIt = theObjects.begin(); anObjectsIt != theObjects.end(); anObjectsIt++)
{
anObjects.Append((*anObjectsIt)->impl<TopoDS_Shape>());
}
// Getting tools.
TopTools_ListOfShape aTools;
- for(ListOfShape::const_iterator aToolsIt = theTools.begin(); aToolsIt != theTools.end(); aToolsIt++)
+ for(ListOfShape::const_iterator
+ aToolsIt = theTools.begin(); aToolsIt != theTools.end(); aToolsIt++)
{
aTools.Append((*aToolsIt)->impl<TopoDS_Shape>());
}
aRes->setImpl(new TopoDS_Shape(anEdge));
return aRes;
}
-std::shared_ptr<GeomAPI_Edge> GeomAlgoAPI_EdgeBuilder::line(
+std::shared_ptr<GeomAPI_Edge> GeomAlgoAPI_EdgeBuilder::line(
double theDX, double theDY, double theDZ)
{
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
#ifndef GeomAlgoAPI_Exception_H_
#define GeomAlgoAPI_Exception_H_
#include <TopoDS_Face.hxx>
//==================================================================================================
-std::shared_ptr<GeomAPI_Face> GeomAlgoAPI_FaceBuilder::squareFace(const std::shared_ptr<GeomAPI_Pnt> theCenter,
- const std::shared_ptr<GeomAPI_Dir> theNormal,
- const double theSize)
+std::shared_ptr<GeomAPI_Face> GeomAlgoAPI_FaceBuilder::squareFace(
+ const std::shared_ptr<GeomAPI_Pnt> theCenter,
+ const std::shared_ptr<GeomAPI_Dir> theNormal,
+ const double theSize)
{
const gp_Pnt& aCenter = theCenter->impl<gp_Pnt>();
const gp_Dir& aDir = theNormal->impl<gp_Dir>();
}
//==================================================================================================
-std::shared_ptr<GeomAPI_Face> GeomAlgoAPI_FaceBuilder::squareFace(const std::shared_ptr<GeomAPI_Pln> thePlane,
- const double theSize)
+std::shared_ptr<GeomAPI_Face> GeomAlgoAPI_FaceBuilder::squareFace(
+ const std::shared_ptr<GeomAPI_Pln> thePlane,
+ const double theSize)
{
// half of the size in each direction from the center
BRepBuilderAPI_MakeFace aFaceBuilder(thePlane->impl<gp_Pln>(),
}
//==================================================================================================
-std::shared_ptr<GeomAPI_Face> GeomAlgoAPI_FaceBuilder::planarFace(const std::shared_ptr<GeomAPI_Pnt> theCenter,
- const std::shared_ptr<GeomAPI_Dir> theNormal)
+std::shared_ptr<GeomAPI_Face> GeomAlgoAPI_FaceBuilder::planarFace(
+ const std::shared_ptr<GeomAPI_Pnt> theCenter,
+ const std::shared_ptr<GeomAPI_Dir> theNormal)
{
const gp_Pnt& aCenter = theCenter->impl<gp_Pnt>();
const gp_Dir& aDir = theNormal->impl<gp_Dir>();
}
//==================================================================================================
-std::shared_ptr<GeomAPI_Face> GeomAlgoAPI_FaceBuilder::planarFace(const std::shared_ptr<GeomAPI_Pln> thePlane,
- const double theX, const double theY,
- const double theWidth, const double theHeight)
+std::shared_ptr<GeomAPI_Face> GeomAlgoAPI_FaceBuilder::planarFace(
+ const std::shared_ptr<GeomAPI_Pln> thePlane,
+ const double theX, const double theY,
+ const double theWidth, const double theHeight)
{
double aA, aB, aC, aD;
thePlane->coefficients(aA, aB, aC, aD);
const double theWidth, const double theHeight);
/// Creates a planar face by three vertices.
- static std::shared_ptr<GeomAPI_Face> planarFaceByThreeVertices(const std::shared_ptr<GeomAPI_Vertex> theVertex1,
- const std::shared_ptr<GeomAPI_Vertex> theVertex2,
- const std::shared_ptr<GeomAPI_Vertex> theVertex3);
+ static std::shared_ptr<GeomAPI_Face> planarFaceByThreeVertices(
+ const std::shared_ptr<GeomAPI_Vertex> theVertex1,
+ const std::shared_ptr<GeomAPI_Vertex> theVertex2,
+ const std::shared_ptr<GeomAPI_Vertex> theVertex3);
/// Creates a planar face parallel to theFace and passing through theVertex.
- static std::shared_ptr<GeomAPI_Face> planarFaceByFaceAndVertex(const std::shared_ptr<GeomAPI_Face> theFace,
- const std::shared_ptr<GeomAPI_Vertex> theVertex);
+ static std::shared_ptr<GeomAPI_Face> planarFaceByFaceAndVertex(
+ const std::shared_ptr<GeomAPI_Face> theFace,
+ const std::shared_ptr<GeomAPI_Vertex> theVertex);
};
#endif
// Getting objects.
TopTools_ListOfShape anObjects;
- for (ListOfShape::const_iterator anObjectsIt = theObjects.begin(); anObjectsIt != theObjects.end(); anObjectsIt++) {
+ for (ListOfShape::const_iterator
+ anObjectsIt = theObjects.begin(); anObjectsIt != theObjects.end(); anObjectsIt++) {
const TopoDS_Shape& aShape = (*anObjectsIt)->impl<TopoDS_Shape>();
if(!aShape.IsNull()) {
anObjects.Append(aShape);
// Getting tools.
TopTools_ListOfShape aTools;
- for (ListOfShape::const_iterator aToolsIt = theTools.begin(); aToolsIt != theTools.end(); aToolsIt++) {
+ for (ListOfShape::const_iterator
+ aToolsIt = theTools.begin(); aToolsIt != theTools.end(); aToolsIt++) {
const TopoDS_Shape& aShape = (*aToolsIt)->impl<TopoDS_Shape>();
if(!aShape.IsNull()) {
aTools.Append(aShape);
}
if (aNbVolumes != 1) {
- myError = theMessage + " :: connexity error, the resulting shape is made of several separate solids.";
+ myError = theMessage +
+ " :: connexity error, the resulting shape is made of several separate solids.";
return false;
}
/// \brief Constructor by builder and builder type.
/// \param[in] theBuilder pointer to the builder.
/// \param[in] theBuilderType builder type.
- template<class T> explicit GeomAlgoAPI_MakeShape(T* theBuilder, const BuilderType theBuilderType = OCCT_BRepBuilderAPI_MakeShape)
+ template<class T> explicit GeomAlgoAPI_MakeShape(T* theBuilder,
+ const BuilderType theBuilderType = OCCT_BRepBuilderAPI_MakeShape)
: GeomAPI_Interface(theBuilder),
myBuilderType(theBuilderType)
{
/// \brief Initializes internals.
/// \param[in] theBuilder pointer to the builder.
/// \param[in] theBuilderType builder type.
- template<class T> void initialize(T* theBuilder, const BuilderType theBuilderType = OCCT_BRepBuilderAPI_MakeShape)
+ template<class T> void initialize(T* theBuilder,
+ const BuilderType theBuilderType = OCCT_BRepBuilderAPI_MakeShape)
{
setImpl(theBuilder);
myBuilderType = theBuilderType;
GEOMALGOAPI_EXPORT virtual bool check() { return true; };
/// \return the list of created faces.
- GEOMALGOAPI_EXPORT std::map< std::string, std::shared_ptr<GeomAPI_Shape> > getCreatedFaces() {return myCreatedFaces;}
+ GEOMALGOAPI_EXPORT std::map< std::string, std::shared_ptr<GeomAPI_Shape> > getCreatedFaces()
+ {return myCreatedFaces;}
/// \return the error.
GEOMALGOAPI_EXPORT std::string getError() { return myError; }
void setShape(const std::shared_ptr<GeomAPI_Shape> theShape);
protected:
- std::shared_ptr<GeomAPI_DataMapOfShapeShape> myMap; ///< Data map to keep correct orientation of sub-shapes.
- std::string myError; /// Error occurred during the execution of an algorithm.
- std::map< std::string, std::shared_ptr<GeomAPI_Shape> > myCreatedFaces; /// Map of created faces with their name for naming.
+ /// Data map to keep correct orientation of sub-shapes.
+ std::shared_ptr<GeomAPI_DataMapOfShapeShape> myMap;
+ /// Error occurred during the execution of an algorithm.
+ std::string myError;
+ /// Map of created faces with their name for naming.
+ std::map< std::string, std::shared_ptr<GeomAPI_Shape> > myCreatedFaces;
private:
/// \brief Initializes internals.
}
//=================================================================================================
-void GeomAlgoAPI_MakeShapeList::appendAlgo(const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape)
+void GeomAlgoAPI_MakeShapeList::appendAlgo(
+ const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape)
{
myListOfMakeShape.push_back(theMakeShape);
if(!myMap.get()) {
bool GeomAlgoAPI_MakeShapeList::isDeleted(const std::shared_ptr<GeomAPI_Shape> theShape)
{
- for(ListOfMakeShape::iterator aBuilderIt = myListOfMakeShape.begin(); aBuilderIt != myListOfMakeShape.end(); aBuilderIt++) {
+ for(ListOfMakeShape::iterator aBuilderIt = myListOfMakeShape.begin();
+ aBuilderIt != myListOfMakeShape.end(); aBuilderIt++) {
std::shared_ptr<GeomAlgoAPI_MakeShape> aMakeShape = *aBuilderIt;
if(aMakeShape->isDeleted(theShape)) {
return true;
aResultShapesMap.Add(theShape->impl<TopoDS_Shape>());
aResultShapesList.Append(theShape->impl<TopoDS_Shape>());
- for(ListOfMakeShape::iterator aBuilderIt = myListOfMakeShape.begin(); aBuilderIt != myListOfMakeShape.end(); aBuilderIt++) {
+ for(ListOfMakeShape::iterator aBuilderIt = myListOfMakeShape.begin();
+ aBuilderIt != myListOfMakeShape.end(); aBuilderIt++) {
std::shared_ptr<GeomAlgoAPI_MakeShape> aMakeShape = *aBuilderIt;
NCollection_Map<TopoDS_Shape> aTempShapes;
bool hasResults = false;
- for(NCollection_Map<TopoDS_Shape>::Iterator aShapeIt(anAlgoShapes); aShapeIt.More(); aShapeIt.Next()) {
+ for(NCollection_Map<TopoDS_Shape>::Iterator
+ aShapeIt(anAlgoShapes); aShapeIt.More(); aShapeIt.Next()) {
std::shared_ptr<GeomAPI_Shape> aShape(new GeomAPI_Shape);
aShape->setImpl(new TopoDS_Shape(aShapeIt.Value()));
ListOfShape aGeneratedShapes;
aMakeShape->generated(aShape, aGeneratedShapes);
- for(ListOfShape::const_iterator anIt = aGeneratedShapes.cbegin(); anIt != aGeneratedShapes.cend(); anIt++) {
+ for(ListOfShape::const_iterator
+ anIt = aGeneratedShapes.cbegin(); anIt != aGeneratedShapes.cend(); anIt++) {
const TopoDS_Shape& anItShape = (*anIt)->impl<TopoDS_Shape>();
aTempShapes.Add(anItShape);
if(aResultShapesMap.Add(anItShape) == Standard_True) {
}
ListOfShape aModifiedShapes;
aMakeShape->modified(aShape, aModifiedShapes);
- for(ListOfShape::const_iterator anIt = aModifiedShapes.cbegin(); anIt != aModifiedShapes.cend(); anIt++) {
+ for(ListOfShape::const_iterator
+ anIt = aModifiedShapes.cbegin(); anIt != aModifiedShapes.cend(); anIt++) {
const TopoDS_Shape& anItShape = (*anIt)->impl<TopoDS_Shape>();
aTempShapes.Add(anItShape);
if(aResultShapesMap.Add(anItShape) == Standard_True) {
if(hasResults) {
const TopoDS_Shape& aTopoDSShape = aShapeIt.Value();
if(aResultShapesMap.Remove(aTopoDSShape) == Standard_True) {
- for(NCollection_List<TopoDS_Shape>::Iterator aResIt(aResultShapesList); aResIt.More(); aResIt.Next()) {
+ for(NCollection_List<TopoDS_Shape>::Iterator
+ aResIt(aResultShapesList); aResIt.More(); aResIt.Next()) {
if(aTopoDSShape.IsEqual(aResIt.Value())) {
aResultShapesList.Remove(aResIt);
break;
anAlgoShapes.Unite(aTempShapes);
}
- for(NCollection_List<TopoDS_Shape>::Iterator aShapeIt(aResultShapesList); aShapeIt.More(); aShapeIt.Next()) {
+ for(NCollection_List<TopoDS_Shape>::Iterator
+ aShapeIt(aResultShapesList); aShapeIt.More(); aShapeIt.Next()) {
std::shared_ptr<GeomAPI_Shape> aShape(new GeomAPI_Shape());
aShape->setImpl(new TopoDS_Shape(aShapeIt.Value()));
theHistory.push_back(aShape);
this->setBuilderType(OCCT_BOPAlgo_Builder);
// Getting objects.
- for (ListOfShape::const_iterator anObjectsIt = theObjects.begin(); anObjectsIt != theObjects.end(); anObjectsIt++) {
+ for (ListOfShape::const_iterator
+ anObjectsIt = theObjects.begin(); anObjectsIt != theObjects.end(); anObjectsIt++) {
const TopoDS_Shape& aShape = (*anObjectsIt)->impl<TopoDS_Shape>();
anOperation->AddArgument(aShape);
}
// Getting tools.
- for (ListOfShape::const_iterator aToolsIt = theTools.begin(); aToolsIt != theTools.end(); aToolsIt++) {
+ for (ListOfShape::const_iterator
+ aToolsIt = theTools.begin(); aToolsIt != theTools.end(); aToolsIt++) {
const TopoDS_Shape& aShape = (*aToolsIt)->impl<TopoDS_Shape>();
anOperation->AddTool(aShape);
}
#include <TopoDS_Iterator.hxx>
//=================================================================================================
-GeomAlgoAPI_PaveFiller::GeomAlgoAPI_PaveFiller(const ListOfShape& theListOfShape, const bool theIsMakeCompSolids)
+GeomAlgoAPI_PaveFiller::GeomAlgoAPI_PaveFiller(const ListOfShape& theListOfShape,
+ const bool theIsMakeCompSolids)
{
build(theListOfShape, theIsMakeCompSolids);
}
//=================================================================================================
-void GeomAlgoAPI_PaveFiller::build(const ListOfShape& theListOfShape, const bool theIsMakeCompSolids)
+void GeomAlgoAPI_PaveFiller::build(const ListOfShape& theListOfShape,
+ const bool theIsMakeCompSolids)
{
BOPAlgo_PaveFiller aPaveFiller;
BOPCol_ListOfShape aListOfShape;
- for(ListOfShape::const_iterator anIt = theListOfShape.cbegin(); anIt != theListOfShape.cend(); anIt++) {
+ for(ListOfShape::const_iterator
+ anIt = theListOfShape.cbegin(); anIt != theListOfShape.cend(); anIt++) {
const TopoDS_Shape& aShape = (*anIt)->impl<TopoDS_Shape>();
if(aShape.ShapeType() == TopAbs_COMPOUND) {
for(TopoDS_Iterator anIter(aShape); anIter.More(); anIter.Next()) {
/// \class GeomAlgoAPI_PaveFiller
/// \ingroup DataAlgo
-/// \brief Finds the common parts from the list of shapes and breaks it to shapes with shared subshapes.
+/// \brief Finds the common parts from the list of shapes and
+/// breaks it to shapes with shared subshapes.
class GeomAlgoAPI_PaveFiller : public GeomAlgoAPI_MakeShape
{
public:
/// \brief Constructor.
/// \param[in] theListOfShape list of shape which should be splitted.
/// \param[in] theIsMakeCompSolids if true gather shapes with shared faces to compsolids.
- GEOMALGOAPI_EXPORT GeomAlgoAPI_PaveFiller(const ListOfShape& theListOfShape, const bool theIsMakeCompSolids = false);
+ GEOMALGOAPI_EXPORT GeomAlgoAPI_PaveFiller(const ListOfShape& theListOfShape,
+ const bool theIsMakeCompSolids = false);
private:
/// Builds resulting shape.
const ListOfShape& theLocations,
const GeomShapePtr thePathShape)
{
- if(theBaseShapes.empty() || (!theLocations.empty() && theLocations.size() != theBaseShapes.size())) {
+ if(theBaseShapes.empty() ||
+ (!theLocations.empty() && theLocations.size() != theBaseShapes.size())) {
return;
}
/// \class GeomAlgoAPI_Pipe
/// \ingroup DataAlgo
-/// \brief Allows to create extrusion of objects along a path. It produces the following results from objects:\n
+/// \brief Allows to create extrusion of objects along a path.
+/// It produces the following results from objects:\n
/// Vertex -> Edge\n
/// Edge -> Face\n
/// Wire -> Shell\n
if (hasDirection[0] || hasDirection[1]) { // plane - line
int anInd = hasDirection[0] ? 0 : 1;
gp_Vec aVec = aSrcDstNormals[1 - anInd].Crossed(aSrcDstDirections[anInd]);
- if (aVec.SquareMagnitude() < Precision::SquareConfusion()) { // normal and direction are collinear
+ if (aVec.SquareMagnitude() < Precision::SquareConfusion()) {
+ // normal and direction are collinear
aVec = aSrcDstNormals[1 - anInd].Crossed(
gp_Vec(aSrcDstPoints[1 - anInd], aSrcDstPoints[anInd]));
- if (aVec.SquareMagnitude() < Precision::SquareConfusion()) { // normal and points direction are collinear
+ if (aVec.SquareMagnitude() < Precision::SquareConfusion()) {
+ // normal and points direction are collinear
if (Abs(aSrcDstNormals[1 - anInd].Y()) >= Precision::Confusion() ||
Abs(aSrcDstNormals[1 - anInd].Z()) >= Precision::Confusion())
aVec = gp::DX();
if (theSimpleTransform) { // just add transformation
TopLoc_Location aDelta(aTrsf);
// store the accumulated information about the result and this delta
- //myTrsf = std::shared_ptr<GeomAPI_Trsf>(new GeomAPI_Trsf(new gp_Trsf(aTrsf * aSourceShape.Location().Transformation())));
myTrsf.reset(new GeomAPI_Trsf(new gp_Trsf(aTrsf)));
TopoDS_Shape aResult = aSourceShape.Moved(aDelta);
std::shared_ptr<GeomAPI_Shape> aShape(new GeomAPI_Shape());
/// \param[in] theDestSolid invariant shape
/// \param[in] theSourceShape a shape on the solid to be made coincident with destination object
/// \param[in] theDestShape destination object
- /// \param[in] theIsReverse indicates that the solid materials should be on the same side against the destination plane
+ /// \param[in] theIsReverse indicates that the solid materials should be on the same side
+ /// against the destination plane
/// \param[in] theIsCentering indicates the planes should be centered
- /// \param[in] theSimpleTransform makes just transformation of shape without changing of topology or geometry
+ /// \param[in] theSimpleTransform makes just transformation of shape
+ /// without changing of topology or geometry
GEOMALGOAPI_EXPORT GeomAlgoAPI_Placement(const std::shared_ptr<GeomAPI_Shape> theSourceSolid,
const std::shared_ptr<GeomAPI_Shape> theDestSolid,
const std::shared_ptr<GeomAPI_Shape> theSourceShape,
#include <TopoDS_Vertex.hxx>
//==================================================================================================
-std::shared_ptr<GeomAPI_Vertex> GeomAlgoAPI_PointBuilder::vertex(const std::shared_ptr<GeomAPI_Pnt> thePoint)
+std::shared_ptr<GeomAPI_Vertex>
+ GeomAlgoAPI_PointBuilder::vertex(const std::shared_ptr<GeomAPI_Pnt> thePoint)
{
const gp_Pnt& aPnt = thePoint->impl<gp_Pnt>();
BRepBuilderAPI_MakeVertex aMaker(aPnt);
}
//==================================================================================================
-std::shared_ptr<GeomAPI_Pnt> GeomAlgoAPI_PointBuilder::point(const std::shared_ptr<GeomAPI_Shape> theVertex)
+std::shared_ptr<GeomAPI_Pnt>
+ GeomAlgoAPI_PointBuilder::point(const std::shared_ptr<GeomAPI_Shape> theVertex)
{
TopoDS_Shape aShape = theVertex->impl<TopoDS_Shape>();
if ((!aShape.IsNull()) && (aShape.ShapeType() == TopAbs_VERTEX)) {
}
//==================================================================================================
-std::shared_ptr<GeomAPI_Vertex> GeomAlgoAPI_PointBuilder::vertexOnEdge(const std::shared_ptr<GeomAPI_Edge> theEdge,
- const double theValue,
- const bool theIsPercent,
- const bool theIsReverse)
+std::shared_ptr<GeomAPI_Vertex> GeomAlgoAPI_PointBuilder::vertexOnEdge(
+ const std::shared_ptr<GeomAPI_Edge> theEdge,
+ const double theValue,
+ const bool theIsPercent,
+ const bool theIsReverse)
{
std::shared_ptr<GeomAPI_Vertex> aVertex;
/// \brief Creates vertex by edge and distance on it.
/// \param[in] theEdge edge.
/// \param[in] theValue distance value.
- /// \param[in] theIsPercent if true theValue will be treated as a percentage of theEdge total length.
+ /// \param[in] theIsPercent if true theValue will be treated
+ /// as a percentage of theEdge total length.
/// \param[in] theIsReverse if true the distance will be measured from the edge end point.
/// \return created vertex.
static std::shared_ptr<GeomAPI_Vertex> vertexOnEdge(const std::shared_ptr<GeomAPI_Edge> theEdge,
/// \param[in] theVertex vertex to project.
/// \param[in] thePlane face for projection. Should be planar.
/// \return created vertex.
- static std::shared_ptr<GeomAPI_Vertex> vertexByProjection(const std::shared_ptr<GeomAPI_Vertex> theVertex,
- const std::shared_ptr<GeomAPI_Face> thePlane);
+ static std::shared_ptr<GeomAPI_Vertex>
+ vertexByProjection(const std::shared_ptr<GeomAPI_Vertex> theVertex,
+ const std::shared_ptr<GeomAPI_Face> thePlane);
/// \brief Creates vertex by intersection two coplanar lines.
/// \param[in] theEdge1 first linear edge.
/// \param[in] theEdge2 second linear edge.
/// \return created vertex.
- static std::shared_ptr<GeomAPI_Vertex> vertexByIntersection(const std::shared_ptr<GeomAPI_Edge> theEdge1,
- const std::shared_ptr<GeomAPI_Edge> theEdge2);
+ static std::shared_ptr<GeomAPI_Vertex>
+ vertexByIntersection(const std::shared_ptr<GeomAPI_Edge> theEdge1,
+ const std::shared_ptr<GeomAPI_Edge> theEdge2);
/// \brief Creates vertex by intersection line and plane.
/// \param[in] theEdge linear edge.
/// \param[in] theFace planar face.
/// \return created vertex.
- static std::shared_ptr<GeomAPI_Vertex> vertexByIntersection(const std::shared_ptr<GeomAPI_Edge> theEdge,
- const std::shared_ptr<GeomAPI_Face> theFace);
+ static std::shared_ptr<GeomAPI_Vertex>
+ vertexByIntersection(const std::shared_ptr<GeomAPI_Edge> theEdge,
+ const std::shared_ptr<GeomAPI_Face> theFace);
/// Return point by shape vertex
static std::shared_ptr<GeomAPI_Pnt> point(const std::shared_ptr<GeomAPI_Shape> theVertex);
const double theToSize,
const double theFromSize)
{
- build(theBaseShape, std::shared_ptr<GeomAPI_Dir>(), GeomShapePtr(), theToSize, GeomShapePtr(), theFromSize);
+ build(theBaseShape, std::shared_ptr<GeomAPI_Dir>(), GeomShapePtr(),
+ theToSize, GeomShapePtr(), theFromSize);
}
//==================================================================================================
const GeomShapePtr theFromShape,
const double theFromSize)
{
- build(theBaseShape, std::shared_ptr<GeomAPI_Dir>(), theToShape, theToSize, theFromShape, theFromSize);
+ build(theBaseShape, std::shared_ptr<GeomAPI_Dir>(), theToShape,
+ theToSize, theFromShape, theFromSize);
}
//==================================================================================================
const double theFromSize)
{
if(!theBaseShape.get() ||
- (((!theFromShape.get() && !theToShape.get()) || (theFromShape.get() && theToShape.get() && theFromShape->isEqual(theToShape)))
+ (((!theFromShape.get() && !theToShape.get()) ||
+ (theFromShape.get() && theToShape.get() && theFromShape->isEqual(theToShape)))
&& (theFromSize == -theToSize))) {
return;
}
// Moving base shape.
gp_Trsf aTrsf;
aTrsf.SetTranslation(aDirVec * -theFromSize);
- BRepBuilderAPI_Transform* aTransformBuilder = new BRepBuilderAPI_Transform(aBaseShape, aTrsf);
+ BRepBuilderAPI_Transform* aTransformBuilder =
+ new BRepBuilderAPI_Transform(aBaseShape, aTrsf);
if(!aTransformBuilder) {
return;
}
- this->appendAlgo(std::shared_ptr<GeomAlgoAPI_MakeShape>(new GeomAlgoAPI_MakeShape(aTransformBuilder)));
+ this->appendAlgo(std::shared_ptr<GeomAlgoAPI_MakeShape>(
+ new GeomAlgoAPI_MakeShape(aTransformBuilder)));
if(!aTransformBuilder->IsDone()) {
return;
}
TopoDS_Shape aMovedBase = aTransformBuilder->Shape();
// Making prism.
- BRepPrimAPI_MakePrism* aPrismBuilder = new BRepPrimAPI_MakePrism(aMovedBase, aDirVec * (theFromSize + theToSize));
+ BRepPrimAPI_MakePrism* aPrismBuilder =
+ new BRepPrimAPI_MakePrism(aMovedBase, aDirVec * (theFromSize + theToSize));
if(!aPrismBuilder) {
return;
}
- this->appendAlgo(std::shared_ptr<GeomAlgoAPI_MakeShape>(new GeomAlgoAPI_MakeShape(aPrismBuilder)));
+ this->appendAlgo(std::shared_ptr<GeomAlgoAPI_MakeShape>(
+ new GeomAlgoAPI_MakeShape(aPrismBuilder)));
if(!aPrismBuilder->IsDone()) {
return;
}
bool aSign = aFromLoc->xyz()->dot(aBaseDir->xyz()) > aToLoc->xyz()->dot(aBaseDir->xyz());
- std::shared_ptr<GeomAPI_Pnt> aFromPnt(new GeomAPI_Pnt(aFromLoc->xyz()->added(aBaseDir->xyz()->multiplied(
- aSign ? theFromSize : -theFromSize))));
+ std::shared_ptr<GeomAPI_Pnt> aFromPnt(
+ new GeomAPI_Pnt(aFromLoc->xyz()->added(aBaseDir->xyz()->multiplied(
+ aSign ? theFromSize : -theFromSize))));
aBoundingFromShape = GeomAlgoAPI_FaceBuilder::planarFace(aFromPnt, aFromDir);
- std::shared_ptr<GeomAPI_Pnt> aToPnt(new GeomAPI_Pnt(aToLoc->xyz()->added(aBaseDir->xyz()->multiplied(
- aSign ? -theToSize : theToSize))));
+ std::shared_ptr<GeomAPI_Pnt> aToPnt(
+ new GeomAPI_Pnt(aToLoc->xyz()->added(aBaseDir->xyz()->multiplied(
+ aSign ? -theToSize : theToSize))));
aBoundingToShape = GeomAlgoAPI_FaceBuilder::planarFace(aToPnt, aToDir);
// Getting bounding box for base shape.
if(!aTransformBuilder) {
return;
}
- this->appendAlgo(std::shared_ptr<GeomAlgoAPI_MakeShape>(new GeomAlgoAPI_MakeShape(aTransformBuilder)));
+ this->appendAlgo(std::shared_ptr<GeomAlgoAPI_MakeShape>(
+ new GeomAlgoAPI_MakeShape(aTransformBuilder)));
if(!aTransformBuilder->IsDone()) {
return;
}
TopoDS_Shape aMovedBase = aTransformBuilder->Shape();
// Making prism.
- BRepPrimAPI_MakePrism* aPrismBuilder = new BRepPrimAPI_MakePrism(aMovedBase, aDirVec * 2 * aPrismLength);
+ BRepPrimAPI_MakePrism* aPrismBuilder =
+ new BRepPrimAPI_MakePrism(aMovedBase, aDirVec * 2 * aPrismLength);
if(!aPrismBuilder) {
return;
}
- this->appendAlgo(std::shared_ptr<GeomAlgoAPI_MakeShape>(new GeomAlgoAPI_MakeShape(aPrismBuilder)));
+ this->appendAlgo(std::shared_ptr<GeomAlgoAPI_MakeShape>(
+ new GeomAlgoAPI_MakeShape(aPrismBuilder)));
if(!aPrismBuilder->IsDone()) {
return;
}
if(!aToCutBuilder->IsDone()) {
return;
}
- this->appendAlgo(std::shared_ptr<GeomAlgoAPI_MakeShape>(new GeomAlgoAPI_MakeShape(aToCutBuilder)));
+ this->appendAlgo(std::shared_ptr<GeomAlgoAPI_MakeShape>(
+ new GeomAlgoAPI_MakeShape(aToCutBuilder)));
aResult = aToCutBuilder->Shape();
if(aResult.ShapeType() == TopAbs_COMPOUND) {
aResult = GeomAlgoAPI_DFLoader::refineResult(aResult);
if(!aFromCutBuilder->IsDone()) {
return;
}
- this->appendAlgo(std::shared_ptr<GeomAlgoAPI_MakeShape>(new GeomAlgoAPI_MakeShape(aFromCutBuilder)));
+ this->appendAlgo(std::shared_ptr<GeomAlgoAPI_MakeShape>(
+ new GeomAlgoAPI_MakeShape(aFromCutBuilder)));
aResult = aFromCutBuilder->Shape();
TopoDS_Iterator aCheckIt(aResult);
if(!aCheckIt.More()) {
if(theType == TopAbs_VERTEX) {
gp_Pnt aPnt = BRep_Tool::Pnt(TopoDS::Vertex(aShape));
IntTools_Context anIntTools;
- if(anIntTools.IsValidPointForFace(aPnt, theToFace, Precision::Confusion()) == Standard_True) {
+ if(anIntTools.IsValidPointForFace(aPnt,
+ theToFace, Precision::Confusion()) == Standard_True) {
aGeomSh->setImpl(new TopoDS_Shape(aShape));
thePrismAlgo->addToShape(aGeomSh);
}
- if(anIntTools.IsValidPointForFace(aPnt, theFromFace, Precision::Confusion()) == Standard_True) {
+ if(anIntTools.IsValidPointForFace(aPnt,
+ theFromFace, Precision::Confusion()) == Standard_True) {
aGeomSh->setImpl(new TopoDS_Shape(aShape));
thePrismAlgo->addFromShape(aGeomSh);
}
/// \brief Creates extrusion for the given shape along the normal for this shape.
/// \param[in] theBaseShape vertex, edge, wire, face or shell.
- /// \param[in] theDirection direction of extrusion. Can be empty if theBaseShape is planar wire or face.
+ /// \param[in] theDirection direction of extrusion.
+ /// Can be empty if theBaseShape is planar wire or face.
/// \param[in] theToSize offset for "to" plane.
/// \param[in] theFromSize offset for "from" plane.
GEOMALGOAPI_EXPORT GeomAlgoAPI_Prism(const GeomShapePtr theBaseShape,
/// \brief Creates extrusion for the given shape along the normal for this shape.
/// \param[in] theBaseShape planar face or wire to be extruded.
- /// \param[in] theToShape top bounding shape. Can be empty. In this case offset will be applied to the basis.
+ /// \param[in] theToShape top bounding shape. Can be empty.
+ /// In this case offset will be applied to the basis.
/// \param[in] theToSize offset for "to" plane.
- /// \param[in] theFromShape bottom bounding shape. Can be empty. In this case offset will be applied to the basis.
+ /// \param[in] theFromShape bottom bounding shape. Can be empty.
+ /// In this case offset will be applied to the basis.
/// \param[in] theFromSize offset for "from" plane.
GEOMALGOAPI_EXPORT GeomAlgoAPI_Prism(const GeomShapePtr theBaseShape,
const GeomShapePtr theToShape,
/// \brief Creates extrusion for the given shape along the normal for this shape.
/// \param[in] theBaseShape planar face or wire to be extruded.
- /// \param[in] theDirection direction of extrusion. Can be empty if theBaseShape is planar wire or face.
- /// \param[in] theToShape top bounding shape. Can be empty. In this case offset will be applied to the basis.
+ /// \param[in] theDirection direction of extrusion.
+ /// Can be empty if theBaseShape is planar wire or face.
+ /// \param[in] theToShape top bounding shape. Can be empty.
+ /// In this case offset will be applied to the basis.
/// \param[in] theToSize offset for "to" plane.
- /// \param[in] theFromShape bottom bounding shape. Can be empty. In this case offset will be applied to the basis.
+ /// \param[in] theFromShape bottom bounding shape. Can be empty.
+ /// In this case offset will be applied to the basis.
/// \param[in] theFromSize offset for "from" plane.
GEOMALGOAPI_EXPORT GeomAlgoAPI_Prism(const GeomShapePtr theBaseShape,
const std::shared_ptr<GeomAPI_Dir> theDirection,
const double theFromAngle)
{
if(!theBaseShape || !theAxis ||
- (((!theFromShape && !theToShape) || (theFromShape && theToShape && theFromShape->isEqual(theToShape)))
+ (((!theFromShape && !theToShape) ||
+ (theFromShape && theToShape && theFromShape->isEqual(theToShape)))
&& (theFromAngle == -theToAngle))) {
return;
}
if(!aBaseTransform) {
return;
}
- this->appendAlgo(std::shared_ptr<GeomAlgoAPI_MakeShape>(new GeomAlgoAPI_MakeShape(aBaseTransform)));
+ this->appendAlgo(std::shared_ptr<GeomAlgoAPI_MakeShape>(
+ new GeomAlgoAPI_MakeShape(aBaseTransform)));
if(!aBaseTransform->IsDone()) {
return;
}
// Making revolution to the angle equal to the sum of "from angle" and "to angle".
BRepPrimAPI_MakeRevol* aRevolBuilder = new BRepPrimAPI_MakeRevol(aRotatedBase,
- anAxis,
- (theFromAngle + theToAngle) / 180 * M_PI,
- Standard_True);
+ anAxis,
+ (theFromAngle + theToAngle) / 180 * M_PI,
+ Standard_True);
if(!aRevolBuilder) {
return;
}
- this->appendAlgo(std::shared_ptr<GeomAlgoAPI_MakeShape>(new GeomAlgoAPI_MakeShape(aRevolBuilder)));
+ this->appendAlgo(std::shared_ptr<GeomAlgoAPI_MakeShape>(
+ new GeomAlgoAPI_MakeShape(aRevolBuilder)));
if(!aRevolBuilder->IsDone()) {
return;
}
}
} else if(theFromShape && theToShape) { // Case 2: When both bounding planes were set.
// Making revolution to the 360 angle.
- BRepPrimAPI_MakeRevol* aRevolBuilder = new BRepPrimAPI_MakeRevol(aBaseShape, anAxis, 2 * M_PI, Standard_True);
+ BRepPrimAPI_MakeRevol* aRevolBuilder =
+ new BRepPrimAPI_MakeRevol(aBaseShape, anAxis, 2 * M_PI, Standard_True);
if(!aRevolBuilder) {
return;
}
- this->appendAlgo(std::shared_ptr<GeomAlgoAPI_MakeShape>(new GeomAlgoAPI_MakeShape(aRevolBuilder)));
+ this->appendAlgo(std::shared_ptr<GeomAlgoAPI_MakeShape>(
+ new GeomAlgoAPI_MakeShape(aRevolBuilder)));
if(!aRevolBuilder->IsDone()) {
return;
}
// Getting planes from bounding face.
GeomLib_IsPlanarSurface isFromPlanar(BRep_Tool::Surface(aFromFace));
GeomLib_IsPlanarSurface isToPlanar(BRep_Tool::Surface(aToFace));
- if(!isFromPlanar.IsPlanar() || !isToPlanar.IsPlanar()) {// non-planar shapes is not supported for revolution bounding
+ if(!isFromPlanar.IsPlanar() || !isToPlanar.IsPlanar()) {
+ // non-planar shapes is not supported for revolution bounding
return;
}
// Rotating bounding planes to the specified angle.
gp_Trsf aFromTrsf;
gp_Trsf aToTrsf;
- double aFromRotAngle = ((aFromPln.Axis().Direction() * aBasePlane->Axis().Direction()) > 0) ? -theFromAngle : theFromAngle;
- double aToRotAngle = ((aToPln.Axis().Direction() * aBasePlane->Axis().Direction()) > 0) ? -theToAngle : theToAngle;
+ double aFromRotAngle =
+ ((aFromPln.Axis().Direction() * aBasePlane->Axis().Direction()) > 0) ? -theFromAngle :
+ theFromAngle;
+ double aToRotAngle =
+ ((aToPln.Axis().Direction() * aBasePlane->Axis().Direction()) > 0) ? -theToAngle :
+ theToAngle;
aFromTrsf.SetRotation(anAxis,aFromRotAngle / 180.0 * M_PI);
aToTrsf.SetRotation(anAxis, aToRotAngle / 180.0 * M_PI);
BRepBuilderAPI_Transform aFromTransform(aFromSolid, aFromTrsf, true);
if(!aFromCutBuilder->IsDone()) {
return;
}
- this->appendAlgo(std::shared_ptr<GeomAlgoAPI_MakeShape>(new GeomAlgoAPI_MakeShape(aFromCutBuilder)));
+ this->appendAlgo(std::shared_ptr<GeomAlgoAPI_MakeShape>(
+ new GeomAlgoAPI_MakeShape(aFromCutBuilder)));
aResult = aFromCutBuilder->Shape();
if(aResult.ShapeType() == TopAbs_COMPOUND) {
aResult = GeomAlgoAPI_DFLoader::refineResult(aResult);
if(!aToCutBuilder->IsDone()) {
return;
}
- this->appendAlgo(std::shared_ptr<GeomAlgoAPI_MakeShape>(new GeomAlgoAPI_MakeShape(aToCutBuilder)));
+ this->appendAlgo(std::shared_ptr<GeomAlgoAPI_MakeShape>(
+ new GeomAlgoAPI_MakeShape(aToCutBuilder)));
aResult = aToCutBuilder->Shape();
TopoDS_Iterator aCheckIt(aResult);
if(!aCheckIt.More()) {
aResult = aGeomShape->impl<TopoDS_Shape>();
}
- // If after cut we got more than one solids then take closest to the center of mass of the base face.
+ // If after cut we got more than one solids then take closest
+ // to the center of mass of the base face.
aResult = findClosest(aResult, aBaseCentre);
// Setting naming.
}
} else { //Case 3: When only one bounding plane was set.
// Making revolution to the 360 angle.
- BRepPrimAPI_MakeRevol* aRevolBuilder = new BRepPrimAPI_MakeRevol(aBaseShape, anAxis, 2 * M_PI, Standard_True);
+ BRepPrimAPI_MakeRevol* aRevolBuilder =
+ new BRepPrimAPI_MakeRevol(aBaseShape, anAxis, 2 * M_PI, Standard_True);
if(!aRevolBuilder) {
return;
}
- this->appendAlgo(std::shared_ptr<GeomAlgoAPI_MakeShape>(new GeomAlgoAPI_MakeShape(aRevolBuilder)));
+ this->appendAlgo(std::shared_ptr<GeomAlgoAPI_MakeShape>(
+ new GeomAlgoAPI_MakeShape(aRevolBuilder)));
if(!aRevolBuilder->IsDone()) {
return;
}
if(!aBoundingCutBuilder->IsDone()) {
return;
}
- this->appendAlgo(std::shared_ptr<GeomAlgoAPI_MakeShape>(new GeomAlgoAPI_MakeShape(aBoundingCutBuilder)));
+ this->appendAlgo(std::shared_ptr<GeomAlgoAPI_MakeShape>(
+ new GeomAlgoAPI_MakeShape(aBoundingCutBuilder)));
aResult = aBoundingCutBuilder->Shape();
if(aResult.ShapeType() == TopAbs_COMPOUND) {
aResult = GeomAlgoAPI_DFLoader::refineResult(aResult);
aBasePlane->Axis().Direction().Z()));
GeomShapePtr aPln = GeomAlgoAPI_FaceBuilder::planarFace(theCenter, theNormal);
aList.push_back(aSh);
- std::list<std::shared_ptr<GeomAPI_Pnt> > aBoundingPoints = GeomAlgoAPI_ShapeTools::getBoundingBox(aList);
+ std::list<std::shared_ptr<GeomAPI_Pnt> >
+ aBoundingPoints = GeomAlgoAPI_ShapeTools::getBoundingBox(aList);
aSh = GeomAlgoAPI_ShapeTools::fitPlaneToBox(aPln, aBoundingPoints);
aModifiedBaseShape = aSh->impl<TopoDS_Shape>();
} else {
TopoDS_Shape aCutResult = aBaseCutBuilder->Shape();
TopoDS_Iterator aCheckIt(aCutResult);
if(aCheckIt.More()) {
- this->appendAlgo(std::shared_ptr<GeomAlgoAPI_MakeShape>(new GeomAlgoAPI_MakeShape(aBaseCutBuilder)));
+ this->appendAlgo(std::shared_ptr<GeomAlgoAPI_MakeShape>(
+ new GeomAlgoAPI_MakeShape(aBaseCutBuilder)));
aResult = aCutResult;
if(aResult.ShapeType() == TopAbs_COMPOUND) {
aResult = GeomAlgoAPI_DFLoader::refineResult(aResult);
aResult = aGeomShape->impl<TopoDS_Shape>();
}
- // If after cut we got more than one solids then take closest to the center of mass of the base face.
+ // If after cut we got more than one solids then take
+ // closest to the center of mass of the base face.
aResult = findClosest(aResult, aBaseCentre);
// Setting naming.
if(aShapeTypeToExp == TopAbs_COMPOUND) {
- storeGenerationHistory(this, aResult, TopAbs_EDGE, aRotatedBoundingFace, aModifiedBaseShape, isFromFaceSet);
- storeGenerationHistory(this, aResult, TopAbs_FACE, aRotatedBoundingFace, aModifiedBaseShape, isFromFaceSet);
+ storeGenerationHistory(this, aResult, TopAbs_EDGE,
+ aRotatedBoundingFace, aModifiedBaseShape, isFromFaceSet);
+ storeGenerationHistory(this, aResult, TopAbs_FACE,
+ aRotatedBoundingFace, aModifiedBaseShape, isFromFaceSet);
} else {
- storeGenerationHistory(this, aResult, aShapeTypeToExp, aRotatedBoundingFace, aModifiedBaseShape, isFromFaceSet);
+ storeGenerationHistory(this, aResult, aShapeTypeToExp,
+ aRotatedBoundingFace, aModifiedBaseShape, isFromFaceSet);
}
}
return aSolid;
}
-//==================================================================================================
+//================================================================================================
gp_Pnt centreOfMass(const TopoDS_Shape& theShape)
{
TopAbs_ShapeEnum aShType = theShape.ShapeType();
return aGProps.CentreOfMass();
}
-//==================================================================================================
+//================================================================================================
TopoDS_Shape findClosest(const TopoDS_Shape& theShape, const gp_Pnt& thePoint)
{
TopoDS_Shape aResult = theShape;
return aResult;
}
-//==================================================================================================
+//================================================================================================
void storeGenerationHistory(GeomAlgoAPI_Revolution* theRevolutionAlgo,
const TopoDS_Shape& theBase,
const TopAbs_ShapeEnum theType,
}
}
-//==================================================================================================
+//================================================================================================
void storeGenerationHistory(GeomAlgoAPI_Revolution* theRevolutionAlgo,
const TopoDS_Shape& theResult,
const TopAbs_ShapeEnum theType,
if(theType == TopAbs_VERTEX) {
gp_Pnt aPnt = BRep_Tool::Pnt(TopoDS::Vertex(aShape));
IntTools_Context anIntTools;
- if(anIntTools.IsValidPointForFace(aPnt, TopoDS::Face(theToFace), Precision::Confusion()) == Standard_True) {
+ if(anIntTools.IsValidPointForFace(aPnt, TopoDS::Face(theToFace),
+ Precision::Confusion()) == Standard_True) {
aGeomSh->setImpl(new TopoDS_Shape(aShape));
theRevolutionAlgo->addToShape(aGeomSh);
}
- if(anIntTools.IsValidPointForFace(aPnt, TopoDS::Face(theFromFace), Precision::Confusion()) == Standard_True) {
+ if(anIntTools.IsValidPointForFace(aPnt, TopoDS::Face(theFromFace),
+ Precision::Confusion()) == Standard_True) {
aGeomSh->setImpl(new TopoDS_Shape(aShape));
theRevolutionAlgo->addFromShape(aGeomSh);
}
if(theType == TopAbs_VERTEX) {
gp_Pnt aPnt = BRep_Tool::Pnt(TopoDS::Vertex(aShape));
IntTools_Context anIntTools;
- if(anIntTools.IsValidPointForFace(aPnt, TopoDS::Face(theRotatedBoundingFace), Precision::Confusion()) == Standard_True) {
+ if(anIntTools.IsValidPointForFace(aPnt, TopoDS::Face(theRotatedBoundingFace),
+ Precision::Confusion()) == Standard_True) {
aGeomSh->setImpl(new TopoDS_Shape(aShape));
- theIsFromFaceSet ? theRevolutionAlgo->addFromShape(aGeomSh) : theRevolutionAlgo->addToShape(aGeomSh);
+ theIsFromFaceSet ? theRevolutionAlgo->addFromShape(aGeomSh) :
+ theRevolutionAlgo->addToShape(aGeomSh);
}
- if(anIntTools.IsValidPointForFace(aPnt, TopoDS::Face(theModifiedBaseShape), Precision::Confusion()) == Standard_True) {
+ if(anIntTools.IsValidPointForFace(aPnt, TopoDS::Face(theModifiedBaseShape),
+ Precision::Confusion()) == Standard_True) {
aGeomSh->setImpl(new TopoDS_Shape(aShape));
- theIsFromFaceSet ? theRevolutionAlgo->addToShape(aGeomSh) : theRevolutionAlgo->addFromShape(aGeomSh);
+ theIsFromFaceSet ? theRevolutionAlgo->addToShape(aGeomSh) :
+ theRevolutionAlgo->addFromShape(aGeomSh);
}
} else if(theType == TopAbs_EDGE) {
TopoDS_Edge anEdge = TopoDS::Edge(aShape);
anEdgeCheck.Perform();
if(anEdgeCheck.MaxDistance() < Precision::Confusion()) {
aGeomSh->setImpl(new TopoDS_Shape(aShape));
- theIsFromFaceSet ? theRevolutionAlgo->addFromShape(aGeomSh) : theRevolutionAlgo->addToShape(aGeomSh);
+ theIsFromFaceSet ? theRevolutionAlgo->addFromShape(aGeomSh) :
+ theRevolutionAlgo->addToShape(aGeomSh);
}
anEdgeCheck.Init(anEdge, TopoDS::Face(theModifiedBaseShape));
anEdgeCheck.Perform();
if(anEdgeCheck.MaxDistance() < Precision::Confusion()) {
aGeomSh->setImpl(new TopoDS_Shape(aShape));
- theIsFromFaceSet ? theRevolutionAlgo->addToShape(aGeomSh) : theRevolutionAlgo->addFromShape(aGeomSh);
+ theIsFromFaceSet ? theRevolutionAlgo->addToShape(aGeomSh) :
+ theRevolutionAlgo->addFromShape(aGeomSh);
}
} else {
Handle(Geom_Surface) aFaceSurface = BRep_Tool::Surface(TopoDS::Face(aShape));
- Handle(Geom_Surface) aBoundingSurface = BRep_Tool::Surface(TopoDS::Face(theRotatedBoundingFace));
+ Handle(Geom_Surface) aBoundingSurface =
+ BRep_Tool::Surface(TopoDS::Face(theRotatedBoundingFace));
Handle(Geom_Surface) aBaseSurface = BRep_Tool::Surface(TopoDS::Face(theModifiedBaseShape));
if(aFaceSurface == aBoundingSurface) {
aGeomSh->setImpl(new TopoDS_Shape(aShape));
- theIsFromFaceSet ? theRevolutionAlgo->addFromShape(aGeomSh) : theRevolutionAlgo->addToShape(aGeomSh);
+ theIsFromFaceSet ? theRevolutionAlgo->addFromShape(aGeomSh) :
+ theRevolutionAlgo->addToShape(aGeomSh);
}
if(aFaceSurface == aBaseSurface) {
aGeomSh->setImpl(new TopoDS_Shape(aShape));
- theIsFromFaceSet ? theRevolutionAlgo->addToShape(aGeomSh) : theRevolutionAlgo->addFromShape(aGeomSh);
+ theIsFromFaceSet ? theRevolutionAlgo->addToShape(aGeomSh) :
+ theRevolutionAlgo->addFromShape(aGeomSh);
}
}
}
/// \brief Creates revolution for the given shape.
/// \param[in] theBaseShape face for revolution.
/// \param[in] theAxis axis for revolution.
- /// \param[in] theToShape to bounding shape. Can be empty. In this case offset will be applied to the basis.
+ /// \param[in] theToShape to bounding shape. Can be empty.
+ /// In this case offset will be applied to the basis.
/// \param[in] theToAngle to angle.
- /// \param[in] theFromShape from bounding shape. Can be empty. In this case offset will be applied to the basis.
+ /// \param[in] theFromShape from bounding shape. Can be empty.
+ /// In this case offset will be applied to the basis.
/// \param[in] theFromAngle from angle.
GEOMALGOAPI_EXPORT GeomAlgoAPI_Revolution(const GeomShapePtr theBaseShape,
const std::shared_ptr<GeomAPI_Ax1> theAxis,
Standard_Integer nbs = aReader.NbShapes();
if (!ok || nbs == 0)
{
- // THROW_SALOME_CORBA_EXCEPTION("Exception catched in GEOM_Gen_i::ImportStep", SALOME::BAD_PARAM);
continue; // skip empty root
}
/* For a single entity */
for (Standard_Integer i = 1; i <= nbs; i++) {
TopoDS_Shape aShape = aReader.Shape(i);
if (aShape.IsNull()) {
- // THROW_SALOME_CORBA_EXCEPTION("Null shape in GEOM_Gen_i::ImportStep", SALOME::BAD_PARAM) ;
//return aResShape;
continue;
}
/// \class GeomAlgoAPI_Sewing
/// \ingroup DataAlgo
-/// \brief Allows creation of connected topology (shells) from a set of separate topological elements (faces).
+/// \brief Allows creation of connected topology (shells)
+/// from a set of separate topological elements (faces).
class GeomAlgoAPI_Sewing : public GeomAlgoAPI_MakeShape
{
public:
namespace GeomAlgoAPI_ShapeAPI
{
- //=========================================================================================================
- std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeAPI::makeBox(const double theDx, const double theDy,
- const double theDz) throw (GeomAlgoAPI_Exception)
+ //=======================================================================================
+ std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeAPI::makeBox(
+ const double theDx, const double theDy,
+ const double theDz) throw (GeomAlgoAPI_Exception)
{
GeomAlgoAPI_Box aBoxAlgo(theDx,theDy,theDz);
return aBoxAlgo.shape();
}
- //=========================================================================================================
- std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeAPI::makeBox(std::shared_ptr<GeomAPI_Pnt> theFirstPoint,
- std::shared_ptr<GeomAPI_Pnt> theSecondPoint) throw (GeomAlgoAPI_Exception)
+ //======================================================================================
+ std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeAPI::makeBox(
+ std::shared_ptr<GeomAPI_Pnt> theFirstPoint,
+ std::shared_ptr<GeomAPI_Pnt> theSecondPoint) throw (GeomAlgoAPI_Exception)
{
GeomAlgoAPI_BoxPoints aBoxAlgo(theFirstPoint, theSecondPoint);
/// \param theDy The dimension on Y
/// \param theDz The dimension on Z
/// \return a shape
- static std::shared_ptr<GeomAPI_Shape> makeBox(const double theDx, const double theDy, const double theDz) throw (GeomAlgoAPI_Exception);
+ static std::shared_ptr<GeomAPI_Shape> makeBox(const double theDx, const double theDy,
+ const double theDz) throw (GeomAlgoAPI_Exception);
/// Creates a box using the two points that defined a diagonal.
/// \param theFirstPoint One extermity of the diagonal
/// \param theSecondPoint The other extremity of the diagonal
/// \return a shape
static std::shared_ptr<GeomAPI_Shape> makeBox(std::shared_ptr<GeomAPI_Pnt> theFirstPoint,
- std::shared_ptr<GeomAPI_Pnt> theSecondPoint) throw (GeomAlgoAPI_Exception);
+ std::shared_ptr<GeomAPI_Pnt> theSecondPoint) throw (GeomAlgoAPI_Exception);
};
}
#endif
GeomAPI_Shape::ShapeType aBaseShapeType = theShape->shapeType();
if(aBaseShapeType == GeomAPI_Shape::WIRE) {
aResultShape = theShape->emptyCopied();
- std::shared_ptr<GeomAlgoAPI_MakeShapeCustom> aMakeShapeCustom(new GeomAlgoAPI_MakeShapeCustom());
+ std::shared_ptr<GeomAlgoAPI_MakeShapeCustom>
+ aMakeShapeCustom(new GeomAlgoAPI_MakeShapeCustom());
for(GeomAPI_ShapeIterator anIter(theShape); anIter.more(); anIter.next()) {
GeomShapePtr aSubShape = anIter.current();
GeomShapePtr aSubShapeCopy = aSubShape->emptyCopied();
} else if(aBaseShapeType == GeomAPI_Shape::FACE) {
const TopoDS_Shape& aBaseShape = theShape->impl<TopoDS_Shape>();
BRepBuilderAPI_Copy* aCopyBuilder = new BRepBuilderAPI_Copy(aBaseShape);
- this->appendAlgo(std::shared_ptr<GeomAlgoAPI_MakeShape>(new GeomAlgoAPI_MakeShape(aCopyBuilder)));
+ this->appendAlgo(std::shared_ptr<GeomAlgoAPI_MakeShape>(
+ new GeomAlgoAPI_MakeShape(aCopyBuilder)));
if(!aCopyBuilder->IsDone()) {
return;
}
// Copy sub-shapes from list to new shape.
BRep_Builder aBuilder;
std::shared_ptr<GeomAlgoAPI_MakeShapeCustom> aMakeShapeCustom(new GeomAlgoAPI_MakeShapeCustom());
- for(ListOfShape::const_iterator anIt = theShapesToAdd.cbegin(); anIt != theShapesToAdd.cend(); ++anIt) {
+ for(ListOfShape::const_iterator
+ anIt = theShapesToAdd.cbegin(); anIt != theShapesToAdd.cend(); ++anIt) {
TopoDS_Shape aShapeToAdd = (*anIt)->impl<TopoDS_Shape>();
TopoDS_Shape aModShapeToAdd = aShapeToAdd;
aModShapeToAdd.Orientation(TopAbs_INTERNAL);
if(aBaseShapeType == TopAbs_WIRE) {
if(aShapeToAddType == TopAbs_VERTEX) {
// Find on which edge vertex is lie and add to this edge.
- for(TopExp_Explorer aResultExp(aResultShape, TopAbs_EDGE); aResultExp.More(); aResultExp.Next()) {
+ for(TopExp_Explorer
+ aResultExp(aResultShape, TopAbs_EDGE); aResultExp.More(); aResultExp.Next()) {
TopoDS_Shape anEdge = aResultExp.Current();
BRepExtrema_DistShapeShape aDist(anEdge, aShapeToAdd);
aDist.Perform();
}
//==================================================================================================
-std::shared_ptr<GeomAPI_Pnt> GeomAlgoAPI_ShapeTools::centreOfMass(const std::shared_ptr<GeomAPI_Shape> theShape)
+std::shared_ptr<GeomAPI_Pnt>
+ GeomAlgoAPI_ShapeTools::centreOfMass(const std::shared_ptr<GeomAPI_Shape> theShape)
{
GProp_GProps aGProps;
if(!theShape) {
}
//==================================================================================================
-std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeTools::combineShapes(const std::shared_ptr<GeomAPI_Shape> theCompound,
- const GeomAPI_Shape::ShapeType theType,
- ListOfShape& theCombinedShapes,
- ListOfShape& theFreeShapes)
+std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeTools::combineShapes(
+ const std::shared_ptr<GeomAPI_Shape> theCompound,
+ const GeomAPI_Shape::ShapeType theType,
+ ListOfShape& theCombinedShapes,
+ ListOfShape& theFreeShapes)
{
GeomShapePtr aResult = theCompound;
// Get all shapes with common subshapes and free shapes.
NCollection_Map<TopoDS_Shape> aFreeShapes;
NCollection_Vector<NCollection_Map<TopoDS_Shape>> aShapesWithCommonSubshapes;
- for(BOPCol_IndexedDataMapOfShapeListOfShape::Iterator anIter(aMapSA); anIter.More(); anIter.Next()) {
+ for(BOPCol_IndexedDataMapOfShapeListOfShape::Iterator
+ anIter(aMapSA); anIter.More(); anIter.Next()) {
const TopoDS_Shape& aShape = anIter.Key();
BOPCol_ListOfShape& aListOfShape = anIter.ChangeValue();
if(aListOfShape.IsEmpty()) {
aFreeShapes.Remove(aF);
aFreeShapes.Remove(aL);
aListOfShape.Clear();
- for(NCollection_List<TopoDS_Shape>::Iterator aTempIter(aTempList); aTempIter.More(); aTempIter.Next()) {
+ for(NCollection_List<TopoDS_Shape>::Iterator
+ aTempIter(aTempList); aTempIter.More(); aTempIter.Next()) {
const TopoDS_Shape& aTempShape = aTempIter.Value();
- for(BOPCol_IndexedDataMapOfShapeListOfShape::Iterator anIter(aMapSA); anIter.More(); anIter.Next()) {
+ for(BOPCol_IndexedDataMapOfShapeListOfShape::Iterator
+ anIter(aMapSA); anIter.More(); anIter.Next()) {
BOPCol_ListOfShape& aTempListOfShape = anIter.ChangeValue();
if(aTempListOfShape.IsEmpty()) {
continue;
}
// Combine shapes with common subshapes.
- for(NCollection_Vector<NCollection_Map<TopoDS_Shape>>::Iterator anIter(aShapesWithCommonSubshapes); anIter.More(); anIter.Next()) {
+ for(NCollection_Vector<NCollection_Map<TopoDS_Shape>>::Iterator
+ anIter(aShapesWithCommonSubshapes); anIter.More(); anIter.Next()) {
TopoDS_Shell aShell;
TopoDS_CompSolid aCSolid;
TopoDS_Builder aBuilder;
- theType == GeomAPI_Shape::COMPSOLID ? aBuilder.MakeCompSolid(aCSolid) : aBuilder.MakeShell(aShell);
+ theType ==
+ GeomAPI_Shape::COMPSOLID ? aBuilder.MakeCompSolid(aCSolid) : aBuilder.MakeShell(aShell);
NCollection_Map<TopoDS_Shape>& aShapesMap = anIter.ChangeValue();
for(TopExp_Explorer anExp(aShapesComp, aTA); anExp.More(); anExp.Next()) {
const TopoDS_Shape& aShape = anExp.Current();
if(aShapesMap.Contains(aShape)) {
- theType == GeomAPI_Shape::COMPSOLID ? aBuilder.Add(aCSolid, aShape) : aBuilder.Add(aShell, aShape);
+ theType ==
+ GeomAPI_Shape::COMPSOLID ? aBuilder.Add(aCSolid, aShape) : aBuilder.Add(aShell, aShape);
aShapesMap.Remove(aShape);
}
}
std::shared_ptr<GeomAPI_Shape> aGeomShape(new GeomAPI_Shape);
- TopoDS_Shape* aSh = theType == GeomAPI_Shape::COMPSOLID ? new TopoDS_Shape(aCSolid) : new TopoDS_Shape(aShell);
+ TopoDS_Shape* aSh = theType == GeomAPI_Shape::COMPSOLID ? new TopoDS_Shape(aCSolid) :
+ new TopoDS_Shape(aShell);
aGeomShape->setImpl<TopoDS_Shape>(aSh);
theCombinedShapes.push_back(aGeomShape);
}
TopoDS_Compound aResultComp;
TopoDS_Builder aBuilder;
aBuilder.MakeCompound(aResultComp);
- for(ListOfShape::const_iterator anIter = theCombinedShapes.cbegin(); anIter != theCombinedShapes.cend(); anIter++) {
+ for(ListOfShape::const_iterator anIter = theCombinedShapes.cbegin();
+ anIter != theCombinedShapes.cend(); anIter++) {
aBuilder.Add(aResultComp, (*anIter)->impl<TopoDS_Shape>());
}
- for(ListOfShape::const_iterator anIter = theFreeShapes.cbegin(); anIter != theFreeShapes.cend(); anIter++) {
+ for(ListOfShape::const_iterator anIter = theFreeShapes.cbegin();
+ anIter != theFreeShapes.cend(); anIter++) {
aBuilder.Add(aResultComp, (*anIter)->impl<TopoDS_Shape>());
}
aResult->setImpl(new TopoDS_Shape(aResultComp));
}
//==================================================================================================
-static void addSimpleShapeToList(const TopoDS_Shape& theShape, NCollection_List<TopoDS_Shape>& theList)
+static void addSimpleShapeToList(const TopoDS_Shape& theShape,
+ NCollection_List<TopoDS_Shape>& theList)
{
if(theShape.IsNull()) {
return;
}
//==================================================================================================
-std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeTools::groupSharedTopology(const std::shared_ptr<GeomAPI_Shape> theCompound)
+std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeTools::groupSharedTopology(
+ const std::shared_ptr<GeomAPI_Shape> theCompound)
{
GeomShapePtr aResult = theCompound;
NCollection_List<TopoDS_Shape> aGroupedShapes;
aGroupedShapes.Append(anUngroupedShapes.First());
anUngroupedShapes.RemoveFirst();
- for(NCollection_List<TopoDS_Shape>::Iterator aGroupIt(aGroupedShapes); aGroupIt.More(); aGroupIt.Next()) {
+ for(NCollection_List<TopoDS_Shape>::Iterator aGroupIt(aGroupedShapes);
+ aGroupIt.More(); aGroupIt.Next()) {
const TopoDS_Shape& aGroupShape = aGroupIt.Value();
- for(NCollection_List<TopoDS_Shape>::Iterator anUngroupedIt(anUngroupedShapes); anUngroupedIt.More(); anUngroupedIt.Next()) {
+ for(NCollection_List<TopoDS_Shape>::Iterator anUngroupedIt(anUngroupedShapes);
+ anUngroupedIt.More(); anUngroupedIt.Next()) {
const TopoDS_Shape& anUngroupedShape = anUngroupedIt.Value();
bool isFound = false;
- for(TopExp_Explorer aGroupShapeExp(aGroupShape, TopAbs_VERTEX); aGroupShapeExp.More(); aGroupShapeExp.Next()) {
+ for(TopExp_Explorer aGroupShapeExp(aGroupShape, TopAbs_VERTEX);
+ aGroupShapeExp.More(); aGroupShapeExp.Next()) {
const TopoDS_Shape& aVertex1 = aGroupShapeExp.Current();
- for(TopExp_Explorer anUngroupedShapeExp(anUngroupedShape, TopAbs_VERTEX); anUngroupedShapeExp.More(); anUngroupedShapeExp.Next()) {
+ for(TopExp_Explorer anUngroupedShapeExp(anUngroupedShape, TopAbs_VERTEX);
+ anUngroupedShapeExp.More(); anUngroupedShapeExp.Next()) {
const TopoDS_Shape& aVertex2 = anUngroupedShapeExp.Current();
if(aVertex1.IsSame(aVertex2)) {
aGroupedShapes.Append(anUngroupedShape);
BRep_Builder aBuilder;
aBuilder.MakeCompound(aCompound);
ListOfShape aCompSolids, aFreeSolids;
- for(NCollection_Vector<NCollection_List<TopoDS_Shape>>::Iterator anIt(aGroups); anIt.More(); anIt.Next()) {
+ for(NCollection_Vector<NCollection_List<TopoDS_Shape>>::Iterator
+ anIt(aGroups); anIt.More(); anIt.Next()) {
NCollection_List<TopoDS_Shape> aGroup = anIt.Value();
GeomShapePtr aGeomShape(new GeomAPI_Shape());
if(aGroup.Size() == 1) {
}
//==================================================================================================
-std::list<std::shared_ptr<GeomAPI_Pnt> > GeomAlgoAPI_ShapeTools::getBoundingBox(const ListOfShape& theShapes, const double theEnlarge)
+std::list<std::shared_ptr<GeomAPI_Pnt> >
+ GeomAlgoAPI_ShapeTools::getBoundingBox(const ListOfShape& theShapes, const double theEnlarge)
{
// Bounding box of all objects.
Bnd_Box aBndBox;
// Getting box.
- for (ListOfShape::const_iterator anObjectsIt = theShapes.begin(); anObjectsIt != theShapes.end(); anObjectsIt++) {
+ for (ListOfShape::const_iterator
+ anObjectsIt = theShapes.begin(); anObjectsIt != theShapes.end(); anObjectsIt++) {
const TopoDS_Shape& aShape = (*anObjectsIt)->impl<TopoDS_Shape>();
BRepBndLib::Add(aShape, aBndBox);
}
}
//==================================================================================================
-std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeTools::faceToInfinitePlane(const std::shared_ptr<GeomAPI_Shape> theFace)
+std::shared_ptr<GeomAPI_Shape>
+ GeomAlgoAPI_ShapeTools::faceToInfinitePlane(const std::shared_ptr<GeomAPI_Shape> theFace)
{
if (!theFace.get())
return std::shared_ptr<GeomAPI_Shape>();
}
//==================================================================================================
-std::shared_ptr<GeomAPI_Face> GeomAlgoAPI_ShapeTools::fitPlaneToBox(const std::shared_ptr<GeomAPI_Shape> thePlane,
- const std::list<std::shared_ptr<GeomAPI_Pnt> >& thePoints)
+std::shared_ptr<GeomAPI_Face> GeomAlgoAPI_ShapeTools::fitPlaneToBox(
+ const std::shared_ptr<GeomAPI_Shape> thePlane,
+ const std::list<std::shared_ptr<GeomAPI_Pnt> >& thePoints)
{
std::shared_ptr<GeomAPI_Face> aResultFace;
IntAna_Quadric aQuadric(aFacePln);
Standard_Real UMin, UMax, VMin, VMax;
UMin = UMax = VMin = VMax = 0;
- for (std::list<std::shared_ptr<GeomAPI_Pnt> >::const_iterator aPointsIt = thePoints.begin(); aPointsIt != thePoints.end(); aPointsIt++) {
+ for (std::list<std::shared_ptr<GeomAPI_Pnt> >::const_iterator
+ aPointsIt = thePoints.begin(); aPointsIt != thePoints.end(); aPointsIt++) {
const gp_Pnt& aPnt = (*aPointsIt)->impl<gp_Pnt>();
gp_Lin aLin(aPnt, aFacePln.Axis().Direction());
IntAna_IntConicQuad anIntAna(aLin, aQuadric);
}
//==================================================================================================
-bool GeomAlgoAPI_ShapeTools::isSubShapeInsideShape(const std::shared_ptr<GeomAPI_Shape> theSubShape,
- const std::shared_ptr<GeomAPI_Shape> theBaseShape)
+bool GeomAlgoAPI_ShapeTools::isSubShapeInsideShape(
+ const std::shared_ptr<GeomAPI_Shape> theSubShape,
+ const std::shared_ptr<GeomAPI_Shape> theBaseShape)
{
if(!theSubShape.get() || !theBaseShape.get()) {
return false;
// No intersections found. Edge is inside or outside face. Check it.
BRepAdaptor_Curve aCurveAdaptor(anEdge);
- gp_Pnt aPointToCheck = aCurveAdaptor.Value((aCurveAdaptor.FirstParameter() + aCurveAdaptor.LastParameter()) / 2.0);
+ gp_Pnt aPointToCheck =
+ aCurveAdaptor.Value((aCurveAdaptor.FirstParameter() +
+ aCurveAdaptor.LastParameter()) / 2.0);
Handle(Geom_Surface) aSurface = BRep_Tool::Surface(aFace);
ShapeAnalysis_Surface aSAS(aSurface);
gp_Pnt2d aPointOnFace = aSAS.ValueOfUV(aPointToCheck, Precision::Confusion());
}
//==================================================================================================
-std::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_ShapeTools::getFaceOuterWire(const std::shared_ptr<GeomAPI_Shape> theFace)
+std::shared_ptr<GeomAPI_Shape>
+ GeomAlgoAPI_ShapeTools::getFaceOuterWire(const std::shared_ptr<GeomAPI_Shape> theFace)
{
GeomShapePtr anOuterWire;
/// \return the total volume of the solids of the current shape or 0.0 if it can be computed.
GEOMALGOAPI_EXPORT static double volume(const std::shared_ptr<GeomAPI_Shape> theShape);
- /// \return the centre of mass of the current face. The coordinates returned for the center of mass
- /// are expressed in the absolute Cartesian coordinate system. (This function works only for surfaces).
- GEOMALGOAPI_EXPORT static std::shared_ptr<GeomAPI_Pnt> centreOfMass(const std::shared_ptr<GeomAPI_Shape> theShape);
+ /// \return the centre of mass of the current face.
+ /// The coordinates returned for the center of mass
+ /// are expressed in the absolute Cartesian coordinate system.
+ /// (This function works only for surfaces).
+ GEOMALGOAPI_EXPORT static std::shared_ptr<GeomAPI_Pnt>
+ centreOfMass(const std::shared_ptr<GeomAPI_Shape> theShape);
/// \brief Combines faces with common edges to shells, or solids to compsolids.
/// \param[in] theCompound compound of shapes.
/// \param[in] theType type of combine.
/// \param[out] theCombinedShapes resulting shapes.
/// \param[out] theFreeShapes shapes that does not have common subshapes.
- GEOMALGOAPI_EXPORT static std::shared_ptr<GeomAPI_Shape> combineShapes(const std::shared_ptr<GeomAPI_Shape> theCompound,
- const GeomAPI_Shape::ShapeType theType,
- ListOfShape& theCombinedShapes,
- ListOfShape& theFreeShapes);
+ GEOMALGOAPI_EXPORT static std::shared_ptr<GeomAPI_Shape> combineShapes(
+ const std::shared_ptr<GeomAPI_Shape> theCompound,
+ const GeomAPI_Shape::ShapeType theType,
+ ListOfShape& theCombinedShapes,
+ ListOfShape& theFreeShapes);
/// \brief Groups shapes with shared topology to compounds.
/// \param[in] theCompound compound of shapes.
/// \return compound of compounds with shared topology.
- GEOMALGOAPI_EXPORT static std::shared_ptr<GeomAPI_Shape> groupSharedTopology(const std::shared_ptr<GeomAPI_Shape> theCompound);
+ GEOMALGOAPI_EXPORT static std::shared_ptr<GeomAPI_Shape>
+ groupSharedTopology(const std::shared_ptr<GeomAPI_Shape> theCompound);
/// \brief Calculates bounding box for theShapes
/// \return list of eight points.
/// \param[in] theShapes list of shapes.
/// \param[in] theEnlarge enlarges bounding box size.
- GEOMALGOAPI_EXPORT static std::list<std::shared_ptr<GeomAPI_Pnt> > getBoundingBox(const ListOfShape& theShapes, const double theEnlarge = 0.0);
+ GEOMALGOAPI_EXPORT static
+ std::list<std::shared_ptr<GeomAPI_Pnt> > getBoundingBox(const ListOfShape& theShapes,
+ const double theEnlarge = 0.0);
/// \return infinite plane received from theFace plane.
- GEOMALGOAPI_EXPORT static std::shared_ptr<GeomAPI_Shape> faceToInfinitePlane(const std::shared_ptr<GeomAPI_Shape> theFace);
+ GEOMALGOAPI_EXPORT static std::shared_ptr<GeomAPI_Shape>
+ faceToInfinitePlane(const std::shared_ptr<GeomAPI_Shape> theFace);
/// \brief Enlarges or reduces plane to fit bounding box.
/// \return plane that fits to bounding box.
/// \param[in] thePlane base plane.
/// \param[in] thePoints bounding box points (shoud be eight).
- GEOMALGOAPI_EXPORT static std::shared_ptr<GeomAPI_Face> fitPlaneToBox(const std::shared_ptr<GeomAPI_Shape> thePlane,
- const std::list<std::shared_ptr<GeomAPI_Pnt> >& thePoints);
+ GEOMALGOAPI_EXPORT static std::shared_ptr<GeomAPI_Face> fitPlaneToBox(
+ const std::shared_ptr<GeomAPI_Shape> thePlane,
+ const std::list<std::shared_ptr<GeomAPI_Pnt> >& thePoints);
/// \brief Finds the start and end vertices of theShape. theShape can be of the following type:\n
/// Vertex: theV1 and theV2 are the same and equal to theShape;\n
/// \param[in] theWires base wires.
/// \param[out] theFaces resulting faces.
GEOMALGOAPI_EXPORT static void makeFacesWithHoles(const std::shared_ptr<GeomAPI_Pnt> theOrigin,
- const std::shared_ptr<GeomAPI_Dir> theDirection,
- const ListOfShape& theWires,
- ListOfShape& theFaces);
+ const std::shared_ptr<GeomAPI_Dir> theDirection,
+ const ListOfShape& theWires,
+ ListOfShape& theFaces);
/// \brief Return a plane for list of shapes if they are all planar.
/// \param[in] theShapes shapes to find plane.
/// \param[in] theSubShape shape that should be inside.
/// \param[in] theBaseShape base shape.
/// \return true if edge inside the face.
- GEOMALGOAPI_EXPORT static bool isSubShapeInsideShape(const std::shared_ptr<GeomAPI_Shape> theSubShape,
- const std::shared_ptr<GeomAPI_Shape> theBaseShape);
+ GEOMALGOAPI_EXPORT static bool isSubShapeInsideShape(
+ const std::shared_ptr<GeomAPI_Shape> theSubShape,
+ const std::shared_ptr<GeomAPI_Shape> theBaseShape);
/// \return true if theShape is valid.
GEOMALGOAPI_EXPORT static bool isShapeValid(const std::shared_ptr<GeomAPI_Shape> theShape);
/// \return outer wire for face. If theShape has different type returns empty pointer.
- GEOMALGOAPI_EXPORT static std::shared_ptr<GeomAPI_Shape> getFaceOuterWire(const std::shared_ptr<GeomAPI_Shape> theFace);
+ GEOMALGOAPI_EXPORT static
+ std::shared_ptr<GeomAPI_Shape> getFaceOuterWire(const std::shared_ptr<GeomAPI_Shape> theFace);
/// \return true if edge is parallel to face.
GEOMALGOAPI_EXPORT static bool isParallel(const std::shared_ptr<GeomAPI_Edge> theEdge,
/// \param[in] thePoints container of points to split
/// \param[out] theShapes container of shapes after split
GEOMALGOAPI_EXPORT static void splitShape(const std::shared_ptr<GeomAPI_Shape>& theBaseShape,
- const std::list<std::shared_ptr<GeomAPI_Pnt> >& thePoints,
- std::set<std::shared_ptr<GeomAPI_Shape> >& theShapes);
+ const std::list<std::shared_ptr<GeomAPI_Pnt> >& thePoints,
+ std::set<std::shared_ptr<GeomAPI_Shape> >& theShapes);
GEOMALGOAPI_EXPORT static std::shared_ptr<GeomAPI_Shape> findShape(
- const std::list<std::shared_ptr<GeomAPI_Pnt> >& thePoints,
- const std::set<std::shared_ptr<GeomAPI_Shape> >& theShapes);
+ const std::list<std::shared_ptr<GeomAPI_Pnt> >& thePoints,
+ const std::set<std::shared_ptr<GeomAPI_Shape> >& theShapes);
};
const std::shared_ptr<GeomAPI_Dir>& theDirX,
const std::shared_ptr<GeomAPI_Dir>& theNorm,
const std::shared_ptr<GeomAPI_Shape>& theWire,
- std::list<std::shared_ptr<GeomAPI_Shape> >& theResultFaces)
+ std::list<std::shared_ptr<GeomAPI_Shape> >& theResultFaces)
{
std::shared_ptr<GeomAPI_PlanarEdges> aWire =
std::dynamic_pointer_cast<GeomAPI_PlanarEdges>(theWire);
public:
/// \brief Creates a wire from edges and wires.
/// \param[in] theShapes list of shapes. Only edges and wires allowed.
- /// The edges are not to be consecutive. But they are to be all connected geometrically or topologically.
+ /// The edges are not to be consecutive.
+ /// But they are to be all connected geometrically or topologically.
/// \return wire created from theShapes. Empty in case of error or bad input.
GEOMALGOAPI_EXPORT static std::shared_ptr<GeomAPI_Shape> wire(const ListOfShape& theShapes);
};