1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0030687: Visualization - remove redundant interfaces SelectBasics_EntityOwner and SelectBasics_SensitiveEntity

SelectBasics_EntityOwner has been merged into SelectMgr_EntityOwner.
Unused property SelectMgr_EntityOwner::ResetLocation() has been removed.
SelectBasics package has been moved from TKService to TKV3d.

SelectBasics_SensitiveEntity has been merged into Select3D_SensitiveEntity.
This commit is contained in:
kgv
2019-05-21 19:42:15 +03:00
parent 547fcc76b2
commit 0ef04197f7
101 changed files with 429 additions and 812 deletions

View File

@@ -1,8 +1,5 @@
SelectBasics.cxx
SelectBasics.hxx
SelectBasics_EntityOwner.cxx
SelectBasics_EntityOwner.hxx
SelectBasics_PickResult.hxx
SelectBasics_SelectingVolumeManager.hxx
SelectBasics_SensitiveEntity.cxx
SelectBasics_SensitiveEntity.hxx

View File

@@ -1,25 +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.
#include <SelectBasics.hxx>
Standard_Integer SelectBasics::MaxOwnerPriority()
{return 9;}
Standard_Integer SelectBasics::MinOwnerPriority()
{return 0;}

View File

@@ -26,14 +26,10 @@ class SelectBasics
{
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();
//! Structure to provide all-in-one result of selection of sensitive for "Matches" method of Select3D_SensitiveEntity.
static Standard_Integer MaxOwnerPriority() { return 9; }
static Standard_Integer MinOwnerPriority() { return 0; }
};
#endif // _SelectBasics_HeaderFile

View File

@@ -1,39 +0,0 @@
// Created on: 1995-02-09
// 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.
#include <SelectBasics_EntityOwner.hxx>
IMPLEMENT_STANDARD_RTTIEXT(SelectBasics_EntityOwner, Standard_Transient)
//========================================
// Function : SelectBasics_EntityOwner
// Purpose :
//========================================
SelectBasics_EntityOwner::SelectBasics_EntityOwner (const Standard_Integer thePriority)
: mypriority (thePriority)
{
//
}
//========================================
// Function : SelectBasics_EntityOwner
// Purpose :
//========================================
SelectBasics_EntityOwner::SelectBasics_EntityOwner()
: mypriority (0)
{
//
}

View File

@@ -17,61 +17,6 @@
#ifndef _SelectBasics_EntityOwner_HeaderFile
#define _SelectBasics_EntityOwner_HeaderFile
#include <Standard.hxx>
#include <Standard_Transient.hxx>
#include <Standard_Type.hxx>
#include <TopLoc_Location.hxx>
//! defines an abstract owner of sensitive primitives.
//! Owners are typically used to establish a connection
//! between sensitive entities and high-level objects (e.g. presentations).
//!
//! Priority : It's possible to give a priority:
//! the scale : [0-9] ; the default priority is 0
//! it allows the predominance of one selected object upon
//! another one if many objects are selected at the same time
//!
//! example : Selection of shapes : the owners are
//! selectable objects (presentations)
//!
//! a user can give vertex priority [3], edges [2] faces [1] shape [0],
//! so that if during selection one vertex one edge and one face are
//! simultaneously detected, the vertex will only be hilighted.
class SelectBasics_EntityOwner : public Standard_Transient
{
DEFINE_STANDARD_RTTIEXT(SelectBasics_EntityOwner, Standard_Transient)
public:
//! sets the selectable priority of the owner
void SetPriority (const Standard_Integer thePriority) { mypriority = thePriority; }
Standard_Integer Priority() const { return mypriority; }
Standard_EXPORT virtual Standard_Boolean HasLocation() const = 0;
Standard_EXPORT virtual void SetLocation (const TopLoc_Location& aLoc) = 0;
Standard_EXPORT virtual void ResetLocation() = 0;
Standard_EXPORT virtual TopLoc_Location Location() const = 0;
public:
//! sets the selectable priority of the owner
void Set (const Standard_Integer thePriority) { SetPriority (thePriority); }
protected:
Standard_EXPORT SelectBasics_EntityOwner (const Standard_Integer thePriority);
Standard_EXPORT SelectBasics_EntityOwner();
protected:
Standard_Integer mypriority;
};
DEFINE_STANDARD_HANDLE(SelectBasics_EntityOwner, Standard_Transient)
#include <SelectMgr_EntityOwner.hxx>
#endif // _SelectBasics_EntityOwner_HeaderFile

View File

@@ -16,8 +16,7 @@
#ifndef _SelectBasics_PickResult_HeaderFile
#define _SelectBasics_PickResult_HeaderFile
#include <Standard.hxx>
#include <NCollection_Vec4.hxx>
#include <gp_Pnt.hxx>
//! This structure provides unified access to the results of Matches() method in all sensitive entities,
//! so that it defines a Depth (distance to the entity along picking ray) and a closest Point on entity.

View File

@@ -1,39 +0,0 @@
// Created on: 1995-01-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.
#include <SelectBasics_SensitiveEntity.hxx>
#include <SelectBasics_EntityOwner.hxx>
#include <TColStd_HArray1OfBoolean.hxx>
IMPLEMENT_STANDARD_RTTIEXT(SelectBasics_SensitiveEntity, Standard_Transient)
//=======================================================================
// function : SelectBasics_SensitiveEntity
// purpose : Creates new empty sensitive entity instance
//=======================================================================
SelectBasics_SensitiveEntity::SelectBasics_SensitiveEntity (const Handle(SelectBasics_EntityOwner)& theOwnerId)
: myOwnerId (theOwnerId),
mySFactor (2) {}
//=======================================================================
// function : Set
// purpose : Sets owner of the entity
//=======================================================================
void SelectBasics_SensitiveEntity::Set (const Handle(SelectBasics_EntityOwner)& theOwnerId)
{
myOwnerId = theOwnerId;
}

View File

@@ -17,78 +17,6 @@
#ifndef _SelectBasics_SensitiveEntity_HeaderFile
#define _SelectBasics_SensitiveEntity_HeaderFile
#include <gp_GTrsf.hxx>
#include <gp_Trsf.hxx>
#include <Standard_Transient.hxx>
#include <SelectBasics_SelectingVolumeManager.hxx>
#include <SelectBasics_PickResult.hxx>
#include <Select3D_BndBox3d.hxx>
class SelectBasics_EntityOwner;
//! root class; the inheriting classes will be able to give
//! sensitive Areas for the dynamic selection algorithms
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
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 { return mySFactor; }
//! Allows to manage sensitivity of a particular sensitive entity
void SetSensitivityFactor (const Standard_Integer theNewSens)
{
Standard_ASSERT_RAISE (theNewSens > 0, "Error! Selection sensitivity have positive value.");
mySFactor = 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;
//! Returns true if the shape corresponding to the entity has init location
virtual Standard_Boolean HasInitLocation() const = 0;
//! Returns inversed location transformation matrix if the shape corresponding
//! to this entity has init location set. Otherwise, returns identity matrix.
virtual gp_GTrsf InvInitLocation() const = 0;
protected:
Standard_EXPORT SelectBasics_SensitiveEntity (const Handle(SelectBasics_EntityOwner)& theOwnerId);
protected:
Handle(SelectBasics_EntityOwner) myOwnerId;
Standard_Integer mySFactor;
};
DEFINE_STANDARD_HANDLE(SelectBasics_SensitiveEntity, Standard_Transient)
#include <Select3D_SensitiveEntity.hxx>
#endif // _SelectBasics_SensitiveEntity_HeaderFile