]> OCCT Git - occt-copy.git/commitdiff
0032488: Repack toolkit TKDraw to avoid possible cyclic dependency CR32488
authorjgv <jgv@opencascade.com>
Tue, 20 Jul 2021 16:33:25 +0000 (19:33 +0300)
committerjgv <jgv@opencascade.com>
Tue, 20 Jul 2021 16:38:36 +0000 (19:38 +0300)
First version

22 files changed:
adm/MODULES
adm/UDLIST
src/DBRep/DBRep.cxx
src/DBRep/DBRep_DrawableShape.cxx
src/Draw/Draw.cxx
src/Draw/Draw.hxx
src/Draw/Draw_PntParams.hxx [new file with mode: 0644]
src/Draw/Draw_Point.cxx [new file with mode: 0644]
src/Draw/Draw_Point.hxx [new file with mode: 0644]
src/Draw/FILES
src/DrawTrSurf/DrawTrSurf_Curve.cxx
src/DrawTrSurf/DrawTrSurf_Curve2d.cxx
src/IntWalk/IntWalk_IWalking_3.gxx
src/IntWalk/IntWalk_IWalking_4.gxx
src/OS/Draw.tcl
src/TKDraw/EXTERNLIB
src/TKDraw/PACKAGES
src/TKDrawBase/CMakeLists.txt [new file with mode: 0644]
src/TKDrawBase/EXTERNLIB [new file with mode: 0644]
src/TKDrawBase/FILES [new file with mode: 0644]
src/TKDrawBase/PACKAGES [new file with mode: 0644]
src/TKGeomAlgo/EXTERNLIB

index 724bf81776b9bce84f78f9102e9702a8fcc6e160..77b81cd911d9a0bef592b7ef7f79263e4a73498d 100644 (file)
@@ -4,4 +4,4 @@ ModelingAlgorithms TKGeomAlgo TKTopAlgo TKPrim TKBO TKBool TKHLR TKFillet TKOffs
 Visualization TKService TKV3d TKOpenGl TKOpenGles TKMeshVS TKIVtk TKD3DHost
 ApplicationFramework TKCDF TKLCAF TKCAF TKBinL TKXmlL TKBin TKXml TKStdL TKStd TKTObj TKBinTObj TKXmlTObj TKVCAF
 DataExchange TKXSBase TKSTEPBase TKSTEPAttr TKSTEP209 TKSTEP TKIGES TKXCAF TKXDEIGES TKXDESTEP TKSTL TKVRML TKXmlXCAF TKBinXCAF TKRWMesh
-Draw TKDraw TKTopTest TKOpenGlTest TKOpenGlesTest TKD3DHostTest TKViewerTest TKXSDRAW TKDCAF TKXDEDRAW TKTObjDRAW TKQADraw TKIVtkDraw DRAWEXE
+Draw TKDrawBase TKDraw TKTopTest TKOpenGlTest TKOpenGlesTest TKD3DHostTest TKViewerTest TKXSDRAW TKDCAF TKXDEDRAW TKTObjDRAW TKQADraw TKIVtkDraw DRAWEXE
index f5d21762448343c96aaef8b32c6981444785ef83..008763fabf1b3507a65c16e75f255d8045b13555 100644 (file)
@@ -415,6 +415,7 @@ n XSDRAWSTEP
 n XSDRAWSTLVRML
 r DrawResources
 t TKDCAF
+t TKDrawBase
 t TKDraw
 t TKTObjDRAW
 t TKTopTest
index 8e7e90943b401e6533c8691d63316e194fd9c166..5b487ccc7b70b52571a118ec065ea08b811318d1 100644 (file)
@@ -50,7 +50,7 @@
 #include <stdio.h>
 // memory management
 #ifdef _WIN32
-extern Draw_Viewer dout;
+Standard_IMPORT Draw_Viewer dout;
 #endif
 
 #define Characters(IArg) (strspn (Arg[IArg], "0123456789.+-eE") != strlen (Arg[IArg]))
index b5d661fda877685dc175cbfc3bd369ab00f77387..b2299decc3242e18f5cec83c75de3e61262f6e07 100644 (file)
@@ -74,7 +74,7 @@ static Standard_Integer PlotCount = 0;    // PlotEdge and PlotIso for cases of "
 static TopoDS_Shape  pickshape;
 static Standard_Real upick,vpick;
 #ifdef _WIN32
-extern Draw_Viewer dout;
+Standard_IMPORT Draw_Viewer dout;
 #endif
 
 //=======================================================================
index 957aec927a9b58fa7b9d557b562d861e3c024594..eb894315949c48b18117342b7df6097ae3edad61 100644 (file)
@@ -989,3 +989,37 @@ Standard_Boolean Draw::ParseOnOffNoIterator (Standard_Integer  theArgsNb,
   Standard_Boolean isOn = Draw::ParseOnOffIterator (theArgsNb, theArgVec, theArgIter);
   return toReverse ? !isOn : isOn;
 }
+
+//=======================================================================
+//function : Set
+//purpose  : point
+//=======================================================================
+void Draw::Set (const Standard_CString theName,
+                const gp_Pnt& thePoint)
+{
+  Draw_PntParams& aParams = PntParameters();
+  Handle(Draw_Point) aDrawPoint = new Draw_Point (thePoint, aParams.PntMarker, aParams.PntColor);
+  Draw::Set (theName, aDrawPoint);
+}
+
+//=======================================================================
+//function : Set
+//purpose  : point
+//=======================================================================
+void Draw::Set (const Standard_CString theName,
+                const gp_Pnt2d& thePoint)
+{
+  Draw_PntParams& aParams = PntParameters();
+  Handle(Draw_Point) aDrawPoint = new Draw_Point (thePoint, aParams.PntMarker, aParams.PntColor);
+  Draw::Set (theName, aDrawPoint);
+}
+
+//=======================================================================
+//function : PntParameters
+//purpose  :
+//=======================================================================
+Draw_PntParams& Draw::PntParameters()
+{
+  static Draw_PntParams aParams;
+  return aParams;
+}
index 338682bc4a18725a8ec4025a312074cef0f21b50..0d7c57943e5ee80e98adac5ce2a7ef0d7ace4bf1 100644 (file)
@@ -18,6 +18,8 @@
 #define _Draw_HeaderFile
 
 #include <Draw_Interpretor.hxx>
+#include <Draw_PntParams.hxx>
+#include <Draw_Point.hxx>
 #include <NCollection_Map.hxx>
 #include <Quantity_ColorRGBA.hxx>
 #include <Standard_Handle.hxx>
@@ -58,6 +60,17 @@ public: //! @name Tcl variables management tools
   //! Sets a numeric variable.
   Standard_EXPORT static void Set (const Standard_CString Name, const Standard_Real val);
 
+  //! Sets <G> in the variable <Name>.  Overwrite the
+  //! variable if already set.
+  Standard_EXPORT static void Set (const Standard_CString Name, const gp_Pnt& G);
+  
+  //! Sets <G> in the variable <Name>.  Overwrite the
+  //! variable if already set.
+  Standard_EXPORT static void Set (const Standard_CString Name, const gp_Pnt2d& G);
+
+  //! Return global parameters for points.
+  Standard_EXPORT static Draw_PntParams& PntParameters();
+  
   //! Returns main DRAW interpretor.
   Standard_EXPORT static Draw_Interpretor& GetInterpretor();
 
