1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0024023: Revamp the OCCT Handle -- general

Missing headers added; includes of headers "Handle_...hxx" removed.

Misuses of macro Handle() and its use in typedefs corrected.

Alias classes Profile and Option are removed from IFSelect; ones defined in MoniTool are used directly.

Removed header files defining only Handle classes (except Image_PixMap_Handle.hxx)

Classes SelectMgr_BaseFrustum and now inherit Standard_Transient and can be manipulated by Handle (not NCollection_Handle)

Fixed reference-type local variable pointing to temporary object

Use of handle in conditional expressions and comparisons to NULL are replaced by call to method IsNull()
This commit is contained in:
abv
2015-06-30 10:25:12 +03:00
parent 35c0599a42
commit c04c30b3ee
311 changed files with 725 additions and 1175 deletions

View File

@@ -34,6 +34,7 @@
#include <TopoDS_Face.hxx>
#include <TopoDS_Vertex.hxx>
class AIS_AngleDimension;
DEFINE_STANDARD_HANDLE (AIS_AngleDimension, AIS_Dimension)
//! Angle dimension. Can be constructed:

View File

@@ -24,6 +24,7 @@
#include <Standard_Macro.hxx>
#include <Standard_Type.hxx>
class AIS_DiameterDimension;
DEFINE_STANDARD_HANDLE (AIS_DiameterDimension, AIS_Dimension)
//! Diameter dimension. Can be constructued:

View File

@@ -42,6 +42,7 @@
#include <NCollection_Sequence.hxx>
#include <NCollection_Handle.hxx>
class AIS_Dimension;
DEFINE_STANDARD_HANDLE(AIS_Dimension, AIS_InteractiveObject)
//! AIS_Dimension is a base class for 2D presentations of linear (length, diameter, radius)

View File

@@ -28,7 +28,7 @@
#include <Aspect_InteriorStyle.hxx>
#include <Prs3d_ShadingAspect.hxx>
#include <Prs3d_IsoAspect.hxx>
static Handle(Prs3d_LineAspect) GetLineAspect(const Handle(Prs3d_Drawer)& Dr,
const AIS_TypeOfAttribute Att)

View File

@@ -395,11 +395,11 @@ void AIS_InteractiveContext::SetViewAffinity (const Handle(AIS_InteractiveObject
anAffinity->SetVisible (aCView->ViewId, theIsVisible == Standard_True);
if (theIsVisible)
{
theView->View()->ChangeHiddenObjects()->Remove (theIObj);
theView->View()->ChangeHiddenObjects()->Remove (theIObj.get());
}
else
{
theView->View()->ChangeHiddenObjects()->Add (theIObj);
theView->View()->ChangeHiddenObjects()->Add (theIObj.get());
}
}
@@ -2435,7 +2435,7 @@ void AIS_InteractiveContext::ClearGlobal (const Handle(AIS_InteractiveObject)& t
myMainVwr->Viewer()->UnregisterObject (theIObj);
for (myMainVwr->InitDefinedViews(); myMainVwr->MoreDefinedViews(); myMainVwr->NextDefinedViews())
{
myMainVwr->DefinedView()->View()->ChangeHiddenObjects()->Remove (theIObj);
myMainVwr->DefinedView()->View()->ChangeHiddenObjects()->Remove (theIObj.get());
}
if (theToUpdateviewer
@@ -2826,7 +2826,7 @@ void AIS_InteractiveContext::Disconnect (const Handle(AIS_InteractiveObject)& th
theObj->Disconnect (theObjToDisconnect);
mgrSelector->Remove (theObjToDisconnect);
}
else if (theAssembly->IsInstance ("AIS_ConnectedInteractive") && theObjToDisconnect == NULL)
else if (theAssembly->IsInstance ("AIS_ConnectedInteractive") && theObjToDisconnect.IsNull())
{
const Handle(AIS_ConnectedInteractive)& theObj =
Handle(AIS_ConnectedInteractive)::DownCast (theAssembly);

View File

@@ -674,7 +674,7 @@ Standard_Integer AIS_InteractiveContext::PurgeDisplay()
//=======================================================================
Standard_Integer AIS_InteractiveContext::PurgeViewer(const Handle(V3d_Viewer)& Vwr)
{
const Handle(Graphic3d_StructureManager)& GSM = Vwr->Viewer();
Handle(Graphic3d_StructureManager) GSM = Vwr->Viewer();
Standard_Integer NbCleared(0);
Graphic3d_MapOfStructure SOS;
GSM->DisplayedStructures(SOS);

View File

@@ -41,6 +41,7 @@
#include <BRepAdaptor_Curve.hxx>
#include <Geom_Ellipse.hxx>
#include <Geom_OffsetCurve.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <Geom_Plane.hxx>
#include <Geom_Surface.hxx>
@@ -323,7 +324,7 @@ void AIS_MaxRadiusDimension::ComputeSelection(const Handle(SelectMgr_Selection)&
else
parStart = par;
Handle(Geom_TrimmedCurve)TrimCurve;
Handle(Geom_Curve)TrimCurve;
if(myIsOffset)
{
Handle(Geom_Curve) aCurve = myOffsetCurve;

View File

@@ -42,6 +42,7 @@
#include <BRepAdaptor_Curve.hxx>
#include <Geom_Ellipse.hxx>
#include <Geom_OffsetCurve.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <Geom_Plane.hxx>
#include <Geom_Surface.hxx>
@@ -325,7 +326,7 @@ void AIS_MinRadiusDimension::ComputeSelection(const Handle(SelectMgr_Selection)&
}
else
parStart = par;
Handle(Geom_TrimmedCurve)TrimCurve;
Handle(Geom_Curve)TrimCurve;
if(myIsOffset)
{
Handle(Geom_Curve) aCurve = myOffsetCurve;

View File

@@ -27,6 +27,7 @@
#include <TColgp_HArray1OfDir.hxx>
#include <TColgp_HArray1OfPnt.hxx>
class AIS_PointCloud;
DEFINE_STANDARD_HANDLE(AIS_PointCloud, AIS_InteractiveObject)
//! Interactive object for set of points.

View File

@@ -22,6 +22,7 @@
#include <Standard.hxx>
#include <Standard_Macro.hxx>
class AIS_RadiusDimension;
DEFINE_STANDARD_HANDLE (AIS_RadiusDimension,AIS_Dimension)
//! Radius dimension. Can be constructued: