1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-03 14:10:33 +03:00

0031458: Visualization - refine classes across Prs3d and StdPrs packages

Prs3d::GetDeflection() has been moved to StdPrs_ToolTriangulatedShape::GetDeflection().
Prs3d_ShapeTool has been moved to StdPrs_ShapeTool.
Code collecting free edges on Poly_Triangulation
has been moved out from StdPrs_WFShape to Prs3d::AddFreeEdges().
StdPrs_BndBox has been moved to Prs3d_BndBox.
Geom_Transformation has been replaced by TopLoc_Datum3D within visualization classes.

Select3D_SensitiveCircle constructor now takes gp_Circ instead of Geom_Circle.
StdSelect_ViewerSelector3d has been moved to SelectMgr_ViewerSelector3d.
Methods ::GetPoint3d() and ::ArrayBounds() has been moved
from subclass Select3D_SensitiveCircle to the base class Select3D_SensitiveCurve.
StdSelect_ViewerSelector3d::computeSensitivePrs() has been moved to SelectMgr::ComputeSensitivePrs().

Removed unused declarations StdSelect_Prs, StdSelect_DisplayMode,
StdSelect_SensitivityMode, StdSelect_TypeOfResult, SelectMgr_SOPtr, TColQuantity.

Package Graphic3d has been moved from TKV3d to TKService.
This commit is contained in:
kgv
2020-03-14 13:32:48 +03:00
committed by bugmaster
parent 787ff2408c
commit 7f24b768c3
127 changed files with 2215 additions and 2992 deletions

View File

@@ -2,27 +2,17 @@ StdSelect.cxx
StdSelect.hxx
StdSelect_BRepOwner.cxx
StdSelect_BRepOwner.hxx
StdSelect_BRepOwner.lxx
StdSelect_BRepSelectionTool.cxx
StdSelect_BRepSelectionTool.hxx
StdSelect_DisplayMode.hxx
StdSelect_EdgeFilter.cxx
StdSelect_EdgeFilter.hxx
StdSelect_FaceFilter.cxx
StdSelect_FaceFilter.hxx
StdSelect_IndexedDataMapOfOwnerPrs.hxx
StdSelect_Prs.cxx
StdSelect_Prs.hxx
StdSelect_Prs.lxx
StdSelect_SensitivityMode.hxx
StdSelect_Shape.cxx
StdSelect_Shape.hxx
StdSelect_ShapeTypeFilter.cxx
StdSelect_ShapeTypeFilter.hxx
StdSelect_ShapeTypeFilter.lxx
StdSelect_TypeOfEdge.hxx
StdSelect_TypeOfFace.hxx
StdSelect_TypeOfResult.hxx
StdSelect_TypeOfSelectionImage.hxx
StdSelect_ViewerSelector3d.cxx
StdSelect_ViewerSelector3d.hxx

View File

@@ -14,23 +14,10 @@
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#include <Aspect_TypeOfLine.hxx>
#include <gp_Ax3.hxx>
#include <gp_Dir.hxx>
#include <gp_Pnt.hxx>
#include <Graphic3d_AspectLine3d.hxx>
#include <Graphic3d_Group.hxx>
#include <Graphic3d_Structure.hxx>
#include <Graphic3d_StructureManager.hxx>
#include <Quantity_NameOfColor.hxx>
#include <Select3D_SensitiveCurve.hxx>
#include <Select3D_SensitiveFace.hxx>
#include <Select3D_SensitiveSegment.hxx>
#include <SelectMgr_Selection.hxx>
#include <StdSelect.hxx>
#include <SelectMgr_Selection.hxx>
#include <StdSelect_BRepOwner.hxx>
#include <TColgp_HArray1OfPnt.hxx>
//=======================================================================
//function : SetDrawerForBRepOwner

View File

@@ -17,20 +17,8 @@
#ifndef _StdSelect_HeaderFile
#define _StdSelect_HeaderFile
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
#include <SelectMgr_Selection.hxx>
#include <Prs3d_Drawer.hxx>
class StdSelect_BRepSelectionTool;
class StdSelect_BRepOwner;
class StdSelect_EdgeFilter;
class StdSelect_FaceFilter;
class StdSelect_ShapeTypeFilter;
class StdSelect_Prs;
class StdSelect_Shape;
//! The StdSelect package provides the following services
//! - the definition of selection modes for topological shapes
@@ -58,39 +46,10 @@ public:
DEFINE_STANDARD_ALLOC
//! puts The same drawer in every BRepOwner Of SensitivePrimitive
//! Used Only for hilight Of BRepOwner...
Standard_EXPORT static void SetDrawerForBRepOwner (const Handle(SelectMgr_Selection)& aSelection, const Handle(Prs3d_Drawer)& aDrawer);
protected:
private:
friend class StdSelect_BRepSelectionTool;
friend class StdSelect_BRepOwner;
friend class StdSelect_EdgeFilter;
friend class StdSelect_FaceFilter;
friend class StdSelect_ShapeTypeFilter;
friend class StdSelect_Prs;
friend class StdSelect_Shape;
};
#endif // _StdSelect_HeaderFile