diff --git a/src/Draw/Draw_PntParams.hxx b/src/Draw/Draw_PntParams.hxx
new file mode 100644 (file)
index 0000000..5c972a6
--- /dev/null
@@ -0,0 +1,34 @@
+// Copyright (c) 2021 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#ifndef Draw_PntParams_HeaderFile
+#define Draw_PntParams_HeaderFile
+
+#include <Draw_Color.hxx>
+#include <Draw_MarkerShape.hxx>
+
+//! Draw parameters for points.
+struct Draw_PntParams
+{
+public:
+  Draw_Color       PntColor;
+  Draw_MarkerShape PntMarker;
+
+  Draw_PntParams()
+  : PntColor   (Draw_rouge),
+    PntMarker  (Draw_Plus)
+  {}
+
+};
+
+#endif
diff --git a/src/Draw/Draw_Point.cxx b/src/Draw/Draw_Point.cxx
new file mode 100644 (file)
index 0000000..4fa40d1
--- /dev/null
@@ -0,0 +1,208 @@
+// Created on: 1994-03-28
+// Created by: Remi LEQUETTE
+// Copyright (c) 1994-1999 Matra Datavision
+// Copyright (c) 1999-2014 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#include <Draw_Point.hxx>
+
+#include <Draw.hxx>
+#include <Draw_Color.hxx>
+#include <Draw_Display.hxx>
+#include <Draw_PntParams.hxx>
+#include <gp_Pnt.hxx>
+#include <gp_Pnt2d.hxx>
+
+IMPLEMENT_STANDARD_RTTIEXT(Draw_Point, Draw_Drawable3D)
+
+//=======================================================================
+//function : Draw_Point
+//purpose  :
+//=======================================================================
+Draw_Point::Draw_Point (const gp_Pnt& P,
+                        const Draw_MarkerShape Shape,
+                        const Draw_Color& Col)
+: myPoint(P),
+  is3D(Standard_True),
+  myShape(Shape),
+  myColor(Col)
+{
+  //
+}
+
+//=======================================================================
+//function : Draw_Point
+//purpose  :
+//=======================================================================
+Draw_Point::Draw_Point (const gp_Pnt2d& P,
+                        const Draw_MarkerShape Shape,
+                        const Draw_Color& Col)
+: myPoint(P.X(),P.Y(),0.),
+  is3D(Standard_False),
+  myShape(Shape),
+  myColor(Col)
+{
+  //
+}
+
+//=======================================================================
+//function : Is3D
+//purpose  :
+//=======================================================================
+Standard_Boolean Draw_Point::Is3D() const
+{
+  return is3D;
+}
+
+//=======================================================================
+//function : DrawOn
+//purpose  :
+//=======================================================================
+void Draw_Point::DrawOn (Draw_Display& dis) const 
+{
+  dis.SetColor(myColor);
+  if (is3D)
+    dis.DrawMarker(myPoint,myShape);
+  else
+    dis.DrawMarker(Point2d(),myShape);
+}
+
+//=======================================================================
+//function : Point
+//purpose  :
+//=======================================================================
+void Draw_Point::Point (const gp_Pnt& P)
+{
+  myPoint = P;
+  is3D = Standard_True;
+}
+
+//=======================================================================
+//function : Point2d
+//purpose  :
+//=======================================================================
+void Draw_Point::Point2d(const gp_Pnt2d& P)
+{
+  myPoint.SetCoord(P.X(),P.Y(),0);
+  is3D = Standard_False;
+}
+
+//=======================================================================
+//function : Copy
+//purpose  :
+//=======================================================================
+Handle(Draw_Drawable3D) Draw_Point::Copy() const 
+{
+  Handle(Draw_Point) P;
+  if (is3D)
+    P = new Draw_Point(myPoint,myShape,myColor);
+  else
+    P = new Draw_Point(Point2d(),myShape,myColor);
+    
+  return P;
+}
+
+//=======================================================================
+//function : Dump
+//purpose  :
+//=======================================================================
+void Draw_Point::Dump (Standard_OStream& S) const
+{
+#if !defined(_MSC_VER) && !defined(__sgi) && !defined(IRIX)
+  std::ios::fmtflags F = S.flags();
+  S.setf(std::ios::scientific,std::ios::floatfield);
+  S.precision(15);
+#else
+  long form = S.setf(std::ios::scientific);
+  std::streamsize prec = S.precision(15);
+#endif
+  if (is3D)
+    S << "Point : " << myPoint.X() << ", " << myPoint.Y() << ", " << myPoint.Z() <<std::endl;
+  else
+    S << "Point 2d : " << myPoint.X() << ", " << myPoint.Y() <<std::endl;
+#if !defined(_MSC_VER) && !defined(__sgi) && !defined(IRIX)
+  S.setf(F);
+#else
+  S.setf(form);
+  S.precision(prec);
+#endif
+}
+
+//=======================================================================
+//function : Save
+//purpose  :
+//=======================================================================
+void Draw_Point::Save (Standard_OStream& theStream) const
+{
+#if !defined(_MSC_VER) && !defined(__sgi) && !defined(IRIX)
+  std::ios::fmtflags aFlags = theStream.flags();
+  theStream.setf (std::ios::scientific, std::ios::floatfield);
+  theStream.precision (15);
+#else
+  long aForm = theStream.setf (std::ios::scientific);
+  std::streamsize aPrec = theStream.precision (15);
+#endif
+  if (is3D)
+  {
+    theStream << "1 " << myPoint.X() << " " << myPoint.Y() << " " << myPoint.Z() << "\n";
+  }
+  else
+  {
+    theStream << "0 " << myPoint.X() << " " << myPoint.Y() << "\n";
+  }
+#if !defined(_MSC_VER) && !defined(__sgi) && !defined(IRIX)
+  theStream.setf (aFlags);
+#else
+  theStream.setf (aForm);
+  theStream.precision (aPrec);
+#endif
+}
+
+//=======================================================================
+//function : Restore
+//purpose  :
+//=======================================================================
+Handle(Draw_Drawable3D) Draw_Point::Restore (Standard_IStream& theStream)
+{
+  const Draw_PntParams& aParams = Draw::PntParameters();
+  Standard_Integer is3d = 0;
+  theStream >> is3d;
+  Standard_Real x,y,z = 0.0;
+  if (is3d)
+  {
+    theStream >> x >> y >> z;
+  }
+  else
+  {
+    theStream >> x >> y;
+  }
+  Handle(Draw_Point) aDrawPoint;
+  if (is3d)
+  {
+    aDrawPoint = new Draw_Point (gp_Pnt (x, y, z), aParams.PntMarker, aParams.PntColor);
+  }
+  else
+  {
+    aDrawPoint = new Draw_Point (gp_Pnt2d (x, y), aParams.PntMarker, aParams.PntColor);
+  }
+  return aDrawPoint;
+}
+
+//=======================================================================
+//function : Whatis
+//purpose  :
+//=======================================================================
+void Draw_Point::Whatis (Draw_Interpretor& S) const 
+{
+  S << "point";
+}
diff --git a/src/Draw/Draw_Point.hxx b/src/Draw/Draw_Point.hxx
new file mode 100644 (file)
index 0000000..d3ff023
--- /dev/null
@@ -0,0 +1,84 @@
+// Created on: 1994-03-28
+// Created by: Remi LEQUETTE
+// Copyright (c) 1994-1999 Matra Datavision
+// Copyright (c) 1999-2014 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#ifndef _Draw_Point_HeaderFile
+#define _Draw_Point_HeaderFile
+
+#include <gp_Pnt.hxx>
+#include <Draw_MarkerShape.hxx>
+#include <Draw_Color.hxx>
+#include <Draw_Drawable3D.hxx>
+#include <Draw_Interpretor.hxx>
+
+class Draw_Color;
+class gp_Pnt2d;
+
+DEFINE_STANDARD_HANDLE(Draw_Point, Draw_Drawable3D)
+
+//! A drawable point.
+class Draw_Point : public Draw_Drawable3D
+{
+  DEFINE_STANDARD_RTTIEXT(Draw_Point, Draw_Drawable3D)
+  Draw_Drawable3D_FACTORY
+public:
+
+  Standard_EXPORT Draw_Point (const gp_Pnt& P, const Draw_MarkerShape Shape, const Draw_Color& Col);
+
+  Standard_EXPORT Draw_Point (const gp_Pnt2d& P, const Draw_MarkerShape Shape, const Draw_Color& Col);
+
+  Standard_EXPORT virtual void DrawOn (Draw_Display& dis) const Standard_OVERRIDE;
+
+  //! Is a 3D object. (Default True).
+  Standard_EXPORT virtual Standard_Boolean Is3D() const Standard_OVERRIDE;
+
+  gp_Pnt Point() const { return myPoint; }
+
+  Standard_EXPORT void Point (const gp_Pnt& P);
+
+  gp_Pnt2d Point2d() const { return gp_Pnt2d(myPoint.X(), myPoint.Y()); }
+
+  Standard_EXPORT void Point2d (const gp_Pnt2d& P);
+
+  void Color (const Draw_Color& theColor) { myColor = theColor; }
+
+  Draw_Color Color() const { return myColor; }
+
+  void Shape (const Draw_MarkerShape theS) { myShape = theS; }
+
+  Draw_MarkerShape Shape() const { return myShape; }
+
+  //! For variable copy.
+  Standard_EXPORT virtual Handle(Draw_Drawable3D) Copy() const Standard_OVERRIDE;
+
+  //! For variable dump.
+  Standard_EXPORT virtual void Dump (Standard_OStream& S) const Standard_OVERRIDE;
+
+  //! Save drawable into stream.
+  Standard_EXPORT virtual void Save (Standard_OStream& theStream) const Standard_OVERRIDE;
+
+  //! For variable whatis command.
+  Standard_EXPORT virtual void Whatis (Draw_Interpretor& I) const Standard_OVERRIDE;
+
+private:
+
+  gp_Pnt myPoint;
+  Standard_Boolean is3D;
+  Draw_MarkerShape myShape;
+  Draw_Color myColor;
+
+};
+
+#endif // _Draw_Point_HeaderFile
index fbfb1247249d2153e85fdc56510f3cdda4b94344..38912a92c8aad7b506212ffdca509e8afa14671d 100755 (executable)
@@ -46,6 +46,9 @@ Draw_Number.hxx
 Draw_PInterp.hxx
 Draw_PloadCommands.cxx
 Draw_PluginMacro.hxx
