X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FOBJECT%2FGEOM_OCCReader.cxx;h=5401ee6d240e6eb3a309a9791ae5e16872781b74;hb=8b1511ff6327ae63c450b10e49714d3c83577eda;hp=500fdd35660a98a30c48c8f73e1aee9fe159eba0;hpb=0f1369c27fd6a84ba1149c3c5f3ed181acc055f1;p=modules%2Fgeom.git diff --git a/src/OBJECT/GEOM_OCCReader.cxx b/src/OBJECT/GEOM_OCCReader.cxx index 500fdd356..5401ee6d2 100644 --- a/src/OBJECT/GEOM_OCCReader.cxx +++ b/src/OBJECT/GEOM_OCCReader.cxx @@ -1,53 +1,47 @@ -// GEOM OBJECT : interactive object for Geometry entities visualization +// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. // -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // + +// GEOM OBJECT : interactive object for Geometry entities visualization // File : GEOM_OCCReader.h // Author : Christophe ATTANASIO // Module : GEOM // $Header$ - -using namespace std; +// #include "GEOM_OCCReader.h" -// SALOME Includes -#include "utilities.h" - // VTK Includes -#include "VTKViewer_Common.h" -#include +#include +#include + +#include +#include // OpenCASCADE Includes -#include #include -#include #include #include -#include +#include #include #include -#include -#include -#include #include #include #include @@ -59,21 +53,18 @@ using namespace std; #include #include #include -#include -#include #include -#include -#include -#include #include #include #include #include #include +#include "utilities.h" + -#define MAX2(X, Y) ( Abs(X) > Abs(Y)? Abs(X) : Abs(Y) ) -#define MAX3(X, Y, Z) ( MAX2 ( MAX2(X,Y) , Z) ) +#define MAX2(X, Y) ( Abs(X) > Abs(Y)? Abs(X) : Abs(Y) ) +#define MAX3(X, Y, Z) ( MAX2 ( MAX2(X,Y) , Z) ) // Constante for iso building static Standard_Real IntersectorConfusion = 1.e-10 ; // -8 ; @@ -139,7 +130,7 @@ void GEOM_OCCReader::Execute() { // Allocation Pts = vtkPoints::New(); Cells = vtkCellArray::New(); - + //Compute number of triangles and points Standard_Integer nbpoly=0,nbpts=0; @@ -151,9 +142,9 @@ void GEOM_OCCReader::Execute() { const TopoDS_Face& aFace = TopoDS::Face(myShape); Handle(Poly_Triangulation) aPoly = BRep_Tool::Triangulation(aFace,aLoc); if(aPoly.IsNull()) { - Pts->Delete(); - Cells->Delete(); - return; + Pts->Delete(); + Cells->Delete(); + return; } nbpts = aPoly->NbNodes(); @@ -163,9 +154,9 @@ void GEOM_OCCReader::Execute() { Cells->Allocate(Cells->EstimateSize(nbpoly,3)); } else { - Cells->Delete(); - Pts->Delete(); - return; + Cells->Delete(); + Pts->Delete(); + return; } } @@ -218,8 +209,8 @@ void GEOM_OCCReader::ComputeWireframe(vtkPoints* Pts,vtkCellArray* Cells){ //======================================================================= void GEOM_OCCReader::TransferFaceWData(const TopoDS_Face& aFace, - vtkPoints* Pts, - vtkCellArray* Cells) + vtkPoints* Pts, + vtkCellArray* Cells) { TopoDS_Face aCopyFace = aFace; aCopyFace.Orientation (TopAbs_FORWARD); @@ -232,17 +223,17 @@ void GEOM_OCCReader::TransferFaceWData(const TopoDS_Face& aFace, //======================================================================= void GEOM_OCCReader::createISO (const TopoDS_Face& TopologicalFace, - const Standard_Real Infinite, - const Standard_Integer NbIsos, - vtkPoints* Pts, - vtkCellArray* Cell) + const Standard_Real Infinite, + const Standard_Integer NbIsos, + vtkPoints* Pts, + vtkCellArray* Cell) { Geom2dHatch_Hatcher aHatcher (Geom2dHatch_Intersector (IntersectorConfusion, - IntersectorTangency), - HatcherConfusion2d, - HatcherConfusion3d, - Standard_True, - Standard_False); + IntersectorTangency), + HatcherConfusion2d, + HatcherConfusion3d, + Standard_True, + Standard_False); Standard_Real myInfinite,myUMin,myUMax,myVMin,myVMax; //myInfinite = Precision::Infinite(); @@ -302,27 +293,27 @@ void GEOM_OCCReader::createISO (const TopoDS_Face& TopologicalFace, //-- Test if a TrimmedCurve is necessary if( Abs(PCurve->FirstParameter()-U1)<= Precision::PConfusion() - && Abs(PCurve->LastParameter()-U2)<= Precision::PConfusion()) { + && Abs(PCurve->LastParameter()-U2)<= Precision::PConfusion()) { aHatcher.AddElement (PCurve, TopologicalEdge.Orientation()) ; } else { if (!PCurve->IsPeriodic()) { - Handle (Geom2d_TrimmedCurve) TrimPCurve =Handle(Geom2d_TrimmedCurve)::DownCast(PCurve); - if (!TrimPCurve.IsNull()) { - if (TrimPCurve->BasisCurve()->FirstParameter()-U1 > Precision::PConfusion() || - U2-TrimPCurve->BasisCurve()->LastParameter() > Precision::PConfusion()) { - aHatcher.AddElement (PCurve, TopologicalEdge.Orientation()) ; - return; - } - } - else { - if (PCurve->FirstParameter()-U1 > Precision::PConfusion()){ - U1=PCurve->FirstParameter(); - } - if (U2-PCurve->LastParameter() > Precision::PConfusion()){ - U2=PCurve->LastParameter(); - } - } + Handle (Geom2d_TrimmedCurve) TrimPCurve =Handle(Geom2d_TrimmedCurve)::DownCast(PCurve); + if (!TrimPCurve.IsNull()) { + if (TrimPCurve->BasisCurve()->FirstParameter()-U1 > Precision::PConfusion() || + U2-TrimPCurve->BasisCurve()->LastParameter() > Precision::PConfusion()) { + aHatcher.AddElement (PCurve, TopologicalEdge.Orientation()) ; + return; + } + } + else { + if (PCurve->FirstParameter()-U1 > Precision::PConfusion()){ + U1=PCurve->FirstParameter(); + } + if (U2-PCurve->LastParameter() > Precision::PConfusion()){ + U2=PCurve->LastParameter(); + } + } } Handle (Geom2d_TrimmedCurve) TrimPCurve = new Geom2d_TrimmedCurve (PCurve, U1, U2) ; aHatcher.AddElement (TrimPCurve, TopologicalEdge.Orientation()) ; @@ -379,16 +370,16 @@ void GEOM_OCCReader::createISO (const TopoDS_Face& TopologicalFace, Index = myUInd(IIso) ; if (Index != 0) { if (aHatcher.TrimDone (Index) && !aHatcher.TrimFailed (Index)) { - aHatcher.ComputeDomains (Index); - if (aHatcher.IsDone (Index)) myNbDom = myNbDom + aHatcher.NbDomains (Index) ; + aHatcher.ComputeDomains (Index); + if (aHatcher.IsDone (Index)) myNbDom = myNbDom + aHatcher.NbDomains (Index) ; } } Index = myVInd(IIso) ; if (Index != 0) { if (aHatcher.TrimDone (Index) && !aHatcher.TrimFailed (Index)) { - aHatcher.ComputeDomains (Index); - if (aHatcher.IsDone (Index)) myNbDom = myNbDom + aHatcher.NbDomains (Index) ; + aHatcher.ComputeDomains (Index); + if (aHatcher.IsDone (Index)) myNbDom = myNbDom + aHatcher.NbDomains (Index) ; } } } @@ -405,22 +396,22 @@ void GEOM_OCCReader::createISO (const TopoDS_Face& TopologicalFace, if (UInd != 0) { Standard_Real UPrm = myUPrm.Value (UIso) ; if (!aHatcher.IsDone (UInd)) { - MESSAGE("DBRep_IsoBuilder:: U iso of parameter: "<InsertNextPoint(coord); - int pts[2]; + vtkIdType pts[2]; pts[0] = lastVTKpoint; pts[1] = NewVTKpoint; @@ -493,12 +484,12 @@ void GEOM_OCCReader::DrawTo(gp_Pnt P, // Purpose : Draw an iso on vtk //======================================================================= void GEOM_OCCReader::DrawIso(GeomAbs_IsoType T, - Standard_Real Par, - Standard_Real T1, - Standard_Real T2, - vtkPoints* Pts, - vtkCellArray* Cells, - Standard_Integer& startidx) + Standard_Real Par, + Standard_Real T1, + Standard_Real T2, + vtkPoints* Pts, + vtkCellArray* Cells, + Standard_Integer& startidx) { Standard_Boolean halt = Standard_False; @@ -538,112 +529,112 @@ void GEOM_OCCReader::DrawIso(GeomAbs_IsoType T, V2 = Par; stepV = 0; nbIntv = nbUIntv; - } - + } + S.D0(U1,V1,P); MoveTo(P,Pts); for (Intrv = 1; Intrv <= nbIntv; Intrv++) { if (TI(Intrv) <= T1 && TI(Intrv + 1) <= T1) - continue; + continue; if (TI(Intrv) >= T2 && TI(Intrv + 1) >= T2) - continue; + continue; if (T == GeomAbs_IsoU) { - V1 = Max(T1, TI(Intrv)); - V2 = Min(T2, TI(Intrv + 1)); - stepV = (V2 - V1) / myDiscret; + V1 = Max(T1, TI(Intrv)); + V2 = Min(T2, TI(Intrv + 1)); + stepV = (V2 - V1) / myDiscret; } else { - U1 = Max(T1, TI(Intrv)); - U2 = Min(T2, TI(Intrv + 1)); - stepU = (U2 - U1) / myDiscret; + U1 = Max(T1, TI(Intrv)); + U2 = Min(T2, TI(Intrv + 1)); + stepU = (U2 - U1) / myDiscret; } switch (SurfType) { - //-------------GeomAbs_Plane--------------- + //-------------GeomAbs_Plane--------------- case GeomAbs_Plane : - break; - //----GeomAbs_Cylinder GeomAbs_Cone------ + break; + //----GeomAbs_Cylinder GeomAbs_Cone------ case GeomAbs_Cylinder : case GeomAbs_Cone : - if (T == GeomAbs_IsoV) { - for (j = 1; j < myDiscret; j++) { - U1 += stepU; - V1 += stepV; - S.D0(U1,V1,P); - DrawTo(P,Pts,Cells); - } - } - break; - //---GeomAbs_Sphere GeomAbs_Torus-------- - //GeomAbs_BezierSurface GeomAbs_BezierSurface + if (T == GeomAbs_IsoV) { + for (j = 1; j < myDiscret; j++) { + U1 += stepU; + V1 += stepV; + S.D0(U1,V1,P); + DrawTo(P,Pts,Cells); + } + } + break; + //---GeomAbs_Sphere GeomAbs_Torus-------- + //GeomAbs_BezierSurface GeomAbs_BezierSurface case GeomAbs_Sphere : case GeomAbs_Torus : case GeomAbs_OffsetSurface : case GeomAbs_OtherSurface : - for (j = 1; j < myDiscret; j++) { - U1 += stepU; - V1 += stepV; - S.D0(U1,V1,P); - DrawTo(P,Pts,Cells); - } - break; - //-------------GeomAbs_BSplineSurface------ + for (j = 1; j < myDiscret; j++) { + U1 += stepU; + V1 += stepV; + S.D0(U1,V1,P); + DrawTo(P,Pts,Cells); + } + break; + //-------------GeomAbs_BSplineSurface------ case GeomAbs_BezierSurface : case GeomAbs_BSplineSurface : - for (j = 1; j <= myDiscret/2; j++) { + for (j = 1; j <= myDiscret/2; j++) { - PlotCount = 0; + PlotCount = 0; - PlotIso ( S, T, U1, V1, (T == GeomAbs_IsoV) ? stepU*2. : stepV*2., halt, Pts, Cells); - U1 += stepU*2.; - V1 += stepV*2.; - } - break; - //-------------GeomAbs_SurfaceOfExtrusion-- - //-------------GeomAbs_SurfaceOfRevolution- + PlotIso ( S, T, U1, V1, (T == GeomAbs_IsoV) ? stepU*2. : stepV*2., halt, Pts, Cells); + U1 += stepU*2.; + V1 += stepV*2.; + } + break; + //-------------GeomAbs_SurfaceOfExtrusion-- + //-------------GeomAbs_SurfaceOfRevolution- case GeomAbs_SurfaceOfExtrusion : case GeomAbs_SurfaceOfRevolution : - if ((T == GeomAbs_IsoV && SurfType == GeomAbs_SurfaceOfRevolution) || - (T == GeomAbs_IsoU && SurfType == GeomAbs_SurfaceOfExtrusion)) { - if (SurfType == GeomAbs_SurfaceOfExtrusion) break; - for (j = 1; j < myDiscret; j++) { - U1 += stepU; - V1 += stepV; - S.D0(U1,V1,P); - DrawTo(P,Pts,Cells); - } - } else { - CurvType = (S.BasisCurve())->GetType(); - switch (CurvType) { - case GeomAbs_Line : - break; - case GeomAbs_Circle : - case GeomAbs_Ellipse : - for (j = 1; j < myDiscret; j++) { - U1 += stepU; - V1 += stepV; - S.D0(U1,V1,P); - DrawTo(P,Pts,Cells); - } - break; - case GeomAbs_Parabola : - case GeomAbs_Hyperbola : - case GeomAbs_BezierCurve : - case GeomAbs_BSplineCurve : - case GeomAbs_OtherCurve : - for (j = 1; j <= myDiscret/2; j++) { - - PlotCount = 0; - - PlotIso ( S, T, U1, V1,(T == GeomAbs_IsoV) ? stepU*2. : stepV*2., halt, Pts, Cells); - U1 += stepU*2.; - V1 += stepV*2.; - } - break; - } - } + if ((T == GeomAbs_IsoV && SurfType == GeomAbs_SurfaceOfRevolution) || + (T == GeomAbs_IsoU && SurfType == GeomAbs_SurfaceOfExtrusion)) { + if (SurfType == GeomAbs_SurfaceOfExtrusion) break; + for (j = 1; j < myDiscret; j++) { + U1 += stepU; + V1 += stepV; + S.D0(U1,V1,P); + DrawTo(P,Pts,Cells); + } + } else { + CurvType = (S.BasisCurve())->GetType(); + switch (CurvType) { + case GeomAbs_Line : + break; + case GeomAbs_Circle : + case GeomAbs_Ellipse : + for (j = 1; j < myDiscret; j++) { + U1 += stepU; + V1 += stepV; + S.D0(U1,V1,P); + DrawTo(P,Pts,Cells); + } + break; + case GeomAbs_Parabola : + case GeomAbs_Hyperbola : + case GeomAbs_BezierCurve : + case GeomAbs_BSplineCurve : + case GeomAbs_OtherCurve : + for (j = 1; j <= myDiscret/2; j++) { + + PlotCount = 0; + + PlotIso ( S, T, U1, V1,(T == GeomAbs_IsoV) ? stepU*2. : stepV*2., halt, Pts, Cells); + U1 += stepU*2.; + V1 += stepV*2.; + } + break; + } + } } } S.D0(U2,V2,P); @@ -657,13 +648,13 @@ void GEOM_OCCReader::DrawIso(GeomAbs_IsoType T, //======================================================================= void GEOM_OCCReader::PlotIso (BRepAdaptor_Surface& S, - GeomAbs_IsoType T, - Standard_Real& U, - Standard_Real& V, - Standard_Real Step, - Standard_Boolean& halt, - vtkPoints* Pts, - vtkCellArray* Cells) + GeomAbs_IsoType T, + Standard_Real& U, + Standard_Real& V, + Standard_Real Step, + Standard_Boolean& halt, + vtkPoints* Pts, + vtkCellArray* Cells) { ++PlotCount; @@ -705,8 +696,8 @@ void GEOM_OCCReader::PlotIso (BRepAdaptor_Surface& S, //======================================================================= void GEOM_OCCReader::TransferEdgeWData(const TopoDS_Edge& aEdge, - vtkPoints* Pts, - vtkCellArray* Cells) { + vtkPoints* Pts, + vtkCellArray* Cells) { Handle(Poly_PolygonOnTriangulation) aEdgePoly; @@ -733,22 +724,27 @@ void GEOM_OCCReader::TransferEdgeWData(const TopoDS_Edge& aEdge, edgeTransf = aEdgeLoc.Transformation(); } + gp_Pnt aP1, aP2; + Standard_Integer nbnodes; if (aEdgePoly.IsNull()) { nbnodes = P->NbNodes(); const TColgp_Array1OfPnt& theNodesP = P->Nodes(); + aP1 = theNodesP(1); + aP2 = theNodesP(nbnodes); + float coord[3]; - int pts[2]; - + vtkIdType pts[2]; + for(int j=1;jNodes(); const TColgp_Array1OfPnt& theNodesPoly = T->Nodes(); + aP1 = theNodesPoly(1); + aP2 = theNodesPoly(nbnodes); + float coord[3]; - int pts[2]; + vtkIdType pts[2]; for(int j=1;jInsertNextCell(2,pts); } } + + // vector representation has an arrow on its end + if (myIsVector) + { + if (!isidtrsf) { + // apply edge transformation + aP1.Transform(edgeTransf); + aP2.Transform(edgeTransf); + } + + // draw an arrow + gp_Vec aDirVec (aP1, aP2); + Standard_Real aDist = aDirVec.Magnitude(); + if (aDist < gp::Resolution()) return; + gp_Dir aDirection (aDirVec); + + Standard_Real anAngle = PI/180.*5.; + Standard_Real aLength = aDist/10.; + + Standard_Real dx,dy,dz; + aDirection.Coord(dx,dy,dz); + + // Pointe de la fleche + Standard_Real xo,yo,zo; + aP2.Coord(xo,yo,zo); + + // Centre du cercle base de la fleche + gp_XYZ aPc = aP2.XYZ() - aDirection.XYZ() * aLength; + + // Construction d'un repere i,j pour le cercle + gp_Dir aDirN; + if (Abs(dx) <= Abs(dy) && Abs(dx) <= Abs(dz)) aDirN = gp::DX(); + else if (Abs(dy) <= Abs(dz) && Abs(dy) <= Abs(dx)) aDirN = gp::DY(); + else aDirN = gp::DZ(); + + gp_Dir aDirI = aDirection ^ aDirN; + gp_Dir aDirJ = aDirection ^ aDirI; + + // Add points and segments, composing the arrow + Standard_Real cosinus, sinus, Tg = tan(anAngle); + + float coord[3]; + coord[0] = xo; coord[1] = yo; coord[2] = zo; + + int ptLoc = Pts->InsertNextPoint(coord); + int ptFirst = 0; + int ptPrev = 0; + int ptCur = 0; + + vtkIdType pts[2]; + + int NbPoints = 15; + for (int i = 1; i <= NbPoints; i++, ptPrev = ptCur) + { + cosinus = cos(2. * PI / NbPoints * (i-1)); + sinus = sin(2. * PI / NbPoints * (i-1)); + + gp_XYZ aP = aPc + (aDirI.XYZ() * cosinus + aDirJ.XYZ() * sinus) * aLength * Tg; + coord[0] = aP.X(); + coord[1] = aP.Y(); + coord[2] = aP.Z(); + + // insert pts + ptCur = Pts->InsertNextPoint(coord); + pts[0] = ptCur; + + if (i == 1) { + ptFirst = ptCur; + } + else { + // insert line (ptCur,ptPrev) + pts[1] = ptPrev; + Cells->InsertNextCell(2,pts); + } + + // insert line (ptCur,ptLoc) + pts[1] = ptLoc; + Cells->InsertNextCell(2,pts); + } + + // insert line (ptCur,ptFirst) + pts[0] = ptCur; + pts[1] = ptFirst; + Cells->InsertNextCell(2,pts); + } } /* Standard_Integer nbnodes = aEdgePoly->NbNodes(); @@ -802,7 +886,7 @@ void GEOM_OCCReader::TransferEdgeWData(const TopoDS_Edge& aEdge, const TColgp_Array1OfPnt& theNodes = T->Nodes(); float coord[3]; - int pts[2]; + vtkIdType pts[2]; // PUSH NODES @@ -825,7 +909,7 @@ void GEOM_OCCReader::TransferEdgeWData(const TopoDS_Edge& aEdge, Standard_Integer id1 = Nodesidx(i); Standard_Integer id2 = Nodesidx(i+1); - int pts[2]; + vtkIdType pts[2]; pts[0] = id1-1; pts[1] = id2-1; // insert line (pt1,pt2) @@ -841,13 +925,13 @@ void GEOM_OCCReader::TransferEdgeWData(const TopoDS_Edge& aEdge, //======================================================================= void GEOM_OCCReader::TransferVertexWData(const TopoDS_Vertex& aVertex, - vtkPoints* Pts, - vtkCellArray* Cells) { + vtkPoints* Pts, + vtkCellArray* Cells) { #define ZERO_COORD coord[0] = 0.0; coord[1] = 0.0; coord[2] = 0.0 gp_Pnt P = BRep_Tool::Pnt( aVertex ); float delta = 1, coord[3]; - int pts[2]; + vtkIdType pts[2]; // insert pt ZERO_COORD; coord[0] = +delta; pts[0] = Pts->InsertNextPoint(coord); @@ -871,7 +955,7 @@ void GEOM_OCCReader::TransferVertexWData(const TopoDS_Vertex& aVertex, Cells->InsertNextCell(2,pts); #undef ZERO_COORD -} +} //======================================================================= // Function : TransferEdgeSData( @@ -879,8 +963,8 @@ void GEOM_OCCReader::TransferVertexWData(const TopoDS_Vertex& aVertex, //======================================================================= void GEOM_OCCReader::TransferEdgeSData(const TopoDS_Edge& aFace, - vtkPoints* Pts, - vtkCellArray* Cells) + vtkPoints* Pts, + vtkCellArray* Cells) { } @@ -890,8 +974,8 @@ void GEOM_OCCReader::TransferEdgeSData(const TopoDS_Edge& aFace, // Purpose : Transfert shading data for FACE //======================================================================= void GEOM_OCCReader::TransferFaceSData(const TopoDS_Face& aFace, - vtkPoints* Pts, - vtkCellArray* Cells) { + vtkPoints* Pts, + vtkCellArray* Cells) { TopLoc_Location aLoc; Handle(Poly_Triangulation) aPoly = BRep_Tool::Triangulation(aFace,aLoc); @@ -907,7 +991,7 @@ void GEOM_OCCReader::TransferFaceSData(const TopoDS_Face& aFace, Standard_Integer nbNodesInFace = aPoly->NbNodes(); Standard_Integer nbTriInFace = aPoly->NbTriangles(); - + const Poly_Array1OfTriangle& Triangles = aPoly->Triangles(); const TColgp_Array1OfPnt& Nodes = aPoly->Nodes(); @@ -922,11 +1006,11 @@ void GEOM_OCCReader::TransferFaceSData(const TopoDS_Face& aFace, for(i=1;i<=nbTriInFace;i++) { // Get the triangle - + Standard_Integer N1,N2,N3; Triangles(i).Get(N1,N2,N3); - - int pts[3]; + + vtkIdType pts[3]; pts[0] = N1-1; pts[1] = N2-1; pts[2] = N3-1; Cells->InsertNextCell(3,pts); @@ -965,8 +1049,9 @@ void GEOM_OCCReader::setDisplayMode(int thenewmode) { amode = thenewmode; } -void GEOM_OCCReader::setTopo(const TopoDS_Shape& aShape) { +void GEOM_OCCReader::setTopo(const TopoDS_Shape& aShape, bool isVector) { myShape = aShape; + myIsVector = isVector; } void GEOM_OCCReader::setForceUpdate(Standard_Boolean bol) {