View File

@@ -1,36 +0,0 @@
// 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.
#include <StdSelect_Shape.hxx>
inline Standard_Boolean StdSelect_BRepOwner::HasHilightMode() const
{return myCurMode == -1;}
inline void StdSelect_BRepOwner::SetHilightMode(const Standard_Integer HiMod)
{myCurMode=HiMod;}
inline void StdSelect_BRepOwner::ResetHilightMode()
{myCurMode =-1;}
inline Standard_Integer StdSelect_BRepOwner::HilightMode() const
{return myCurMode;}
inline const TopoDS_Shape& StdSelect_BRepOwner::Shape() const
{return myShape;}
inline Standard_Boolean StdSelect_BRepOwner::HasShape() const
{return !myShape.IsNull();}
inline Standard_Boolean StdSelect_BRepOwner::ComesFromDecomposition() const
{return myFromDecomposition;}

View File

@@ -25,7 +25,6 @@
#include <BRepTools.hxx>
#include <BRepTools_WireExplorer.hxx>
#include <GCPnts_TangentialDeflection.hxx>
#include <Geom_Circle.hxx>
#include <GeomAbs_SurfaceType.hxx>
#include <GeomAdaptor_Curve.hxx>
#include <gp_Circ.hxx>
@@ -482,10 +481,10 @@ void StdSelect_BRepSelectionTool::GetEdgeSensitive (const TopoDS_Shape& theShape
}
case GeomAbs_Circle:
{
Handle (Geom_Circle) aCircle = new Geom_Circle (cu3d.Circle());
if (aCircle->Radius() <= Precision::Confusion())
const gp_Circ aCircle = cu3d.Circle();
if (aCircle.Radius() <= Precision::Confusion())
{
theSelection->Add (new Select3D_SensitivePoint (theOwner, aCircle->Location()));
theSelection->Add (new Select3D_SensitivePoint (theOwner, aCircle.Location()));
}
else
{
@@ -704,7 +703,7 @@ Standard_Boolean StdSelect_BRepSelectionTool::GetSensitiveForFace (const TopoDS_
}
else
{
theSensitiveList.Append (new Select3D_SensitiveCircle (theOwner, new Geom_Circle (cu3d.Circle()), theInteriorFlag, 16));
theSensitiveList.Append (new Select3D_SensitiveCircle (theOwner, cu3d.Circle(), theInteriorFlag, 16));
}
}
}

View File

@@ -1,28 +0,0 @@
// Created on: 1995-03-08
// 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.
#ifndef _StdSelect_DisplayMode_HeaderFile
#define _StdSelect_DisplayMode_HeaderFile
enum StdSelect_DisplayMode
{
StdSelect_DM_Wireframe,
StdSelect_DM_Shading,
StdSelect_DM_HLR
};
#endif // _StdSelect_DisplayMode_HeaderFile

View File

@@ -1,27 +0,0 @@
// Created on: 1995-03-08
// 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.
#ifndef StdSelect_IndexedDataMapOfOwnerPrs_HeaderFile
#define StdSelect_IndexedDataMapOfOwnerPrs_HeaderFile
#include <SelectMgr_EntityOwner.hxx>
#include <StdSelect_Prs.hxx>
#include <TColStd_MapTransientHasher.hxx>
#include <NCollection_IndexedDataMap.hxx>
typedef NCollection_IndexedDataMap<Handle(SelectMgr_EntityOwner), Handle(StdSelect_Prs), TColStd_MapTransientHasher> StdSelect_IndexedDataMapOfOwnerPrs;
#endif

View File

@@ -1,28 +0,0 @@
// Created on: 1995-03-17
// Created by: Robert COUBLANC
// 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 <Graphic3d_StructureManager.hxx>
#include <Standard_Type.hxx>
#include <StdSelect_Prs.hxx>
IMPLEMENT_STANDARD_RTTIEXT(StdSelect_Prs,Prs3d_Presentation)
StdSelect_Prs::
StdSelect_Prs(const Handle(Graphic3d_StructureManager)& aStructureManager):
Prs3d_Presentation(aStructureManager),
myManager(aStructureManager){}

View File