+Draw_PntParams.hxx
+Draw_Point.cxx
+Draw_Point.hxx
 Draw_Printer.cxx
 Draw_Printer.hxx
 Draw_ProgressIndicator.cxx
index 3a97655454d5665eba481a5171b7a743b83788df..8e3d4aaedf42e91a4b982592d6cea92bccec04ee 100644 (file)
@@ -33,7 +33,7 @@
 IMPLEMENT_STANDARD_RTTIEXT(DrawTrSurf_Curve, DrawTrSurf_Drawable)
 
 Standard_Real DrawTrSurf_CurveLimit = 400;
-extern Standard_Boolean Draw_Bounds;
+Standard_IMPORT Standard_Boolean Draw_Bounds;
 
 //=======================================================================
 //function : DrawTrSurf_Curve
index af427ff03b5bb0c3c6bc404c2b288082e4bb5db2..b8a0e2de166a5c8bf00a2e17c794098904cce9b2 100644 (file)
@@ -35,7 +35,7 @@
 IMPLEMENT_STANDARD_RTTIEXT(DrawTrSurf_Curve2d, DrawTrSurf_Drawable)
 
 static Standard_Real DrawTrSurf_CurveLimit = 400;
-extern Standard_Boolean Draw_Bounds;
+Standard_IMPORT Standard_Boolean Draw_Bounds;
 
 //=======================================================================
 //function : DrawTrSurf_Curve2d
