mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-24 13:50:49 +03:00
0027567: VIS - possible memory leaks due to use of plain pointers: Fix also the VIS guide. Add the test v3d/ivtk/bug27567. Add a draw command "ivtkremove".
0027734: Configuration - TKIVtkDraw build fails with TBB: Remove unnecessary define statement (windows specific). Small correction of test case for issue CR27567
This commit is contained in:
@@ -14,9 +14,9 @@
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <IVtkVTK_ShapeData.hxx>
|
||||
#include <vtkCellArray.h>
|
||||
#include <vtkCellData.h>
|
||||
#include <vtkDoubleArray.h>
|
||||
#include <vtkIdList.h>
|
||||
#include <vtkIdTypeArray.h>
|
||||
#include <vtkPoints.h>
|
||||
#include <vtkPolyData.h>
|
||||
@@ -38,7 +38,7 @@ IVtkVTK_ShapeData::IVtkVTK_ShapeData()
|
||||
{
|
||||
myPolyData = vtkSmartPointer<vtkPolyData>::New();
|
||||
myPolyData->Allocate();
|
||||
myPolyData->SetPoints (vtkPoints::New());
|
||||
myPolyData->SetPoints (vtkSmartPointer<vtkPoints>::New());
|
||||
|
||||
mySubShapeIDs = vtkSmartPointer<vtkIdTypeArray>::New();
|
||||
mySubShapeIDs->SetName (IVtkVTK_ShapeData::ARRNAME_SUBSHAPE_IDS);
|
||||
@@ -112,7 +112,7 @@ void IVtkVTK_ShapeData::InsertLine (const IVtk_IdType theShapeID,
|
||||
{
|
||||
if (!thePointIds->IsEmpty())
|
||||
{
|
||||
vtkIdList* anIdList = vtkIdList::New();
|
||||
vtkSmartPointer<vtkIdList> anIdList = vtkSmartPointer<vtkIdList>::New();
|
||||
// Fill the vtk id list by ids from IVtk_PointIdList.
|
||||
IVtk_PointIdList::Iterator anIterOfIds =
|
||||
IVtk_PointIdList::Iterator(*thePointIds);
|
||||
@@ -127,7 +127,6 @@ void IVtkVTK_ShapeData::InsertLine (const IVtk_IdType theShapeID,
|
||||
mySubShapeIDs->InsertNextTupleValue (&aShapeIDVTK);
|
||||
const vtkIdType aType = theMeshType;
|
||||
myMeshTypes->InsertNextTupleValue (&aType);
|
||||
anIdList->Delete();
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -17,11 +17,10 @@
|
||||
#define __IVTKVTK_SHAPEDATA_H__
|
||||
|
||||
#include <IVtk_IShapeData.hxx>
|
||||
#include <vtkType.h>
|
||||
#include <vtkPolyData.h>
|
||||
#include <vtkSmartPointer.h>
|
||||
|
||||
class vtkIdTypeArray;
|
||||
class vtkPolyData;
|
||||
|
||||
class IVtkVTK_ShapeData;
|
||||
DEFINE_STANDARD_HANDLE( IVtkVTK_ShapeData, IVtk_IShapeData )
|
||||
@@ -106,7 +105,7 @@ public: //! @name Specific methods
|
||||
|
||||
//! Get VTK PolyData.
|
||||
//! @return VTK PolyData
|
||||
vtkSmartPointer< vtkPolyData > getVtkPolyData() const
|
||||
vtkPolyData* getVtkPolyData() const
|
||||
{ return myPolyData; }
|
||||
|
||||
private:
|
||||
|
@@ -161,7 +161,8 @@ bool IVtkVTK_View::DisplayToWorld (const gp_XY& theDisplayPnt, gp_XYZ& theWorldP
|
||||
return false;
|
||||
}
|
||||
|
||||
theWorldPnt = gp_XYZ (aCoords[0] / aCoords[3], aCoords[1] / aCoords[3], aCoords[2] / aCoords[3]);
|
||||
theWorldPnt = gp_XYZ (aCoords[0] / aCoords[3],
|
||||
aCoords[1] / aCoords[3], aCoords[2] / aCoords[3]);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -188,9 +189,10 @@ void IVtkVTK_View::GetCamera (Graphic3d_Mat4d& theProj,
|
||||
theIsOrtho = !IsPerspective();
|
||||
|
||||
vtkMatrix4x4* aCompositeProj =
|
||||
myRenderer->GetActiveCamera()->GetCompositeProjectionTransformMatrix (myRenderer->GetTiledAspectRatio(),
|
||||
0,
|
||||
1);
|
||||
myRenderer->GetActiveCamera()->
|
||||
GetCompositeProjectionTransformMatrix (myRenderer->GetTiledAspectRatio(),
|
||||
0,
|
||||
1);
|
||||
for (Standard_Integer aRow = 0; aRow < 4; ++aRow)
|
||||
{
|
||||
for (Standard_Integer aCol = 0; aCol < 4; ++aCol)
|
||||
|
@@ -17,6 +17,7 @@
|
||||
#define __IVTKVTK_VIEW_H__
|
||||
|
||||
#include <IVtk_IView.hxx>
|
||||
#include <vtkSmartPointer.h>
|
||||
|
||||
class vtkRenderer;
|
||||
|
||||
@@ -92,7 +93,7 @@ public:
|
||||
DEFINE_STANDARD_RTTIEXT(IVtkVTK_View,IVtk_IView)
|
||||
|
||||
private:
|
||||
vtkRenderer* myRenderer;
|
||||
vtkSmartPointer<vtkRenderer> myRenderer;
|
||||
};
|
||||
|
||||
#endif // __IVTKVTK_VIEW_H__
|
||||
|
Reference in New Issue
Block a user