@@ -1,67 +0,0 @@
// Created on: 1995-03-17
// Created by: Robert COUBLANC
// 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.
#ifndef _StdSelect_Prs_HeaderFile
#define _StdSelect_Prs_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <Prs3d_Presentation.hxx>
class Graphic3d_StructureManager;
class StdSelect_Prs;
DEFINE_STANDARD_HANDLE(StdSelect_Prs, Prs3d_Presentation)
//! allows entities owners to be hilighted
//! independantly from PresentableObjects
class StdSelect_Prs : public Prs3d_Presentation
{
public:
Standard_EXPORT StdSelect_Prs(const Handle(Graphic3d_StructureManager)& aStructureManager);
const Handle(Graphic3d_StructureManager)& Manager() const;
DEFINE_STANDARD_RTTIEXT(StdSelect_Prs,Prs3d_Presentation)
protected:
private:
Handle(Graphic3d_StructureManager) myManager;
};
#include <StdSelect_Prs.lxx>
#endif // _StdSelect_Prs_HeaderFile

View File

@@ -1,16 +0,0 @@
// 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.
inline const Handle(Graphic3d_StructureManager)& StdSelect_Prs::
Manager() const {return myManager;}

View File

@@ -1,29 +0,0 @@
// Created on: 1995-03-08
// 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.
#ifndef _StdSelect_SensitivityMode_HeaderFile
#define _StdSelect_SensitivityMode_HeaderFile
//! Selection sensitivity mode. SM_WINDOW mode uses the
//! specified pixel tolerance to compute the sensitivity value,
//! SM_VIEW mode allows to define the sensitivity manually.
enum StdSelect_SensitivityMode
{
StdSelect_SM_WINDOW,
StdSelect_SM_VIEW
};
#endif // _StdSelect_SensitivityMode_HeaderFile

View File

@@ -16,7 +16,6 @@
#include <StdSelect_Shape.hxx>
#include <Geom_Transformation.hxx>
#include <Prs3d_Drawer.hxx>
#include <Prs3d_Presentation.hxx>
#include <Standard_Type.hxx>

View File

@@ -17,67 +17,33 @@
#ifndef _StdSelect_ShapeTypeFilter_HeaderFile
#define _StdSelect_ShapeTypeFilter_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <TopAbs_ShapeEnum.hxx>
#include <SelectMgr_Filter.hxx>
#include <Standard_Boolean.hxx>
class SelectMgr_EntityOwner;
class StdSelect_ShapeTypeFilter;
DEFINE_STANDARD_HANDLE(StdSelect_ShapeTypeFilter, SelectMgr_Filter)
//! A filter framework which allows you to define a filter
//! for a specific shape type. The types available include:
//! - compound
//! - compsolid
//! - solid
//! - shell
//! - face
//! - wire
//! - edge
//! - vertex.
//! A filter framework which allows you to define a filter for a specific shape type.
class StdSelect_ShapeTypeFilter : public SelectMgr_Filter
{
DEFINE_STANDARD_RTTIEXT(StdSelect_ShapeTypeFilter, SelectMgr_Filter)
public:
//! Constructs a filter object defined by the shape type aType.
Standard_EXPORT StdSelect_ShapeTypeFilter(const TopAbs_ShapeEnum aType);
Standard_EXPORT virtual Standard_Boolean IsOk (const Handle(SelectMgr_EntityOwner)& anobj) const Standard_OVERRIDE;
//! Returns the type of shape selected by the filter.
TopAbs_ShapeEnum Type() const;
TopAbs_ShapeEnum Type() const {return myType;}
Standard_EXPORT virtual Standard_Boolean IsOk (const Handle(SelectMgr_EntityOwner)& anobj) const Standard_OVERRIDE;
Standard_EXPORT virtual Standard_Boolean ActsOn (const TopAbs_ShapeEnum aStandardMode) const Standard_OVERRIDE;
DEFINE_STANDARD_RTTIEXT(StdSelect_ShapeTypeFilter,SelectMgr_Filter)
protected:
private:
TopAbs_ShapeEnum myType;
};
#include <StdSelect_ShapeTypeFilter.lxx>
#endif // _StdSelect_ShapeTypeFilter_HeaderFile

View File

@@ -1,18 +0,0 @@
// Created on: 1997-03-06
// 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.
inline TopAbs_ShapeEnum StdSelect_ShapeTypeFilter::Type() const
{return myType;}

View File