index 224d2575086b578ad34fa70310aa0a6c45bc879b..ef1b779d92d6082417ad98dff8e3e5adc47bba1b 100644 (file)
@@ -15,6 +15,9 @@
 #include <NCollection_IncAllocator.hxx>
 #include <NCollection_LocalArray.hxx>
 
+//#ifdef DRAW
+#include <Draw.hxx>
+//#endif
 
 // modified by NIZHNY-MKK  Thu Nov  2 15:07:26 2000.BEGIN
 static Standard_Boolean TestPassedSolutionWithNegativeState(const IntWalk_VectorOfWalkingData& wd,
@@ -63,6 +66,10 @@ void IntWalk_IWalking::ComputeOpenLine(const TColStd_SequenceOfReal& Umult,
 //    end of conditions.
 
 {
+  //#ifdef DRAW
+  char* name = new char[100];
+  //#endif
+  
   Standard_Integer I = 0, N = 0, SaveN = 0;
   Standard_Real aBornInf[2] = {}, aBornSup[2] = {}, aUVap[2] = {};
   math_Vector BornInf(aBornInf,1,2), BornSup(aBornSup,1,2), UVap(aUVap,1,2);
@@ -125,6 +132,17 @@ void IntWalk_IWalking::ComputeOpenLine(const TColStd_SequenceOfReal& Umult,
       previousd3d = Func.Direction3d();
       previousd2d = Func.Direction2d();
       CurrentLine->AddPoint(previousPoint);
+      
+      //#ifdef DRAW
+      Standard_Integer aNbPoints = CurrentLine->NbPoints();
+      gp_Pnt aPnt = previousPoint.Value();
+      sprintf(name, "op%d_%d", I, aNbPoints);
+      Draw::Set(name, aPnt);
+      gp_Pnt2d aPnt2d = previousPoint.ValueOnSurface(false);
+      sprintf(name, "opp%d_%d", I, aNbPoints);
+      Draw::Set(name, aPnt2d);
+      //#endif
+      
       // modified by NIZHNY-MKK  Fri Oct 27 12:34:32 2000.BEGIN
       if(movementdirectioninfo[I] !=0) {
         if(movementdirectioninfo[I] < 0) {
@@ -266,6 +284,17 @@ void IntWalk_IWalking::ComputeOpenLine(const TColStd_SequenceOfReal& Umult,
               CurrentLine->AddStatusLast(Standard_False);
               //if (aStatus != IntWalk_ArretSurPointPrecedent)
               CurrentLine->AddPoint(Psol);                      
+      
+              //#ifdef DRAW
+              aNbPoints = CurrentLine->NbPoints();
+              aPnt = Psol.Value();
+              sprintf(name, "op%d_%d", I, aNbPoints);
+              Draw::Set(name, aPnt);
+              aPnt2d = Psol.ValueOnSurface(false);
+              sprintf(name, "opp%d_%d", I, aNbPoints);
+              Draw::Set(name, aPnt2d);
+              //#endif
+      
               //Remove <SaveN> from <seqAlone>
               for (Standard_Integer iseq = 1; iseq <= seqAlone.Length(); iseq++)
                 if (seqAlone(iseq) == SaveN)
@@ -348,6 +377,17 @@ void IntWalk_IWalking::ComputeOpenLine(const TColStd_SequenceOfReal& Umult,
               Tgtend = Standard_True;
               MakeWalkingPoint(1, UVap(1), UVap(2), Func, Psol);
               CurrentLine->AddPoint(Psol);
+      
+              //#ifdef DRAW
+              aNbPoints = CurrentLine->NbPoints();
+              aPnt = Psol.Value();
+              sprintf(name, "op%d_%d", I, aNbPoints);
+              Draw::Set(name, aPnt);
+              aPnt2d = Psol.ValueOnSurface(false);
+              sprintf(name, "opp%d_%d", I, aNbPoints);
+              Draw::Set(name, aPnt2d);
+              //#endif
+      
               Rajout = Standard_True;
               seqAlone.Append(lines.Length() + 1);
               seqAjout.Append(lines.Length() + 1);
@@ -357,6 +397,16 @@ void IntWalk_IWalking::ComputeOpenLine(const TColStd_SequenceOfReal& Umult,
               previousd3d = Func.Direction3d();
               previousd2d = Func.Direction2d();
               CurrentLine->AddPoint(previousPoint);
+      
+              //#ifdef DRAW
+              aNbPoints = CurrentLine->NbPoints();
+              aPnt = previousPoint.Value();
+              sprintf(name, "op%d_%d", I, aNbPoints);
+              Draw::Set(name, aPnt);
+              aPnt2d = previousPoint.ValueOnSurface(false);
+              sprintf(name, "opp%d_%d", I, aNbPoints);
+              Draw::Set(name, aPnt2d);
+              //#endif
             }     
             else if (aStatus == IntWalk_PointConfondu)
             {
index 8965974e8c569ddba3c8f30a64fbab8ecf4fa88a..3ac5ca6e4b11ed79fdcc3e905cec9046a5adff5c 100644 (file)
 
 #include <NCollection_IncAllocator.hxx>
 
+//#ifdef DRAW
+#include <Draw.hxx>
+//#endif
+
 void IntWalk_IWalking::ComputeCloseLine(const TColStd_SequenceOfReal& Umult,
                                        const TColStd_SequenceOfReal& Vmult,
                                        const ThePOPIterator& Pnts1,
@@ -41,6 +45,10 @@ void IntWalk_IWalking::ComputeCloseLine(const TColStd_SequenceOfReal& Umult,
 //
 // ******************************************************************** 
 {
+  //#ifdef DRAW
+  char* name = new char[100];
+  //#endif
+  
   Standard_Integer I = 0, N = 0,SaveN = 0;
   Standard_Real aBornInf[2] = {}, aBornSup[2] = {}, aUVap[2] = {};
   math_Vector BornInf(aBornInf,1,2), BornSup(aBornSup,1,2);
@@ -138,6 +146,17 @@ void IntWalk_IWalking::ComputeCloseLine(const TColStd_SequenceOfReal& Umult,
 
       CurrentLine = new IntWalk_TheIWLine (new NCollection_IncAllocator());
       CurrentLine->AddPoint(previousPoint);
+      
+      //#ifdef DRAW
+      Standard_Integer aNbPoints = CurrentLine->NbPoints();
+      gp_Pnt aPnt = previousPoint.Value();
+      sprintf(name, "cp%d_%d", I, aNbPoints);
+      Draw::Set(name, aPnt);
+      gp_Pnt2d aPnt2d = previousPoint.ValueOnSurface(false);
+      sprintf(name, "cpp%d_%d", I, aNbPoints);
+      Draw::Set(name, aPnt2d);
+      //#endif
+      
       CurrentLine->SetTangentVector(previousd3d,1);
       Tgtbeg = Standard_False;
       Tgtend = Standard_False;
@@ -341,6 +360,16 @@ void IntWalk_IWalking::ComputeCloseLine(const TColStd_SequenceOfReal& Umult,
                 //if (aStatus != IntWalk_ArretSurPointPrecedent)
                 CurrentLine->AddPoint(Psol);
 
+                //#ifdef DRAW
+                aNbPoints = CurrentLine->NbPoints();
+                aPnt = Psol.Value();
+                sprintf(name, "cp%d_%d", I, aNbPoints);
+                Draw::Set(name, aPnt);
+                aPnt2d = Psol.ValueOnSurface(false);
+                sprintf(name, "cpp%d_%d", I, aNbPoints);
+                Draw::Set(name, aPnt2d);
+                //#endif
+      
                 //Remove <SaveN> from <seqAlone> and, if it is first found point,
                 //from <seqAjout> too
                 if (IsValidEndPoint(I, SaveN))
@@ -391,6 +420,17 @@ void IntWalk_IWalking::ComputeCloseLine(const TColStd_SequenceOfReal& Umult,
                 {
                   if (aStatus == IntWalk_ArretSurPointPrecedent) {
                     CurrentLine->AddPoint(Psol);
+
+                    //#ifdef DRAW
+                    aNbPoints = CurrentLine->NbPoints();
+                    aPnt = Psol.Value();
+                    sprintf(name, "cp%d_%d", I, aNbPoints);
+                    Draw::Set(name, aPnt);
+                    aPnt2d = Psol.ValueOnSurface(false);
+                    sprintf(name, "cpp%d_%d", I, aNbPoints);
+                    Draw::Set(name, aPnt2d);
+                    //#endif
+      
                     OpenLine(0,Psol,Pnts1,Func,CurrentLine);
                   }
                   else {
@@ -495,6 +535,17 @@ void IntWalk_IWalking::ComputeCloseLine(const TColStd_SequenceOfReal& Umult,
                   IntSurf_PntOn2S newP;
                   newP.SetValue(Func.Point(),reversed,Uvap(1),Uvap(2));
                   CurrentLine->AddPoint(newP);
+
+                  //#ifdef DRAW
+                  aNbPoints = CurrentLine->NbPoints();
+                  aPnt = newP.Value();
+                  sprintf(name, "cp%d_%d", I, aNbPoints);
+                  Draw::Set(name, aPnt);
+                  aPnt2d = newP.ValueOnSurface(false);
+                  sprintf(name, "cpp%d_%d", I, aNbPoints);
+                  Draw::Set(name, aPnt2d);
+                  //#endif
+      
                   Rajout = Standard_True;
                   seqAlone.Append(lines.Length()+1);
                   seqAjout.Append(lines.Length()+1);
@@ -507,6 +558,16 @@ void IntWalk_IWalking::ComputeCloseLine(const TColStd_SequenceOfReal& Umult,
               previousd3d = Func.Direction3d();
               previousd2d = Func.Direction2d();
               CurrentLine->AddPoint(previousPoint);
+      
+              //#ifdef DRAW
+              aNbPoints = CurrentLine->NbPoints();
+              aPnt = previousPoint.Value();
+              sprintf(name, "cp%d_%d", I, aNbPoints);
+              Draw::Set(name, aPnt);
+              aPnt2d = previousPoint.ValueOnSurface(false);
+              sprintf(name, "cpp%d_%d", I, aNbPoints);
+              Draw::Set(name, aPnt2d);
+              //#endif
             }
             else if (aStatus == IntWalk_PointConfondu)
             {
index 3d7eaef53cc55130989e5d991780dfca4317e075..df88a9fbfb8d9f7dc4a7be1894ebd4e17de6378b 100644 (file)
@@ -13,7 +13,7 @@
 
 ;# Return list of toolkits
 proc Draw:toolkits { } {
-  set aResult [list TKDraw TKTopTest TKViewerTest TKXSDRAW TKDCAF TKXDEDRAW TKTObjDRAW TKQADraw]
+  set aResult [list TKDrawBase TKDraw TKTopTest TKViewerTest TKXSDRAW TKDCAF TKXDEDRAW TKTObjDRAW TKQADraw]
 
   lappend aResult "TKOpenGlTest"
   if { [info exists ::env(HAVE_GLES2)] && "$::env(HAVE_GLES2)" == "true" } {
index 46fa6c978b7f49984c49fae1fa7a85585bb3fd0d..64f65537a990fe8033b735034cce1ae2209f2b2b 100755 (executable)
@@ -1,4 +1,5 @@
 TKernel
+TKDrawBase
 TKG2d
 TKGeomBase
 TKG3d
index 1600bddebd53826cbb951a89f48f49c9ceffc9d2..b4ec61c777af35978fcc55c2a6f41b77addfb5fb 100755 (executable)
@@ -1,3 +1,2 @@
-Draw
 DBRep
 DrawTrSurf
diff --git a/src/TKDrawBase/CMakeLists.txt b/src/TKDrawBase/CMakeLists.txt
new file mode 100644 (file)
index 0000000..8293496
--- /dev/null
@@ -0,0 +1,3 @@
+project(TKDrawBase)
+
+OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit)
diff --git a/src/TKDrawBase/EXTERNLIB b/src/TKDrawBase/EXTERNLIB
new file mode 100644 (file)
index 0000000..00a37f8
--- /dev/null
@@ -0,0 +1,17 @@
+TKernel
+TKG2d
+TKG3d
+TKMath
+TKService
+CSF_TclLibs
+CSF_TclTkLibs
+CSF_XwLibs
+CSF_gdi32
+CSF_advapi32
+CSF_user32
+CSF_shell32
+CSF_TBB
+CSF_objc
+CSF_Appkit
+CSF_IOKit
+CSF_ThreadLibs
diff --git a/src/TKDrawBase/FILES b/src/TKDrawBase/FILES
new file mode 100644 (file)
index 0000000..ca4f0e5
--- /dev/null
@@ -0,0 +1,2 @@
+EXTERNLIB
+PACKAGES
diff --git a/src/TKDrawBase/PACKAGES b/src/TKDrawBase/PACKAGES
new file mode 100644 (file)
index 0000000..8e3aa57
--- /dev/null
@@ -0,0 +1 @@
+Draw
index ca0ecb9dab46705a3c41eed31c3c5c2e5c3323b9..b83dbb3c813167305f834140cbfbede01ed29b49 100755 (executable)
@@ -4,3 +4,4 @@ TKG3d
 TKG2d
 TKGeomBase
 TKBRep
+TKDrawBase
\ No newline at end of file