From fbfcc4fd956a374c8d380c2da280c61eaa57bcfd Mon Sep 17 00:00:00 2001 From: dbv Date: Tue, 8 Sep 2015 16:05:54 +0300 Subject: [PATCH] Code clean up --- src/FeaturesPlugin/CMakeLists.txt | 6 +- src/FeaturesPlugin/FeaturesPlugin_Plugin.cpp | 6 +- ...ent.cpp => FeaturesPlugin_Translation.cpp} | 26 ++-- ...ovement.h => FeaturesPlugin_Translation.h} | 18 +-- .../{TestMovement.py => TestTranslation.py} | 0 src/GeomAPI/GeomAPI_Ax3.cpp | 4 +- src/GeomAPI/GeomAPI_Ax3.h | 4 +- src/GeomAPI/GeomAPI_PlanarEdges.cpp | 2 +- src/GeomAlgoAPI/CMakeLists.txt | 6 +- src/GeomAlgoAPI/GeomAlgoAPI.i | 6 +- src/GeomAlgoAPI/GeomAlgoAPI_Extrusion.cpp | 138 ------------------ src/GeomAlgoAPI/GeomAlgoAPI_Extrusion.h | 73 --------- ...vement.cpp => GeomAlgoAPI_Translation.cpp} | 20 +-- ...I_Movement.h => GeomAlgoAPI_Translation.h} | 12 +- src/SketcherPrs/SketcherPrs_PositionMgr.cpp | 2 +- src/SketcherPrs/SketcherPrs_Radius.cpp | 2 +- 16 files changed, 55 insertions(+), 270 deletions(-) rename src/FeaturesPlugin/{FeaturesPlugin_Movement.cpp => FeaturesPlugin_Translation.cpp} (83%) rename src/FeaturesPlugin/{FeaturesPlugin_Movement.h => FeaturesPlugin_Translation.h} (78%) rename src/FeaturesPlugin/Test/{TestMovement.py => TestTranslation.py} (100%) delete mode 100644 src/GeomAlgoAPI/GeomAlgoAPI_Extrusion.cpp delete mode 100644 src/GeomAlgoAPI/GeomAlgoAPI_Extrusion.h rename src/GeomAlgoAPI/{GeomAlgoAPI_Movement.cpp => GeomAlgoAPI_Translation.cpp} (83%) rename src/GeomAlgoAPI/{GeomAlgoAPI_Movement.h => GeomAlgoAPI_Translation.h} (89%) diff --git a/src/FeaturesPlugin/CMakeLists.txt b/src/FeaturesPlugin/CMakeLists.txt index c475ee87d..b7cbad1ba 100644 --- a/src/FeaturesPlugin/CMakeLists.txt +++ b/src/FeaturesPlugin/CMakeLists.txt @@ -9,7 +9,7 @@ SET(PROJECT_HEADERS FeaturesPlugin_Extrusion.h FeaturesPlugin_Revolution.h FeaturesPlugin_Rotation.h - FeaturesPlugin_Movement.h + FeaturesPlugin_Translation.h FeaturesPlugin_Boolean.h FeaturesPlugin_Group.h FeaturesPlugin_Partition.h @@ -28,7 +28,7 @@ SET(PROJECT_SOURCES FeaturesPlugin_Extrusion.cpp FeaturesPlugin_Revolution.cpp FeaturesPlugin_Rotation.cpp - FeaturesPlugin_Movement.cpp + FeaturesPlugin_Translation.cpp FeaturesPlugin_Boolean.cpp FeaturesPlugin_Group.cpp FeaturesPlugin_Partition.cpp @@ -86,7 +86,7 @@ ADD_UNIT_TESTS(TestExtrusion.py TestRevolutionCut.py TestRevolutionFuse.py TestPartition.py - TestMovement.py + TestTranslation.py TestRotation.py TestBoolean.py TestMultiBoolean.py diff --git a/src/FeaturesPlugin/FeaturesPlugin_Plugin.cpp b/src/FeaturesPlugin/FeaturesPlugin_Plugin.cpp index d3d243a4a..c8ab834cc 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Plugin.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Plugin.cpp @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include #include #include @@ -40,8 +40,8 @@ FeaturePtr FeaturesPlugin_Plugin::createFeature(string theFeatureID) return FeaturePtr(new FeaturesPlugin_Revolution); } else if (theFeatureID == FeaturesPlugin_Rotation::ID()) { return FeaturePtr(new FeaturesPlugin_Rotation); - } else if (theFeatureID == FeaturesPlugin_Movement::ID()) { - return FeaturePtr(new FeaturesPlugin_Movement); + } else if (theFeatureID == FeaturesPlugin_Translation::ID()) { + return FeaturePtr(new FeaturesPlugin_Translation); } else if (theFeatureID == FeaturesPlugin_Boolean::ID()) { return FeaturePtr(new FeaturesPlugin_Boolean); } else if (theFeatureID == FeaturesPlugin_Group::ID()) { diff --git a/src/FeaturesPlugin/FeaturesPlugin_Movement.cpp b/src/FeaturesPlugin/FeaturesPlugin_Translation.cpp similarity index 83% rename from src/FeaturesPlugin/FeaturesPlugin_Movement.cpp rename to src/FeaturesPlugin/FeaturesPlugin_Translation.cpp index ebe2eb808..d1ff455a2 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Movement.cpp +++ b/src/FeaturesPlugin/FeaturesPlugin_Translation.cpp @@ -1,10 +1,10 @@ // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -// File: FeaturesPlugin_Movement.cpp +// File: FeaturesPlugin_Translation.cpp // Created: 8 June 2015 // Author: Dmitry Bobylev -#include +#include #include #include @@ -17,30 +17,30 @@ #include //================================================================================================= -FeaturesPlugin_Movement::FeaturesPlugin_Movement() +FeaturesPlugin_Translation::FeaturesPlugin_Translation() { } //================================================================================================= -void FeaturesPlugin_Movement::initAttributes() +void FeaturesPlugin_Translation::initAttributes() { AttributeSelectionListPtr aSelection = std::dynamic_pointer_cast(data()->addAttribute( - FeaturesPlugin_Movement::OBJECTS_LIST_ID(), ModelAPI_AttributeSelectionList::typeId())); + FeaturesPlugin_Translation::OBJECTS_LIST_ID(), ModelAPI_AttributeSelectionList::typeId())); // revolution works with faces always aSelection->setSelectionType("SOLID"); - data()->addAttribute(FeaturesPlugin_Movement::AXIS_OBJECT_ID(), ModelAPI_AttributeSelection::typeId()); - data()->addAttribute(FeaturesPlugin_Movement::DISTANCE_ID(), ModelAPI_AttributeDouble::typeId()); + data()->addAttribute(FeaturesPlugin_Translation::AXIS_OBJECT_ID(), ModelAPI_AttributeSelection::typeId()); + data()->addAttribute(FeaturesPlugin_Translation::DISTANCE_ID(), ModelAPI_AttributeDouble::typeId()); } //================================================================================================= -void FeaturesPlugin_Movement::execute() +void FeaturesPlugin_Translation::execute() { // Getting objects. ListOfShape anObjects; std::list aContextes; - AttributeSelectionListPtr anObjectsSelList = selectionList(FeaturesPlugin_Movement::OBJECTS_LIST_ID()); + AttributeSelectionListPtr anObjectsSelList = selectionList(FeaturesPlugin_Translation::OBJECTS_LIST_ID()); if (anObjectsSelList->size() == 0) { return; } @@ -57,7 +57,7 @@ void FeaturesPlugin_Movement::execute() //Getting axis. std::shared_ptr anAxis; std::shared_ptr anEdge; - std::shared_ptr anObjRef = selection(FeaturesPlugin_Movement::AXIS_OBJECT_ID()); + std::shared_ptr anObjRef = selection(FeaturesPlugin_Translation::AXIS_OBJECT_ID()); if(anObjRef && anObjRef->value() && anObjRef->value()->isEdge()) { anEdge = std::shared_ptr(new GeomAPI_Edge(anObjRef->value())); } else if (anObjRef && !anObjRef->value() && anObjRef->context() && @@ -69,7 +69,7 @@ void FeaturesPlugin_Movement::execute() } // Getting distance. - double aDistance = real(FeaturesPlugin_Movement::DISTANCE_ID())->value(); + double aDistance = real(FeaturesPlugin_Translation::DISTANCE_ID())->value(); // Moving each object. int aResultIndex = 0; @@ -78,7 +78,7 @@ void FeaturesPlugin_Movement::execute() anObjectsIt++, aContext++) { std::shared_ptr aBaseShape = *anObjectsIt; bool isPart = (*aContext)->groupName() == ModelAPI_ResultPart::group(); - GeomAlgoAPI_Movement aMovementAlgo(aBaseShape, anAxis, aDistance, isPart); + GeomAlgoAPI_Translation aMovementAlgo(aBaseShape, anAxis, aDistance, isPart); // Checking that the algorithm worked properly. if(!aMovementAlgo.isDone()) { @@ -115,7 +115,7 @@ void FeaturesPlugin_Movement::execute() removeResults(aResultIndex); } -void FeaturesPlugin_Movement::LoadNamingDS(const GeomAlgoAPI_Movement& theMovementAlgo, +void FeaturesPlugin_Translation::LoadNamingDS(const GeomAlgoAPI_Translation& theMovementAlgo, std::shared_ptr theResultBody, std::shared_ptr theBaseShape) { diff --git a/src/FeaturesPlugin/FeaturesPlugin_Movement.h b/src/FeaturesPlugin/FeaturesPlugin_Translation.h similarity index 78% rename from src/FeaturesPlugin/FeaturesPlugin_Movement.h rename to src/FeaturesPlugin/FeaturesPlugin_Translation.h index 27e4becfb..2f6ce2d92 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Movement.h +++ b/src/FeaturesPlugin/FeaturesPlugin_Translation.h @@ -1,23 +1,23 @@ // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -// File: FeaturesPlugin_Movement.h +// File: FeaturesPlugin_Translation.h // Created: 8 June 2015 // Author: Dmitry Bobylev -#ifndef FeaturesPlugin_Movement_H_ -#define FeaturesPlugin_Movement_H_ +#ifndef FeaturesPlugin_Translation_H_ +#define FeaturesPlugin_Translation_H_ #include #include -#include +#include -/** \class FeaturesPlugin_Movement +/** \class FeaturesPlugin_Translation * \ingroup Plugins * \brief Feature for movement objects along the axis. */ -class FeaturesPlugin_Movement : public ModelAPI_Feature +class FeaturesPlugin_Translation : public ModelAPI_Feature { public: /// Movement kind. @@ -51,7 +51,7 @@ class FeaturesPlugin_Movement : public ModelAPI_Feature /// \return the kind of a feature. FEATURESPLUGIN_EXPORT virtual const std::string& getKind() { - static std::string MY_KIND = FeaturesPlugin_Movement::ID(); + static std::string MY_KIND = FeaturesPlugin_Translation::ID(); return MY_KIND; } @@ -62,10 +62,10 @@ class FeaturesPlugin_Movement : public ModelAPI_Feature FEATURESPLUGIN_EXPORT virtual void initAttributes(); /// Use plugin manager for features creation. - FeaturesPlugin_Movement(); + FeaturesPlugin_Translation(); private: - void LoadNamingDS(const GeomAlgoAPI_Movement& theMovementAlgo, + void LoadNamingDS(const GeomAlgoAPI_Translation& theMovementAlgo, std::shared_ptr theResultBody, std::shared_ptr theBaseShape); }; diff --git a/src/FeaturesPlugin/Test/TestMovement.py b/src/FeaturesPlugin/Test/TestTranslation.py similarity index 100% rename from src/FeaturesPlugin/Test/TestMovement.py rename to src/FeaturesPlugin/Test/TestTranslation.py diff --git a/src/GeomAPI/GeomAPI_Ax3.cpp b/src/GeomAPI/GeomAPI_Ax3.cpp index 0ff482b85..7dd2632ce 100644 --- a/src/GeomAPI/GeomAPI_Ax3.cpp +++ b/src/GeomAPI/GeomAPI_Ax3.cpp @@ -67,14 +67,14 @@ std::shared_ptr GeomAPI_Ax3::dirY() const return std::shared_ptr(new GeomAPI_Dir(aDir.X(), aDir.Y(), aDir.Z())); } -void GeomAPI_Ax3::setNorm(const std::shared_ptr& theNorm) +void GeomAPI_Ax3::setNormal(const std::shared_ptr& theNorm) { gp_Ax1 aAx1 = MY_AX3->Axis(); aAx1.SetDirection(theNorm->impl()); MY_AX3->SetAxis(aAx1); } -std::shared_ptr GeomAPI_Ax3::norm() const +std::shared_ptr GeomAPI_Ax3::normal() const { gp_Dir aDir = MY_AX3->Axis().Direction(); return std::shared_ptr(new GeomAPI_Dir(aDir.X(),aDir.Y(),aDir.Z())); diff --git a/src/GeomAPI/GeomAPI_Ax3.h b/src/GeomAPI/GeomAPI_Ax3.h index df7ef774d..613513a46 100644 --- a/src/GeomAPI/GeomAPI_Ax3.h +++ b/src/GeomAPI/GeomAPI_Ax3.h @@ -58,11 +58,11 @@ public: /// Sets Z direction vector GEOMAPI_EXPORT - void setNorm(const std::shared_ptr& theNorm); + void setNormal(const std::shared_ptr& theNorm); /// Returns Z direction vector GEOMAPI_EXPORT - std::shared_ptr norm() const; + std::shared_ptr normal() const; /// Converts 2d coordinates from the plane to 3d space point /// \param theX X coordinate diff --git a/src/GeomAPI/GeomAPI_PlanarEdges.cpp b/src/GeomAPI/GeomAPI_PlanarEdges.cpp index 619716256..9bb3fb994 100644 --- a/src/GeomAPI/GeomAPI_PlanarEdges.cpp +++ b/src/GeomAPI/GeomAPI_PlanarEdges.cpp @@ -87,7 +87,7 @@ std::shared_ptr GeomAPI_PlanarEdges::dirY() const std::shared_ptr GeomAPI_PlanarEdges::norm() const { if (hasPlane()) - return myPlane->norm(); + return myPlane->normal(); return std::shared_ptr(); } diff --git a/src/GeomAlgoAPI/CMakeLists.txt b/src/GeomAlgoAPI/CMakeLists.txt index 9c85cf7bd..fb238e478 100644 --- a/src/GeomAlgoAPI/CMakeLists.txt +++ b/src/GeomAlgoAPI/CMakeLists.txt @@ -13,12 +13,11 @@ SET(PROJECT_HEADERS GeomAlgoAPI_EdgeBuilder.h GeomAlgoAPI_PointBuilder.h GeomAlgoAPI_SketchBuilder.h - GeomAlgoAPI_Extrusion.h GeomAlgoAPI_Prism.h GeomAlgoAPI_Revolution.h GeomAlgoAPI_Boolean.h GeomAlgoAPI_Rotation.h - GeomAlgoAPI_Movement.h + GeomAlgoAPI_Translation.h GeomAlgoAPI_MakeShape.h GeomAlgoAPI_MakeShapeCustom.h GeomAlgoAPI_MakeShapeList.h @@ -43,12 +42,11 @@ SET(PROJECT_SOURCES GeomAlgoAPI_EdgeBuilder.cpp GeomAlgoAPI_PointBuilder.cpp GeomAlgoAPI_SketchBuilder.cpp - GeomAlgoAPI_Extrusion.cpp GeomAlgoAPI_Prism.cpp GeomAlgoAPI_Revolution.cpp GeomAlgoAPI_Boolean.cpp GeomAlgoAPI_Rotation.cpp - GeomAlgoAPI_Movement.cpp + GeomAlgoAPI_Translation.cpp GeomAlgoAPI_MakeShape.cpp GeomAlgoAPI_MakeShapeCustom.cpp GeomAlgoAPI_MakeShapeList.cpp diff --git a/src/GeomAlgoAPI/GeomAlgoAPI.i b/src/GeomAlgoAPI/GeomAlgoAPI.i index 1c1c25283..51817d6c1 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI.i +++ b/src/GeomAlgoAPI/GeomAlgoAPI.i @@ -6,12 +6,11 @@ #include "GeomAlgoAPI_CompoundBuilder.h" #include "GeomAlgoAPI_DFLoader.h" #include "GeomAlgoAPI_EdgeBuilder.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_Translation.h" #include "GeomAlgoAPI_Placement.h" #include "GeomAlgoAPI_PointBuilder.h" #include "GeomAlgoAPI_Prism.h" @@ -48,12 +47,11 @@ %include "GeomAlgoAPI_CompoundBuilder.h" %include "GeomAlgoAPI_DFLoader.h" %include "GeomAlgoAPI_EdgeBuilder.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_Translation.h" %include "GeomAlgoAPI_Placement.h" %include "GeomAlgoAPI_PointBuilder.h" %include "GeomAlgoAPI_Prism.h" diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Extrusion.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_Extrusion.cpp deleted file mode 100644 index eecff212a..000000000 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Extrusion.cpp +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright (C) 2014-20xx CEA/DEN, EDF R&D - -// File: GeomAlgoAPI_Extrusion.cpp -// Created: 06 Jun 2014 -// Author: Artem ZHIDKOV - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -const double tolerance = Precision::Angular(); -// Constructor -GeomAlgoAPI_Extrusion::GeomAlgoAPI_Extrusion( - std::shared_ptr theBasis, double theSize) -: mySize(theSize), myDone(false), myShape(new GeomAPI_Shape()), - myFirst(new GeomAPI_Shape()), myLast(new GeomAPI_Shape()) -{ - build(theBasis); -} - -//============================================================================ -void GeomAlgoAPI_Extrusion::build(const std::shared_ptr& theBasis) -{ - bool isFirstNorm = true; - gp_Dir aShapeNormal; - TopoDS_Face aBasis = TopoDS::Face(theBasis->impl()); - Handle(Geom_Plane) aPlane = Handle(Geom_Plane)::DownCast( - BRep_Tool::Surface(aBasis)); - if (aPlane.IsNull()) // non-planar shapes is not supported for extrusion yet - return; - - const gp_Dir& aNormal = aPlane->Pln().Axis().Direction(); - gp_Vec aVec(aNormal); - aVec = aVec * mySize; - - BRepPrimAPI_MakePrism* aBuilder = new BRepPrimAPI_MakePrism(aBasis, aVec); - if(aBuilder) { - setImpl(aBuilder); - myDone = aBuilder->IsDone() == Standard_True; - if (myDone) { - TopoDS_Shape aResult; - if(aBuilder->Shape().ShapeType() == TopAbs_COMPOUND) - aResult = GeomAlgoAPI_DFLoader::refineResult(aBuilder->Shape()); - else - aResult = aBuilder->Shape(); - // fill data map to keep correct orientation of sub-shapes - for (TopExp_Explorer Exp(aResult,TopAbs_FACE); Exp.More(); Exp.Next()) { - std::shared_ptr aCurrentShape(new GeomAPI_Shape()); - aCurrentShape->setImpl(new TopoDS_Shape(Exp.Current())); - myMap.bind(aCurrentShape, aCurrentShape); - } - myShape->setImpl(new TopoDS_Shape(aResult)); - myFirst->setImpl(new TopoDS_Shape(aBuilder->FirstShape())); - myLast->setImpl(new TopoDS_Shape(aBuilder-> LastShape())); - myMkShape = new GeomAlgoAPI_MakeShape (aBuilder); - } - } -} - -//============================================================================ -const bool GeomAlgoAPI_Extrusion::isDone() const -{return myDone;} - -//============================================================================ -const bool GeomAlgoAPI_Extrusion::isValid() const -{ - BRepCheck_Analyzer aChecker(myShape->impl()); - return (aChecker.IsValid() == Standard_True); -} - -//============================================================================ -const bool GeomAlgoAPI_Extrusion::hasVolume() const -{ - bool hasVolume(false); - if(isValid()) { - const TopoDS_Shape& aRShape = myShape->impl(); - GProp_GProps aGProp; - BRepGProp::VolumeProperties(aRShape, aGProp); - if(aGProp.Mass() > Precision::Confusion()) - hasVolume = true; - } - return hasVolume; -} - -//============================================================================ -const std::shared_ptr& GeomAlgoAPI_Extrusion::shape () const -{ - return myShape; -} - -//============================================================================ -const std::shared_ptr& GeomAlgoAPI_Extrusion::firstShape() -{ - return myFirst; -} - -//============================================================================ -const std::shared_ptr& GeomAlgoAPI_Extrusion::lastShape() -{ - return myLast; -} - -//============================================================================ -void GeomAlgoAPI_Extrusion::mapOfShapes (GeomAPI_DataMapOfShapeShape& theMap) const -{ - theMap = myMap; -} - -//============================================================================ -GeomAlgoAPI_MakeShape * GeomAlgoAPI_Extrusion::makeShape() const -{ - return myMkShape; -} - -//============================================================================ -GeomAlgoAPI_Extrusion::~GeomAlgoAPI_Extrusion() -{ - if (!empty()) { - myMap.clear(); - } -} diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Extrusion.h b/src/GeomAlgoAPI/GeomAlgoAPI_Extrusion.h deleted file mode 100644 index 0ac301469..000000000 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Extrusion.h +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (C) 2014-20xx CEA/DEN, EDF R&D - -// File: GeomAlgoAPI_Extrusion.h -// Created: 22 October 2014 -// Author: Sergey Zaritchny - -#ifndef GeomAlgoAPI_Extrusion_H_ -#define GeomAlgoAPI_Extrusion_H_ - -#include -#include -#include -#include -#include -#include - -/**\class GeomAlgoAPI_Extrusion - * \ingroup DataAlgo - * \brief Allows to create the prism based on a given face and a direction - */ - -class GeomAlgoAPI_Extrusion : public GeomAPI_Interface -{ - public: - - /* \brief Creates extrusion for the given shape along the normal for this shape - * \param[in] theBasis face or wire to be extruded - * \param[in] theSize the length of extrusion (if the value is less than 0, the extrusion in opposite normal) - * \return a solid or a face/shell which is obtained from specified one - */ - /// Constructor - GEOMALGOAPI_EXPORT GeomAlgoAPI_Extrusion (std::shared_ptr theBasis, double theSize); - - /// Returns True if algorithm succeed - GEOMALGOAPI_EXPORT const bool isDone() const; - - /// Returns True if resulting shape is valid - GEOMALGOAPI_EXPORT const bool isValid() const; - - /// Returns True if resulting shape has volume - GEOMALGOAPI_EXPORT const bool hasVolume() const; - - /// Returns result of the Extrusion algorithm which may be a Solid or a Face - GEOMALGOAPI_EXPORT const std::shared_ptr& shape () const; - - /// Returns the first shape - GEOMALGOAPI_EXPORT const std::shared_ptr& firstShape(); - - /// returns last shape - GEOMALGOAPI_EXPORT const std::shared_ptr& lastShape(); - - /// Returns map of sub-shapes of the result. To be used for History keeping - GEOMALGOAPI_EXPORT void mapOfShapes (GeomAPI_DataMapOfShapeShape& theMap) const; - - /// Return interface for for History processing - GEOMALGOAPI_EXPORT GeomAlgoAPI_MakeShape* makeShape () const; - - /// Destructor - GEOMALGOAPI_EXPORT ~GeomAlgoAPI_Extrusion(); -private: - /// builds resulting shape - void build(const std::shared_ptr& theBasis); - /// fields - double mySize; - bool myDone; - std::shared_ptr myShape; - std::shared_ptr myFirst; - std::shared_ptr myLast; - GeomAPI_DataMapOfShapeShape myMap; - GeomAlgoAPI_MakeShape * myMkShape; -}; - -#endif diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Movement.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_Translation.cpp similarity index 83% rename from src/GeomAlgoAPI/GeomAlgoAPI_Movement.cpp rename to src/GeomAlgoAPI/GeomAlgoAPI_Translation.cpp index 9bef39222..b9cc3b690 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Movement.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Translation.cpp @@ -1,10 +1,10 @@ // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -// File: GeomAlgoAPI_Movement.cpp +// File: GeomAlgoAPI_Translation.cpp // Created: 8 June 2015 // Author: Dmitry Bobylev -#include +#include #include @@ -15,7 +15,7 @@ #include //================================================================================================= -GeomAlgoAPI_Movement::GeomAlgoAPI_Movement(std::shared_ptr theSourceShape, +GeomAlgoAPI_Translation::GeomAlgoAPI_Translation(std::shared_ptr theSourceShape, std::shared_ptr theAxis, double theDistance, bool theSimpleTransform) @@ -25,7 +25,7 @@ GeomAlgoAPI_Movement::GeomAlgoAPI_Movement(std::shared_ptr theSou } //================================================================================================= -void GeomAlgoAPI_Movement::build(std::shared_ptr theSourceShape, +void GeomAlgoAPI_Translation::build(std::shared_ptr theSourceShape, std::shared_ptr theAxis, double theDistance, bool theSimpleTransform) @@ -81,14 +81,14 @@ void GeomAlgoAPI_Movement::build(std::shared_ptr theSourceShape, } //================================================================================================= -const bool GeomAlgoAPI_Movement::isValid() const +const bool GeomAlgoAPI_Translation::isValid() const { BRepCheck_Analyzer aChecker(myShape->impl()); return (aChecker.IsValid() == Standard_True); } //================================================================================================= -const bool GeomAlgoAPI_Movement::hasVolume() const +const bool GeomAlgoAPI_Translation::hasVolume() const { bool hasVolume(false); if(isValid() && (GeomAlgoAPI_ShapeTools::volume(myShape) > Precision::Confusion())) { @@ -98,25 +98,25 @@ const bool GeomAlgoAPI_Movement::hasVolume() const } //================================================================================================= -const std::shared_ptr& GeomAlgoAPI_Movement::shape() const +const std::shared_ptr& GeomAlgoAPI_Translation::shape() const { return myShape; } //================================================================================================= -std::shared_ptr GeomAlgoAPI_Movement::mapOfShapes() const +std::shared_ptr GeomAlgoAPI_Translation::mapOfShapes() const { return myMap; } //================================================================================================= -std::shared_ptr GeomAlgoAPI_Movement::makeShape() const +std::shared_ptr GeomAlgoAPI_Translation::makeShape() const { return myMkShape; } //================================================================================================= -std::shared_ptr GeomAlgoAPI_Movement::transformation() const +std::shared_ptr GeomAlgoAPI_Translation::transformation() const { return myTrsf; } diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Movement.h b/src/GeomAlgoAPI/GeomAlgoAPI_Translation.h similarity index 89% rename from src/GeomAlgoAPI/GeomAlgoAPI_Movement.h rename to src/GeomAlgoAPI/GeomAlgoAPI_Translation.h index e3cced35b..95f9c55f7 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Movement.h +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Translation.h @@ -1,11 +1,11 @@ // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -// File: GeomAlgoAPI_Movement.h +// File: GeomAlgoAPI_Translation.h // Created: 8 June 2015 // Author: Dmitry Bobylev -#ifndef GeomAlgoAPI_Movement_H_ -#define GeomAlgoAPI_Movement_H_ +#ifndef GeomAlgoAPI_Translation_H_ +#define GeomAlgoAPI_Translation_H_ #include #include @@ -14,11 +14,11 @@ #include #include -/** \class GeomAlgoAPI_Movement +/** \class GeomAlgoAPI_Translation * \ingroup DataAlgo * \brief Creates a copy of the object by moving it along the axis. */ -class GeomAlgoAPI_Movement : public GeomAPI_Interface +class GeomAlgoAPI_Translation : public GeomAPI_Interface { public: /** \brief Creates an object which is obtained from current object by moving it along the axis. @@ -27,7 +27,7 @@ public: * \param[in] theDistance movement distance. * \param[in] theSimpleTransform makes just transformation of shape without changing of topology or geometry */ - GEOMALGOAPI_EXPORT GeomAlgoAPI_Movement(std::shared_ptr theSourceShape, + GEOMALGOAPI_EXPORT GeomAlgoAPI_Translation(std::shared_ptr theSourceShape, std::shared_ptr theAxis, double theDistance, bool theSimpleTransform = false); diff --git a/src/SketcherPrs/SketcherPrs_PositionMgr.cpp b/src/SketcherPrs/SketcherPrs_PositionMgr.cpp index ec7938b89..842eceba4 100644 --- a/src/SketcherPrs/SketcherPrs_PositionMgr.cpp +++ b/src/SketcherPrs/SketcherPrs_PositionMgr.cpp @@ -88,7 +88,7 @@ gp_Pnt SketcherPrs_PositionMgr::getPosition(ObjectPtr theShape, std::shared_ptr aDir = thePrs->plane()->dirX(); aVec1 = gp_Vec(aDir->impl()); } - gp_Vec aShift = aVec1.Crossed(thePrs->plane()->norm()->impl()); + gp_Vec aShift = aVec1.Crossed(thePrs->plane()->normal()->impl()); aShift.Normalize(); aShift.Multiply(theStep * 0.8); diff --git a/src/SketcherPrs/SketcherPrs_Radius.cpp b/src/SketcherPrs/SketcherPrs_Radius.cpp index 011555ffa..9a1ac1676 100644 --- a/src/SketcherPrs/SketcherPrs_Radius.cpp +++ b/src/SketcherPrs/SketcherPrs_Radius.cpp @@ -83,7 +83,7 @@ void SketcherPrs_Radius::Compute(const Handle(PrsMgr_PresentationManager3d)& the aRadius = aCenterAttr->pnt()->distance(aStartAttr->pnt()); } std::shared_ptr aCenter = myPlane->to3D(aCenterAttr->x(), aCenterAttr->y()); - std::shared_ptr aNormal = myPlane->norm(); + std::shared_ptr aNormal = myPlane->normal(); GeomAPI_Circ aCircle(aCenter, aNormal, aRadius); -- 2.39.2