mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-29 14:00:49 +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:
@@ -61,7 +61,7 @@ IVtkOCC_SelectableObject::IVtkOCC_SelectableObject()
|
||||
void IVtkOCC_SelectableObject::SetShape (const IVtkOCC_Shape::Handle& theShape)
|
||||
{
|
||||
myShape = theShape;
|
||||
if (myShape)
|
||||
if (! myShape.IsNull())
|
||||
{
|
||||
myShape->SetSelectableObject (this);
|
||||
}
|
||||
@@ -78,7 +78,7 @@ void IVtkOCC_SelectableObject::SetShape (const IVtkOCC_Shape::Handle& theShape)
|
||||
void IVtkOCC_SelectableObject::ComputeSelection (const Handle(SelectMgr_Selection)& theSelection,
|
||||
const Standard_Integer theMode)
|
||||
{
|
||||
if (!myShape)
|
||||
if (myShape.IsNull())
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -143,7 +143,7 @@ void IVtkOCC_SelectableObject::ComputeSelection (const Handle(SelectMgr_Selectio
|
||||
//============================================================================
|
||||
const Bnd_Box& IVtkOCC_SelectableObject::BoundingBox()
|
||||
{
|
||||
if (!myShape)
|
||||
if (myShape.IsNull())
|
||||
{
|
||||
myBndBox.SetVoid();
|
||||
return myBndBox;
|
||||
|
@@ -21,6 +21,7 @@
|
||||
#include <TopTools_IndexedMapOfShape.hxx>
|
||||
#include <SelectMgr_SelectableObject.hxx>
|
||||
|
||||
class IVtkOCC_Shape;
|
||||
DEFINE_STANDARD_HANDLE( IVtkOCC_Shape, IVtk_IShape )
|
||||
|
||||
//! @class IVtkOCC_Shape
|
||||
|
@@ -25,6 +25,8 @@
|
||||
#include <Hatch_Hatcher.hxx>
|
||||
#include <GCPnts_QuasiUniformDeflection.hxx>
|
||||
#include <GCPnts_TangentialDeflection.hxx>
|
||||
#include <Geom_BezierSurface.hxx>
|
||||
#include <Geom_BSplineSurface.hxx>
|
||||
#include <Geom2dAdaptor_Curve.hxx>
|
||||
#include <GeomAdaptor_Curve.hxx>
|
||||
#include <gp_Dir2d.hxx>
|
||||
|
@@ -34,6 +34,7 @@ typedef NCollection_DataMap <TopoDS_Shape, IVtk_MeshType, TopTools_ShapeMapHashe
|
||||
typedef NCollection_Sequence <gp_Pnt> IVtk_Polyline;
|
||||
typedef NCollection_List <IVtk_Polyline> IVtk_PolylineList;
|
||||
|
||||
class IVtkOCC_ShapeMesher;
|
||||
DEFINE_STANDARD_HANDLE( IVtkOCC_ShapeMesher, IVtk_IShapeMesher )
|
||||
|
||||
//! @class IVtkOCC_ShapeMesher
|
||||
|
@@ -57,7 +57,7 @@ IVtk_SelectionModeList IVtkOCC_ShapePickerAlgo::GetSelectionModes (
|
||||
{
|
||||
IVtk_SelectionModeList aRes;
|
||||
|
||||
if (theShape)
|
||||
if (! theShape.IsNull())
|
||||
{
|
||||
// Get shape implementation from shape interface.
|
||||
Handle(IVtkOCC_Shape) aShapeImpl = Handle(IVtkOCC_Shape)::DownCast(theShape);
|
||||
@@ -90,7 +90,7 @@ void IVtkOCC_ShapePickerAlgo::SetSelectionMode (const IVtk_IShape::Handle& theSh
|
||||
const IVtk_SelectionMode theMode,
|
||||
const bool theIsTurnOn)
|
||||
{
|
||||
if (!theShape)
|
||||
if (theShape.IsNull())
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -305,14 +305,14 @@ bool IVtkOCC_ShapePickerAlgo::processPicked()
|
||||
Handle(IVtkOCC_SelectableObject) aSelectable =
|
||||
Handle(IVtkOCC_SelectableObject)::DownCast (anEntityOwner->Selectable());
|
||||
|
||||
if (!aSelectable)
|
||||
if (aSelectable.IsNull())
|
||||
{
|
||||
anOutput << "Error: EntityOwner having null SelectableObject picked!";
|
||||
continue;
|
||||
}
|
||||
|
||||
Handle(IVtkOCC_Shape) aSelShape = aSelectable->GetShape();
|
||||
if (!aSelShape)
|
||||
if (aSelShape.IsNull())
|
||||
{
|
||||
anOutput << "Error: SelectableObject with null OccShape pointer picked!";
|
||||
continue;
|
||||
|
@@ -19,6 +19,7 @@
|
||||
#include <IVtk_IShapePickerAlgo.hxx>
|
||||
#include <IVtkOCC_ViewerSelector.hxx>
|
||||
|
||||
class IVtkOCC_ShapePickerAlgo;
|
||||
DEFINE_STANDARD_HANDLE( IVtkOCC_ShapePickerAlgo, IVtk_IShapePickerAlgo )
|
||||
|
||||
//! @class IVtkOCC_ShapePickerAlgo
|
||||
|
Reference in New Issue
Block a user