@@ -1,29 +0,0 @@
// Created on: 1995-03-08
// 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.
#ifndef _StdSelect_TypeOfResult_HeaderFile
#define _StdSelect_TypeOfResult_HeaderFile
//! Provides values for type of result.
//! These are used to specify whether the result is to
//! be simple or whether it may be multiple.
enum StdSelect_TypeOfResult
{
StdSelect_TOR_SIMPLE,
StdSelect_TOR_MULTIPLE
};
#endif // _StdSelect_TypeOfResult_HeaderFile

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,4 @@
// Created on: 1995-03-15
// Created by: Robert COUBLANC
// Copyright (c) 1995-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
// Copyright (c) 2020 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
@@ -17,102 +14,8 @@
#ifndef _StdSelect_ViewerSelector3d_HeaderFile
#define _StdSelect_ViewerSelector3d_HeaderFile
#include <Standard.hxx>
#include <Standard_Type.hxx>
#include <Standard_Type.hxx>
#include <SelectMgr_ViewerSelector3d.hxx>
#include <Graphic3d_SequenceOfStructure.hxx>
#include <Graphic3d_SequenceOfHClipPlane.hxx>
#include <SelectMgr_ViewerSelector.hxx>
#include <SelectMgr_Selection.hxx>
#include <StdSelect_TypeOfSelectionImage.hxx>
#include <NCollection_Handle.hxx>
#include <V3d_ImageDumpOptions.hxx>
typedef SelectMgr_ViewerSelector3d StdSelect_ViewerSelector3d;
class Graphic3d_Group;
class Graphic3d_Structure;
class Graphic3d_TransformPers;
class V3d_View;
class SelectMgr_EntityOwner;
class SelectMgr_SelectableObjectSet;
//! Selector Usable by Viewers from V3d
class StdSelect_ViewerSelector3d : public SelectMgr_ViewerSelector
{
public:
//! Constructs an empty 3D selector object.
Standard_EXPORT StdSelect_ViewerSelector3d();
//! Sets the pixel tolerance <theTolerance>.
Standard_EXPORT void SetPixelTolerance (const Standard_Integer theTolerance);
//! Returns the pixel tolerance.
Standard_Integer PixelTolerance() const { return myTolerances.Tolerance(); }
//! Picks the sensitive entity at the pixel coordinates of
//! the mouse <theXPix> and <theYPix>. The selector looks for touched areas and owners.
Standard_EXPORT void Pick (const Standard_Integer theXPix,
const Standard_Integer theYPix,
const Handle(V3d_View)& theView);
//! Picks the sensitive entity according to the minimum
//! and maximum pixel values <theXPMin>, <theYPMin>, <theXPMax>
//! and <theYPMax> defining a 2D area for selection in the 3D view aView.
Standard_EXPORT void Pick (const Standard_Integer theXPMin,
const Standard_Integer theYPMin,
const Standard_Integer theXPMax,
const Standard_Integer theYPMax,
const Handle(V3d_View)& theView);
//! pick action - input pixel values for polyline selection for selection.
Standard_EXPORT void Pick (const TColgp_Array1OfPnt2d& thePolyline,
const Handle(V3d_View)& theView);
//! Dump of detection results into image.
//! This method performs axis picking for each pixel in the image
//! and generates a color depending on picking results and selection image type.
//! @param theImage result image, should be initialized
//! @param theView 3D view defining camera position
//! @param theType type of image to define
//! @param thePickedIndex index of picked entity (1 means topmost)
Standard_EXPORT Standard_Boolean ToPixMap (Image_PixMap& theImage,
const Handle(V3d_View)& theView,
const StdSelect_TypeOfSelectionImage theType,
const Standard_Integer thePickedIndex = 1);
//! Displays sensitives in view <theView>.
Standard_EXPORT void DisplaySensitive (const Handle(V3d_View)& theView);
Standard_EXPORT void ClearSensitive (const Handle(V3d_View)& theView);
Standard_EXPORT void DisplaySensitive (const Handle(SelectMgr_Selection)& theSel,
const gp_Trsf& theTrsf,
const Handle(V3d_View)& theView,
const Standard_Boolean theToClearOthers = Standard_True);
//! Dumps the content of me into the stream
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
DEFINE_STANDARD_RTTIEXT(StdSelect_ViewerSelector3d,SelectMgr_ViewerSelector)
protected:
Standard_EXPORT void computeSensitivePrs (const Handle(Graphic3d_Structure)& theStructure,
const Handle(SelectMgr_Selection)& theSel,
const gp_Trsf& theLoc,
const Handle(Graphic3d_TransformPers)& theTrsfPers);
//! Update z-layers order map.
Standard_EXPORT void updateZLayers (const Handle(V3d_View)& theView);
protected:
Graphic3d_SequenceOfStructure myStructs;
};
DEFINE_STANDARD_HANDLE(StdSelect_ViewerSelector3d, SelectMgr_ViewerSelector)
#endif
#endif // _StdSelect_ViewerSelector3d_HeaderFile