From 0609d8ee53b0b9d31dd49c39acc74ad83304db97 Mon Sep 17 00:00:00 2001 From: kgv Date: Tue, 23 May 2017 19:05:41 +0300 Subject: [PATCH] 0028778: Coding Rules - clean up confusing code from Select3D --- src/Select3D/FILES | 5 -- src/Select3D/Select3D_Macro.hxx | 26 --------- src/Select3D/Select3D_Pnt.hxx | 36 +++++------- src/Select3D/Select3D_PointData.hxx | 5 +- src/Select3D/Select3D_SensitiveBox.cxx | 18 ------ src/Select3D/Select3D_SensitiveBox.hxx | 24 +++----- src/Select3D/Select3D_SensitiveCircle.cxx | 58 +++++++++---------- src/Select3D/Select3D_SensitiveCircle.hxx | 24 ++------ src/Select3D/Select3D_SensitiveCurve.hxx | 17 +----- src/Select3D/Select3D_SensitiveEntity.cxx | 4 +- src/Select3D/Select3D_SensitiveEntity.hxx | 9 --- src/Select3D/Select3D_SensitiveFace.cxx | 9 +-- src/Select3D/Select3D_SensitiveFace.hxx | 15 +---- src/Select3D/Select3D_SensitiveGroup.cxx | 3 +- src/Select3D/Select3D_SensitiveGroup.hxx | 20 ++----- src/Select3D/Select3D_SensitiveGroup.lxx | 42 -------------- src/Select3D/Select3D_SensitivePoint.cxx | 12 ---- src/Select3D/Select3D_SensitivePoint.hxx | 17 +----- src/Select3D/Select3D_SensitivePoly.cxx | 9 +-- src/Select3D/Select3D_SensitivePoly.hxx | 29 ++++------ src/Select3D/Select3D_SensitivePoly.lxx | 30 ---------- src/Select3D/Select3D_SensitiveSegment.hxx | 31 ++++------ src/Select3D/Select3D_SensitiveSegment.lxx | 51 ---------------- src/Select3D/Select3D_SensitiveSet.hxx | 2 - src/Select3D/Select3D_SensitiveTriangle.cxx | 22 ------- src/Select3D/Select3D_SensitiveTriangle.hxx | 20 +++---- .../Select3D_SensitiveTriangulation.cxx | 33 ++++++----- .../Select3D_SensitiveTriangulation.hxx | 30 +--------- .../Select3D_SensitiveTriangulation.lxx | 33 ----------- src/Select3D/Select3D_SensitiveWire.hxx | 11 ---- src/SelectBasics/FILES | 2 - src/SelectBasics/SelectBasics.hxx | 29 ---------- src/SelectBasics/SelectBasics_EntityOwner.hxx | 2 - src/SelectBasics/SelectBasics_EntityOwner.lxx | 21 ------- .../SelectBasics_SensitiveEntity.cxx | 14 +---- .../SelectBasics_SensitiveEntity.hxx | 52 +++++------------ .../SelectBasics_SensitiveEntity.lxx | 22 ------- 37 files changed, 143 insertions(+), 644 deletions(-) delete mode 100644 src/Select3D/Select3D_Macro.hxx delete mode 100644 src/Select3D/Select3D_SensitiveGroup.lxx delete mode 100644 src/Select3D/Select3D_SensitivePoly.lxx delete mode 100644 src/Select3D/Select3D_SensitiveSegment.lxx delete mode 100644 src/Select3D/Select3D_SensitiveTriangulation.lxx delete mode 100644 src/SelectBasics/SelectBasics_EntityOwner.lxx delete mode 100644 src/SelectBasics/SelectBasics_SensitiveEntity.lxx diff --git a/src/Select3D/FILES b/src/Select3D/FILES index 3146054e36..124695382a 100755 --- a/src/Select3D/FILES +++ b/src/Select3D/FILES @@ -3,7 +3,6 @@ Select3D_BVHIndexBuffer.hxx Select3D_EntitySequence.hxx Select3D_InteriorSensitivePointSet.cxx Select3D_InteriorSensitivePointSet.hxx -Select3D_Macro.hxx Select3D_Pnt.hxx Select3D_PointData.hxx Select3D_SensitiveBox.cxx @@ -18,24 +17,20 @@ Select3D_SensitiveFace.cxx Select3D_SensitiveFace.hxx Select3D_SensitiveGroup.cxx Select3D_SensitiveGroup.hxx -Select3D_SensitiveGroup.lxx Select3D_SensitivePoint.cxx Select3D_SensitivePoint.hxx Select3D_SensitivePoly.cxx Select3D_SensitivePoly.hxx -Select3D_SensitivePoly.lxx Select3D_SensitivePrimitiveArray.cxx Select3D_SensitivePrimitiveArray.hxx Select3D_SensitiveSegment.cxx Select3D_SensitiveSegment.hxx -Select3D_SensitiveSegment.lxx Select3D_SensitiveSet.cxx Select3D_SensitiveSet.hxx Select3D_SensitiveTriangle.cxx Select3D_SensitiveTriangle.hxx Select3D_SensitiveTriangulation.cxx Select3D_SensitiveTriangulation.hxx -Select3D_SensitiveTriangulation.lxx Select3D_SensitiveWire.cxx Select3D_SensitiveWire.hxx Select3D_TypeOfSensitivity.hxx diff --git a/src/Select3D/Select3D_Macro.hxx b/src/Select3D/Select3D_Macro.hxx deleted file mode 100644 index f69c65dc55..0000000000 --- a/src/Select3D/Select3D_Macro.hxx +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _Select3D_Macro_HeaderFile -#define _Select3D_Macro_HeaderFile - -#include - -// Safe conversion of Standard_ShortReal(float) to Standard_Real(double) -inline Standard_ShortReal DToF (Standard_Real a) -{ - return a > ShortRealLast() ? ShortRealLast() : - a < ShortRealFirst() ? ShortRealFirst() : (Standard_ShortReal)a; -} - -#endif diff --git a/src/Select3D/Select3D_Pnt.hxx b/src/Select3D/Select3D_Pnt.hxx index 25618d220f..6163f83aed 100644 --- a/src/Select3D/Select3D_Pnt.hxx +++ b/src/Select3D/Select3D_Pnt.hxx @@ -14,33 +14,23 @@ #ifndef _Select3D_Pnt_HeaderFile #define _Select3D_Pnt_HeaderFile -#include -#include -#include +#include -struct Select3D_Pnt{ +struct Select3D_Pnt +{ + Standard_ShortReal x, y, z; - Standard_ShortReal x, y, z; - - inline operator gp_Pnt() const - { - return gp_Pnt(x, y, z); - } + operator gp_Pnt() const { return gp_Pnt(x, y, z); } - inline operator gp_XYZ() const - { - return gp_XYZ(x, y, z); - } - - inline gp_Pnt operator = (const gp_Pnt& thePnt) - { - x = DToF(thePnt.X()); - y = DToF(thePnt.Y()); - z = DToF(thePnt.Z()); - return *this; - } + operator gp_XYZ() const { return gp_XYZ(x, y, z); } + gp_Pnt operator= (const gp_Pnt& thePnt) + { + x = RealToShortReal (thePnt.X()); + y = RealToShortReal (thePnt.Y()); + z = RealToShortReal (thePnt.Z()); + return *this; + } }; #endif - diff --git a/src/Select3D/Select3D_PointData.hxx b/src/Select3D/Select3D_PointData.hxx index 07d9e20c10..66d48d58d0 100644 --- a/src/Select3D/Select3D_PointData.hxx +++ b/src/Select3D/Select3D_PointData.hxx @@ -17,7 +17,8 @@ #include // A framework for safe management of Select3D_SensitivePoly polygons of 3D points -class Select3D_PointData { +class Select3D_PointData +{ public: @@ -60,7 +61,7 @@ public: // Returns 3D point from internal array // if theIndex is valid - Select3D_Pnt Pnt (const Standard_Integer theIndex) const + const Select3D_Pnt& Pnt (const Standard_Integer theIndex) const { if (theIndex < 0 || theIndex >= mynbpoints) throw Standard_OutOfRange("Select3D_PointData::Pnt"); diff --git a/src/Select3D/Select3D_SensitiveBox.cxx b/src/Select3D/Select3D_SensitiveBox.cxx index 0332dceb92..c363c1e538 100644 --- a/src/Select3D/Select3D_SensitiveBox.cxx +++ b/src/Select3D/Select3D_SensitiveBox.cxx @@ -15,11 +15,6 @@ // commercial license or contractual agreement. #include -#include -#include -#include -#include - IMPLEMENT_STANDARD_RTTIEXT(Select3D_SensitiveBox,Select3D_SensitiveEntity) @@ -130,16 +125,3 @@ Select3D_BndBox3d Select3D_SensitiveBox::BoundingBox() { return myBox; } - -//======================================================================= -// function : Box -// purpose : -//======================================================================= -Bnd_Box Select3D_SensitiveBox::Box() const -{ - Bnd_Box aBox; - aBox.Update (myBox.CornerMin().x(), myBox.CornerMin().y(), myBox.CornerMin().z(), - myBox.CornerMax().x(), myBox.CornerMax().y(), myBox.CornerMax().z()); - - return aBox; -} diff --git a/src/Select3D/Select3D_SensitiveBox.hxx b/src/Select3D/Select3D_SensitiveBox.hxx index fd359ddf06..79569b77b0 100644 --- a/src/Select3D/Select3D_SensitiveBox.hxx +++ b/src/Select3D/Select3D_SensitiveBox.hxx @@ -17,24 +17,13 @@ #ifndef _Select3D_SensitiveBox_HeaderFile #define _Select3D_SensitiveBox_HeaderFile -#include -#include -#include - #include -#include #include -#include -#include - -class SelectBasics_EntityOwner; -class Bnd_Box; -class TopLoc_Location; - //! A framework to define selection by a sensitive box. class Select3D_SensitiveBox : public Select3D_SensitiveEntity { + DEFINE_STANDARD_RTTIEXT(Select3D_SensitiveBox, Select3D_SensitiveEntity) public: //! Constructs a sensitive box object defined by the @@ -64,7 +53,14 @@ public: Standard_EXPORT virtual Standard_Boolean Matches (SelectBasics_SelectingVolumeManager& theMgr, SelectBasics_PickResult& thePickResult) Standard_OVERRIDE; - Standard_EXPORT Bnd_Box Box() const; + Bnd_Box Box() const + { + Bnd_Box aBox; + aBox.Update (myBox.CornerMin().x(), myBox.CornerMin().y(), myBox.CornerMin().z(), + myBox.CornerMax().x(), myBox.CornerMax().y(), myBox.CornerMax().z()); + + return aBox; + } //! Returns center of the box. If location //! transformation is set, it will be applied @@ -74,8 +70,6 @@ public: //! transformation is set, it will be applied Standard_EXPORT virtual Select3D_BndBox3d BoundingBox() Standard_OVERRIDE; - DEFINE_STANDARD_RTTIEXT(Select3D_SensitiveBox,Select3D_SensitiveEntity) - private: Select3D_BndBox3d myBox; //!< 3d coordinates of box corners diff --git a/src/Select3D/Select3D_SensitiveCircle.cxx b/src/Select3D/Select3D_SensitiveCircle.cxx index 16fff0f0e7..06829501cc 100644 --- a/src/Select3D/Select3D_SensitiveCircle.cxx +++ b/src/Select3D/Select3D_SensitiveCircle.cxx @@ -14,44 +14,44 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. -#include - -#include -#include -#include - #include +#include +#include +#include IMPLEMENT_STANDARD_RTTIEXT(Select3D_SensitiveCircle,Select3D_SensitivePoly) -static Standard_Integer GetCircleNbPoints (const Handle(Geom_Circle)& theCircle, - const Standard_Integer theNbPnts) +namespace { - // Check if number of points is invalid. - // In this case myPolyg raises Standard_ConstructionError - // exception (look constructor bellow). - if (theNbPnts <= 0) - return 0; + static Standard_Integer GetCircleNbPoints (const Handle(Geom_Circle)& theCircle, + const Standard_Integer theNbPnts) + { + // Check if number of points is invalid. + // In this case myPolyg raises Standard_ConstructionError + // exception (look constructor bellow). + if (theNbPnts <= 0) + return 0; - if (theCircle->Radius() > Precision::Confusion()) - return 2 * theNbPnts + 1; + if (theCircle->Radius() > Precision::Confusion()) + return 2 * theNbPnts + 1; - // The radius is too small and circle degenerates into point - return 1; -} + // The radius is too small and circle degenerates into point + return 1; + } -static Standard_Integer GetArcNbPoints (const Handle(Geom_Circle)& theCircle, - const Standard_Integer theNbPnts) -{ - // There is no need to check number of points here. - // In case of invalid number of points this method returns - // -1 or smaller value. - if (theCircle->Radius() > Precision::Confusion()) - return 2 * theNbPnts - 1; - - // The radius is too small and circle degenerates into point - return 1; + static Standard_Integer GetArcNbPoints (const Handle(Geom_Circle)& theCircle, + const Standard_Integer theNbPnts) + { + // There is no need to check number of points here. + // In case of invalid number of points this method returns + // -1 or smaller value. + if (theCircle->Radius() > Precision::Confusion()) + return 2 * theNbPnts - 1; + + // The radius is too small and circle degenerates into point + return 1; + } } //======================================================================= diff --git a/src/Select3D/Select3D_SensitiveCircle.hxx b/src/Select3D/Select3D_SensitiveCircle.hxx index a5751309b6..12ca661577 100644 --- a/src/Select3D/Select3D_SensitiveCircle.hxx +++ b/src/Select3D/Select3D_SensitiveCircle.hxx @@ -14,17 +14,10 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. -// Modified Tue Apr 14 1998 by rob : fix Bug : Case of Null Radius Circle... - #ifndef _Select3D_SensitiveCircle_HeaderFile #define _Select3D_SensitiveCircle_HeaderFile -#include -#include -#include - #include -#include #include #include #include @@ -32,16 +25,13 @@ class Geom_Circle; class Standard_ConstructionError; class Standard_OutOfRange; -class SelectBasics_EntityOwner; -class gp_Pnt; -class TopLoc_Location; - //! A framework to define sensitive 3D arcs and circles. //! In some cases this class can raise Standard_ConstructionError and //! Standard_OutOfRange exceptions. For more details see Select3D_SensitivePoly. class Select3D_SensitiveCircle : public Select3D_SensitivePoly { + DEFINE_STANDARD_RTTIEXT(Select3D_SensitiveCircle, Select3D_SensitivePoly) public: //! Constructs the sensitive circle object defined by the @@ -99,8 +89,6 @@ public: //! Builds BVH tree for a circle's edge segments if needed Standard_EXPORT virtual void BVH() Standard_OVERRIDE; - DEFINE_STANDARD_RTTIEXT(Select3D_SensitiveCircle,Select3D_SensitivePoly) - protected: //! Calculates distance from the 3d projection of used-picked screen point @@ -114,11 +102,11 @@ private: private: - Select3D_TypeOfSensitivity mySensType; //!< True if type of selection is interior, false otherwise - gp_Pnt myCenter3D; //!< Center of a circle - Handle(Geom_Circle) myCircle; //!< Points of the circle - Standard_Real myStart; //!< Sensitive arc parameter - Standard_Real myEnd; //!< Sensitive arc parameter + Select3D_TypeOfSensitivity mySensType; //!< True if type of selection is interior, false otherwise + gp_Pnt myCenter3D; //!< Center of a circle + Handle(Geom_Circle) myCircle; //!< Points of the circle + Standard_Real myStart; //!< Sensitive arc parameter + Standard_Real myEnd; //!< Sensitive arc parameter }; DEFINE_STANDARD_HANDLE(Select3D_SensitiveCircle, Select3D_SensitivePoly) diff --git a/src/Select3D/Select3D_SensitiveCurve.hxx b/src/Select3D/Select3D_SensitiveCurve.hxx index cd18217448..c2951d7799 100644 --- a/src/Select3D/Select3D_SensitiveCurve.hxx +++ b/src/Select3D/Select3D_SensitiveCurve.hxx @@ -17,31 +17,20 @@ #ifndef _Select3D_SensitiveCurve_HeaderFile #define _Select3D_SensitiveCurve_HeaderFile -#include -#include -#include - #include #include #include -#include #include -#include -#include -class Geom_Curve; class Standard_ConstructionError; class Standard_OutOfRange; -class SelectBasics_EntityOwner; -class Select3D_SensitiveEntity; -class TopLoc_Location; - //! A framework to define a sensitive 3D curve. //! In some cases this class can raise Standard_ConstructionError and //! Standard_OutOfRange exceptions. For more details see Select3D_SensitivePoly. class Select3D_SensitiveCurve : public Select3D_SensitivePoly { + DEFINE_STANDARD_RTTIEXT(Select3D_SensitiveCurve, Select3D_SensitivePoly) public: //! Constructs a sensitive curve object defined by the @@ -64,10 +53,6 @@ public: //! Returns the copy of this Standard_EXPORT virtual Handle(Select3D_SensitiveEntity) GetConnected() Standard_OVERRIDE; -public: - - DEFINE_STANDARD_RTTIEXT(Select3D_SensitiveCurve,Select3D_SensitivePoly) - private: void loadPoints (const Handle(Geom_Curve)& aCurve, diff --git a/src/Select3D/Select3D_SensitiveEntity.cxx b/src/Select3D/Select3D_SensitiveEntity.cxx index 697b81eec9..ec0c57b5c1 100644 --- a/src/Select3D/Select3D_SensitiveEntity.cxx +++ b/src/Select3D/Select3D_SensitiveEntity.cxx @@ -15,11 +15,9 @@ // commercial license or contractual agreement. #include + #include #include -#include -#include - IMPLEMENT_STANDARD_RTTIEXT(Select3D_SensitiveEntity,SelectBasics_SensitiveEntity) diff --git a/src/Select3D/Select3D_SensitiveEntity.hxx b/src/Select3D/Select3D_SensitiveEntity.hxx index 7265e36fdc..12c3006818 100644 --- a/src/Select3D/Select3D_SensitiveEntity.hxx +++ b/src/Select3D/Select3D_SensitiveEntity.hxx @@ -17,19 +17,10 @@ #ifndef _Select3D_SensitiveEntity_HeaderFile #define _Select3D_SensitiveEntity_HeaderFile -#include -#include - #include -#include -#include #include -#include -#include - #include -class Select3D_SensitiveEntity; class SelectBasics_EntityOwner; //! Abstract framework to define 3D sensitive entities. diff --git a/src/Select3D/Select3D_SensitiveFace.cxx b/src/Select3D/Select3D_SensitiveFace.cxx index 19c712022e..790b89c182 100644 --- a/src/Select3D/Select3D_SensitiveFace.cxx +++ b/src/Select3D/Select3D_SensitiveFace.cxx @@ -14,18 +14,11 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. -//Modif on jun-24-97 : introduction de CSLib_Class2d de LBR -// pour teste si on est dedans ou dehors... -//Modif on jul-21-97 : changement en harray1 pour eventuelles connexions ... - #include + #include #include -#include -#include - - IMPLEMENT_STANDARD_RTTIEXT(Select3D_SensitiveFace,Select3D_SensitiveEntity) //================================================== diff --git a/src/Select3D/Select3D_SensitiveFace.hxx b/src/Select3D/Select3D_SensitiveFace.hxx index b6ab2240ff..b46d8246d3 100644 --- a/src/Select3D/Select3D_SensitiveFace.hxx +++ b/src/Select3D/Select3D_SensitiveFace.hxx @@ -14,34 +14,23 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. -//Modif on jun-24-97 : introduction de CSLib_Class2d de LBR -// pour teste si on est dedans ou dehors... -//Modif on jul-21-97 : changement en harray1 pour eventuelles connexions ... - #ifndef _Select3D_SensitiveFace_HeaderFile #define _Select3D_SensitiveFace_HeaderFile -#include - #include #include #include -#include #include -#include -#include class Standard_ConstructionError; class Standard_OutOfRange; -class SelectBasics_EntityOwner; -class TopLoc_Location; - //! Sensitive Entity to make a face selectable. //! In some cases this class can raise Standard_ConstructionError and //! Standard_OutOfRange exceptions. For more details see Select3D_SensitivePoly. class Select3D_SensitiveFace : public Select3D_SensitiveEntity { + DEFINE_STANDARD_RTTIEXT(Select3D_SensitiveFace, Select3D_SensitiveEntity) public: //! Constructs a sensitive face object defined by the @@ -84,8 +73,6 @@ public: //! Returns the amount of sub-entities (points or planar convex polygons) Standard_EXPORT virtual Standard_Integer NbSubElements() Standard_OVERRIDE; - DEFINE_STANDARD_RTTIEXT(Select3D_SensitiveFace,Select3D_SensitiveEntity) - private: Select3D_TypeOfSensitivity mySensType; //!< Type of sensitivity: interior or boundary diff --git a/src/Select3D/Select3D_SensitiveGroup.cxx b/src/Select3D/Select3D_SensitiveGroup.cxx index fa5cb64111..5d91264be2 100644 --- a/src/Select3D/Select3D_SensitiveGroup.cxx +++ b/src/Select3D/Select3D_SensitiveGroup.cxx @@ -14,10 +14,9 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. -#include #include -#include +#include IMPLEMENT_STANDARD_RTTIEXT(Select3D_SensitiveGroup,Select3D_SensitiveSet) diff --git a/src/Select3D/Select3D_SensitiveGroup.hxx b/src/Select3D/Select3D_SensitiveGroup.hxx index d64d146ac8..d3700a1c6c 100644 --- a/src/Select3D/Select3D_SensitiveGroup.hxx +++ b/src/Select3D/Select3D_SensitiveGroup.hxx @@ -14,23 +14,14 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. - #ifndef _Select3D_SensitiveGroup_HeaderFile #define _Select3D_SensitiveGroup_HeaderFile -#include -#include -#include - #include #include #include #include -class SelectBasics_EntityOwner; -class TopLoc_Location; - - //! A framework to define selection of a sensitive group //! by a sensitive entity which is a set of 3D sensitive entities. //! Remark: 2 modes are possible for rectangle selection @@ -40,6 +31,7 @@ class TopLoc_Location; //! By default the "Match All entities" mode is set. class Select3D_SensitiveGroup : public Select3D_SensitiveSet { + DEFINE_STANDARD_RTTIEXT(Select3D_SensitiveGroup, Select3D_SensitiveSet) public: //! Constructs an empty sensitive group object. @@ -76,11 +68,11 @@ public: //! Sets the requirement that all sensitive entities in the //! list used at the time of construction, or added using //! the function Add must be matched. - void SetMatchType (const Standard_Boolean theIsMustMatchAll); + void SetMatchType (const Standard_Boolean theIsMustMatchAll) { myMustMatchAll = theIsMustMatchAll; } //! Returns true if all sensitive entities in the list used //! at the time of construction, or added using the function Add must be matched. - Standard_Boolean MustMatchAll() const; + Standard_Boolean MustMatchAll() const { return myMustMatchAll; } //! Checks whether the group overlaps current selecting volume Standard_EXPORT virtual Standard_Boolean Matches (SelectBasics_SelectingVolumeManager& theMgr, @@ -95,7 +87,7 @@ public: Standard_EXPORT void Set (const Handle(SelectBasics_EntityOwner)& theOwnerId) Standard_OVERRIDE; //! Gets group content - const Select3D_EntitySequence& GetEntities() const; + const Select3D_EntitySequence& GetEntities() const { return myEntities; } //! Returns bounding box of the group. If location transformation //! is set, it will be applied @@ -120,8 +112,6 @@ public: //! Returns the length of vector of sensitive entities Standard_EXPORT virtual Standard_Integer Size() const Standard_OVERRIDE; - DEFINE_STANDARD_RTTIEXT(Select3D_SensitiveGroup,Select3D_SensitiveSet) - private: //! Checks whether the entity with index theIdx overlaps the current selecting volume @@ -147,6 +137,4 @@ private: DEFINE_STANDARD_HANDLE(Select3D_SensitiveGroup, Select3D_SensitiveEntity) -#include - #endif // _Select3D_SensitiveGroup_HeaderFile diff --git a/src/Select3D/Select3D_SensitiveGroup.lxx b/src/Select3D/Select3D_SensitiveGroup.lxx deleted file mode 100644 index 1dda86a297..0000000000 --- a/src/Select3D/Select3D_SensitiveGroup.lxx +++ /dev/null @@ -1,42 +0,0 @@ -// Created on: 1998-04-16 -// Created by: Robert COUBLANC -// Copyright (c) 1998-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//======================================================================= -//function : SetMatchType -//purpose : -//======================================================================= -inline void Select3D_SensitiveGroup::SetMatchType (const Standard_Boolean theIsMustMatchAll) -{ - myMustMatchAll = theIsMustMatchAll; -} - -//======================================================================= -//function : MustMatchAll -//purpose : -//======================================================================= -inline Standard_Boolean Select3D_SensitiveGroup::MustMatchAll() const -{ - return myMustMatchAll; -} - -//======================================================================= -//function : GetEntities -//purpose : -//======================================================================= -inline const Select3D_EntitySequence& Select3D_SensitiveGroup::GetEntities() const -{ - return myEntities; -} diff --git a/src/Select3D/Select3D_SensitivePoint.cxx b/src/Select3D/Select3D_SensitivePoint.cxx index 355f29f45e..18941fa953 100644 --- a/src/Select3D/Select3D_SensitivePoint.cxx +++ b/src/Select3D/Select3D_SensitivePoint.cxx @@ -16,9 +16,6 @@ #include -#include - - IMPLEMENT_STANDARD_RTTIEXT(Select3D_SensitivePoint,Select3D_SensitiveEntity) //================================================== @@ -53,15 +50,6 @@ Standard_Boolean Select3D_SensitivePoint::Matches (SelectBasics_SelectingVolumeM return Standard_True; } -//======================================================================= -//function : Point -//purpose : -//======================================================================= -gp_Pnt Select3D_SensitivePoint::Point() const -{ - return myPoint; -} - //======================================================================= //function : GetConnected //purpose : diff --git a/src/Select3D/Select3D_SensitivePoint.hxx b/src/Select3D/Select3D_SensitivePoint.hxx index 9a0dd4df48..be1088fd79 100644 --- a/src/Select3D/Select3D_SensitivePoint.hxx +++ b/src/Select3D/Select3D_SensitivePoint.hxx @@ -17,24 +17,13 @@ #ifndef _Select3D_SensitivePoint_HeaderFile #define _Select3D_SensitivePoint_HeaderFile -#include -#include -#include - -#include #include -#include #include -#include -#include - -class SelectBasics_EntityOwner; -class gp_Pnt; -class TopLoc_Location; //! A framework to define sensitive 3D points. class Select3D_SensitivePoint : public Select3D_SensitiveEntity { + DEFINE_STANDARD_RTTIEXT(Select3D_SensitivePoint, Select3D_SensitiveEntity) public: //! Constructs a sensitive point object defined by the @@ -51,7 +40,7 @@ public: SelectBasics_PickResult& thePickResult) Standard_OVERRIDE; //! Returns the point used at the time of construction. - Standard_EXPORT gp_Pnt Point() const; + const gp_Pnt& Point() const { return myPoint; } //! Returns center of point. If location transformation //! is set, it will be applied @@ -61,8 +50,6 @@ public: //! transformation is set, it will be applied Standard_EXPORT virtual Select3D_BndBox3d BoundingBox() Standard_OVERRIDE; - DEFINE_STANDARD_RTTIEXT(Select3D_SensitivePoint,Select3D_SensitiveEntity) - private: gp_Pnt myPoint; //!< 3d coordinates of the point diff --git a/src/Select3D/Select3D_SensitivePoly.cxx b/src/Select3D/Select3D_SensitivePoly.cxx index 7f7199b703..c7f625e177 100644 --- a/src/Select3D/Select3D_SensitivePoly.cxx +++ b/src/Select3D/Select3D_SensitivePoly.cxx @@ -11,14 +11,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. -#include -#include - -#include - #include - IMPLEMENT_STANDARD_RTTIEXT(Select3D_SensitivePoly,Select3D_SensitiveSet) //================================================== @@ -199,7 +193,7 @@ Standard_Real Select3D_SensitivePoly::Center (const Standard_Integer theIdx, return RealLast(); const Select3D_BndBox3d aBndBox = Box (theIdx); - const SelectMgr_Vec3& aCenter = (aBndBox.CornerMin() + aBndBox.CornerMax()) * 0.5; + const SelectMgr_Vec3 aCenter = (aBndBox.CornerMin() + aBndBox.CornerMax()) * 0.5; return theAxis == 0 ? aCenter.x() : (theAxis == 1 ? aCenter.y() : aCenter.z()); } @@ -218,7 +212,6 @@ void Select3D_SensitivePoly::Swap (const Standard_Integer theIdx1, const Standard_Integer aSegmentIdx2 = mySegmentIndexes->Value (theIdx2); mySegmentIndexes->ChangeValue (theIdx1) = aSegmentIdx2; mySegmentIndexes->ChangeValue (theIdx2) = aSegmentIdx1; - return; } //================================================== diff --git a/src/Select3D/Select3D_SensitivePoly.hxx b/src/Select3D/Select3D_SensitivePoly.hxx index 0cf476e624..0e3eb81a3a 100644 --- a/src/Select3D/Select3D_SensitivePoly.hxx +++ b/src/Select3D/Select3D_SensitivePoly.hxx @@ -14,24 +14,14 @@ #ifndef _Select3D_SensitivePoly_HeaderFile #define _Select3D_SensitivePoly_HeaderFile -#include - -#include -#include -#include - -#include -#include - #include -#include #include #include - +#include +#include class Standard_ConstructionError; class Standard_OutOfRange; -class SelectBasics_EntityOwner; //! Sensitive Entity to make a face selectable. //! In some cases this class can raise Standard_ConstructionError and @@ -39,6 +29,7 @@ class SelectBasics_EntityOwner; //! myPolyg. class Select3D_SensitivePoly : public Select3D_SensitiveSet { + DEFINE_STANDARD_RTTIEXT(Select3D_SensitivePoly, Select3D_SensitiveSet) public: //! Constructs a sensitive face object defined by the @@ -68,7 +59,15 @@ public: Standard_EXPORT virtual Standard_Integer NbSubElements() Standard_OVERRIDE; //! Returns the 3D points of the array used at construction time. - void Points3D (Handle(TColgp_HArray1OfPnt)& theHArrayOfPnt); + void Points3D (Handle(TColgp_HArray1OfPnt)& theHArrayOfPnt) + { + Standard_Integer aSize = myPolyg.Size(); + theHArrayOfPnt = new TColgp_HArray1OfPnt (1,aSize); + for(Standard_Integer anIndex = 1; anIndex <= aSize; anIndex++) + { + theHArrayOfPnt->SetValue (anIndex, myPolyg.Pnt (anIndex-1)); + } + } //! Returns bounding box of a polygon. If location //! transformation is set, it will be applied @@ -93,8 +92,6 @@ public: Standard_EXPORT virtual void Swap (const Standard_Integer theIdx1, const Standard_Integer theIdx2) Standard_OVERRIDE; - DEFINE_STANDARD_RTTIEXT(Select3D_SensitivePoly,Select3D_SensitiveSet) - private: //! Checks whether the segment with index theIdx overlaps the current selecting volume @@ -121,6 +118,4 @@ protected: DEFINE_STANDARD_HANDLE(Select3D_SensitivePoly, Select3D_SensitiveSet) -#include - #endif // _Select3D_SensitivePoly_HeaderFile diff --git a/src/Select3D/Select3D_SensitivePoly.lxx b/src/Select3D/Select3D_SensitivePoly.lxx deleted file mode 100644 index 4cc28175ca..0000000000 --- a/src/Select3D/Select3D_SensitivePoly.lxx +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#include -#include -#include - -//================================================== -// Function: Points3D -// Purpose : -//================================================== -inline void Select3D_SensitivePoly::Points3D (Handle(TColgp_HArray1OfPnt)& theHArrayOfPnt) -{ - Standard_Integer aSize = myPolyg.Size(); - theHArrayOfPnt = new TColgp_HArray1OfPnt (1,aSize); - for(Standard_Integer anIndex = 1; anIndex <= aSize; anIndex++) - { - theHArrayOfPnt->SetValue (anIndex, myPolyg.Pnt (anIndex-1)); - } -} diff --git a/src/Select3D/Select3D_SensitiveSegment.hxx b/src/Select3D/Select3D_SensitiveSegment.hxx index 4d3cf6492c..01d8977b20 100644 --- a/src/Select3D/Select3D_SensitiveSegment.hxx +++ b/src/Select3D/Select3D_SensitiveSegment.hxx @@ -17,25 +17,14 @@ #ifndef _Select3D_SensitiveSegment_HeaderFile #define _Select3D_SensitiveSegment_HeaderFile -#include -#include -#include - -#include -#include #include -#include #include -#include - -class SelectBasics_EntityOwner; -class gp_Pnt; -class TopLoc_Location; //! A framework to define sensitive zones along a segment //! One gives the 3D start and end point class Select3D_SensitiveSegment : public Select3D_SensitiveEntity { + DEFINE_STANDARD_RTTIEXT(Select3D_SensitiveSegment, Select3D_SensitiveEntity) public: //! Constructs the sensitive segment object defined by @@ -45,16 +34,16 @@ public: const gp_Pnt& theLastPnt); //! changes the start Point of the Segment; - void StartPoint (const gp_Pnt& thePnt); + void SetStartPoint (const gp_Pnt& thePnt) { myStart = thePnt; } //! changes the end point of the segment - void EndPoint (const gp_Pnt& thePnt); + void SetEndPoint (const gp_Pnt& thePnt) { myEnd = thePnt; } //! gives the 3D start Point of the Segment - gp_Pnt StartPoint() const; + const gp_Pnt& StartPoint() const { return myStart; } //! gives the 3D End Point of the Segment - gp_Pnt EndPoint() const; + const gp_Pnt& EndPoint() const { return myEnd; } //! Returns the amount of points Standard_EXPORT virtual Standard_Integer NbSubElements() Standard_OVERRIDE; @@ -73,7 +62,13 @@ public: //! transformation is set, it will be applied Standard_EXPORT virtual Select3D_BndBox3d BoundingBox() Standard_OVERRIDE; - DEFINE_STANDARD_RTTIEXT(Select3D_SensitiveSegment,Select3D_SensitiveEntity) +public: + + //! changes the start Point of the Segment; + void StartPoint (const gp_Pnt& thePnt) { myStart = thePnt; } + + //! changes the end point of the segment + void EndPoint (const gp_Pnt& thePnt) { myEnd = thePnt; } private: @@ -83,6 +78,4 @@ private: DEFINE_STANDARD_HANDLE(Select3D_SensitiveSegment, Select3D_SensitiveEntity) -#include - #endif // _Select3D_SensitiveSegment_HeaderFile diff --git a/src/Select3D/Select3D_SensitiveSegment.lxx b/src/Select3D/Select3D_SensitiveSegment.lxx deleted file mode 100644 index c5fd4fe279..0000000000 --- a/src/Select3D/Select3D_SensitiveSegment.lxx +++ /dev/null @@ -1,51 +0,0 @@ -// Created on: 1995-02-23 -// Created by: Mister rmi -// Copyright (c) 1995-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//======================================================================= -//function : StartPoint -//purpose : -//======================================================================= -inline void Select3D_SensitiveSegment::StartPoint (const gp_Pnt& thePnt) -{ - myStart = thePnt; -} - -//======================================================================= -//function : EndPoint -//purpose : -//======================================================================= -inline void Select3D_SensitiveSegment::EndPoint (const gp_Pnt& thePnt) -{ - myEnd = thePnt; -} - -//======================================================================= -//function : StartPoint -//purpose : -//======================================================================= -inline gp_Pnt Select3D_SensitiveSegment::StartPoint() const -{ - return myStart; -} - -//======================================================================= -//function : EndPoint -//purpose : -//======================================================================= -inline gp_Pnt Select3D_SensitiveSegment::EndPoint() const -{ - return myEnd; -} diff --git a/src/Select3D/Select3D_SensitiveSet.hxx b/src/Select3D/Select3D_SensitiveSet.hxx index 56c5cc8247..94c202c1bf 100644 --- a/src/Select3D/Select3D_SensitiveSet.hxx +++ b/src/Select3D/Select3D_SensitiveSet.hxx @@ -17,8 +17,6 @@ #define _Select3D_SensitiveSet_Header #include -#include -#include #include #include #include diff --git a/src/Select3D/Select3D_SensitiveTriangle.cxx b/src/Select3D/Select3D_SensitiveTriangle.cxx index a16a6a2bc0..d07f418cf7 100644 --- a/src/Select3D/Select3D_SensitiveTriangle.cxx +++ b/src/Select3D/Select3D_SensitiveTriangle.cxx @@ -16,12 +16,10 @@ #include -#include #include #include #include - IMPLEMENT_STANDARD_RTTIEXT(Select3D_SensitiveTriangle,Select3D_SensitiveEntity) //================================================== @@ -70,26 +68,6 @@ Standard_Boolean Select3D_SensitiveTriangle::Matches (SelectBasics_SelectingVolu return Standard_True; } -//================================================== -// Function: Points3D -// Purpose : -//================================================== -void Select3D_SensitiveTriangle::Points3D (gp_Pnt& thePnt0, gp_Pnt& thePnt1, gp_Pnt& thePnt2) const -{ - thePnt0 = myPoints[0]; - thePnt1 = myPoints[1]; - thePnt2 = myPoints[2]; -} - -//================================================== -// Function: Center3D -// Purpose : -//================================================== -gp_Pnt Select3D_SensitiveTriangle::Center3D() const -{ - return myCentroid; -} - //================================================== // Function: GetConnected // Purpose : diff --git a/src/Select3D/Select3D_SensitiveTriangle.hxx b/src/Select3D/Select3D_SensitiveTriangle.hxx index 39ffccdd03..ecec92d67c 100644 --- a/src/Select3D/Select3D_SensitiveTriangle.hxx +++ b/src/Select3D/Select3D_SensitiveTriangle.hxx @@ -17,23 +17,12 @@ #ifndef _Select3D_SensitiveTriangle_HeaderFile #define _Select3D_SensitiveTriangle_HeaderFile -#include -#include -#include - #include -#include #include #include -#include class Standard_ConstructionError; class Standard_OutOfRange; -class SelectBasics_EntityOwner; -class gp_Pnt; -class Select3D_SensitiveEntity; -class TopLoc_Location; - //! A framework to define selection of triangles in a view. //! This comes into play in the detection of meshing and triangulation in surfaces. @@ -56,10 +45,15 @@ public: SelectBasics_PickResult& thePickResult) Standard_OVERRIDE; //! Returns the 3D points P1, P2, P3 used at the time of construction. - Standard_EXPORT void Points3D (gp_Pnt& thePnt0, gp_Pnt& thePnt1, gp_Pnt& thePnt2) const; + void Points3D (gp_Pnt& thePnt0, gp_Pnt& thePnt1, gp_Pnt& thePnt2) const + { + thePnt0 = myPoints[0]; + thePnt1 = myPoints[1]; + thePnt2 = myPoints[2]; + } //! Returns the center point of the sensitive triangle created at construction time. - Standard_EXPORT gp_Pnt Center3D() const; + Standard_EXPORT gp_Pnt Center3D() const { return myCentroid; } //! Returns the copy of this Standard_EXPORT virtual Handle(Select3D_SensitiveEntity) GetConnected() Standard_OVERRIDE; diff --git a/src/Select3D/Select3D_SensitiveTriangulation.cxx b/src/Select3D/Select3D_SensitiveTriangulation.cxx index 88543d5ecd..21ccbc27ca 100644 --- a/src/Select3D/Select3D_SensitiveTriangulation.cxx +++ b/src/Select3D/Select3D_SensitiveTriangulation.cxx @@ -14,7 +14,7 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. -#include +#include #include #include @@ -23,24 +23,30 @@ #include #include -#include - +#include IMPLEMENT_STANDARD_RTTIEXT(Select3D_SensitiveTriangulation,Select3D_SensitiveSet) -static Standard_Integer NbOfFreeEdges (const Handle(Poly_Triangulation)& theTriangulation) +namespace { - Standard_Integer aNbFree = 0; - Poly_Connect aPoly (theTriangulation); - Standard_Integer aTriangleNodes[3]; - for (Standard_Integer aTrgIdx = 1; aTrgIdx <= theTriangulation->NbTriangles(); aTrgIdx++) + static Standard_Integer NbOfFreeEdges (const Handle(Poly_Triangulation)& theTriangulation) { - aPoly.Triangles (aTrgIdx, aTriangleNodes[0], aTriangleNodes[1], aTriangleNodes[2]); - for (Standard_Integer aNodeIdx = 0; aNodeIdx < 3; aNodeIdx++) - if (aTriangleNodes[aNodeIdx] == 0) - aNbFree++; + Standard_Integer aNbFree = 0; + Poly_Connect aPoly (theTriangulation); + Standard_Integer aTriangleNodes[3]; + for (Standard_Integer aTrgIdx = 1; aTrgIdx <= theTriangulation->NbTriangles(); aTrgIdx++) + { + aPoly.Triangles (aTrgIdx, aTriangleNodes[0], aTriangleNodes[1], aTriangleNodes[2]); + for (Standard_Integer aNodeIdx = 0; aNodeIdx < 3; ++aNodeIdx) + { + if (aTriangleNodes[aNodeIdx] == 0) + { + ++aNbFree; + } + } + } + return aNbFree; } - return aNbFree; } //======================================================================= @@ -130,7 +136,6 @@ Select3D_SensitiveTriangulation::Select3D_SensitiveTriangulation (const Handle(S } } - //======================================================================= //function : Select3D_SensitiveTriangulation //purpose : diff --git a/src/Select3D/Select3D_SensitiveTriangulation.hxx b/src/Select3D/Select3D_SensitiveTriangulation.hxx index 5f212cdd54..7950ced868 100644 --- a/src/Select3D/Select3D_SensitiveTriangulation.hxx +++ b/src/Select3D/Select3D_SensitiveTriangulation.hxx @@ -14,40 +14,23 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. -//Modified Thur Apr 09 98 by rob : No more computation of free edges. -// fix bug on Compute Depth (don't forget -// Location...) - #ifndef _Select3D_SensitiveTriangulation_Header #define _Select3D_SensitiveTriangulation_Header -#include -#include -#include - #include #include #include #include -#include -#include -#include #include #include -#include #include -#include class Poly_Triangulation; -class SelectBasics_EntityOwner; -class TopLoc_Location; -class gp_Pnt; -class Select3D_SensitiveEntity; //! A framework to define selection of a sensitive entity made of a set of triangles. class Select3D_SensitiveTriangulation : public Select3D_SensitiveSet { - + DEFINE_STANDARD_RTTIEXT(Select3D_SensitiveTriangulation, Select3D_SensitiveSet) public: //! Constructs a sensitive triangulation object defined by @@ -76,7 +59,7 @@ public: Standard_EXPORT Handle(Select3D_SensitiveEntity) GetConnected() Standard_OVERRIDE; - const Handle(Poly_Triangulation)& Triangulation() const; + const Handle(Poly_Triangulation)& Triangulation() const { return myTriangul; } //! Returns the length of array of triangles or edges Standard_EXPORT virtual Standard_Integer Size() const Standard_OVERRIDE; @@ -108,10 +91,7 @@ public: //! to this entity has init location set. Otherwise, returns identity matrix. Standard_EXPORT virtual gp_GTrsf InvInitLocation() const Standard_OVERRIDE; - inline const TopLoc_Location& GetInitLocation() const; - -public: - DEFINE_STANDARD_RTTIEXT(Select3D_SensitiveTriangulation,Select3D_SensitiveSet) + const TopLoc_Location& GetInitLocation() const { return myInitLocation; } protected: @@ -119,7 +99,6 @@ protected: //! box of the triangulation Select3D_BndBox3d applyTransformation(); - private: //! Checks whether the element with index theIdx overlaps the current selecting volume @@ -149,7 +128,4 @@ private: DEFINE_STANDARD_HANDLE(Select3D_SensitiveTriangulation, Select3D_SensitiveSet) -#include - - #endif // _Select3D_SensitiveTriangulation_Header diff --git a/src/Select3D/Select3D_SensitiveTriangulation.lxx b/src/Select3D/Select3D_SensitiveTriangulation.lxx deleted file mode 100644 index 9898e4b1e8..0000000000 --- a/src/Select3D/Select3D_SensitiveTriangulation.lxx +++ /dev/null @@ -1,33 +0,0 @@ -// Created on: 1997-05-15 -// Created by: Robert COUBLANC -// Copyright (c) 1997-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//======================================================================= -//function : Triangulation -//purpose : -//======================================================================= -inline const Handle(Poly_Triangulation)& Select3D_SensitiveTriangulation::Triangulation() const -{ - return myTriangul; -} - -//======================================================================= -//function : GetInitLocation -//purpose : -//======================================================================= -inline const TopLoc_Location& Select3D_SensitiveTriangulation::GetInitLocation() const -{ - return myInitLocation; -} diff --git a/src/Select3D/Select3D_SensitiveWire.hxx b/src/Select3D/Select3D_SensitiveWire.hxx index 0ce5fa2137..df778d01ce 100644 --- a/src/Select3D/Select3D_SensitiveWire.hxx +++ b/src/Select3D/Select3D_SensitiveWire.hxx @@ -17,18 +17,7 @@ #ifndef _Select3D_SensitiveWire_HeaderFile #define _Select3D_SensitiveWire_HeaderFile -#include -#include -#include - #include -#include -#include - -class SelectBasics_EntityOwner; -class TopLoc_Location; -class Select3D_SensitiveEntitySequence; - //! A framework to define selection of a wire owner by an //! elastic wire band. diff --git a/src/SelectBasics/FILES b/src/SelectBasics/FILES index 13aee8d44d..246d485a0f 100644 --- a/src/SelectBasics/FILES +++ b/src/SelectBasics/FILES @@ -2,9 +2,7 @@ SelectBasics.cxx SelectBasics.hxx SelectBasics_EntityOwner.cxx SelectBasics_EntityOwner.hxx -SelectBasics_EntityOwner.lxx SelectBasics_PickResult.hxx SelectBasics_SelectingVolumeManager.hxx SelectBasics_SensitiveEntity.cxx SelectBasics_SensitiveEntity.hxx -SelectBasics_SensitiveEntity.lxx diff --git a/src/SelectBasics/SelectBasics.hxx b/src/SelectBasics/SelectBasics.hxx index 0d30d0a6cf..34390c813a 100644 --- a/src/SelectBasics/SelectBasics.hxx +++ b/src/SelectBasics/SelectBasics.hxx @@ -19,12 +19,7 @@ #include #include -#include - #include -class SelectBasics_EntityOwner; -class SelectBasics_SensitiveEntity; - //! interface class for dynamic selection class SelectBasics @@ -33,36 +28,12 @@ public: DEFINE_STANDARD_ALLOC - //! Structure to provide all-in-one result of selection of sensitive //! for "Matches" method of SelectBasics_SensitiveEntity. Standard_EXPORT static Standard_Integer MaxOwnerPriority(); Standard_EXPORT static Standard_Integer MinOwnerPriority(); - - - -protected: - - - - - -private: - - - - -friend class SelectBasics_EntityOwner; -friend class SelectBasics_SensitiveEntity; - }; - - - - - - #endif // _SelectBasics_HeaderFile diff --git a/src/SelectBasics/SelectBasics_EntityOwner.hxx b/src/SelectBasics/SelectBasics_EntityOwner.hxx index 566960c283..8a28b974c0 100644 --- a/src/SelectBasics/SelectBasics_EntityOwner.hxx +++ b/src/SelectBasics/SelectBasics_EntityOwner.hxx @@ -18,10 +18,8 @@ #define _SelectBasics_EntityOwner_HeaderFile #include -#include #include #include -#include #include //! defines an abstract owner of sensitive primitives. diff --git a/src/SelectBasics/SelectBasics_EntityOwner.lxx b/src/SelectBasics/SelectBasics_EntityOwner.lxx deleted file mode 100644 index 5c26dde79a..0000000000 --- a/src/SelectBasics/SelectBasics_EntityOwner.lxx +++ /dev/null @@ -1,21 +0,0 @@ -// Created on: 1995-02-23 -// Created by: Mister rmi -// Copyright (c) 1995-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -inline void SelectBasics_EntityOwner::Set (const Standard_Integer aPriority) -{mypriority = aPriority;} - -inline Standard_Integer SelectBasics_EntityOwner::Priority() const -{return mypriority;} diff --git a/src/SelectBasics/SelectBasics_SensitiveEntity.cxx b/src/SelectBasics/SelectBasics_SensitiveEntity.cxx index 5a30318b05..e852d30f74 100644 --- a/src/SelectBasics/SelectBasics_SensitiveEntity.cxx +++ b/src/SelectBasics/SelectBasics_SensitiveEntity.cxx @@ -14,13 +14,12 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include #include -#include -#include #include -IMPLEMENT_STANDARD_RTTIEXT(SelectBasics_SensitiveEntity,MMgt_TShared) +IMPLEMENT_STANDARD_RTTIEXT(SelectBasics_SensitiveEntity, Standard_Transient) //======================================================================= // function : SelectBasics_SensitiveEntity @@ -39,15 +38,6 @@ void SelectBasics_SensitiveEntity::Set (const Handle(SelectBasics_EntityOwner)& myOwnerId = theOwnerId; } -//======================================================================= -// function : OwnerId -// purpose : Returns pointer to owner of the entity -//======================================================================= -const Handle(SelectBasics_EntityOwner)& SelectBasics_SensitiveEntity::OwnerId() const -{ - return myOwnerId; -} - //======================================================================= // function : SetSensitivityFactor // purpose : Allows to manage sensitivity of a particular entity diff --git a/src/SelectBasics/SelectBasics_SensitiveEntity.hxx b/src/SelectBasics/SelectBasics_SensitiveEntity.hxx index d4d1431074..633fed8309 100644 --- a/src/SelectBasics/SelectBasics_SensitiveEntity.hxx +++ b/src/SelectBasics/SelectBasics_SensitiveEntity.hxx @@ -19,63 +19,51 @@ #include #include - -#include -#include - -#include -#include -#include +#include #include #include -#include #include class SelectBasics_EntityOwner; - -class SelectBasics_SensitiveEntity; -DEFINE_STANDARD_HANDLE(SelectBasics_SensitiveEntity, MMgt_TShared) - //! root class; the inheriting classes will be able to give //! sensitive Areas for the dynamic selection algorithms -class SelectBasics_SensitiveEntity : public MMgt_TShared +class SelectBasics_SensitiveEntity : public Standard_Transient { - + DEFINE_STANDARD_RTTIEXT(SelectBasics_SensitiveEntity, Standard_Transient) public: - //! Sets owner of the entity Standard_EXPORT virtual void Set (const Handle(SelectBasics_EntityOwner)& theOwnerId); - + //! Returns pointer to owner of the entity - Standard_EXPORT const Handle(SelectBasics_EntityOwner)& OwnerId() const; - + const Handle(SelectBasics_EntityOwner)& OwnerId() const { return myOwnerId; } + //! Checks whether the sensitive entity is overlapped by //! current selecting volume virtual Standard_Boolean Matches (SelectBasics_SelectingVolumeManager& theMgr, SelectBasics_PickResult& thePickResult) = 0; - + //! allows a better sensitivity for //! a specific entity in selection algorithms //! useful for small sized entities. - Standard_Integer SensitivityFactor() const; + Standard_Integer SensitivityFactor() const { return mySFactor; } //! Allows to manage sensitivity of a particular sensitive entity Standard_EXPORT void SetSensitivityFactor (const Standard_Integer theNewSens); - + //! Returns the number of sub-entities or elements in //! sensitive entity. Is used to determine if entity is //! complex and needs to pre-build BVH at the creation of //! sensitive entity step or is light-weighted so the tree //! can be build on demand with unnoticeable delay virtual Standard_Integer NbSubElements() = 0; - + //! Returns bounding box of sensitive entity virtual Select3D_BndBox3d BoundingBox() = 0; - + //! Builds BVH tree for sensitive if it is needed virtual void BVH() = 0; - + //! Clears up all the resources and memory allocated virtual void Clear() = 0; @@ -86,25 +74,17 @@ public: //! to this entity has init location set. Otherwise, returns identity matrix. virtual gp_GTrsf InvInitLocation() const = 0; - DEFINE_STANDARD_RTTIEXT(SelectBasics_SensitiveEntity,MMgt_TShared) - protected: Standard_EXPORT SelectBasics_SensitiveEntity (const Handle(SelectBasics_EntityOwner)& theOwnerId); - Handle(SelectBasics_EntityOwner) myOwnerId; - - -private: +protected: + Handle(SelectBasics_EntityOwner) myOwnerId; Standard_Integer mySFactor; -}; - - -#include - - +}; +DEFINE_STANDARD_HANDLE(SelectBasics_SensitiveEntity, Standard_Transient) #endif // _SelectBasics_SensitiveEntity_HeaderFile diff --git a/src/SelectBasics/SelectBasics_SensitiveEntity.lxx b/src/SelectBasics/SelectBasics_SensitiveEntity.lxx deleted file mode 100644 index 9d134fecc1..0000000000 --- a/src/SelectBasics/SelectBasics_SensitiveEntity.lxx +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) 1998-1999 Matra Datavision -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -//======================================================================= -// function : SensitivityFactor -// purpose : Gets sensitivity factor for the entity -//======================================================================= -inline Standard_Integer SelectBasics_SensitiveEntity::SensitivityFactor() const -{ - return mySFactor; -} -- 2.39.5