1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-19 13:40:49 +03:00

0028778: Coding Rules - clean up confusing code from Select3D

This commit is contained in:
kgv
2017-05-23 19:05:41 +03:00
committed by bugmaster
parent 69f1a8997e
commit 0609d8ee53
37 changed files with 143 additions and 644 deletions

View File

@@ -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

View File

@@ -19,12 +19,7 @@
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <Standard_Integer.hxx>
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

View File

@@ -18,10 +18,8 @@
#define _SelectBasics_EntityOwner_HeaderFile
#include <Standard.hxx>
#include <Standard_Integer.hxx>
#include <Standard_Transient.hxx>
#include <Standard_Type.hxx>
#include <Standard_Boolean.hxx>
#include <TopLoc_Location.hxx>
//! defines an abstract owner of sensitive primitives.

View File

@@ -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;}

View File

@@ -14,13 +14,12 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <SelectBasics_SensitiveEntity.hxx>
#include <SelectBasics_EntityOwner.hxx>
#include <SelectBasics_SensitiveEntity.hxx>
#include <Standard_Type.hxx>
#include <TColStd_HArray1OfBoolean.hxx>
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

View File

@@ -19,63 +19,51 @@
#include <gp_GTrsf.hxx>
#include <gp_Trsf.hxx>
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <Standard_Real.hxx>
#include <MMgt_TShared.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Transient.hxx>
#include <SelectBasics_SelectingVolumeManager.hxx>
#include <SelectBasics_PickResult.hxx>
#include <Standard_Integer.hxx>
#include <Select3D_BndBox3d.hxx>
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);
protected:
Handle(SelectBasics_EntityOwner) myOwnerId;
private:
Standard_Integer mySFactor;
};
#include <SelectBasics_SensitiveEntity.lxx>
DEFINE_STANDARD_HANDLE(SelectBasics_SensitiveEntity, Standard_Transient)
#endif // _SelectBasics_SensitiveEntity_HeaderFile

View File

@@ -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;
}