]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
Refs #289 - Spline profile is represented in OCC view as polyline profile
authornds <nds@opencascade.com>
Thu, 26 Dec 2013 10:30:18 +0000 (10:30 +0000)
committernds <nds@opencascade.com>
Thu, 26 Dec 2013 10:30:18 +0000 (10:30 +0000)
src/HYDROData/HYDROData_PolylineXY.cxx
src/HYDROData/HYDROData_Profile.cxx

index 226cf65ec0d1e804b3fa0a048fc5900c16135626..f55f42b8ce6ab679873e44bc921122f8a8d4d62f 100755 (executable)
@@ -338,7 +338,7 @@ TopoDS_Wire HYDROData_PolylineXY::BuildWire( const SectionType&
       aMakeWire.Add( aPnt );
     }
     if( theIsClosed )
-      aMakeWire.Close();//.Add( thePoints.Value( 1 ) );
+      aMakeWire.Close();
 
     if ( aMakeWire.IsDone() )
       aWire = aMakeWire.Wire();
index f970509e255594371801463ab7ba79218b6f0673..a3cbe730753853d77fcec0d3f75da78e268e1283 100755 (executable)
@@ -4,6 +4,7 @@
 #include "HYDROData_Document.h"
 #include "HYDROData_Iterator.h"
 #include "HYDROData_Tool.h"
+#include "HYDROData_PolylineXY.h"
 
 #include <BRepBuilderAPI_MakeEdge.hxx>
 #include <BRepBuilderAPI_MakeWire.hxx>
@@ -86,41 +87,15 @@ void HYDROData_Profile::Update()
 {
   HYDROData_Object::Update();
 
-  BRepBuilderAPI_MakePolygon aMakeWire;
-
-  ProfilePoints aProfilePoints = GetProfilePoints();
-  for ( int i = 1, n = aProfilePoints.Length(); i <= n ; ++i )
-  {
-    ProfilePoint aPoint = aProfilePoints.Value( i );
-    gp_Pnt aPnt( aPoint.X(), aPoint.Y(), aPoint.Z() );
-    aMakeWire.Add( aPnt );
-  }
-
   TopoDS_Wire aWire;
-  if ( aMakeWire.IsDone() )
-    aWire = aMakeWire.Wire();
-
-  /*BRepBuilderAPI_MakeWire aMakeWire;
-
-  ProfilePoints aProfilePoints = GetProfilePoints();
-  for ( int i = 1, n = aProfilePoints.Length(); i < n ; ++i )
+  Handle(HYDROData_ProfileUZ) aProfile = GetProfileUZ( false );
+  if ( !aProfile.IsNull() )
   {
-    ProfilePoint aFirstPoint = aProfilePoints.Value( i );
-    ProfilePoint aSecPoint = aProfilePoints.Value( i + 1 );
+    ProfilePoints aProfilePoints = GetProfilePoints();
+    HYDROData_IPolyline::SectionType aSectionType = aProfile->GetSectionType( 0 );
 
-    gp_Pnt aPnt1( aFirstPoint.X(), aFirstPoint.Y(), aFirstPoint.Z() );
-    gp_Pnt aPnt2( aSecPoint.X(),   aSecPoint.Y(),   aSecPoint.Z()   );
-
-    BRepBuilderAPI_MakeEdge aMakeEdge( aPnt1, aPnt2 );
-    TopoDS_Edge anEdge = aMakeEdge;
-
-    aMakeWire.Add( anEdge );
+    aWire = HYDROData_PolylineXY::BuildWire( aSectionType, false, aProfilePoints );
   }
-
-  TopoDS_Wire aWire;
-  if ( aMakeWire.IsDone() )
-    aWire = aMakeWire;*/
-
   SetShape3D( aWire );
 }